Classify a noun in an abstract or concrete using NLTK or similar

How can I classify a list of nouns into abstract or concrete in Python?

For instance:

"Have a seat in that chair." 

In the sentence above, chair noun and can be classified as concrete.

+5
source share
1 answer

first, tokenize the words word_tokenize (string) then use pos_tag from nltk.

 import nltk from nltk import* string="Have a seat in that chair." words=nltk.word_tokenize(string) nltk.pos_tag(words) 

This has not been tested, but I think it can almost look like this.

+1
source

Source: https://habr.com/ru/post/1213583/


All Articles