UKPLab / sentence-transformers

Multilingual Sentence & Image Embeddings with BERT
https://www.SBERT.net
Apache License 2.0
14.72k stars 2.43k forks source link

Need help assigning weights to words when getting vectors!!! #2555

Open seregadgl20-oss opened 5 months ago

seregadgl20-oss commented 5 months ago

Hello everyone, I need your help urgently. How can I assign weights to words or labels when obtaining vectors? For instance, consider the sentence: "apple iphone 14 pro red." When obtaining vectors, I want the words "iphone" and "14" to carry more weight compared to other words. This is so that when searching for similar models, the focus is on "iphone 14". Thank you for your assistance!

tomaarsen commented 5 months ago

Hello!

This is not possible with Sentence Transformers, at least, not without notable finetuning, etc. Increasing the weight for specific words seems more feasible with e.g. SPLADE or BM25.