GithubHelp home page GithubHelp logo

Comments (3)

dluc avatar dluc commented on June 8, 2024

Removing line endings is a tricky step because it affects the semantics. From a high level perspective I usually leave all the line endings in place, until the moment of calculating embeddings and saving the text chunk. I would avoid removing line endings while chunking sentences because it might join paragraphs together. Then there's the scenario where one might want to use "the chunk before" and "the chunk after", merged with the current chunk. In this case it would be better having the original line endings.

I'm a bit surprised that cosine similarity is affected so much by this detail to be honest, and I would not jump the gun without a thorough investigation with a considerable amount of test cases and a report comparing results. I'm worried we could make things worse overall.

There's also another way to look at it if you want: for each pieace of text we could have multiple versions (with line endings, without, etc), and calculate embeddings for all. It would increase cost, but could make things better for everyone.

from kernel-memory.

marcominerva avatar marcominerva commented on June 8, 2024

I understand your point, so I think that the correct approach could be the feature I have discussed in #379, so everyone can makes the tests for a specific use case.

from kernel-memory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.