Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

nltk python

>>> import nltk
>>> sentence = """At eight o'clock on Thursday morning
... Arthur didn't feel very good."""
>>> tokens = nltk.word_tokenize(sentence)
>>> tokens
['At', 'eight', "o'clock", 'on', 'Thursday', 'morning',
'Arthur', 'did', "n't", 'feel', 'very', 'good', '.']
>>> tagged = nltk.pos_tag(tokens)
>>> tagged[0:6]
[('At', 'IN'), ('eight', 'CD'), ("o'clock", 'JJ'), ('on', 'IN'),
('Thursday', 'NNP'), ('morning', 'NN')]
Comment

nltk python

pip install nltk
import nltk
nltk.download()
Comment

PREVIOUS NEXT
Code Example
Python :: dtype array 
Python :: python evaluate string 
Python :: check space in string python 
Python :: import python file from another directory 
Python :: how to add value in array django 
Python :: unsupervised knn 
Python :: open image in PILLOW 
Python :: python dictionary get value if key exists 
Python :: error: not well-formed (invalid token) 
Python :: how to combine two lists in python 
Python :: python how to convert a list of floats to a list of strings 
Python :: intersection of three arrays 
Python :: get guild from a channel discord py 
Python :: print format python 
Python :: Progress Bars in Python 
Python :: change value in nested dictionary python 
Python :: how to use prettytable in python 
Python :: i have two versions of python installed mac 
Python :: cookies in django 
Python :: upload_file boto3 headers 
Python :: bubblesort python 
Python :: transpose of a matrix in python numpy 
Python :: add favicon in django admin 
Python :: bot delete embed py 
Python :: convert df.isnull().sum() to dataframe 
Python :: pandas describe 
Python :: roc auc score 
Python :: matplotlib save figure without showing 
Python :: extract address from text python 
Python :: validationerror django params 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =