Git Product home page Git Product logo

Comments (3)

oborchers avatar oborchers commented on May 26, 2024 1

As far as I can tell this might be related to the computation of the SVD and that 30GB of sentences might kill the SVD solver. It should nonetheless be possible to approximate the SVD components by using only a subset of sentences. I'll have to dig into this.

Btw: For that amount of text it is very likely the lib needs an approximate nearest neighbor search for similar sentences. I'm looking at Annoy

from fast_sentence_embeddings.

joelkuiper avatar joelkuiper commented on May 26, 2024

Yeah I'm thinking the SVD is crashing, the machine had approx 100GB of memory left though (since the rest was memory mapped). I am not sure if there is nice iterative version of SVD, I'm guessing no. But, for such a large set of documents taking a (random) subset to approximate it might be valid; as you proposed.

And yeah, for nearest neighbor lookup it definitely needs an approximate kNN, apart from Annoy there is also https://github.com/Microsoft/SPTAG and https://github.com/facebookresearch/faiss . Annoy is nice and simple, but I found it to be very finicky in terms of number of trees used.

from fast_sentence_embeddings.

oborchers avatar oborchers commented on May 26, 2024

@joelkuiper

I've included a solution to the problem! SIF and uSIF basically now come with a parameter "cache_size_gb", which determines the amount of ram to reserve for the SVD computation.
This is standard 1 GB, so the SVD routine will randomly sample rows from the matrix if the matrix is larger than 1 GB. Pushed this change to the development branch.

As for the approximate NN search: Is on my list. Thank you for the suggestions. I want a lib that is easily pip-able. Annoy is easy, yet I'll have to dig into this more thoroughly https://github.com/erikbern/ann-benchmarks

from fast_sentence_embeddings.

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.