max
max

Reputation: 11

How do I use NLP to find which group of words a sentence is closes to?

I am trying to use NLP to see how well survey responses fit into predetermined categories. I can't use normal text-classification methods since a given response usually contains multiple categories.

Instead, I've pulled out the 10-20 words most commonly used in each category, and I want to build a script that inputs a survey response and computes how much it aligns with each list of words. Ideally I'd like it to recognize similar words to the ones in each list as well. The final result should a vector describing how much the response aligns with each group of words.

My only idea so far is to use a for loop that loops over every word in a response, while each group has a counter that goes up if a word matches. However, this wouldn't be useful in dealing with synonyms or similar words. Is there any way to work this out?

Upvotes: 0

Views: 478

Answers (1)

OK 400
OK 400

Reputation: 831

I do not have 50 reputation so I can't comment. But I think if you implement a sin function you could represent more precisely the word meaning. That is, creaste a sin or cos function which contains every word and then, to compute its relation, just calculate sin or cos similarity.

The problem here is which features do you need to use to create this function. Well, your question is a bit open so here we cannot help you. There are several ways to do this, one if them is the following:

positional similarity

Upvotes: -1

Related Questions