How would one disambiguate between two meanings of the same word in a sentence?
I'd suggest BERT for this. It is essentially a word-embedding model that uses at local context to determine the appropriate embedding for each word. This means it would assign &quot;bat&quot; a different embedding in a sentence containing &quot;hit the ball&quot; vs. a sentence containing &quot;flies and eats bugs&quot;. On top of that, Google has released a number of pre-trained versions of BERT, which can be used directly without additional training (depending on your task of course). BERT as a service is great if you just want embeddings. The Python transformers library makes it exceedingly simple to incorporate BERT into your task-specific model.