Check if a noun can be a verb #13087
-
Hi Everyone, I'm trying to understand if a word is chategorized as a noun but might also be a verb. For example, the sentence could be: "Enjoy a walk around the park". Here, "walk" is a noun but in other contexts, walk is a verb. How could I pull out all the words in a sentence that are tagged as nouns but might be verbs? I'm hoping to call a helper function for this logic - is_maybe_verb(token) but I'm having trouble using the API for the right logic.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Word sense disambiguation is usually done by looking up a lexical database that maps words to their different semantic meanings. For English, you can avail yourself of WordNet. This spaCy library should let you query the synsets of a word and its part-of-speech tag. So, you'd iterate over the tokens in the |
Beta Was this translation helpful? Give feedback.
Word sense disambiguation is usually done by looking up a lexical database that maps words to their different semantic meanings. For English, you can avail yourself of WordNet.
This spaCy library should let you query the synsets of a word and its part-of-speech tag. So, you'd iterate over the tokens in the
Doc
that have a NOUN POS tag and look up if a synset exists for the same but with a VERB tag.