Python | TextBlob.noun_phrases() method
Last Updated :
09 Sep, 2019
With the help of TextBlob.noun_phrases()
method, we can get the noun phrases of the sentences by using TextBlob.noun_phrases()
method.
Syntax : TextBlob.noun_phrases()
Return : Return list of noun values.
Example #1 :
In this example we can say that by using TextBlob.noun_phrases()
method, we are able to get the list of noun words.
from textblob import TextBlob
gfg = TextBlob( "Python is a high-level language." )
gfg = gfg.noun_phrases
print (gfg)
|
Output :
[‘python’, ‘high-level language’]
Example #2 :
from textblob import TextBlob
gfg = TextBlob( "Sandeep Jain An IIT Roorkee alumnus and founder of GeeksforGeeks. He loves to solve programming problems in most efficient ways." )
gfg = gfg.noun_phrases
print (gfg)
|
Output :
[‘sandeep jain’, ‘iit roorkee’, ‘geeksforgeeks’, ‘efficient ways’]
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...