TransWikia.com

How to determine semantic differences in NLP

Data Science Asked on December 20, 2020

I would need to determine the difference in meaning between the following two sentences:

I am at home
I am not at home
I am at the office

the first two sentences differs in verb, which changes the meaning of the sentences (to negative); the second one, with the first one, differs because of the place.
I have thought of word2vec, but I am not completely sure if this is the best tool to analyse sentences like the above ones. Also cosine_similarity could be a solution, but I would have not information about the meaning. I think it is more about semantic meaning…

One Answer

Out of the box, something like Google's Universal Sentence Encoder (USE) may work for your use-case. Many of the common NLP embedding techniques nowadays work on individual words and so creating sentence-level embeddings means averaging multiple word-level vectors together. USE was built to operate at the sentence level, so you may find it better.

The original paper can be found here: https://arxiv.org/abs/1803.11175

An example blog post leveraging USE: https://medium.com/@gaurav5430/universal-sentence-encoding-7d440fd3c7c7

Correct answer by Brandon Donehoo on December 20, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP