Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

nltk document

>>> 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

PREVIOUS NEXT
Code Example
Python :: strategy forex with python 
Python :: How many handshakes for all the people in your class? python code 
Python :: scatter plot actual vs predicted python 
Python :: pyAesCrypt 
Python :: odoo wizard current user login 
Python :: is python not a real programing laguage because lines dont end in ; 
Python :: Seaborn boxplots shifted incorrectly along x-axis 
Python :: Python program to remove newline characters from a file 
Python :: python xlrd date 
Python :: tf.data.Dataset select files with labels filter 
Python :: Only show legend of inner donut 
Python :: Syntax Closing a File in python 
Python :: enregistremen en pythin picklr 
Python :: what to replace the rect pygame command 
Python :: fancy index 
Python :: pandas replace not working 
Python :: Convert Time object to String in python 
Python :: disable kivy button in kv 
Python :: how to hide a specific file in python 
Python :: python list as stacks 
Python :: BMI CALCULATOR CODE IN PYTHON 
Python :: axes in array 
Python :: sample k-means clustering 
Python :: how to print continuesly in the same line in python 
Python :: pd.generate_date 
Python :: how to install opencv for python 3.7.3 
Python :: Combine first and last 3 columns into new dataframe 
Python :: expected str instance, NoneType found 
Python :: vscode python region folding 
Python :: python packing circles 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =