Python | TextBlob.noun_phrases() method
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.
# import TextBlob from textblob import TextBlob gfg = TextBlob( "Python is a high-level language." ) # using TextBlob.noun_phrases method gfg = gfg.noun_phrases print (gfg) |
Output :
[‘python’, ‘high-level language’]
Example #2 :
# import TextBlob 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." ) # using TextBlob.noun_phrases method gfg = gfg.noun_phrases print (gfg) |
Output :
[‘sandeep jain’, ‘iit roorkee’, ‘geeksforgeeks’, ‘efficient ways’]
Recommended Posts:
- class method vs static method in Python
- Python | next() method
- Python | set() method
- Python | os.dup() method
- Python | sympy.Pow() method
- Python | os.WIFCONTINUED() method
- Python PIL | blend() method
- Python | Decimal max() method
- Python Dictionary | pop() method
- Python PIL | Image.new() method
- Python | range() method
- Python | os.sysconf() method
- Python | Tensorflow exp() method
- Python | os.confstr() method
- Python | os.fchmod() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.