FlagOpen / FlagEmbedding

Retrieval and Retrieval-augmented LLMs
MIT License
7.4k stars 534 forks source link

Converting vector to text #1047

Open Himasnhu-AT opened 2 months ago

Himasnhu-AT commented 2 months ago

Let's say I embedded a text and save it in a file. After performing cosine similarity, I want to retrieve text. How can I do it?

I'm using onnx file in rust

staoxiao commented 2 months ago

You should build a mapping between embedding and text, so you can find the text after retrieval the top-k embedding. You can refer to https://github.com/FlagOpen/FlagEmbedding/blob/master/FlagEmbedding/baai_general_embedding/finetune/eval_msmarco.py#L254