I want to use NLTK to find the most frequent nouns and the adjectives describing those nouns from texts and then finding synonyms of those nouns. I then want to cluster those documents.
import nltk
from nltk.tag import *
sentence = """Michale Scofield is an engineer. He is expert in java. He knows coding very well.
He think world is like a big system of computers.A big system of computer involves the servers, servers are nothing but super-fast machines"""
tagged_sent = pos_tag(sentence.split())
print(tagged_sent)
nouns = [word for word,pos in tagged_sent if pos == 'NNP' or pos=='NN']
print(nouns)
freq_nouns=nltk.FreqDist(nouns)
freq_nouns.most_common(3)
I have tried but was unable to get the nouns and the adjectives describing those nouns and it should be the most frequent ones.
for the above sentence i want the output to be
expert java, big system, super-fast machines
Can someone please help me in this.