How to compare meaningful level of a set of phrase that describe same concept in NLP?

2024/10/14 7:22:25

I have two terms "vehicle" and "motor vehicle". Are there any way to compare the meaningfulness level or ambiguity level of these two in NLP? The outcome should be that "motor vehicle" is more meaningful than "vehicle" or "vehicle" is more ambiguous than "motor vehicle". Thanks

Answer

The question you ask is very broad (see here) but here are some hints for starting points:

  1. WordNet
  2. Word embeddings: word2vec, Glove

The meaning difference you are looking into is quite peculiar so I suggest starting with WordNet (there are WordNets for other languages as well). The code that uses WordNet to calculate meaning differences using WordNet you can find here.

Good framework to start an NLP journey is NLTK.

https://en.xdnf.cn/q/117982.html

Related Q&A

TypeError: slice indices must be integers or None or have an __index__ method. How to resolve it?

if w<h:normalized_char = np.ones((h, h), dtype=uint8)start = (h-w)/2normalized_char[:, start:start+w] = charelse:normalized_char = np.ones((w, w), dtype=uint8)start = (w-h)/2normalized_char[start:st…

Keras: Understanding the number of trainable LSTM parameters

I have run a Keras LSTM demo containing the following code (after line 166):m = 1 model=Sequential() dim_in = m dim_out = m nb_units = 10model.add(LSTM(input_shape=(None, dim_in),return_sequences=True,…

Updating Labels in Tkinter with for loop

So Im trying to print items in a list dynamically on 10 tkinter Labels using a for loop. Currently I have the following code:labe11 = StringVar() list2_placer = 0 list1_placer = 1 mover = 227 for items…

Paginate results, offset and limit

If I am developing a web service for retrieving some album names of certain artist using an API, and I am asked:The service should give the possibility to paginate results. It should support ofset= and…

Improve code to find prime numbers

I wrote this python code about 3 days ago, and I am stuck here, I think it could be better, but I dont know how to improve it. Can you guys please help me?# Function def is_prime(n):if n == 2 or n == …

How to read the line that contains a string then extract this line without this string

I have a file .txt that contains a specific line, like thisfile.txt. . T - Python and Matplotlib Essentials for Scientists and Engineers . A - Wood, M.A. . . .I would like to extract lines that contain…

Python: How to access and iterate over a list of div class element using (BeautifulSoup)

Im parsing data about car production with BeautifulSoup (see also my first question):from bs4 import BeautifulSoup import stringhtml = """ <h4>Production Capacity (year)</h4>…

What should I worry about Python template engines and web frameworks? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, argum…

Value Search from Dictionary via User Input

I have written the following code for getting an output of the various districts located in the given city and their respective postal codes. I want my code to be able to receive input from the user (D…

Read and aggregate data from CSV file

I have a data file with the following format:name,cost1,cost1,cost1,cost2,cost3,cost3, X,2,4,6,5,6,8, Y,0,3,6,5,4,6, . . ....Now, what I would like to do is to convert this to a dictionary of dictionar…