finalfusion / finalfusion-rust

finalfusion embeddings in Rust
https://finalfusion.github.io/
Other
92 stars 10 forks source link

Support for phrase embeddings #166

Closed sachaarbonel closed 3 years ago

sachaarbonel commented 4 years ago

Hi @danieldk thank's for this great library, can you guide me through the steps to include support for sentence embeddings using sentence-transformer? Which traits should I use? I am specially interested in storing embeddings for similarity queries on phrases

danieldk commented 4 years ago

I might misunderstand your goal, however I think that finalfusion is not a good fit. (Pretrained) transformers provide contextual word representations. The API would require that you give a full sentence, and the library should give the contextual representation for every word in the sentence (or one particular word). However, the finalfusion API can only give an embeddings for tokens without their sentential context. If you are looking for transformer-based representations in Rust, you are better off with one of the following crates:

https://github.com/guillaume-be/rust-bert https://github.com/stickeritis/sticker-transformers/