Tuesday 15 June 2010

python - Getting adjective from an adverb in nltk or other NLP library -


A method of obtaining an adjective related to the implementation given in the NLTK or other dragon libraries is, for example, "< Strong> Very "For adverting, I have to get" awesome "Thank you.

There is a correlation between wordnet, which is adjective to execution and vice versa.

  gt; & Gt; From the Iteratolls import chain & gt; & Gt; & Gt; Nltk.corpus import wordnet to wn & gt; & Gt; & Gt; Diffil import from get_close_matches as GCM & gt; & Gt; & Gt; Possible_adjectives = [Chain in Kashmir (* [j.pertainyms (for the name of the chain in J * Chen (* [for the LeMma in wn.synsets ('nervousness']])) [] '' terrible ',' cruel ',' Awful ',' rotten ']> gt; & Gt; The more human-readable way to calculate  possible_adjective  is as follows:   possible_adj = [] wn.synsets ('disgusting') for sn: for lemmas in sslemas: # For every possible lemmas lemma in lemma: lemma.pertainyms (for ps): # P for all possible pertainyms p: pnn In LN: # All possible Lemma names Possible_adj.append (ln)    

No comments:

Post a Comment