Which model is better able to understand the difference that two sentences are talking about different things?

I'm currently working on the task of measuring semantic proximity between sentences. I use fasttext train _unsiupervised (skipgram) for this. I extract the sentence embeddings and then measure the cosine similarity between them. however, I ran into the following problem: cosine similarity between embeddings of these sentences:

Create a documentation of product A; he is creating a documentation of product B

is very high (0.9). obviously it because both of them is about creating a documentation. but however the first sentence is about product A and second is about product B and I would like my model to understand that and emphasise on those product names since they are key words in sentences. Which type of model would be more suitable for my case? Is BERT for example better for it and why?

Topic semantic-similarity transformer word-embeddings deep-learning nlp

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.