I am new to NLTK
This is the code I have used,
text="The pizza was 66 and brilliant"
pattern = r"""
P: {<NN>+<VBD>+<CD>+}
"""
for sent in sent_tokenize(text):
sentence = sent.split()
PChunker = RegexpParser(pattern)
output= PChunker.parse(pos_tag(sentence))
print(output)
I am getting the output,
(S The/DT (P pizza/NN was/VBD 66/CD) and/CC brilliant/VB)
I need the output ,
pizza was 66
How can I get this?