I have a list of sentences :

sentences = ["Missing Plate", "Plate not found"]

I am trying to find the most similar sentences in the list by using Transformers model with Huggingface embedding. I am able to find the similar sentences but the model is still not able to identify the difference between :

"Message ID exists"  
"Message ID doesn't exist"

[Note: I am trying to find the similarity by using the Cosine similarity from pytorch]

Can you suggest me ways to hyperparameter tune my model so that the model can weigh in more on the negative words and consider them opposite?

I found the list of parameters that can be tuned but not sure what the best parameters would be


New contributor
Chintan Mehta is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • $\begingroup$ Welcome to DataScienceSE. I don't know Huggingface but it might not be possible. Generally negation (also irony, hedging, etc) is difficult to handle: at the end of the day the model doesn't understand anything, it only tries to imitate what it's been fed as training data. $\endgroup$
    – Erwan
    11 hours ago


Your Answer

Chintan Mehta is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.