UKPLab / sentence-transformers

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

Can I distinguish sentiment using sbert? #220

Open ironllamagirl opened 4 years ago

ironllamagirl commented 4 years ago

Hi!

Thank you very much for this package. Very helpful! I have a question. Do you think it is possible to implement this in a way that distinguishes between 'positive' and 'negative' sentiment as well? I understand this would be too much to ask from model and that this could be done using sentiment analysis. But I was wondering if there is a way to build it so that if the query has a 'negative' connotation, such as a risk, then I would get results containing risks/opportunity only, so sentences containing negative/positive connotation. Can the embeddings capture this type of sentiment?

Best,

nreimers commented 4 years ago

Hi @ironllamagirl I think out of the box the models don't capture it.

If you have training data, you could of course fine-tune the sentence embedding to have such properties. You would need to have sentence pairs and the label (0...1) that indicates whether both sentences talk both about a risk or both talk about an opportunity.

Best Nils Reimers