get category to which the word belongs like food,place,clothing

StackOverflow https://stackoverflow.com/questions/23339914

  •  10-07-2023
  •  | 
  •  

Вопрос

I would like to know the category in which the word falls in.

Like it could be a place,food,clothing.. etc how do I get that from any API ? Currently I am using in this example : Pizza which is of category food. How do I get that?

Like Newyork is a place so category:place.

How do I get only the category ?

Это было полезно?

Решение

You are probably looking for the WordNet like database. Obviously this is not that easy (what "granularity" of the categories is ok, what about multi-meaning words?) and there are no good answers for such questions, NLP is not that easy. However, WordNet should help you a lot, as it provides a nice, relational structure of the english words.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top