Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

11/14/2019 NLTK-Tutorial-/nltk_practice1.

ipynb at master · adityaojha07/NLTK-Tutorial-

Branch: master Find file Copy path

NLTK-Tutorial- / nltk_practice1.ipynb

adityaojha07 Add files via upload

5ce4e99 on Sep 2

1 contributor

Raw Blame History

2008 lines (2007 sloc) 195 KB

https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 1/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-

Basic introduction to NLTK


AUTHOR : Aditya Ojha

The prerequistes of this notebook is that you love Python :)

In [20]: nltk.download('movie_reviews')

[nltk_data] Downloading package movie_reviews to


[nltk_data] C:\Users\ABC\AppData\Roaming\nltk_data...
[nltk_data] Unzipping corpora\movie_reviews.zip.
Out[20]: True

In [1]: !pip install nltk

Requirement already satisfied: nltk in c:\users\abc\anaconda3\lib\site-packages (3.4)


Requirement already satisfied: six in c:\users\abc\anaconda3\lib\site-packages (from nltk) (1.12.0)
Requirement already satisfied: singledispatch in c:\users\abc\anaconda3\lib\site-packages (from nlt
k) (3.4.0.3)

TOKENIZING
Tokenizing means to group in words or sentences

Importing necessary packages

In [1]: import nltk


from nltk import sent_tokenize, word_tokenize

Sample Data

In [2]: para = "This is sample text. We are testing nltk packages. Do not disappoint us."

Sentence Tokenization

In [3]: a = sent_tokenize(para)

In [4]: a

Out[4]: ['This is sample text.',


'We are testing nltk packages.',
'Do not disappoint us.']

In [5]: for j in sent_tokenize(para):


print(j)

This is sample text.


We are testing nltk packages.
Do not disappoint us.

Words Tokenizatin

In [6]: b = word_tokenize(para)

In [7]: b

Out[7]: ['This',
'is',
'sample',
'text',
'.',
'We',
'are',
'testing',
'nltk',
'packages',
'.',
'Do',
'not',
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 2/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
,
'disappoint',
'us',
'.']

In [8]: for i in word_tokenize(para):


print(i)

This
is
sample
text
.
We
are
testing
nltk
packages
.
Do
not
disappoint
us
.

STOP_WORDS
They are words that does not have an impact on sentence analysis. For example is, am, was, will, etc

In [9]: from nltk.corpus import stopwords

In [10]: example_sentence = "This is an example of stop words filtaration. Hope it will run"

In [11]: stop_words = set(stopwords.words("english"))

In [12]: print(stop_words)

{'where', 'have', 'than', 'or', "haven't", 'some', 'because', "mightn't", 'your', 'its', "weren't",
"couldn't", 'been', 'did', 'these', 'it', 'for', 'wouldn', 'being', 'my', 'wasn', 'mightn', "should
n't", 'his', 'ma', 'same', 'has', 'do', 'will', 'couldn', 'when', 'won', 'each', 'doing', 'over', "t
hat'll", 'all', 'below', 're', 'any', 'you', 'which', "didn't", "wouldn't", 'as', 'once', "should'v
e", "you'll", 'before', 'why', 'at', 'after', "won't", 'a', 'then', 'above', 'most', 'hadn', 'y', 'n
ow', 'shouldn', 'only', 'itself', 'ours', 'aren', 'her', 'those', 'in', 'just', 'up', 'this', 'thems
elves', "doesn't", 'an', 'there', 'she', 'own', 'whom', 'how', 'not', 'were', "she's", 'should',
'd', 'so', "it's", 'himself', 'me', 'are', 'if', 'who', 'mustn', 'with', 'few', 'haven', 'that', 'b
y', "don't", 'm', 'theirs', 'the', 'between', 's', 'nor', "mustn't", "needn't", 'weren', 'to', 'ou
t', 'here', 'we', 'until', 've', "shan't", 'further', 'into', 'is', "you're", 'our', 'yourselves',
'while', "isn't", 'am', "aren't", 'and', 'during', 'needn', 'i', 'hers', 'them', 'their', 'having',
'o', 'was', 'yourself', 'of', 'didn', 'doesn', 'can', 'had', 'other', 'very', 'ain', "you'd", 'abou
t', 'off', 'he', 'under', 'myself', 'but', "hasn't", 't', 'through', "wasn't", "you've", 'too', "had
n't", 'him', 'be', 'against', 'on', 'they', 'isn', 'what', 'both', 'down', 'll', 'yours', 'no', 'do
n', 'herself', 'hasn', 'does', 'more', 'from', 'shan', 'ourselves', 'again', 'such'}

In [13]: words = word_tokenize(example_sentence)

filtered_sentence = []

for w in words:
if w not in stop_words:
filtered_sentence.append(w)
print(filtered_sentence)

['This', 'example', 'stop', 'words', 'filtaration', '.', 'Hope', 'run']

STEMMING
In stemming we take root words. For example, root word of 'Riding' is 'Ride'.

PorterStemming

In [14]: from nltk.stem import PorterStemmer

In [15]: ps = PorterStemmer()

https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 3/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
In [16]: example_words = ["python","pythoner","pythoning","pythoned","pythonly"]

for w in example_words:
print(ps.stem(w))

python
python
python
python
pythonli

In [17]: sample = "You are not considering the considerable performance considerably.Its consequences will no
t be considerd"
words = sent_tokenize(sample)
sample = sample.split(' ')

for w in sample:
print(ps.stem(w))

you
are
not
consid
the
consider
perform
considerably.it
consequ
will
not
be
considerd

SnowBall Stemming

In [18]: from nltk.stem import SnowballStemmer


sb = SnowballStemmer("english")

In [19]: example_words = ["python","pythoner","pythoning","pythoned","pythonly"]

for w in example_words:
print(sb.stem(w))

python
python
python
python
python

In [20]: sample = ("You are not considering the considerable performance considerably. Its consequences will
not be considerd")
words = word_tokenize(sample)
sample = sample.split(' ')

for w in sample:
print(sb.stem(w))

you
are
not
consid
the
consider
perform
considerably.
it
consequ
will
not
be
considerd

PARTS OF SPEECH TAGGING

In [3]: import nltk


from nltk import sent_tokenize, word_tokenize
from nltk corpus import state union #state union adresses by various americaPunktSentenceTokenizern
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 4/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
from nltk.corpus import state_union #state union adresses by various americaPunktSentenceTokenizern
presidents
#from nltk.tokenize import sent_tokenize
from nltk.tokenize import PunktSentenceTokenizer

In [22]: train_text = state_union.raw("2006-GWBush.txt")


sample_text = state_union.raw("2005-GWBush.txt")

In [23]: custom_sent_tokenizer = PunktSentenceTokenizer(train_text)

tokenized = custom_sent_tokenizer.tokenize(sample_text)

In [24]: def process_content():


try:
for i in tokenized:
words = nltk.word_tokenize(i)
tagged = nltk.pos_tag(words)

print(tagged)

except Exception as e:
print(str(e))

process_content()

[('PRESIDENT', 'NNP'), ('GEORGE', 'NNP'), ('W.', 'NNP'), ('BUSH', 'NNP'), ("'S", 'POS'), ('ADDRESS',
'NNP'), ('BEFORE', 'IN'), ('A', 'NNP'), ('JOINT', 'NNP'), ('SESSION', 'NNP'), ('OF', 'IN'), ('THE',
'NNP'), ('CONGRESS', 'NNP'), ('ON', 'NNP'), ('THE', 'NNP'), ('STATE', 'NNP'), ('OF', 'IN'), ('THE',
'NNP'), ('UNION', 'NNP'), ('February', 'NNP'), ('2', 'CD'), (',', ','), ('2005', 'CD'), ('9:10', 'C
D'), ('P.M', 'NNP'), ('.', '.')]
[('EST', 'IN'), ('THE', 'NNP'), ('PRESIDENT', 'NNP'), (':', ':'), ('Mr.', 'NNP'), ('Speaker', 'NN
P'), (',', ','), ('Vice', 'NNP'), ('President', 'NNP'), ('Cheney', 'NNP'), (',', ','), ('members',
'NNS'), ('of', 'IN'), ('Congress', 'NNP'), (',', ','), ('fellow', 'JJ'), ('citizens', 'NNS'), (':',
':'), ('As', 'IN'), ('a', 'DT'), ('new', 'JJ'), ('Congress', 'NNP'), ('gathers', 'NNS'), (',', ','),
('all', 'DT'), ('of', 'IN'), ('us', 'PRP'), ('in', 'IN'), ('the', 'DT'), ('elected', 'JJ'), ('branch
es', 'NNS'), ('of', 'IN'), ('government', 'NN'), ('share', 'NN'), ('a', 'DT'), ('great', 'JJ'), ('pr
ivilege', 'NN'), (':', ':'), ('We', 'PRP'), ("'ve", 'VBP'), ('been', 'VBN'), ('placed', 'VBN'), ('i
n', 'IN'), ('office', 'NN'), ('by', 'IN'), ('the', 'DT'), ('votes', 'NNS'), ('of', 'IN'), ('the', 'D
T'), ('people', 'NNS'), ('we', 'PRP'), ('serve', 'VBP'), ('.', '.')]
[('And', 'CC'), ('tonight', 'NN'), ('that', 'WDT'), ('is', 'VBZ'), ('a', 'DT'), ('privilege', 'NN'),
('we', 'PRP'), ('share', 'NN'), ('with', 'IN'), ('newly-elected', 'JJ'), ('leaders', 'NNS'), ('of',
'IN'), ('Afghanistan', 'NNP'), (',', ','), ('the', 'DT'), ('Palestinian', 'JJ'), ('Territories', 'NN
P'), (',', ','), ('Ukraine', 'NNP'), (',', ','), ('and', 'CC'), ('a', 'DT'), ('free', 'JJ'), ('and',
'CC'), ('sovereign', 'JJ'), ('Iraq', 'NNP'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Two', 'CD'), ('weeks', 'NNS'), ('ago', 'RB'), (',', ','), ('I', 'PRP'), ('stood', 'VBD'), ('on',
'IN'), ('the', 'DT'), ('steps', 'NNS'), ('of', 'IN'), ('this', 'DT'), ('Capitol', 'NNP'), ('and', 'C
C'), ('renewed', 'VBN'), ('the', 'DT'), ('commitment', 'NN'), ('of', 'IN'), ('our', 'PRP$'), ('natio
n', 'NN'), ('to', 'TO'), ('the', 'DT'), ('guiding', 'VBG'), ('ideal', 'NN'), ('of', 'IN'), ('libert
y', 'NN'), ('for', 'IN'), ('all', 'DT'), ('.', '.')]
[('This', 'DT'), ('evening', 'NN'), ('I', 'PRP'), ('will', 'MD'), ('set', 'VB'), ('forth', 'JJ'),
('policies', 'NNS'), ('to', 'TO'), ('advance', 'VB'), ('that', 'DT'), ('ideal', 'NN'), ('at', 'IN'),
('home', 'NN'), ('and', 'CC'), ('around', 'IN'), ('the', 'DT'), ('world', 'NN'), ('.', '.')]
[('Tonight', 'NNP'), (',', ','), ('with', 'IN'), ('a', 'DT'), ('healthy', 'JJ'), (',', ','), ('growi
ng', 'VBG'), ('economy', 'NN'), (',', ','), ('with', 'IN'), ('more', 'JJR'), ('Americans', 'NNS'),
('going', 'VBG'), ('back', 'RB'), ('to', 'TO'), ('work', 'NN'), (',', ','), ('with', 'IN'), ('our',
'PRP$'), ('nation', 'NN'), ('an', 'DT'), ('active', 'JJ'), ('force', 'NN'), ('for', 'IN'), ('good',
'JJ'), ('in', 'IN'), ('the', 'DT'), ('world', 'NN'), ('--', ':'), ('the', 'DT'), ('state', 'NN'),
('of', 'IN'), ('our', 'PRP$'), ('union', 'NN'), ('is', 'VBZ'), ('confident', 'JJ'), ('and', 'CC'),
('strong', 'JJ'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Our', 'PRP$'), ('generation', 'NN'), ('has', 'VBZ'), ('been', 'VBN'), ('blessed', 'VBN'), ('--',
':'), ('by', 'IN'), ('the', 'DT'), ('expansion', 'NN'), ('of', 'IN'), ('opportunity', 'NN'), (',',
','), ('by', 'IN'), ('advances', 'NNS'), ('in', 'IN'), ('medicine', 'NN'), (',', ','), ('by', 'IN'),
('the', 'DT'), ('security', 'NN'), ('purchased', 'VBN'), ('by', 'IN'), ('our', 'PRP$'), ('parents',
'NNS'), ("'", 'POS'), ('sacrifice', 'NN'), ('.', '.')]
[('Now', 'RB'), (',', ','), ('as', 'IN'), ('we', 'PRP'), ('see', 'VBP'), ('a', 'DT'), ('little', 'J
J'), ('gray', 'NN'), ('in', 'IN'), ('the', 'DT'), ('mirror', 'NN'), ('--', ':'), ('or', 'CC'), ('a',
'DT'), ('lot', 'NN'), ('of', 'IN'), ('gray', 'NN'), ('--', ':'), ('(', '('), ('laughter', 'NN'),
(')', ')'), ('--', ':'), ('and', 'CC'), ('we', 'PRP'), ('watch', 'VBP'), ('our', 'PRP$'), ('childre
n', 'NNS'), ('moving', 'VBG'), ('into', 'IN'), ('adulthood', 'NN'), (',', ','), ('we', 'PRP'), ('as
k', 'VBP'), ('the', 'DT'), ('question', 'NN'), (':', ':'), ('What', 'WP'), ('will', 'MD'), ('be', 'V
B'), ('the', 'DT'), ('state', 'NN'), ('of', 'IN'), ('their', 'PRP$'), ('union', 'NN'), ('?', '.')]
[('Members', 'NNS'), ('of', 'IN'), ('Congress', 'NNP'), (',', ','), ('the', 'DT'), ('choices', 'NN
S'), ('we', 'PRP'), ('make', 'VBP'), ('together', 'RB'), ('will', 'MD'), ('answer', 'VB'), ('that',
'DT'), ('question', 'NN'), ('.', '.')]
[('Over', 'IN'), ('the', 'DT'), ('next', 'JJ'), ('several', 'JJ'), ('months', 'NNS'), (',', ','),
('on', 'IN'), ('issue', 'NN'), ('after', 'IN'), ('issue', 'NN'), (',', ','), ('let', 'VB'), ('us',
' ') ('d ' ' ') (' h t' ' ') (' i ' ' S') ('h ' ' ') (' l ' ' ') ('d
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 5/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
'PRP'), ('do', 'VB'), ('what', 'WP'), ('Americans', 'NNPS'), ('have', 'VBP'), ('always', 'RB'), ('do
ne', 'VBN'), (',', ','), ('and', 'CC'), ('build', 'VB'), ('a', 'DT'), ('better', 'JJR'), ('world',
'NN'), ('for', 'IN'), ('our', 'PRP$'), ('children', 'NNS'), ('and', 'CC'), ('our', 'PRP$'), ('grandc
hildren', 'NNS'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('First', 'RB'), (',', ','), ('we', 'PRP'), ('must', 'MD'), ('be', 'VB'), ('good', 'JJ'), ('steward
s', 'NNS'), ('of', 'IN'), ('this', 'DT'), ('economy', 'NN'), (',', ','), ('and', 'CC'), ('renew', 'V
B'), ('the', 'DT'), ('great', 'JJ'), ('institutions', 'NNS'), ('on', 'IN'), ('which', 'WDT'), ('mill
ions', 'NNS'), ('of', 'IN'), ('our', 'PRP$'), ('fellow', 'JJ'), ('citizens', 'NNS'), ('rely', 'RB'),
('.', '.')]
[('America', 'NNP'), ("'s", 'POS'), ('economy', 'NN'), ('is', 'VBZ'), ('the', 'DT'), ('fastest', 'JJ
S'), ('growing', 'NN'), ('of', 'IN'), ('any', 'DT'), ('major', 'JJ'), ('industrialized', 'VBN'), ('n
ation', 'NN'), ('.', '.')]
[('In', 'IN'), ('the', 'DT'), ('past', 'JJ'), ('four', 'CD'), ('years', 'NNS'), (',', ','), ('we',
'PRP'), ('provided', 'VBD'), ('tax', 'NN'), ('relief', 'NN'), ('to', 'TO'), ('every', 'DT'), ('perso
n', 'NN'), ('who', 'WP'), ('pays', 'VBZ'), ('income', 'NN'), ('taxes', 'NNS'), (',', ','), ('overcom
e', 'VBP'), ('a', 'DT'), ('recession', 'NN'), (',', ','), ('opened', 'VBD'), ('up', 'RP'), ('new',
'JJ'), ('markets', 'NNS'), ('abroad', 'RB'), (',', ','), ('prosecuted', 'JJ'), ('corporate', 'JJ'),
('criminals', 'NNS'), (',', ','), ('raised', 'VBD'), ('homeownership', 'NN'), ('to', 'TO'), ('its',
'PRP$'), ('highest', 'JJS'), ('level', 'NN'), ('in', 'IN'), ('history', 'NN'), (',', ','), ('and',
'CC'), ('in', 'IN'), ('the', 'DT'), ('last', 'JJ'), ('year', 'NN'), ('alone', 'RB'), (',', ','), ('t
he', 'DT'), ('United', 'NNP'), ('States', 'NNPS'), ('has', 'VBZ'), ('added', 'VBN'), ('2.3', 'CD'),
('million', 'CD'), ('new', 'JJ'), ('jobs', 'NNS'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('When', 'WRB'), ('action', 'NN'), ('was', 'VBD'), ('needed', 'VBN'), (',', ','), ('the', 'DT'),
('Congress', 'NNP'), ('delivered', 'VBN'), ('--', ':'), ('and', 'CC'), ('the', 'DT'), ('nation', 'N
N'), ('is', 'VBZ'), ('grateful', 'JJ'), ('.', '.')]
[('Now', 'RB'), ('we', 'PRP'), ('must', 'MD'), ('add', 'VB'), ('to', 'TO'), ('these', 'DT'), ('achie
vements', 'NNS'), ('.', '.')]
[('By', 'IN'), ('making', 'VBG'), ('our', 'PRP$'), ('economy', 'NN'), ('more', 'RBR'), ('flexible',
'JJ'), (',', ','), ('more', 'RBR'), ('innovative', 'JJ'), (',', ','), ('and', 'CC'), ('more', 'RB
R'), ('competitive', 'JJ'), (',', ','), ('we', 'PRP'), ('will', 'MD'), ('keep', 'VB'), ('America',
'NNP'), ('the', 'DT'), ('economic', 'JJ'), ('leader', 'NN'), ('of', 'IN'), ('the', 'DT'), ('world',
'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('America', 'NNP'), ("'s", 'POS'), ('prosperity', 'NN'), ('requires', 'VBZ'), ('restraining', 'VB
G'), ('the', 'DT'), ('spending', 'NN'), ('appetite', 'NN'), ('of', 'IN'), ('the', 'DT'), ('federal',
'JJ'), ('government', 'NN'), ('.', '.')]
[('I', 'PRP'), ('welcome', 'VBP'), ('the', 'DT'), ('bipartisan', 'JJ'), ('enthusiasm', 'NN'), ('fo
r', 'IN'), ('spending', 'NN'), ('discipline', 'NN'), ('.', '.')]
[('I', 'PRP'), ('will', 'MD'), ('send', 'VB'), ('you', 'PRP'), ('a', 'DT'), ('budget', 'NN'), ('tha
t', 'WDT'), ('holds', 'VBZ'), ('the', 'DT'), ('growth', 'NN'), ('of', 'IN'), ('discretionary', 'J
J'), ('spending', 'NN'), ('below', 'IN'), ('inflation', 'NN'), (',', ','), ('makes', 'VBZ'), ('tax',
'NN'), ('relief', 'NN'), ('permanent', 'NN'), (',', ','), ('and', 'CC'), ('stays', 'NNS'), ('on', 'I
N'), ('track', 'NN'), ('to', 'TO'), ('cut', 'VB'), ('the', 'DT'), ('deficit', 'NN'), ('in', 'IN'),
('half', 'NN'), ('by', 'IN'), ('2009', 'CD'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('My', 'PRP$'), ('budget', 'NN'), ('substantially', 'RB'), ('reduces', 'VBZ'), ('or', 'CC'), ('elim
inates', 'VBZ'), ('more', 'JJR'), ('than', 'IN'), ('150', 'CD'), ('government', 'NN'), ('programs',
'NNS'), ('that', 'WDT'), ('are', 'VBP'), ('not', 'RB'), ('getting', 'VBG'), ('results', 'NNS'),
(',', ','), ('or', 'CC'), ('duplicate', 'VB'), ('current', 'JJ'), ('efforts', 'NNS'), (',', ','),
('or', 'CC'), ('do', 'VBP'), ('not', 'RB'), ('fulfill', 'VB'), ('essential', 'JJ'), ('priorities',
'NNS'), ('.', '.')]
[('The', 'DT'), ('principle', 'NN'), ('here', 'RB'), ('is', 'VBZ'), ('clear', 'JJ'), (':', ':'), ('T
axpayer', 'NN'), ('dollars', 'NNS'), ('must', 'MD'), ('be', 'VB'), ('spent', 'VBN'), ('wisely', 'R
B'), (',', ','), ('or', 'CC'), ('not', 'RB'), ('at', 'IN'), ('all', 'DT'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('To', 'TO'), ('make', 'VB'), ('our', 'PRP$'), ('economy', 'NN'), ('stronger', 'JJR'), ('and', 'C
C'), ('more', 'RBR'), ('dynamic', 'JJ'), (',', ','), ('we', 'PRP'), ('must', 'MD'), ('prepare', 'V
B'), ('a', 'DT'), ('rising', 'VBG'), ('generation', 'NN'), ('to', 'TO'), ('fill', 'VB'), ('the', 'D
T'), ('jobs', 'NNS'), ('of', 'IN'), ('the', 'DT'), ('21st', 'JJ'), ('century', 'NN'), ('.', '.')]
[('Under', 'IN'), ('the', 'DT'), ('No', 'NNP'), ('Child', 'NNP'), ('Left', 'NNP'), ('Behind', 'NN
P'), ('Act', 'NNP'), (',', ','), ('standards', 'NNS'), ('are', 'VBP'), ('higher', 'JJR'), (',',
','), ('test', 'NN'), ('scores', 'NNS'), ('are', 'VBP'), ('on', 'IN'), ('the', 'DT'), ('rise', 'N
N'), (',', ','), ('and', 'CC'), ('we', 'PRP'), ("'re", 'VBP'), ('closing', 'VBG'), ('the', 'DT'),
('achievement', 'NN'), ('gap', 'NN'), ('for', 'IN'), ('minority', 'NN'), ('students', 'NNS'), ('.',
'.')]
[('Now', 'RB'), ('we', 'PRP'), ('must', 'MD'), ('demand', 'VB'), ('better', 'JJR'), ('results', 'NN
S'), ('from', 'IN'), ('our', 'PRP$'), ('high', 'JJ'), ('schools', 'NNS'), (',', ','), ('so', 'RB'),
('every', 'DT'), ('high', 'JJ'), ('school', 'NN'), ('diploma', 'NN'), ('is', 'VBZ'), ('a', 'DT'),
('ticket', 'NN'), ('to', 'TO'), ('success', 'NN'), ('.', '.')]
[('We', 'PRP'), ('will', 'MD'), ('help', 'VB'), ('an', 'DT'), ('additional', 'JJ'), ('200,000', 'C
D'), ('workers', 'NNS'), ('to', 'TO'), ('get', 'VB'), ('training', 'NN'), ('for', 'IN'), ('a', 'D
T'), ('better', 'JJR'), ('career', 'NN'), (',', ','), ('by', 'IN'), ('reforming', 'VBG'), ('our', 'P
RP$'), ('job', 'NN'), ('training', 'NN'), ('system', 'NN'), ('and', 'CC'), ('strengthening', 'VBG'),
('America', 'NNP'), ("'s", 'POS'), ('community', 'NN'), ('colleges', 'NNS'), ('.', '.')]
[('And', 'CC'), ('we', 'PRP'), ("'ll", 'MD'), ('make', 'VB'), ('it', 'PRP'), ('easier', 'JJR'), ('fo
r', 'IN'), ('Americans', 'NNPS'), ('to', 'TO'), ('afford', 'VB'), ('a', 'DT'), ('college', 'NN'),
('education', 'NN'), (',', ','), ('by', 'IN'), ('increasing', 'VBG'), ('the', 'DT'), ('size', 'NN'),
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 6/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
('of', 'IN'), ('Pell', 'NNP'), ('Grants', 'NNP'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('To', 'TO'), ('make', 'VB'), ('our', 'PRP$'), ('economy', 'NN'), ('stronger', 'JJR'), ('and', 'C
C'), ('more', 'RBR'), ('competitive', 'JJ'), (',', ','), ('America', 'NNP'), ('must', 'MD'), ('rewar
d', 'VB'), (',', ','), ('not', 'RB'), ('punish', 'VB'), (',', ','), ('the', 'DT'), ('efforts', 'NN
S'), ('and', 'CC'), ('dreams', 'NNS'), ('of', 'IN'), ('entrepreneurs', 'NNS'), ('.', '.')]
[('Small', 'JJ'), ('business', 'NN'), ('is', 'VBZ'), ('the', 'DT'), ('path', 'NN'), ('of', 'IN'),
('advancement', 'NN'), (',', ','), ('especially', 'RB'), ('for', 'IN'), ('women', 'NNS'), ('and', 'C
C'), ('minorities', 'NNS'), (',', ','), ('so', 'IN'), ('we', 'PRP'), ('must', 'MD'), ('free', 'VB'),
('small', 'JJ'), ('businesses', 'NNS'), ('from', 'IN'), ('needless', 'JJ'), ('regulation', 'NN'),
('and', 'CC'), ('protect', 'JJ'), ('honest', 'JJS'), ('job-creators', 'NNS'), ('from', 'IN'), ('jun
k', 'NN'), ('lawsuits', 'NNS'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Justice', 'NNP'), ('is', 'VBZ'), ('distorted', 'VBN'), (',', ','), ('and', 'CC'), ('our', 'PRP
$'), ('economy', 'NN'), ('is', 'VBZ'), ('held', 'VBN'), ('back', 'RB'), ('by', 'IN'), ('irresponsibl
e', 'JJ'), ('class-actions', 'NNS'), ('and', 'CC'), ('frivolous', 'JJ'), ('asbestos', 'NN'), ('claim
s', 'NNS'), ('--', ':'), ('and', 'CC'), ('I', 'PRP'), ('urge', 'VBP'), ('Congress', 'NNP'), ('to',
'TO'), ('pass', 'VB'), ('legal', 'JJ'), ('reforms', 'NNS'), ('this', 'DT'), ('year', 'NN'), ('.',
'.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('To', 'TO'), ('make', 'VB'), ('our', 'PRP$'), ('economy', 'NN'), ('stronger', 'JJR'), ('and', 'C
C'), ('more', 'RBR'), ('productive', 'JJ'), (',', ','), ('we', 'PRP'), ('must', 'MD'), ('make', 'V
B'), ('health', 'NN'), ('care', 'NN'), ('more', 'RBR'), ('affordable', 'JJ'), (',', ','), ('and', 'C
C'), ('give', 'VB'), ('families', 'NNS'), ('greater', 'JJR'), ('access', 'NN'), ('to', 'TO'), ('goo
d', 'JJ'), ('coverage', 'NN'), ('--', ':'), ('(', '('), ('applause', 'NN'), (')', ')'), ('--', ':'),
('and', 'CC'), ('more', 'JJR'), ('control', 'NN'), ('over', 'IN'), ('their', 'PRP$'), ('health', 'N
N'), ('decisions', 'NNS'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('I', 'PRP'), ('ask', 'VBP'), ('Congress', 'NNP'), ('to', 'TO'), ('move', 'VB'), ('forward', 'RB'),
('on', 'IN'), ('a', 'DT'), ('comprehensive', 'JJ'), ('health', 'NN'), ('care', 'NN'), ('agenda', 'N
N'), ('with', 'IN'), ('tax', 'NN'), ('credits', 'NNS'), ('to', 'TO'), ('help', 'VB'), ('low-income',
'JJ'), ('workers', 'NNS'), ('buy', 'VBP'), ('insurance', 'NN'), (',', ','), ('a', 'DT'), ('communit
y', 'NN'), ('health', 'NN'), ('center', 'NN'), ('in', 'IN'), ('every', 'DT'), ('poor', 'JJ'), ('coun
try', 'NN'), (',', ','), ('improved', 'VBN'), ('information', 'NN'), ('technology', 'NN'), ('to', 'T
O'), ('prevent', 'VB'), ('medical', 'JJ'), ('error', 'NN'), ('and', 'CC'), ('needless', 'NN'), ('cos
ts', 'NNS'), (',', ','), ('association', 'NN'), ('health', 'NN'), ('plans', 'NNS'), ('for', 'IN'),
('small', 'JJ'), ('businesses', 'NNS'), ('and', 'CC'), ('their', 'PRP$'), ('employees', 'NNS'), ('--
', ':'), ('(', '('), ('applause', 'NN'), (')', ')'), ('--', ':'), ('expanded', 'VBD'), ('health', 'N
N'), ('savings', 'NNS'), ('accounts', 'NNS'), ('--', ':'), ('(', '('), ('applause', 'NN'), (')',
')'), ('--', ':'), ('and', 'CC'), ('medical', 'JJ'), ('liability', 'NN'), ('reform', 'NN'), ('that',
'WDT'), ('will', 'MD'), ('reduce', 'VB'), ('health', 'NN'), ('care', 'NN'), ('costs', 'NNS'), ('an
d', 'CC'), ('make', 'VB'), ('sure', 'JJ'), ('patients', 'NNS'), ('have', 'VBP'), ('the', 'DT'), ('do
ctors', 'NNS'), ('and', 'CC'), ('care', 'NN'), ('they', 'PRP'), ('need', 'VBP'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('To', 'TO'), ('keep', 'VB'), ('our', 'PRP$'), ('economy', 'NN'), ('growing', 'VBG'), (',', ','),
('we', 'PRP'), ('also', 'RB'), ('need', 'VBP'), ('reliable', 'JJ'), ('supplies', 'NNS'), ('of', 'I
N'), ('affordable', 'JJ'), (',', ','), ('environmentally', 'RB'), ('responsible', 'JJ'), ('energy',
'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Nearly', 'RB'), ('four', 'CD'), ('years', 'NNS'), ('ago', 'RB'), (',', ','), ('I', 'PRP'), ('subm
itted', 'VBD'), ('a', 'DT'), ('comprehensive', 'JJ'), ('energy', 'NN'), ('strategy', 'NN'), ('that',
'WDT'), ('encourages', 'VBZ'), ('conservation', 'NN'), (',', ','), ('alternative', 'JJ'), ('source
s', 'NNS'), (',', ','), ('a', 'DT'), ('modernized', 'JJ'), ('electricity', 'NN'), ('grid', 'NN'),
(',', ','), ('and', 'CC'), ('more', 'JJR'), ('production', 'NN'), ('here', 'RB'), ('at', 'IN'), ('ho
me', 'NN'), ('--', ':'), ('including', 'VBG'), ('safe', 'JJ'), (',', ','), ('clean', 'JJ'), ('nuclea
r', 'JJ'), ('energy', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('My', 'PRP$'), ('Clear', 'JJ'), ('Skies', 'NNPS'), ('legislation', 'NN'), ('will', 'MD'), ('cut',
'VB'), ('power', 'NN'), ('plant', 'NN'), ('pollution', 'NN'), ('and', 'CC'), ('improve', 'VB'), ('th
e', 'DT'), ('health', 'NN'), ('of', 'IN'), ('our', 'PRP$'), ('citizens', 'NNS'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('And', 'CC'), ('my', 'PRP$'), ('budget', 'NN'), ('provides', 'VBZ'), ('strong', 'JJ'), ('funding',
'NN'), ('for', 'IN'), ('leading-edge', 'JJ'), ('technology', 'NN'), ('--', ':'), ('from', 'IN'), ('h
ydrogen-fueled', 'JJ'), ('cars', 'NNS'), (',', ','), ('to', 'TO'), ('clean', 'VB'), ('coal', 'NN'),
(',', ','), ('to', 'TO'), ('renewable', 'VB'), ('sources', 'NNS'), ('such', 'JJ'), ('as', 'IN'), ('e
thanol', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Four', 'CD'), ('years', 'NNS'), ('of', 'IN'), ('debate', 'NN'), ('is', 'VBZ'), ('enough', 'JJ'),
(':', ':'), ('I', 'PRP'), ('urge', 'VBP'), ('Congress', 'NNP'), ('to', 'TO'), ('pass', 'VB'), ('legi
slation', 'NN'), ('that', 'WDT'), ('makes', 'VBZ'), ('America', 'NNP'), ('more', 'JJR'), ('secure',
'NN'), ('and', 'CC'), ('less', 'RBR'), ('dependent', 'JJ'), ('on', 'IN'), ('foreign', 'JJ'), ('energ
y', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('All', 'PDT'), ('these', 'DT'), ('proposals', 'NNS'), ('are', 'VBP'), ('essential', 'JJ'), ('to',
'TO'), ('expand', 'VB'), ('this', 'DT'), ('economy', 'NN'), ('and', 'CC'), ('add', 'VB'), ('new', 'J
J'), ('jobs', 'NNS'), ('--', ':'), ('but', 'CC'), ('they', 'PRP'), ('are', 'VBP'), ('just', 'RB'),
('the', 'DT'), ('beginning', 'NN'), ('of', 'IN'), ('our', 'PRP$'), ('duty', 'NN'), ('.', '.')]
[('To', 'TO'), ('build', 'VB'), ('the', 'DT'), ('prosperity', 'NN'), ('of', 'IN'), ('future', 'JJ'),
('generations', 'NNS'), (',', ','), ('we', 'PRP'), ('must', 'MD'), ('update', 'VB'), ('institution
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 7/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
( g , ), ( , , , ), ( , ), ( , ), ( p , ), (
s', 'NNS'), ('that', 'WDT'), ('were', 'VBD'), ('created', 'VBN'), ('to', 'TO'), ('meet', 'VB'), ('th
e', 'DT'), ('needs', 'NNS'), ('of', 'IN'), ('an', 'DT'), ('earlier', 'JJR'), ('time', 'NN'), ('.',
'.')]
[('Year', 'NN'), ('after', 'IN'), ('year', 'NN'), (',', ','), ('Americans', 'NNPS'), ('are', 'VBP'),
('burdened', 'VBN'), ('by', 'IN'), ('an', 'DT'), ('archaic', 'NN'), (',', ','), ('incoherent', 'J
J'), ('federal', 'JJ'), ('tax', 'NN'), ('code', 'NN'), ('.', '.')]
[('I', 'PRP'), ("'ve", 'VBP'), ('appointed', 'VBN'), ('a', 'DT'), ('bipartisan', 'JJ'), ('panel', 'N
N'), ('to', 'TO'), ('examine', 'VB'), ('the', 'DT'), ('tax', 'NN'), ('code', 'NN'), ('from', 'IN'),
('top', 'JJ'), ('to', 'TO'), ('bottom', 'VB'), ('.', '.')]
[('And', 'CC'), ('when', 'WRB'), ('their', 'PRP$'), ('recommendations', 'NNS'), ('are', 'VBP'), ('de
livered', 'VBN'), (',', ','), ('you', 'PRP'), ('and', 'CC'), ('I', 'PRP'), ('will', 'MD'), ('work',
'VB'), ('together', 'RB'), ('to', 'TO'), ('give', 'VB'), ('this', 'DT'), ('nation', 'NN'), ('a', 'D
T'), ('tax', 'NN'), ('code', 'NN'), ('that', 'WDT'), ('is', 'VBZ'), ('pro-growth', 'JJ'), (',',
','), ('easy', 'JJ'), ('to', 'TO'), ('understand', 'VB'), (',', ','), ('and', 'CC'), ('fair', 'JJ'),
('to', 'TO'), ('all', 'DT'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('America', 'NNP'), ("'s", 'POS'), ('immigration', 'NN'), ('system', 'NN'), ('is', 'VBZ'), ('also',
'RB'), ('outdated', 'VBN'), ('--', ':'), ('unsuited', 'JJ'), ('to', 'TO'), ('the', 'DT'), ('needs',
'NNS'), ('of', 'IN'), ('our', 'PRP$'), ('economy', 'NN'), ('and', 'CC'), ('to', 'TO'), ('the', 'D
T'), ('values', 'NNS'), ('of', 'IN'), ('our', 'PRP$'), ('country', 'NN'), ('.', '.')]
[('We', 'PRP'), ('should', 'MD'), ('not', 'RB'), ('be', 'VB'), ('content', 'JJ'), ('with', 'IN'),
('laws', 'NNS'), ('that', 'WDT'), ('punish', 'VBP'), ('hardworking', 'VBG'), ('people', 'NNS'), ('wh
o', 'WP'), ('want', 'VBP'), ('only', 'RB'), ('to', 'TO'), ('provide', 'VB'), ('for', 'IN'), ('thei
r', 'PRP$'), ('families', 'NNS'), (',', ','), ('and', 'CC'), ('deny', 'JJ'), ('businesses', 'NNS'),
('willing', 'JJ'), ('workers', 'NNS'), (',', ','), ('and', 'CC'), ('invite', 'JJ'), ('chaos', 'NN'),
('at', 'IN'), ('our', 'PRP$'), ('border', 'NN'), ('.', '.')]
[('It', 'PRP'), ('is', 'VBZ'), ('time', 'NN'), ('for', 'IN'), ('an', 'DT'), ('immigration', 'NN'),
('policy', 'NN'), ('that', 'IN'), ('permits', 'VBZ'), ('temporary', 'JJ'), ('guest', 'NN'), ('worker
s', 'NNS'), ('to', 'TO'), ('fill', 'VB'), ('jobs', 'NNS'), ('Americans', 'NNPS'), ('will', 'MD'),
('not', 'RB'), ('take', 'VB'), (',', ','), ('that', 'DT'), ('rejects', 'VBZ'), ('amnesty', 'JJ'),
(',', ','), ('that', 'WDT'), ('tells', 'VBZ'), ('us', 'PRP'), ('who', 'WP'), ('is', 'VBZ'), ('enteri
ng', 'VBG'), ('and', 'CC'), ('leaving', 'VBG'), ('our', 'PRP$'), ('country', 'NN'), (',', ','), ('an
d', 'CC'), ('that', 'IN'), ('closes', 'VBZ'), ('the', 'DT'), ('border', 'NN'), ('to', 'TO'), ('dru
g', 'NN'), ('dealers', 'NNS'), ('and', 'CC'), ('terrorists', 'NNS'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('One', 'CD'), ('of', 'IN'), ('America', 'NNP'), ("'s", 'POS'), ('most', 'RBS'), ('important', 'J
J'), ('institutions', 'NNS'), ('--', ':'), ('a', 'DT'), ('symbol', 'NN'), ('of', 'IN'), ('the', 'D
T'), ('trust', 'NN'), ('between', 'IN'), ('generations', 'NNS'), ('--', ':'), ('is', 'VBZ'), ('als
o', 'RB'), ('in', 'IN'), ('need', 'NN'), ('of', 'IN'), ('wise', 'NN'), ('and', 'CC'), ('effective',
'JJ'), ('reform', 'NN'), ('.', '.')]
[('Social', 'NNP'), ('Security', 'NNP'), ('was', 'VBD'), ('a', 'DT'), ('great', 'JJ'), ('moral', 'J
J'), ('success', 'NN'), ('of', 'IN'), ('the', 'DT'), ('20th', 'JJ'), ('century', 'NN'), (',', ','),
('and', 'CC'), ('we', 'PRP'), ('must', 'MD'), ('honor', 'VB'), ('its', 'PRP$'), ('great', 'JJ'), ('p
urposes', 'NNS'), ('in', 'IN'), ('this', 'DT'), ('new', 'JJ'), ('century', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('The', 'DT'), ('system', 'NN'), (',', ','), ('however', 'RB'), (',', ','), ('on', 'IN'), ('its',
'PRP$'), ('current', 'JJ'), ('path', 'NN'), (',', ','), ('is', 'VBZ'), ('headed', 'VBN'), ('toward',
'IN'), ('bankruptcy', 'NN'), ('.', '.')]
[('And', 'CC'), ('so', 'IN'), ('we', 'PRP'), ('must', 'MD'), ('join', 'VB'), ('together', 'RB'), ('t
o', 'TO'), ('strengthen', 'VB'), ('and', 'CC'), ('save', 'VB'), ('Social', 'NNP'), ('Security', 'NN
P'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Today', 'NN'), (',', ','), ('more', 'JJR'), ('than', 'IN'), ('45', 'CD'), ('million', 'CD'), ('Am
ericans', 'NNPS'), ('receive', 'VBP'), ('Social', 'NNP'), ('Security', 'NNP'), ('benefits', 'NNS'),
(',', ','), ('and', 'CC'), ('millions', 'NNS'), ('more', 'JJR'), ('are', 'VBP'), ('nearing', 'JJ'),
('retirement', 'NN'), ('--', ':'), ('and', 'CC'), ('for', 'IN'), ('them', 'PRP'), ('the', 'DT'), ('s
ystem', 'NN'), ('is', 'VBZ'), ('sound', 'JJ'), ('and', 'CC'), ('fiscally', 'RB'), ('strong', 'JJ'),
('.', '.')]
[('I', 'PRP'), ('have', 'VBP'), ('a', 'DT'), ('message', 'NN'), ('for', 'IN'), ('every', 'DT'), ('Am
erican', 'NNP'), ('who', 'WP'), ('is', 'VBZ'), ('55', 'CD'), ('or', 'CC'), ('older', 'JJR'), (':',
':'), ('Do', 'VB'), ('not', 'RB'), ('let', 'VB'), ('anyone', 'NN'), ('mislead', 'VB'), ('you', 'PR
P'), (';', ':'), ('for', 'IN'), ('you', 'PRP'), (',', ','), ('the', 'DT'), ('Social', 'NNP'), ('Secu
rity', 'NNP'), ('system', 'NN'), ('will', 'MD'), ('not', 'RB'), ('change', 'VB'), ('in', 'IN'), ('an
y', 'DT'), ('way', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('For', 'IN'), ('younger', 'JJR'), ('workers', 'NNS'), (',', ','), ('the', 'DT'), ('Social', 'NN
P'), ('Security', 'NNP'), ('system', 'NN'), ('has', 'VBZ'), ('serious', 'JJ'), ('problems', 'NNS'),
('that', 'WDT'), ('will', 'MD'), ('grow', 'VB'), ('worse', 'JJR'), ('with', 'IN'), ('time', 'NN'),
('.', '.')]
[('Social', 'NNP'), ('Security', 'NNP'), ('was', 'VBD'), ('created', 'VBN'), ('decades', 'NNS'), ('a
go', 'RB'), (',', ','), ('for', 'IN'), ('a', 'DT'), ('very', 'RB'), ('different', 'JJ'), ('era', 'N
N'), ('.', '.')]
[('In', 'IN'), ('those', 'DT'), ('days', 'NNS'), (',', ','), ('people', 'NNS'), ('did', 'VBD'), ('no
t', 'RB'), ('live', 'VB'), ('as', 'IN'), ('long', 'RB'), ('.', '.')]
[('Benefits', 'NNS'), ('were', 'VBD'), ('much', 'RB'), ('lower', 'JJR'), ('than', 'IN'), ('they', 'P
RP'), ('are', 'VBP'), ('today', 'NN'), ('.', '.')]
[('And', 'CC'), ('a', 'DT'), ('half-century', 'NN'), ('ago', 'RB'), (',', ','), ('about', 'IN'), ('s
ixteen', 'JJ'), ('workers', 'NNS'), ('paid', 'VBN'), ('into', 'IN'), ('the', 'DT'), ('system', 'N
N'), ('for', 'IN'), ('each', 'DT'), ('person', 'NN'), ('drawing', 'VBG'), ('benefits', 'NNS'), ('.',
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 8/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
N ), ( for , IN ), ( each , DT ), ( person , NN ), ( drawing , VBG ), ( benefits , NNS ), ( . ,
'.')]
[('Our', 'PRP$'), ('society', 'NN'), ('has', 'VBZ'), ('changed', 'VBN'), ('in', 'IN'), ('ways', 'NN
S'), ('the', 'DT'), ('founders', 'NNS'), ('of', 'IN'), ('Social', 'NNP'), ('Security', 'NNP'), ('cou
ld', 'MD'), ('not', 'RB'), ('have', 'VB'), ('foreseen', 'NN'), ('.', '.')]
[('In', 'IN'), ('today', 'NN'), ("'s", 'POS'), ('world', 'NN'), (',', ','), ('people', 'NNS'), ('ar
e', 'VBP'), ('living', 'VBG'), ('longer', 'RBR'), ('and', 'CC'), (',', ','), ('therefore', 'RB'),
(',', ','), ('drawing', 'VBG'), ('benefits', 'NNS'), ('longer', 'RBR'), ('.', '.')]
[('And', 'CC'), ('those', 'DT'), ('benefits', 'NNS'), ('are', 'VBP'), ('scheduled', 'VBN'), ('to',
'TO'), ('rise', 'VB'), ('dramatically', 'RB'), ('over', 'IN'), ('the', 'DT'), ('next', 'JJ'), ('fe
w', 'JJ'), ('decades', 'NNS'), ('.', '.')]
[('And', 'CC'), ('instead', 'RB'), ('of', 'IN'), ('sixteen', 'JJ'), ('workers', 'NNS'), ('paying',
'VBG'), ('in', 'IN'), ('for', 'IN'), ('every', 'DT'), ('beneficiary', 'NN'), (',', ','), ('right',
'RB'), ('now', 'RB'), ('it', 'PRP'), ("'s", 'VBZ'), ('only', 'RB'), ('about', 'RB'), ('three', 'C
D'), ('workers', 'NNS'), ('.', '.')]
[('And', 'CC'), ('over', 'IN'), ('the', 'DT'), ('next', 'JJ'), ('few', 'JJ'), ('decades', 'NNS'),
('that', 'IN'), ('number', 'NN'), ('will', 'MD'), ('fall', 'VB'), ('to', 'TO'), ('just', 'RB'), ('tw
o', 'CD'), ('workers', 'NNS'), ('per', 'IN'), ('beneficiary', 'NN'), ('.', '.')]
[('With', 'IN'), ('each', 'DT'), ('passing', 'VBG'), ('year', 'NN'), (',', ','), ('fewer', 'JJR'),
('workers', 'NNS'), ('are', 'VBP'), ('paying', 'VBG'), ('ever-higher', 'JJ'), ('benefits', 'NNS'),
('to', 'TO'), ('an', 'DT'), ('ever-larger', 'JJ'), ('number', 'NN'), ('of', 'IN'), ('retirees', 'NN
S'), ('.', '.')]
[('So', 'RB'), ('here', 'RB'), ('is', 'VBZ'), ('the', 'DT'), ('result', 'NN'), (':', ':'), ('Thirtee
n', 'CD'), ('years', 'NNS'), ('from', 'IN'), ('now', 'RB'), (',', ','), ('in', 'IN'), ('2018', 'C
D'), (',', ','), ('Social', 'NNP'), ('Security', 'NNP'), ('will', 'MD'), ('be', 'VB'), ('paying', 'V
BG'), ('out', 'IN'), ('more', 'JJR'), ('than', 'IN'), ('it', 'PRP'), ('takes', 'VBZ'), ('in', 'IN'),
('.', '.')]
[('And', 'CC'), ('every', 'DT'), ('year', 'NN'), ('afterward', 'RB'), ('will', 'MD'), ('bring', 'V
B'), ('a', 'DT'), ('new', 'JJ'), ('shortfall', 'NN'), (',', ','), ('bigger', 'JJR'), ('than', 'IN'),
('the', 'DT'), ('year', 'NN'), ('before', 'RB'), ('.', '.')]
[('For', 'IN'), ('example', 'NN'), (',', ','), ('in', 'IN'), ('the', 'DT'), ('year', 'NN'), ('2027',
'CD'), (',', ','), ('the', 'DT'), ('government', 'NN'), ('will', 'MD'), ('somehow', 'RB'), ('have',
'VB'), ('to', 'TO'), ('come', 'VB'), ('up', 'RP'), ('with', 'IN'), ('an', 'DT'), ('extra', 'JJ'),
('$', '$'), ('200', 'CD'), ('billion', 'CD'), ('to', 'TO'), ('keep', 'VB'), ('the', 'DT'), ('syste
m', 'NN'), ('afloat', 'NN'), ('--', ':'), ('and', 'CC'), ('by', 'IN'), ('2033', 'CD'), (',', ','),
('the', 'DT'), ('annual', 'JJ'), ('shortfall', 'NN'), ('would', 'MD'), ('be', 'VB'), ('more', 'JJ
R'), ('than', 'IN'), ('$', '$'), ('300', 'CD'), ('billion', 'CD'), ('.', '.')]
[('By', 'IN'), ('the', 'DT'), ('year', 'NN'), ('2042', 'CD'), (',', ','), ('the', 'DT'), ('entire',
'JJ'), ('system', 'NN'), ('would', 'MD'), ('be', 'VB'), ('exhausted', 'VBN'), ('and', 'CC'), ('bankr
upt', 'JJ'), ('.', '.')]
[('If', 'IN'), ('steps', 'NNS'), ('are', 'VBP'), ('not', 'RB'), ('taken', 'VBN'), ('to', 'TO'), ('av
ert', 'VB'), ('that', 'DT'), ('outcome', 'NN'), (',', ','), ('the', 'DT'), ('only', 'JJ'), ('solutio
ns', 'NNS'), ('would', 'MD'), ('be', 'VB'), ('dramatically', 'RB'), ('higher', 'JJR'), ('taxes', 'NN
S'), (',', ','), ('massive', 'JJ'), ('new', 'JJ'), ('borrowing', 'NN'), (',', ','), ('or', 'CC'),
('sudden', 'JJ'), ('and', 'CC'), ('severe', 'JJ'), ('cuts', 'NNS'), ('in', 'IN'), ('Social', 'NNP'),
('Security', 'NNP'), ('benefits', 'NNS'), ('or', 'CC'), ('other', 'JJ'), ('government', 'NN'), ('pro
grams', 'NNS'), ('.', '.')]
[('I', 'PRP'), ('recognize', 'VBP'), ('that', 'IN'), ('2018', 'CD'), ('and', 'CC'), ('2042', 'CD'),
('may', 'MD'), ('seem', 'VB'), ('a', 'DT'), ('long', 'JJ'), ('way', 'NN'), ('off', 'IN'), ('.',
'.')]
[('But', 'CC'), ('those', 'DT'), ('dates', 'NNS'), ('are', 'VBP'), ('not', 'RB'), ('so', 'RB'), ('di
stant', 'JJ'), (',', ','), ('as', 'IN'), ('any', 'DT'), ('parent', 'NN'), ('will', 'MD'), ('tell',
'VB'), ('you', 'PRP'), ('.', '.')]
[('If', 'IN'), ('you', 'PRP'), ('have', 'VBP'), ('a', 'DT'), ('five-year-old', 'JJ'), (',', ','),
('you', 'PRP'), ("'re", 'VBP'), ('already', 'RB'), ('concerned', 'VBN'), ('about', 'IN'), ('how', 'W
RB'), ('you', 'PRP'), ("'ll", 'MD'), ('pay', 'VB'), ('for', 'IN'), ('college', 'NN'), ('tuition', 'N
N'), ('13', 'CD'), ('years', 'NNS'), ('down', 'IN'), ('the', 'DT'), ('road', 'NN'), ('.', '.')]
[('If', 'IN'), ('you', 'PRP'), ("'ve", 'VBP'), ('got', 'VBN'), ('children', 'NNS'), ('in', 'IN'),
('their', 'PRP$'), ('20s', 'CD'), (',', ','), ('as', 'IN'), ('some', 'DT'), ('of', 'IN'), ('us', 'PR
P'), ('do', 'VBP'), (',', ','), ('the', 'DT'), ('idea', 'NN'), ('of', 'IN'), ('Social', 'NNP'), ('Se
curity', 'NNP'), ('collapsing', 'VBG'), ('before', 'IN'), ('they', 'PRP'), ('retire', 'VBP'), ('doe
s', 'VBZ'), ('not', 'RB'), ('seem', 'VB'), ('like', 'IN'), ('a', 'DT'), ('small', 'JJ'), ('matter',
'NN'), ('.', '.')]
[('And', 'CC'), ('it', 'PRP'), ('should', 'MD'), ('not', 'RB'), ('be', 'VB'), ('a', 'DT'), ('small',
'JJ'), ('matter', 'NN'), ('to', 'TO'), ('the', 'DT'), ('United', 'NNP'), ('States', 'NNPS'), ('Congr
ess', 'NNP'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('You', 'PRP'), ('and', 'CC'), ('I', 'PRP'), ('share', 'NN'), ('a', 'DT'), ('responsibility', 'N
N'), ('.', '.')]
[('We', 'PRP'), ('must', 'MD'), ('pass', 'VB'), ('reforms', 'NNS'), ('that', 'WDT'), ('solve', 'VB
P'), ('the', 'DT'), ('financial', 'JJ'), ('problems', 'NNS'), ('of', 'IN'), ('Social', 'NNP'), ('Sec
urity', 'NNP'), ('once', 'RB'), ('and', 'CC'), ('for', 'IN'), ('all', 'DT'), ('.', '.')]
[('Fixing', 'VBG'), ('Social', 'NNP'), ('Security', 'NNP'), ('permanently', 'RB'), ('will', 'MD'),
('require', 'VB'), ('an', 'DT'), ('open', 'JJ'), (',', ','), ('candid', 'JJ'), ('review', 'NN'), ('o
f', 'IN'), ('the', 'DT'), ('options', 'NNS'), ('.', '.')]
[('Some', 'DT'), ('have', 'VBP'), ('suggested', 'VBN'), ('limiting', 'JJ'), ('benefits', 'NNS'), ('f
or', 'IN'), ('wealthy', 'JJ'), ('retirees', 'NNS'), ('.', '.')]
[('Former', 'NNP'), ('Congressman', 'NNP'), ('Tim', 'NNP'), ('Penny', 'NNP'), ('has', 'VBZ'), ('rais
ed', 'VBN'), ('the', 'DT'), ('possibility', 'NN'), ('of', 'IN'), ('indexing', 'VBG'), ('benefits',
'NNS') ('to' 'TO') ('prices' 'NNS') ('rather' 'RB') ('than' 'IN') ('wages' 'NNS') (' '
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 9/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
NNS ), ( to , TO ), ( prices , NNS ), ( rather , RB ), ( than , IN ), ( wages , NNS ), ( . ,
'.')]
[('During', 'IN'), ('the', 'DT'), ('1990s', 'CD'), (',', ','), ('my', 'PRP$'), ('predecessor', 'N
N'), (',', ','), ('President', 'NNP'), ('Clinton', 'NNP'), (',', ','), ('spoke', 'NN'), ('of', 'I
N'), ('increasing', 'VBG'), ('the', 'DT'), ('retirement', 'NN'), ('age', 'NN'), ('.', '.')]
[('Former', 'NNP'), ('Senator', 'NNP'), ('John', 'NNP'), ('Breaux', 'NNP'), ('suggested', 'VBD'),
('discouraging', 'VBG'), ('early', 'JJ'), ('collection', 'NN'), ('of', 'IN'), ('Social', 'NNP'), ('S
ecurity', 'NNP'), ('benefits', 'NNS'), ('.', '.')]
[('The', 'DT'), ('late', 'JJ'), ('Senator', 'NNP'), ('Daniel', 'NNP'), ('Patrick', 'NNP'), ('Moyniha
n', 'NNP'), ('recommended', 'VBD'), ('changing', 'VBG'), ('the', 'DT'), ('way', 'NN'), ('benefits',
'NNS'), ('are', 'VBP'), ('calculated', 'VBN'), ('.', '.')]
[('All', 'PDT'), ('these', 'DT'), ('ideas', 'NNS'), ('are', 'VBP'), ('on', 'IN'), ('the', 'DT'), ('t
able', 'NN'), ('.', '.')]
[('I', 'PRP'), ('know', 'VBP'), ('that', 'IN'), ('none', 'NN'), ('of', 'IN'), ('these', 'DT'), ('ref
orms', 'NNS'), ('would', 'MD'), ('be', 'VB'), ('easy', 'JJ'), ('.', '.')]
[('But', 'CC'), ('we', 'PRP'), ('have', 'VBP'), ('to', 'TO'), ('move', 'VB'), ('ahead', 'RB'), ('wit
h', 'IN'), ('courage', 'NN'), ('and', 'CC'), ('honesty', 'NN'), (',', ','), ('because', 'IN'), ('ou
r', 'PRP$'), ('children', 'NNS'), ("'s", 'POS'), ('retirement', 'NN'), ('security', 'NN'), ('is', 'V
BZ'), ('more', 'RBR'), ('important', 'JJ'), ('than', 'IN'), ('partisan', 'JJ'), ('politics', 'NNS'),
('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('I', 'PRP'), ('will', 'MD'), ('work', 'VB'), ('with', 'IN'), ('members', 'NNS'), ('of', 'IN'), ('C
ongress', 'NNP'), ('to', 'TO'), ('find', 'VB'), ('the', 'DT'), ('most', 'RBS'), ('effective', 'JJ'),
('combination', 'NN'), ('of', 'IN'), ('reforms', 'NNS'), ('.', '.')]
[('I', 'PRP'), ('will', 'MD'), ('listen', 'VB'), ('to', 'TO'), ('anyone', 'NN'), ('who', 'WP'), ('ha
s', 'VBZ'), ('a', 'DT'), ('good', 'JJ'), ('idea', 'NN'), ('to', 'TO'), ('offer', 'VB'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('We', 'PRP'), ('must', 'MD'), (',', ','), ('however', 'RB'), (',', ','), ('be', 'VB'), ('guided',
'VBN'), ('by', 'IN'), ('some', 'DT'), ('basic', 'JJ'), ('principles', 'NNS'), ('.', '.')]
[('We', 'PRP'), ('must', 'MD'), ('make', 'VB'), ('Social', 'NNP'), ('Security', 'NNP'), ('permanentl
y', 'RB'), ('sound', 'VBD'), (',', ','), ('not', 'RB'), ('leave', 'VB'), ('that', 'DT'), ('task', 'N
N'), ('for', 'IN'), ('another', 'DT'), ('day', 'NN'), ('.', '.')]
[('We', 'PRP'), ('must', 'MD'), ('not', 'RB'), ('jeopardize', 'VB'), ('our', 'PRP$'), ('economic',
'JJ'), ('strength', 'NN'), ('by', 'IN'), ('increasing', 'VBG'), ('payroll', 'NN'), ('taxes', 'NNS'),
('.', '.')]
[('We', 'PRP'), ('must', 'MD'), ('ensure', 'VB'), ('that', 'IN'), ('lower-income', 'JJ'), ('American
s', 'NNPS'), ('get', 'VBP'), ('the', 'DT'), ('help', 'NN'), ('they', 'PRP'), ('need', 'VBP'), ('to',
'TO'), ('have', 'VB'), ('dignity', 'NN'), ('and', 'CC'), ('peace', 'NN'), ('of', 'IN'), ('mind', 'N
N'), ('in', 'IN'), ('their', 'PRP$'), ('retirement', 'NN'), ('.', '.')]
[('We', 'PRP'), ('must', 'MD'), ('guarantee', 'VB'), ('there', 'EX'), ('is', 'VBZ'), ('no', 'DT'),
('change', 'NN'), ('for', 'IN'), ('those', 'DT'), ('now', 'RB'), ('retired', 'JJ'), ('or', 'CC'),
('nearing', 'JJ'), ('retirement', 'NN'), ('.', '.')]
[('And', 'CC'), ('we', 'PRP'), ('must', 'MD'), ('take', 'VB'), ('care', 'NN'), ('that', 'IN'), ('an
y', 'DT'), ('changes', 'NNS'), ('in', 'IN'), ('the', 'DT'), ('system', 'NN'), ('are', 'VBP'), ('grad
ual', 'JJ'), (',', ','), ('so', 'RB'), ('younger', 'JJR'), ('workers', 'NNS'), ('have', 'VBP'), ('ye
ars', 'NNS'), ('to', 'TO'), ('prepare', 'VB'), ('and', 'CC'), ('plan', 'VB'), ('for', 'IN'), ('thei
r', 'PRP$'), ('future', 'NN'), ('.', '.')]
[('As', 'IN'), ('we', 'PRP'), ('fix', 'VBP'), ('Social', 'JJ'), ('Security', 'NNP'), (',', ','), ('w
e', 'PRP'), ('also', 'RB'), ('have', 'VBP'), ('the', 'DT'), ('responsibility', 'NN'), ('to', 'TO'),
('make', 'VB'), ('the', 'DT'), ('system', 'NN'), ('a', 'DT'), ('better', 'JJR'), ('deal', 'NN'), ('f
or', 'IN'), ('younger', 'JJR'), ('workers', 'NNS'), ('.', '.')]
[('And', 'CC'), ('the', 'DT'), ('best', 'JJS'), ('way', 'NN'), ('to', 'TO'), ('reach', 'VB'), ('tha
t', 'DT'), ('goal', 'NN'), ('is', 'VBZ'), ('through', 'IN'), ('voluntary', 'JJ'), ('personal', 'J
J'), ('retirement', 'NN'), ('accounts', 'NNS'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Here', 'RB'), ('is', 'VBZ'), ('how', 'WRB'), ('the', 'DT'), ('idea', 'NN'), ('works', 'VBZ'),
('.', '.')]
[('Right', 'RB'), ('now', 'RB'), (',', ','), ('a', 'DT'), ('set', 'NN'), ('portion', 'NN'), ('of',
'IN'), ('the', 'DT'), ('money', 'NN'), ('you', 'PRP'), ('earn', 'VBP'), ('is', 'VBZ'), ('taken', 'VB
N'), ('out', 'IN'), ('of', 'IN'), ('your', 'PRP$'), ('paycheck', 'NN'), ('to', 'TO'), ('pay', 'VB'),
('for', 'IN'), ('the', 'DT'), ('Social', 'NNP'), ('Security', 'NNP'), ('benefits', 'NNS'), ('of', 'I
N'), ('today', 'NN'), ("'s", 'POS'), ('retirees', 'NNS'), ('.', '.')]
[('If', 'IN'), ('you', 'PRP'), ("'re", 'VBP'), ('a', 'DT'), ('younger', 'JJR'), ('worker', 'NN'),
(',', ','), ('I', 'PRP'), ('believe', 'VBP'), ('you', 'PRP'), ('should', 'MD'), ('be', 'VB'), ('abl
e', 'JJ'), ('to', 'TO'), ('set', 'VB'), ('aside', 'RP'), ('part', 'NN'), ('of', 'IN'), ('that', 'D
T'), ('money', 'NN'), ('in', 'IN'), ('your', 'PRP$'), ('own', 'JJ'), ('retirement', 'NN'), ('accoun
t', 'NN'), (',', ','), ('so', 'IN'), ('you', 'PRP'), ('can', 'MD'), ('build', 'VB'), ('a', 'DT'),
('nest', 'JJS'), ('egg', 'NN'), ('for', 'IN'), ('your', 'PRP$'), ('own', 'JJ'), ('future', 'NN'),
('.', '.')]
[('Here', 'RB'), ("'s", 'VBZ'), ('why', 'WRB'), ('the', 'DT'), ('personal', 'JJ'), ('accounts', 'NN
S'), ('are', 'VBP'), ('a', 'DT'), ('better', 'JJR'), ('deal', 'NN'), ('.', '.')]
[('Your', 'PRP$'), ('money', 'NN'), ('will', 'MD'), ('grow', 'VB'), (',', ','), ('over', 'IN'), ('ti
me', 'NN'), (',', ','), ('at', 'IN'), ('a', 'DT'), ('greater', 'JJR'), ('rate', 'NN'), ('than', 'I
N'), ('anything', 'NN'), ('the', 'DT'), ('current', 'JJ'), ('system', 'NN'), ('can', 'MD'), ('delive
r', 'VB'), ('--', ':'), ('and', 'CC'), ('your', 'PRP$'), ('account', 'NN'), ('will', 'MD'), ('provid
e', 'VB'), ('money', 'NN'), ('for', 'IN'), ('retirement', 'NN'), ('over', 'IN'), ('and', 'CC'), ('ab
ove', 'IN'), ('the', 'DT'), ('check', 'NN'), ('you', 'PRP'), ('will', 'MD'), ('receive', 'VB'), ('fr
om', 'IN'), ('Social', 'NNP'), ('Security', 'NNP'), ('.', '.')]
[('In', 'IN'), ('addition', 'NN'), (',', ','), ('you', 'PRP'), ("'ll", 'MD'), ('be', 'VB'), ('able',
'JJ') ('t ' 'TO') (' ' 'VB') (' l ' 'IN') ('th ' 'DT') (' ' 'NN') ('th t' 'WD
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 10/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
'JJ'), ('to', 'TO'), ('pass', 'VB'), ('along', 'IN'), ('the', 'DT'), ('money', 'NN'), ('that', 'WD
T'), ('accumulates', 'VBZ'), ('in', 'IN'), ('your', 'PRP$'), ('personal', 'JJ'), ('account', 'NN'),
(',', ','), ('if', 'IN'), ('you', 'PRP'), ('wish', 'VBP'), (',', ','), ('to', 'TO'), ('your', 'PRP
$'), ('children', 'NNS'), ('and', 'CC'), ('--', ':'), ('or', 'CC'), ('grandchildren', 'NNS'), ('.',
'.')]
[('And', 'CC'), ('best', 'JJS'), ('of', 'IN'), ('all', 'DT'), (',', ','), ('the', 'DT'), ('money',
'NN'), ('in', 'IN'), ('the', 'DT'), ('account', 'NN'), ('is', 'VBZ'), ('yours', 'RB'), (',', ','),
('and', 'CC'), ('the', 'DT'), ('government', 'NN'), ('can', 'MD'), ('never', 'RB'), ('take', 'VB'),
('it', 'PRP'), ('away', 'RB'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('The', 'DT'), ('goal', 'NN'), ('here', 'RB'), ('is', 'VBZ'), ('greater', 'JJR'), ('security', 'N
N'), ('in', 'IN'), ('retirement', 'NN'), (',', ','), ('so', 'IN'), ('we', 'PRP'), ('will', 'MD'),
('set', 'VB'), ('careful', 'JJ'), ('guidelines', 'NNS'), ('for', 'IN'), ('personal', 'JJ'), ('accoun
ts', 'NNS'), ('.', '.')]
[('We', 'PRP'), ("'ll", 'MD'), ('make', 'VB'), ('sure', 'JJ'), ('the', 'DT'), ('money', 'NN'), ('ca
n', 'MD'), ('only', 'RB'), ('go', 'VB'), ('into', 'IN'), ('a', 'DT'), ('conservative', 'JJ'), ('mi
x', 'NN'), ('of', 'IN'), ('bonds', 'NNS'), ('and', 'CC'), ('stock', 'NN'), ('funds', 'NNS'), ('.',
'.')]
[('We', 'PRP'), ("'ll", 'MD'), ('make', 'VB'), ('sure', 'JJ'), ('that', 'IN'), ('your', 'PRP$'), ('e
arnings', 'NNS'), ('are', 'VBP'), ('not', 'RB'), ('eaten', 'VBN'), ('up', 'RP'), ('by', 'IN'), ('hid
den', 'NN'), ('Wall', 'NNP'), ('Street', 'NNP'), ('fees', 'NNS'), ('.', '.')]
[('We', 'PRP'), ("'ll", 'MD'), ('make', 'VB'), ('sure', 'JJ'), ('there', 'EX'), ('are', 'VBP'), ('go
od', 'JJ'), ('options', 'NNS'), ('to', 'TO'), ('protect', 'VB'), ('your', 'PRP$'), ('investments',
'NNS'), ('from', 'IN'), ('sudden', 'JJ'), ('market', 'NN'), ('swings', 'NNS'), ('on', 'IN'), ('the',
'DT'), ('eve', 'NN'), ('of', 'IN'), ('your', 'PRP$'), ('retirement', 'NN'), ('.', '.')]
[('We', 'PRP'), ("'ll", 'MD'), ('make', 'VB'), ('sure', 'JJ'), ('a', 'DT'), ('personal', 'JJ'), ('ac
count', 'NN'), ('can', 'MD'), ('not', 'RB'), ('be', 'VB'), ('emptied', 'VBN'), ('out', 'IN'), ('al
l', 'DT'), ('at', 'IN'), ('once', 'RB'), (',', ','), ('but', 'CC'), ('rather', 'RB'), ('paid', 'VB
D'), ('out', 'RP'), ('over', 'IN'), ('time', 'NN'), (',', ','), ('as', 'IN'), ('an', 'DT'), ('additi
on', 'NN'), ('to', 'TO'), ('traditional', 'JJ'), ('Social', 'NNP'), ('Security', 'NNP'), ('benefit
s', 'NNS'), ('.', '.')]
[('And', 'CC'), ('we', 'PRP'), ("'ll", 'MD'), ('make', 'VB'), ('sure', 'JJ'), ('this', 'DT'), ('pla
n', 'NN'), ('is', 'VBZ'), ('fiscally', 'RB'), ('responsible', 'JJ'), (',', ','), ('by', 'IN'), ('sta
rting', 'VBG'), ('personal', 'JJ'), ('retirement', 'NN'), ('accounts', 'NNS'), ('gradually', 'RB'),
(',', ','), ('and', 'CC'), ('raising', 'VBG'), ('the', 'DT'), ('yearly', 'JJ'), ('limits', 'NNS'),
('on', 'IN'), ('contributions', 'NNS'), ('over', 'IN'), ('time', 'NN'), (',', ','), ('eventually',
'RB'), ('permitting', 'VBG'), ('all', 'DT'), ('workers', 'NNS'), ('to', 'TO'), ('set', 'VB'), ('asid
e', 'RB'), ('four', 'CD'), ('percentage', 'NN'), ('points', 'NNS'), ('of', 'IN'), ('their', 'PRP$'),
('payroll', 'NN'), ('taxes', 'NNS'), ('in', 'IN'), ('their', 'PRP$'), ('accounts', 'NNS'), ('.',
'.')]
[('Personal', 'JJ'), ('retirement', 'NN'), ('accounts', 'NNS'), ('should', 'MD'), ('be', 'VB'), ('fa
miliar', 'JJ'), ('to', 'TO'), ('federal', 'JJ'), ('employees', 'NNS'), (',', ','), ('because', 'I
N'), ('you', 'PRP'), ('already', 'RB'), ('have', 'VBP'), ('something', 'NN'), ('similar', 'JJ'),
(',', ','), ('called', 'VBD'), ('the', 'DT'), ('Thrift', 'NNP'), ('Savings', 'NNPS'), ('Plan', 'NN
P'), (',', ','), ('which', 'WDT'), ('lets', 'VBZ'), ('workers', 'NNS'), ('deposit', 'VB'), ('a', 'D
T'), ('portion', 'NN'), ('of', 'IN'), ('their', 'PRP$'), ('paychecks', 'NNS'), ('into', 'IN'), ('an
y', 'DT'), ('of', 'IN'), ('five', 'CD'), ('different', 'JJ'), ('broadly-based', 'JJ'), ('investmen
t', 'NN'), ('funds', 'NNS'), ('.', '.')]
[('It', 'PRP'), ("'s", 'VBZ'), ('time', 'NN'), ('to', 'TO'), ('extend', 'VB'), ('the', 'DT'), ('sam
e', 'JJ'), ('security', 'NN'), (',', ','), ('and', 'CC'), ('choice', 'NN'), (',', ','), ('and', 'C
C'), ('ownership', 'NN'), ('to', 'TO'), ('young', 'JJ'), ('Americans', 'NNPS'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Our', 'PRP$'), ('second', 'JJ'), ('great', 'JJ'), ('responsibility', 'NN'), ('to', 'TO'), ('our',
'PRP$'), ('children', 'NNS'), ('and', 'CC'), ('grandchildren', 'NN'), ('is', 'VBZ'), ('to', 'TO'),
('honor', 'VB'), ('and', 'CC'), ('to', 'TO'), ('pass', 'VB'), ('along', 'IN'), ('the', 'DT'), ('valu
es', 'NNS'), ('that', 'WDT'), ('sustain', 'VBP'), ('a', 'DT'), ('free', 'JJ'), ('society', 'NN'),
('.', '.')]
[('So', 'RB'), ('many', 'JJ'), ('of', 'IN'), ('my', 'PRP$'), ('generation', 'NN'), (',', ','), ('aft
er', 'IN'), ('a', 'DT'), ('long', 'JJ'), ('journey', 'NN'), (',', ','), ('have', 'VBP'), ('come', 'V
BN'), ('home', 'NN'), ('to', 'TO'), ('family', 'NN'), ('and', 'CC'), ('faith', 'NN'), (',', ','),
('and', 'CC'), ('are', 'VBP'), ('determined', 'VBN'), ('to', 'TO'), ('bring', 'VB'), ('up', 'RP'),
('responsible', 'JJ'), (',', ','), ('moral', 'JJ'), ('children', 'NNS'), ('.', '.')]
[('Government', 'NNP'), ('is', 'VBZ'), ('not', 'RB'), ('the', 'DT'), ('source', 'NN'), ('of', 'IN'),
('these', 'DT'), ('values', 'NNS'), (',', ','), ('but', 'CC'), ('government', 'NN'), ('should', 'M
D'), ('never', 'RB'), ('undermine', 'VB'), ('them', 'PRP'), ('.', '.')]
[('Because', 'IN'), ('marriage', 'NN'), ('is', 'VBZ'), ('a', 'DT'), ('sacred', 'JJ'), ('institutio
n', 'NN'), ('and', 'CC'), ('the', 'DT'), ('foundation', 'NN'), ('of', 'IN'), ('society', 'NN'),
(',', ','), ('it', 'PRP'), ('should', 'MD'), ('not', 'RB'), ('be', 'VB'), ('re-defined', 'VBN'), ('b
y', 'IN'), ('activist', 'NN'), ('judges', 'NNS'), ('.', '.')]
[('For', 'IN'), ('the', 'DT'), ('good', 'JJ'), ('of', 'IN'), ('families', 'NNS'), (',', ','), ('chil
dren', 'NNS'), (',', ','), ('and', 'CC'), ('society', 'NN'), (',', ','), ('I', 'PRP'), ('support',
'VBP'), ('a', 'DT'), ('constitutional', 'JJ'), ('amendment', 'NN'), ('to', 'TO'), ('protect', 'VB'),
('the', 'DT'), ('institution', 'NN'), ('of', 'IN'), ('marriage', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Because', 'IN'), ('a', 'DT'), ('society', 'NN'), ('is', 'VBZ'), ('measured', 'VBN'), ('by', 'I
N'), ('how', 'WRB'), ('it', 'PRP'), ('treats', 'VBZ'), ('the', 'DT'), ('weak', 'JJ'), ('and', 'CC'),
('vulnerable', 'JJ'), (',', ','), ('we', 'PRP'), ('must', 'MD'), ('strive', 'VB'), ('to', 'TO'), ('b
uild', 'VB'), ('a', 'DT'), ('culture', 'NN'), ('of', 'IN'), ('life', 'NN'), ('.', '.')]
[('Medical', 'JJ'), ('research', 'NN'), ('can', 'MD'), ('help', 'VB'), ('us', 'PRP'), ('reach', 'V
) ( ) ( ) ( ) ( ) ( ) (
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 11/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
B'), ('that', 'DT'), ('goal', 'NN'), (',', ','), ('by', 'IN'), ('developing', 'VBG'), ('treatments',
'NNS'), ('and', 'CC'), ('cures', 'NNS'), ('that', 'WDT'), ('save', 'VBP'), ('lives', 'NNS'), ('and',
'CC'), ('help', 'NN'), ('people', 'NNS'), ('overcome', 'VBP'), ('disabilities', 'NNS'), ('--', ':'),
('and', 'CC'), ('I', 'PRP'), ('thank', 'VBP'), ('the', 'DT'), ('Congress', 'NNP'), ('for', 'IN'),
('doubling', 'VBG'), ('the', 'DT'), ('funding', 'NN'), ('of', 'IN'), ('the', 'DT'), ('National', 'NN
P'), ('Institutes', 'NNPS'), ('of', 'IN'), ('Health', 'NNP'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('To', 'TO'), ('build', 'VB'), ('a', 'DT'), ('culture', 'NN'), ('of', 'IN'), ('life', 'NN'), (',',
','), ('we', 'PRP'), ('must', 'MD'), ('also', 'RB'), ('ensure', 'VB'), ('that', 'IN'), ('scientifi
c', 'JJ'), ('advances', 'NNS'), ('always', 'RB'), ('serve', 'VBP'), ('human', 'JJ'), ('dignity', 'N
N'), (',', ','), ('not', 'RB'), ('take', 'VB'), ('advantage', 'NN'), ('of', 'IN'), ('some', 'DT'),
('lives', 'NNS'), ('for', 'IN'), ('the', 'DT'), ('benefit', 'NN'), ('of', 'IN'), ('others', 'NNS'),
('.', '.')]
[('We', 'PRP'), ('should', 'MD'), ('all', 'DT'), ('be', 'VB'), ('able', 'JJ'), ('to', 'TO'), ('agre
e', 'VB'), ('--', ':'), ('(', '('), ('applause', 'NN'), (')', ')'), ('--', ':'), ('we', 'PRP'), ('sh
ould', 'MD'), ('all', 'DT'), ('be', 'VB'), ('able', 'JJ'), ('to', 'TO'), ('agree', 'VB'), ('on', 'I
N'), ('some', 'DT'), ('clear', 'JJ'), ('standards', 'NNS'), ('.', '.')]
[('I', 'PRP'), ('will', 'MD'), ('work', 'VB'), ('with', 'IN'), ('Congress', 'NNP'), ('to', 'TO'),
('ensure', 'VB'), ('that', 'IN'), ('human', 'JJ'), ('embryos', 'NNS'), ('are', 'VBP'), ('not', 'R
B'), ('created', 'VBN'), ('for', 'IN'), ('experimentation', 'NN'), ('or', 'CC'), ('grown', 'VBN'),
('for', 'IN'), ('body', 'NN'), ('parts', 'NNS'), (',', ','), ('and', 'CC'), ('that', 'IN'), ('huma
n', 'JJ'), ('life', 'NN'), ('is', 'VBZ'), ('never', 'RB'), ('bought', 'VBN'), ('and', 'CC'), ('sol
d', 'VBN'), ('as', 'IN'), ('a', 'DT'), ('commodity', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('America', 'NNP'), ('will', 'MD'), ('continue', 'VB'), ('to', 'TO'), ('lead', 'VB'), ('the', 'D
T'), ('world', 'NN'), ('in', 'IN'), ('medical', 'JJ'), ('research', 'NN'), ('that', 'WDT'), ('is',
'VBZ'), ('ambitious', 'JJ'), (',', ','), ('aggressive', 'JJ'), (',', ','), ('and', 'CC'), ('always',
'RB'), ('ethical', 'JJ'), ('.', '.')]
[('Because', 'IN'), ('courts', 'NNS'), ('must', 'MD'), ('always', 'RB'), ('deliver', 'VB'), ('impart
ial', 'JJ'), ('justice', 'NN'), (',', ','), ('judges', 'NNS'), ('have', 'VBP'), ('a', 'DT'), ('dut
y', 'NN'), ('to', 'TO'), ('faithfully', 'RB'), ('interpret', 'VB'), ('the', 'DT'), ('law', 'NN'),
(',', ','), ('not', 'RB'), ('legislate', 'VB'), ('from', 'IN'), ('the', 'DT'), ('bench', 'NN'),
('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('As', 'IN'), ('President', 'NNP'), (',', ','), ('I', 'PRP'), ('have', 'VBP'), ('a', 'DT'), ('const
itutional', 'JJ'), ('responsibility', 'NN'), ('to', 'TO'), ('nominate', 'VB'), ('men', 'NNS'), ('an
d', 'CC'), ('women', 'NNS'), ('who', 'WP'), ('understand', 'VBP'), ('the', 'DT'), ('role', 'NN'),
('of', 'IN'), ('courts', 'NNS'), ('in', 'IN'), ('our', 'PRP$'), ('democracy', 'NN'), (',', ','), ('a
nd', 'CC'), ('are', 'VBP'), ('well-qualified', 'JJ'), ('to', 'TO'), ('serve', 'VB'), ('on', 'IN'),
('the', 'DT'), ('bench', 'NN'), ('--', ':'), ('and', 'CC'), ('I', 'PRP'), ('have', 'VBP'), ('done',
'VBN'), ('so', 'RB'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('The', 'DT'), ('Constitution', 'NNP'), ('also', 'RB'), ('gives', 'VBZ'), ('the', 'DT'), ('Senate',
'NNP'), ('a', 'DT'), ('responsibility', 'NN'), (':', ':'), ('Every', 'DT'), ('judicial', 'JJ'), ('no
minee', 'NN'), ('deserves', 'VBZ'), ('an', 'DT'), ('up', 'NN'), ('or', 'CC'), ('down', 'RB'), ('vot
e', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Because', 'IN'), ('one', 'CD'), ('of', 'IN'), ('the', 'DT'), ('deepest', 'JJS'), ('values', 'NN
S'), ('of', 'IN'), ('our', 'PRP$'), ('country', 'NN'), ('is', 'VBZ'), ('compassion', 'JJ'), (',',
','), ('we', 'PRP'), ('must', 'MD'), ('never', 'RB'), ('turn', 'VB'), ('away', 'RP'), ('from', 'I
N'), ('any', 'DT'), ('citizen', 'NN'), ('who', 'WP'), ('feels', 'VBZ'), ('isolated', 'VBN'), ('fro
m', 'IN'), ('the', 'DT'), ('opportunities', 'NNS'), ('of', 'IN'), ('America', 'NNP'), ('.', '.')]
[('Our', 'PRP$'), ('government', 'NN'), ('will', 'MD'), ('continue', 'VB'), ('to', 'TO'), ('suppor
t', 'VB'), ('faith-based', 'JJ'), ('and', 'CC'), ('community', 'NN'), ('groups', 'NNS'), ('that', 'I
N'), ('bring', 'VBG'), ('hope', 'NN'), ('to', 'TO'), ('harsh', 'VB'), ('places', 'NNS'), ('.', '.')]
[('Now', 'RB'), ('we', 'PRP'), ('need', 'VBP'), ('to', 'TO'), ('focus', 'VB'), ('on', 'IN'), ('givin
g', 'VBG'), ('young', 'JJ'), ('people', 'NNS'), (',', ','), ('especially', 'RB'), ('young', 'JJ'),
('men', 'NNS'), ('in', 'IN'), ('our', 'PRP$'), ('cities', 'NNS'), (',', ','), ('better', 'JJR'), ('o
ptions', 'NNS'), ('than', 'IN'), ('apathy', 'JJ'), (',', ','), ('or', 'CC'), ('gangs', 'NNS'), (',',
','), ('or', 'CC'), ('jail', 'NN'), ('.', '.')]
[('Tonight', 'NNP'), ('I', 'PRP'), ('propose', 'VBP'), ('a', 'DT'), ('three-year', 'JJ'), ('initiati
ve', 'NN'), ('to', 'TO'), ('help', 'VB'), ('organizations', 'NNS'), ('keep', 'VB'), ('young', 'JJ'),
('people', 'NNS'), ('out', 'IN'), ('of', 'IN'), ('gangs', 'NNS'), (',', ','), ('and', 'CC'), ('sho
w', 'VB'), ('young', 'JJ'), ('men', 'NNS'), ('an', 'DT'), ('ideal', 'NN'), ('of', 'IN'), ('manhood',
'NN'), ('that', 'WDT'), ('respects', 'VBZ'), ('women', 'NNS'), ('and', 'CC'), ('rejects', 'NNS'),
('violence', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Taking', 'VBG'), ('on', 'IN'), ('gang', 'NN'), ('life', 'NN'), ('will', 'MD'), ('be', 'VB'), ('on
e', 'CD'), ('part', 'NN'), ('of', 'IN'), ('a', 'DT'), ('broader', 'JJR'), ('outreach', 'NN'), ('to',
'TO'), ('at-risk', 'JJ'), ('youth', 'NN'), (',', ','), ('which', 'WDT'), ('involves', 'VBZ'), ('pare
nts', 'NNS'), ('and', 'CC'), ('pastors', 'NNS'), (',', ','), ('coaches', 'NNS'), ('and', 'CC'), ('co
mmunity', 'NN'), ('leaders', 'NNS'), (',', ','), ('in', 'IN'), ('programs', 'NNS'), ('ranging', 'VB
G'), ('from', 'IN'), ('literacy', 'NN'), ('to', 'TO'), ('sports', 'NNS'), ('.', '.')]
[('And', 'CC'), ('I', 'PRP'), ('am', 'VBP'), ('proud', 'JJ'), ('that', 'IN'), ('the', 'DT'), ('leade
r', 'NN'), ('of', 'IN'), ('this', 'DT'), ('nationwide', 'JJ'), ('effort', 'NN'), ('will', 'MD'), ('b
e', 'VB'), ('our', 'PRP$'), ('First', 'NNP'), ('Lady', 'NNP'), (',', ','), ('Laura', 'NNP'), ('Bus
h', 'NNP'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Because', 'IN'), ('HIV/AIDS', 'NNP'), ('brings', 'VBZ'), ('suffering', 'NN'), ('and', 'CC'), ('fe
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 12/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
ar', 'NN'), ('into', 'IN'), ('so', 'RB'), ('many', 'JJ'), ('lives', 'NNS'), (',', ','), ('I', 'PR
P'), ('ask', 'VBP'), ('you', 'PRP'), ('to', 'TO'), ('reauthorize', 'VB'), ('the', 'DT'), ('Ryan', 'N
NP'), ('White', 'NNP'), ('Act', 'NNP'), ('to', 'TO'), ('encourage', 'VB'), ('prevention', 'NN'),
(',', ','), ('and', 'CC'), ('provide', 'VB'), ('care', 'NN'), ('and', 'CC'), ('treatment', 'NN'),
('to', 'TO'), ('the', 'DT'), ('victims', 'NNS'), ('of', 'IN'), ('that', 'DT'), ('disease', 'NN'),
('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('And', 'CC'), ('as', 'IN'), ('we', 'PRP'), ('update', 'VBP'), ('this', 'DT'), ('important', 'JJ'),
('law', 'NN'), (',', ','), ('we', 'PRP'), ('must', 'MD'), ('focus', 'VB'), ('our', 'PRP$'), ('effort
s', 'NNS'), ('on', 'IN'), ('fellow', 'JJ'), ('citizens', 'NNS'), ('with', 'IN'), ('the', 'DT'), ('hi
ghest', 'JJS'), ('rates', 'NNS'), ('of', 'IN'), ('new', 'JJ'), ('cases', 'NNS'), (',', ','), ('Afric
an', 'JJ'), ('American', 'JJ'), ('men', 'NNS'), ('and', 'CC'), ('women', 'NNS'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Because', 'IN'), ('one', 'CD'), ('of', 'IN'), ('the', 'DT'), ('main', 'JJ'), ('sources', 'NNS'),
('of', 'IN'), ('our', 'PRP$'), ('national', 'JJ'), ('unity', 'NN'), ('is', 'VBZ'), ('our', 'PRP$'),
('belief', 'NN'), ('in', 'IN'), ('equal', 'JJ'), ('justice', 'NN'), (',', ','), ('we', 'PRP'), ('nee
d', 'VBP'), ('to', 'TO'), ('make', 'VB'), ('sure', 'JJ'), ('Americans', 'NNPS'), ('of', 'IN'), ('al
l', 'DT'), ('races', 'NNS'), ('and', 'CC'), ('backgrounds', 'NNS'), ('have', 'VBP'), ('confidence',
'NN'), ('in', 'IN'), ('the', 'DT'), ('system', 'NN'), ('that', 'WDT'), ('provides', 'VBZ'), ('justic
e', 'NN'), ('.', '.')]
[('In', 'IN'), ('America', 'NNP'), ('we', 'PRP'), ('must', 'MD'), ('make', 'VB'), ('doubly', 'RB'),
('sure', 'JJ'), ('no', 'DT'), ('person', 'NN'), ('is', 'VBZ'), ('held', 'VBN'), ('to', 'TO'), ('acco
unt', 'VB'), ('for', 'IN'), ('a', 'DT'), ('crime', 'NN'), ('he', 'PRP'), ('or', 'CC'), ('she', 'PR
P'), ('did', 'VBD'), ('not', 'RB'), ('commit', 'VB'), ('--', ':'), ('so', 'IN'), ('we', 'PRP'), ('ar
e', 'VBP'), ('dramatically', 'RB'), ('expanding', 'VBG'), ('the', 'DT'), ('use', 'NN'), ('of', 'I
N'), ('DNA', 'NNP'), ('evidence', 'NN'), ('to', 'TO'), ('prevent', 'VB'), ('wrongful', 'JJ'), ('conv
iction', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Soon', 'RB'), ('I', 'PRP'), ('will', 'MD'), ('send', 'VB'), ('to', 'TO'), ('Congress', 'NNP'),
('a', 'DT'), ('proposal', 'NN'), ('to', 'TO'), ('fund', 'VB'), ('special', 'JJ'), ('training', 'N
N'), ('for', 'IN'), ('defense', 'NN'), ('counsel', 'NN'), ('in', 'IN'), ('capital', 'NN'), ('cases',
'NNS'), (',', ','), ('because', 'IN'), ('people', 'NNS'), ('on', 'IN'), ('trial', 'NN'), ('for', 'I
N'), ('their', 'PRP$'), ('lives', 'NNS'), ('must', 'MD'), ('have', 'VB'), ('competent', 'NN'), ('law
yers', 'NNS'), ('by', 'IN'), ('their', 'PRP$'), ('side', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Our', 'PRP$'), ('third', 'JJ'), ('responsibility', 'NN'), ('to', 'TO'), ('future', 'JJ'), ('gener
ations', 'NNS'), ('is', 'VBZ'), ('to', 'TO'), ('leave', 'VB'), ('them', 'PRP'), ('an', 'DT'), ('Amer
ica', 'NNP'), ('that', 'WDT'), ('is', 'VBZ'), ('safe', 'JJ'), ('from', 'IN'), ('danger', 'NN'),
(',', ','), ('and', 'CC'), ('protected', 'VBN'), ('by', 'IN'), ('peace', 'NN'), ('.', '.')]
[('We', 'PRP'), ('will', 'MD'), ('pass', 'VB'), ('along', 'RB'), ('to', 'TO'), ('our', 'PRP$'), ('ch
ildren', 'NNS'), ('all', 'PDT'), ('the', 'DT'), ('freedoms', 'NNS'), ('we', 'PRP'), ('enjoy', 'VB
P'), ('--', ':'), ('and', 'CC'), ('chief', 'JJ'), ('among', 'IN'), ('them', 'PRP'), ('is', 'VBZ'),
('freedom', 'NN'), ('from', 'IN'), ('fear', 'NN'), ('.', '.')]
[('In', 'IN'), ('the', 'DT'), ('three', 'CD'), ('and', 'CC'), ('a', 'DT'), ('half', 'NN'), ('years',
'NNS'), ('since', 'IN'), ('September', 'NNP'), ('the', 'DT'), ('11th', 'CD'), (',', ','), ('2001',
'CD'), (',', ','), ('we', 'PRP'), ('have', 'VBP'), ('taken', 'VBN'), ('unprecedented', 'JJ'), ('acti
ons', 'NNS'), ('to', 'TO'), ('protect', 'VB'), ('Americans', 'NNPS'), ('.', '.')]
[('We', 'PRP'), ("'ve", 'VBP'), ('created', 'VBN'), ('a', 'DT'), ('new', 'JJ'), ('department', 'N
N'), ('of', 'IN'), ('government', 'NN'), ('to', 'TO'), ('defend', 'VB'), ('our', 'PRP$'), ('homelan
d', 'NN'), (',', ','), ('focused', 'VBD'), ('the', 'DT'), ('FBI', 'NNP'), ('on', 'IN'), ('preventin
g', 'VBG'), ('terrorism', 'NN'), (',', ','), ('begun', 'VBN'), ('to', 'TO'), ('reform', 'VB'), ('ou
r', 'PRP$'), ('intelligence', 'NN'), ('agencies', 'NNS'), (',', ','), ('broken', 'VBD'), ('up', 'R
P'), ('terror', 'NN'), ('cells', 'NNS'), ('across', 'IN'), ('the', 'DT'), ('country', 'NN'), (',',
','), ('expanded', 'VBN'), ('research', 'NN'), ('on', 'IN'), ('defenses', 'NNS'), ('against', 'IN'),
('biological', 'JJ'), ('and', 'CC'), ('chemical', 'JJ'), ('attack', 'NN'), (',', ','), ('improved',
'VBN'), ('border', 'NN'), ('security', 'NN'), (',', ','), ('and', 'CC'), ('trained', 'VBD'), ('mor
e', 'JJR'), ('than', 'IN'), ('a', 'DT'), ('half-million', 'NN'), ('first', 'JJ'), ('responders', 'NN
S'), ('.', '.')]
[('Police', 'NNP'), ('and', 'CC'), ('firefighters', 'NNS'), (',', ','), ('air', 'NN'), ('marshals',
'NNS'), (',', ','), ('researchers', 'NNS'), (',', ','), ('and', 'CC'), ('so', 'RB'), ('many', 'JJ'),
('others', 'NNS'), ('are', 'VBP'), ('working', 'VBG'), ('every', 'DT'), ('day', 'NN'), ('to', 'TO'),
('make', 'VB'), ('our', 'PRP$'), ('homeland', 'NN'), ('safer', 'NN'), (',', ','), ('and', 'CC'), ('w
e', 'PRP'), ('thank', 'VBP'), ('them', 'PRP'), ('all', 'DT'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Our', 'PRP$'), ('nation', 'NN'), (',', ','), ('working', 'VBG'), ('with', 'IN'), ('allies', 'NN
S'), ('and', 'CC'), ('friends', 'NNS'), (',', ','), ('has', 'VBZ'), ('also', 'RB'), ('confronted',
'VBN'), ('the', 'DT'), ('enemy', 'NN'), ('abroad', 'RB'), (',', ','), ('with', 'IN'), ('measures',
'NNS'), ('that', 'WDT'), ('are', 'VBP'), ('determined', 'VBN'), (',', ','), ('successful', 'JJ'),
(',', ','), ('and', 'CC'), ('continuing', 'VBG'), ('.', '.')]
[('The', 'DT'), ('al', 'NN'), ('Qaeda', 'NNP'), ('terror', 'NN'), ('network', 'NN'), ('that', 'WD
T'), ('attacked', 'VBD'), ('our', 'PRP$'), ('country', 'NN'), ('still', 'RB'), ('has', 'VBZ'), ('lea
ders', 'NNS'), ('--', ':'), ('but', 'CC'), ('many', 'JJ'), ('of', 'IN'), ('its', 'PRP$'), ('top', 'J
J'), ('commanders', 'NNS'), ('have', 'VBP'), ('been', 'VBN'), ('removed', 'VBN'), ('.', '.')]
[('There', 'EX'), ('are', 'VBP'), ('still', 'RB'), ('governments', 'NNS'), ('that', 'IN'), ('sponso
r', 'NN'), ('and', 'CC'), ('harbor', 'NN'), ('terrorists', 'NNS'), ('--', ':'), ('but', 'CC'), ('the
ir', 'PRP$'), ('number', 'NN'), ('has', 'VBZ'), ('declined', 'VBN'), ('.', '.')]
[('There', 'EX'), ('are', 'VBP'), ('still', 'RB'), ('regimes', 'NNS'), ('seeking', 'VBG'), ('weapon
s', 'NNS'), ('of', 'IN'), ('mass', 'NN'), ('destruction', 'NN'), ('--', ':'), ('but', 'CC'), ('no',
'DT'), ('longer', 'RB'), ('without', 'IN'), ('attention', 'NN'), ('and', 'CC'), ('without', 'IN'),
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 13/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
), ( g , ), ( , ), ( , ), ( , ), ( , ),
('consequence', 'NN'), ('.', '.')]
[('Our', 'PRP$'), ('country', 'NN'), ('is', 'VBZ'), ('still', 'RB'), ('the', 'DT'), ('target', 'N
N'), ('of', 'IN'), ('terrorists', 'NNS'), ('who', 'WP'), ('want', 'VBP'), ('to', 'TO'), ('kill', 'V
B'), ('many', 'JJ'), (',', ','), ('and', 'CC'), ('intimidate', 'VB'), ('us', 'PRP'), ('all', 'DT'),
('--', ':'), ('and', 'CC'), ('we', 'PRP'), ('will', 'MD'), ('stay', 'VB'), ('on', 'IN'), ('the', 'D
T'), ('offensive', 'JJ'), ('against', 'IN'), ('them', 'PRP'), (',', ','), ('until', 'IN'), ('the',
'DT'), ('fight', 'NN'), ('is', 'VBZ'), ('won', 'VBN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Pursuing', 'VBG'), ('our', 'PRP$'), ('enemies', 'NNS'), ('is', 'VBZ'), ('a', 'DT'), ('vital', 'J
J'), ('commitment', 'NN'), ('of', 'IN'), ('the', 'DT'), ('war', 'NN'), ('on', 'IN'), ('terror', 'N
N'), ('--', ':'), ('and', 'CC'), ('I', 'PRP'), ('thank', 'VBP'), ('the', 'DT'), ('Congress', 'NNP'),
('for', 'IN'), ('providing', 'VBG'), ('our', 'PRP$'), ('servicemen', 'NNS'), ('and', 'CC'), ('wome
n', 'NNS'), ('with', 'IN'), ('the', 'DT'), ('resources', 'NNS'), ('they', 'PRP'), ('have', 'VBP'),
('needed', 'VBN'), ('.', '.')]
[('During', 'IN'), ('this', 'DT'), ('time', 'NN'), ('of', 'IN'), ('war', 'NN'), (',', ','), ('we',
'PRP'), ('must', 'MD'), ('continue', 'VB'), ('to', 'TO'), ('support', 'VB'), ('our', 'PRP$'), ('mili
tary', 'JJ'), ('and', 'CC'), ('give', 'VB'), ('them', 'PRP'), ('the', 'DT'), ('tools', 'NNS'), ('fo
r', 'IN'), ('victory', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Other', 'JJ'), ('nations', 'NNS'), ('around', 'IN'), ('the', 'DT'), ('globe', 'NN'), ('have', 'VB
P'), ('stood', 'VBN'), ('with', 'IN'), ('us', 'PRP'), ('.', '.')]
[('In', 'IN'), ('Afghanistan', 'NNP'), (',', ','), ('an', 'DT'), ('international', 'JJ'), ('force',
'NN'), ('is', 'VBZ'), ('helping', 'VBG'), ('provide', 'JJ'), ('security', 'NN'), ('.', '.')]
[('In', 'IN'), ('Iraq', 'NNP'), (',', ','), ('28', 'CD'), ('countries', 'NNS'), ('have', 'VBP'), ('t
roops', 'NNS'), ('on', 'IN'), ('the', 'DT'), ('ground', 'NN'), (',', ','), ('the', 'DT'), ('United',
'NNP'), ('Nations', 'NNPS'), ('and', 'CC'), ('the', 'DT'), ('European', 'NNP'), ('Union', 'NNP'),
('provided', 'VBD'), ('technical', 'JJ'), ('assistance', 'NN'), ('for', 'IN'), ('the', 'DT'), ('elec
tions', 'NNS'), (',', ','), ('and', 'CC'), ('NATO', 'NNP'), ('is', 'VBZ'), ('leading', 'VBG'), ('a',
'DT'), ('mission', 'NN'), ('to', 'TO'), ('help', 'VB'), ('train', 'VB'), ('Iraqi', 'NNP'), ('officer
s', 'NNS'), ('.', '.')]
[('We', 'PRP'), ("'re", 'VBP'), ('cooperating', 'VBG'), ('with', 'IN'), ('60', 'CD'), ('government
s', 'NNS'), ('in', 'IN'), ('the', 'DT'), ('Proliferation', 'NNP'), ('Security', 'NNP'), ('Initiativ
e', 'NNP'), (',', ','), ('to', 'TO'), ('detect', 'VB'), ('and', 'CC'), ('stop', 'VB'), ('the', 'D
T'), ('transit', 'NN'), ('of', 'IN'), ('dangerous', 'JJ'), ('materials', 'NNS'), ('.', '.')]
[('We', 'PRP'), ("'re", 'VBP'), ('working', 'VBG'), ('closely', 'RB'), ('with', 'IN'), ('the', 'D
T'), ('governments', 'NNS'), ('in', 'IN'), ('Asia', 'NNP'), ('to', 'TO'), ('convince', 'VB'), ('Nort
h', 'NNP'), ('Korea', 'NNP'), ('to', 'TO'), ('abandon', 'VB'), ('its', 'PRP$'), ('nuclear', 'JJ'),
('ambitions', 'NNS'), ('.', '.')]
[('Pakistan', 'NNP'), (',', ','), ('Saudi', 'NNP'), ('Arabia', 'NNP'), (',', ','), ('and', 'CC'),
('nine', 'CD'), ('other', 'JJ'), ('countries', 'NNS'), ('have', 'VBP'), ('captured', 'VBN'), ('or',
'CC'), ('detained', 'VBN'), ('al', 'RP'), ('Qaeda', 'NNP'), ('terrorists', 'NNS'), ('.', '.')]
[('In', 'IN'), ('the', 'DT'), ('next', 'JJ'), ('four', 'CD'), ('years', 'NNS'), (',', ','), ('my',
'PRP$'), ('administration', 'NN'), ('will', 'MD'), ('continue', 'VB'), ('to', 'TO'), ('build', 'V
B'), ('the', 'DT'), ('coalitions', 'NNS'), ('that', 'WDT'), ('will', 'MD'), ('defeat', 'VB'), ('th
e', 'DT'), ('dangers', 'NNS'), ('of', 'IN'), ('our', 'PRP$'), ('time', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('In', 'IN'), ('the', 'DT'), ('long-term', 'JJ'), (',', ','), ('the', 'DT'), ('peace', 'NN'), ('w
e', 'PRP'), ('seek', 'VBP'), ('will', 'MD'), ('only', 'RB'), ('be', 'VB'), ('achieved', 'VBN'), ('b
y', 'IN'), ('eliminating', 'VBG'), ('the', 'DT'), ('conditions', 'NNS'), ('that', 'WDT'), ('feed',
'VBP'), ('radicalism', 'NN'), ('and', 'CC'), ('ideologies', 'NNS'), ('of', 'IN'), ('murder', 'NN'),
('.', '.')]
[('If', 'IN'), ('whole', 'JJ'), ('regions', 'NNS'), ('of', 'IN'), ('the', 'DT'), ('world', 'NN'),
('remain', 'NN'), ('in', 'IN'), ('despair', 'NN'), ('and', 'CC'), ('grow', 'NN'), ('in', 'IN'), ('ha
tred', 'VBN'), (',', ','), ('they', 'PRP'), ('will', 'MD'), ('be', 'VB'), ('the', 'DT'), ('recruitin
g', 'NN'), ('grounds', 'NNS'), ('for', 'IN'), ('terror', 'NN'), (',', ','), ('and', 'CC'), ('that',
'DT'), ('terror', 'NN'), ('will', 'MD'), ('stalk', 'VB'), ('America', 'NNP'), ('and', 'CC'), ('othe
r', 'JJ'), ('free', 'JJ'), ('nations', 'NNS'), ('for', 'IN'), ('decades', 'NNS'), ('.', '.')]
[('The', 'DT'), ('only', 'JJ'), ('force', 'NN'), ('powerful', 'JJ'), ('enough', 'RB'), ('to', 'TO'),
('stop', 'VB'), ('the', 'DT'), ('rise', 'NN'), ('of', 'IN'), ('tyranny', 'NN'), ('and', 'CC'), ('ter
ror', 'NN'), (',', ','), ('and', 'CC'), ('replace', 'VB'), ('hatred', 'VBN'), ('with', 'IN'), ('hop
e', 'NN'), (',', ','), ('is', 'VBZ'), ('the', 'DT'), ('force', 'NN'), ('of', 'IN'), ('human', 'JJ'),
('freedom', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Our', 'PRP$'), ('enemies', 'NNS'), ('know', 'VBP'), ('this', 'DT'), (',', ','), ('and', 'CC'),
('that', 'DT'), ('is', 'VBZ'), ('why', 'WRB'), ('the', 'DT'), ('terrorist', 'NN'), ('Zarqawi', 'NN
P'), ('recently', 'RB'), ('declared', 'VBD'), ('war', 'NN'), ('on', 'IN'), ('what', 'WP'), ('he', 'P
RP'), ('called', 'VBD'), ('the', 'DT'), ('``', '``'), ('evil', 'JJ'), ('principle', 'NN'), ("''",
"''"), ('of', 'IN'), ('democracy', 'NN'), ('.', '.')]
[('And', 'CC'), ('we', 'PRP'), ("'ve", 'VBP'), ('declared', 'VBN'), ('our', 'PRP$'), ('own', 'JJ'),
('intention', 'NN'), (':', ':'), ('America', 'NNP'), ('will', 'MD'), ('stand', 'VB'), ('with', 'I
N'), ('the', 'DT'), ('allies', 'NNS'), ('of', 'IN'), ('freedom', 'NN'), ('to', 'TO'), ('support', 'V
B'), ('democratic', 'JJ'), ('movements', 'NNS'), ('in', 'IN'), ('the', 'DT'), ('Middle', 'NNP'), ('E
ast', 'NNP'), ('and', 'CC'), ('beyond', 'IN'), (',', ','), ('with', 'IN'), ('the', 'DT'), ('ultimat
e', 'JJ'), ('goal', 'NN'), ('of', 'IN'), ('ending', 'VBG'), ('tyranny', 'NN'), ('in', 'IN'), ('our',
'PRP$'), ('world', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('The', 'DT'), ('United', 'NNP'), ('States', 'NNPS'), ('has', 'VBZ'), ('no', 'DT'), ('right', 'N
N'), (',', ','), ('no', 'DT'), ('desire', 'NN'), (',', ','), ('and', 'CC'), ('no', 'DT'), ('intentio
n', 'NN'), ('to', 'TO'), ('impose', 'VB'), ('our', 'PRP$'), ('form', 'NN'), ('of', 'IN'), ('governme
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 14/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
n , NN ), ( to , TO ), ( impose , VB ), ( our , PRP$ ), ( form , NN ), ( of , IN ), ( governme
nt', 'NN'), ('on', 'IN'), ('anyone', 'NN'), ('else', 'RB'), ('.', '.')]
[('That', 'DT'), ('is', 'VBZ'), ('one', 'CD'), ('of', 'IN'), ('the', 'DT'), ('main', 'JJ'), ('differ
ences', 'NNS'), ('between', 'IN'), ('us', 'PRP'), ('and', 'CC'), ('our', 'PRP$'), ('enemies', 'NN
S'), ('.', '.')]
[('They', 'PRP'), ('seek', 'VBP'), ('to', 'TO'), ('impose', 'VB'), ('and', 'CC'), ('expand', 'VB'),
('an', 'DT'), ('empire', 'NN'), ('of', 'IN'), ('oppression', 'NN'), (',', ','), ('in', 'IN'), ('whi
ch', 'WDT'), ('a', 'DT'), ('tiny', 'JJ'), ('group', 'NN'), ('of', 'IN'), ('brutal', 'NN'), (',',
','), ('self-appointed', 'JJ'), ('rulers', 'NNS'), ('control', 'NN'), ('every', 'DT'), ('aspect',
'NN'), ('of', 'IN'), ('every', 'DT'), ('life', 'NN'), ('.', '.')]
[('Our', 'PRP$'), ('aim', 'NN'), ('is', 'VBZ'), ('to', 'TO'), ('build', 'VB'), ('and', 'CC'), ('pres
erve', 'VB'), ('a', 'DT'), ('community', 'NN'), ('of', 'IN'), ('free', 'JJ'), ('and', 'CC'), ('indep
endent', 'JJ'), ('nations', 'NNS'), (',', ','), ('with', 'IN'), ('governments', 'NNS'), ('that', 'WD
T'), ('answer', 'VBP'), ('to', 'TO'), ('their', 'PRP$'), ('citizens', 'NNS'), (',', ','), ('and', 'C
C'), ('reflect', 'VBP'), ('their', 'PRP$'), ('own', 'JJ'), ('cultures', 'NNS'), ('.', '.')]
[('And', 'CC'), ('because', 'IN'), ('democracies', 'NNS'), ('respect', 'VBP'), ('their', 'PRP$'),
('own', 'JJ'), ('people', 'NNS'), ('and', 'CC'), ('their', 'PRP$'), ('neighbors', 'NNS'), (',',
','), ('the', 'DT'), ('advance', 'NN'), ('of', 'IN'), ('freedom', 'NN'), ('will', 'MD'), ('lead',
'VB'), ('to', 'TO'), ('peace', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('That', 'DT'), ('advance', 'NN'), ('has', 'VBZ'), ('great', 'JJ'), ('momentum', 'NN'), ('in', 'I
N'), ('our', 'PRP$'), ('time', 'NN'), ('--', ':'), ('shown', 'VBN'), ('by', 'IN'), ('women', 'NNS'),
('voting', 'VBG'), ('in', 'IN'), ('Afghanistan', 'NNP'), (',', ','), ('and', 'CC'), ('Palestinians',
'NNPS'), ('choosing', 'VBG'), ('a', 'DT'), ('new', 'JJ'), ('direction', 'NN'), (',', ','), ('and',
'CC'), ('the', 'DT'), ('people', 'NNS'), ('of', 'IN'), ('Ukraine', 'NNP'), ('asserting', 'VBG'),
('their', 'PRP$'), ('democratic', 'JJ'), ('rights', 'NNS'), ('and', 'CC'), ('electing', 'VBG'),
('a', 'DT'), ('president', 'NN'), ('.', '.')]
[('We', 'PRP'), ('are', 'VBP'), ('witnessing', 'VBG'), ('landmark', 'NN'), ('events', 'NNS'), ('in',
'IN'), ('the', 'DT'), ('history', 'NN'), ('of', 'IN'), ('liberty', 'NN'), ('.', '.')]
[('And', 'CC'), ('in', 'IN'), ('the', 'DT'), ('coming', 'VBG'), ('years', 'NNS'), (',', ','), ('we',
'PRP'), ('will', 'MD'), ('add', 'VB'), ('to', 'TO'), ('that', 'DT'), ('story', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('The', 'DT'), ('beginnings', 'NNS'), ('of', 'IN'), ('reform', 'NN'), ('and', 'CC'), ('democracy',
'NN'), ('in', 'IN'), ('the', 'DT'), ('Palestinian', 'JJ'), ('territories', 'NNS'), ('are', 'VBP'),
('now', 'RB'), ('showing', 'VBG'), ('the', 'DT'), ('power', 'NN'), ('of', 'IN'), ('freedom', 'NN'),
('to', 'TO'), ('break', 'VB'), ('old', 'JJ'), ('patterns', 'NNS'), ('of', 'IN'), ('violence', 'NN'),
('and', 'CC'), ('failure', 'NN'), ('.', '.')]
[('Tomorrow', 'NN'), ('morning', 'NN'), (',', ','), ('Secretary', 'NNP'), ('of', 'IN'), ('State', 'N
NP'), ('Rice', 'NNP'), ('departs', 'NNS'), ('on', 'IN'), ('a', 'DT'), ('trip', 'NN'), ('that', 'WD
T'), ('will', 'MD'), ('take', 'VB'), ('her', 'PRP$'), ('to', 'TO'), ('Israel', 'NNP'), ('and', 'C
C'), ('the', 'DT'), ('West', 'NNP'), ('Bank', 'NNP'), ('for', 'IN'), ('meetings', 'NNS'), ('with',
'IN'), ('Prime', 'NNP'), ('Minister', 'NNP'), ('Sharon', 'NNP'), ('and', 'CC'), ('President', 'NN
P'), ('Abbas', 'NNP'), ('.', '.')]
[('She', 'PRP'), ('will', 'MD'), ('discuss', 'VB'), ('with', 'IN'), ('them', 'PRP'), ('how', 'WRB'),
('we', 'PRP'), ('and', 'CC'), ('our', 'PRP$'), ('friends', 'NNS'), ('can', 'MD'), ('help', 'VB'),
('the', 'DT'), ('Palestinian', 'JJ'), ('people', 'NNS'), ('end', 'VBP'), ('terror', 'NN'), ('and',
'CC'), ('build', 'VB'), ('the', 'DT'), ('institutions', 'NNS'), ('of', 'IN'), ('a', 'DT'), ('peacef
ul', 'JJ'), (',', ','), ('independent', 'JJ'), (',', ','), ('democratic', 'JJ'), ('state', 'NN'),
('.', '.')]
[('To', 'TO'), ('promote', 'VB'), ('this', 'DT'), ('democracy', 'NN'), (',', ','), ('I', 'PRP'), ('w
ill', 'MD'), ('ask', 'VB'), ('Congress', 'NNP'), ('for', 'IN'), ('$', '$'), ('350', 'CD'), ('millio
n', 'CD'), ('to', 'TO'), ('support', 'VB'), ('Palestinian', 'JJ'), ('political', 'JJ'), (',', ','),
('economic', 'JJ'), (',', ','), ('and', 'CC'), ('security', 'NN'), ('reforms', 'NNS'), ('.', '.')]
[('The', 'DT'), ('goal', 'NN'), ('of', 'IN'), ('two', 'CD'), ('democratic', 'JJ'), ('states', 'NN
S'), (',', ','), ('Israel', 'NNP'), ('and', 'CC'), ('Palestine', 'NNP'), (',', ','), ('living', 'VB
G'), ('side', 'NN'), ('by', 'IN'), ('side', 'NN'), ('in', 'IN'), ('peace', 'NN'), (',', ','), ('is',
'VBZ'), ('within', 'IN'), ('reach', 'NN'), ('--', ':'), ('and', 'CC'), ('America', 'NNP'), ('will',
'MD'), ('help', 'VB'), ('them', 'PRP'), ('achieve', 'VB'), ('that', 'DT'), ('goal', 'NN'), ('.',
'.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('To', 'TO'), ('promote', 'VB'), ('peace', 'NN'), ('and', 'CC'), ('stability', 'NN'), ('in', 'IN'),
('the', 'DT'), ('broader', 'JJR'), ('Middle', 'NNP'), ('East', 'NNP'), (',', ','), ('the', 'DT'),
('United', 'NNP'), ('States', 'NNPS'), ('will', 'MD'), ('work', 'VB'), ('with', 'IN'), ('our', 'PRP
$'), ('friends', 'NNS'), ('in', 'IN'), ('the', 'DT'), ('region', 'NN'), ('to', 'TO'), ('fight', 'V
B'), ('the', 'DT'), ('common', 'JJ'), ('threat', 'NN'), ('of', 'IN'), ('terror', 'NN'), (',', ','),
('while', 'IN'), ('we', 'PRP'), ('encourage', 'VBP'), ('a', 'DT'), ('higher', 'JJR'), ('standard',
'NN'), ('of', 'IN'), ('freedom', 'NN'), ('.', '.')]
[('Hopeful', 'JJ'), ('reform', 'NN'), ('is', 'VBZ'), ('already', 'RB'), ('taking', 'VBG'), ('hold',
'NN'), ('in', 'IN'), ('an', 'DT'), ('arc', 'NN'), ('from', 'IN'), ('Morocco', 'NNP'), ('to', 'TO'),
('Jordan', 'NNP'), ('to', 'TO'), ('Bahrain', 'NNP'), ('.', '.')]
[('The', 'DT'), ('government', 'NN'), ('of', 'IN'), ('Saudi', 'NNP'), ('Arabia', 'NNP'), ('can', 'M
D'), ('demonstrate', 'VB'), ('its', 'PRP$'), ('leadership', 'NN'), ('in', 'IN'), ('the', 'DT'), ('re
gion', 'NN'), ('by', 'IN'), ('expanding', 'VBG'), ('the', 'DT'), ('role', 'NN'), ('of', 'IN'), ('it
s', 'PRP$'), ('people', 'NNS'), ('in', 'IN'), ('determining', 'VBG'), ('their', 'PRP$'), ('future',
'NN'), ('.', '.')]
[('And', 'CC'), ('the', 'DT'), ('great', 'JJ'), ('and', 'CC'), ('proud', 'JJ'), ('nation', 'NN'),
('of', 'IN'), ('Egypt', 'NNP'), (',', ','), ('which', 'WDT'), ('showed', 'VBD'), ('the', 'DT'), ('w
ay', 'NN'), ('toward', 'IN'), ('peace', 'NN'), ('in', 'IN'), ('the', 'DT'), ('Middle', 'NNP'), ('Eas
t', 'NNP'), (',', ','), ('can', 'MD'), ('now', 'RB'), ('show', 'VB'), ('the', 'DT'), ('way', 'NN'),
('toward' 'IN') ('democracy' 'NN') ('in' 'IN') ('the' 'DT') ('Middle' 'NNP') ('East' 'NN
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 15/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
( toward , IN ), ( democracy , NN ), ( in , IN ), ( the , DT ), ( Middle , NNP ), ( East , NN
P'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('To', 'TO'), ('promote', 'VB'), ('peace', 'NN'), ('in', 'IN'), ('the', 'DT'), ('broader', 'JJR'),
('Middle', 'NNP'), ('East', 'NNP'), (',', ','), ('we', 'PRP'), ('must', 'MD'), ('confront', 'VB'),
('regimes', 'NNS'), ('that', 'WDT'), ('continue', 'VBP'), ('to', 'TO'), ('harbor', 'VB'), ('terrori
sts', 'NNS'), ('and', 'CC'), ('pursue', 'NN'), ('weapons', 'NNS'), ('of', 'IN'), ('mass', 'NN'), ('m
urder', 'NN'), ('.', '.')]
[('Syria', 'NNP'), ('still', 'RB'), ('allows', 'VBZ'), ('its', 'PRP$'), ('territory', 'NN'), (',',
','), ('and', 'CC'), ('parts', 'NNS'), ('of', 'IN'), ('Lebanon', 'NNP'), (',', ','), ('to', 'TO'),
('be', 'VB'), ('used', 'VBN'), ('by', 'IN'), ('terrorists', 'NNS'), ('who', 'WP'), ('seek', 'VBP'),
('to', 'TO'), ('destroy', 'VB'), ('every', 'DT'), ('chance', 'NN'), ('of', 'IN'), ('peace', 'NN'),
('in', 'IN'), ('the', 'DT'), ('region', 'NN'), ('.', '.')]
[('You', 'PRP'), ('have', 'VBP'), ('passed', 'VBN'), (',', ','), ('and', 'CC'), ('we', 'PRP'), ('ar
e', 'VBP'), ('applying', 'VBG'), (',', ','), ('the', 'DT'), ('Syrian', 'JJ'), ('Accountability', 'NN
P'), ('Act', 'NNP'), ('--', ':'), ('and', 'CC'), ('we', 'PRP'), ('expect', 'VBP'), ('the', 'DT'),
('Syrian', 'JJ'), ('government', 'NN'), ('to', 'TO'), ('end', 'VB'), ('all', 'DT'), ('support', 'N
N'), ('for', 'IN'), ('terror', 'NN'), ('and', 'CC'), ('open', 'VB'), ('the', 'DT'), ('door', 'NN'),
('to', 'TO'), ('freedom', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Today', 'NN'), (',', ','), ('Iran', 'NNP'), ('remains', 'VBZ'), ('the', 'DT'), ('world', 'NN'),
("'s", 'POS'), ('primary', 'JJ'), ('state', 'NN'), ('sponsor', 'NN'), ('of', 'IN'), ('terror', 'N
N'), ('--', ':'), ('pursuing', 'VBG'), ('nuclear', 'JJ'), ('weapons', 'NNS'), ('while', 'IN'), ('dep
riving', 'VBG'), ('its', 'PRP$'), ('people', 'NNS'), ('of', 'IN'), ('the', 'DT'), ('freedom', 'NN'),
('they', 'PRP'), ('seek', 'VBP'), ('and', 'CC'), ('deserve', 'VBP'), ('.', '.')]
[('We', 'PRP'), ('are', 'VBP'), ('working', 'VBG'), ('with', 'IN'), ('European', 'JJ'), ('allies',
'NNS'), ('to', 'TO'), ('make', 'VB'), ('clear', 'JJ'), ('to', 'TO'), ('the', 'DT'), ('Iranian', 'J
J'), ('regime', 'NN'), ('that', 'IN'), ('it', 'PRP'), ('must', 'MD'), ('give', 'VB'), ('up', 'RP'),
('its', 'PRP$'), ('uranium', 'JJ'), ('enrichment', 'JJ'), ('program', 'NN'), ('and', 'CC'), ('any',
'DT'), ('plutonium', 'NN'), ('reprocessing', 'NN'), (',', ','), ('and', 'CC'), ('end', 'VB'), ('it
s', 'PRP$'), ('support', 'NN'), ('for', 'IN'), ('terror', 'NN'), ('.', '.')]
[('And', 'CC'), ('to', 'TO'), ('the', 'DT'), ('Iranian', 'JJ'), ('people', 'NNS'), (',', ','), ('I',
'PRP'), ('say', 'VBP'), ('tonight', 'JJ'), (':', ':'), ('As', 'IN'), ('you', 'PRP'), ('stand', 'VB
P'), ('for', 'IN'), ('your', 'PRP$'), ('own', 'JJ'), ('liberty', 'NN'), (',', ','), ('America', 'NN
P'), ('stands', 'VBZ'), ('with', 'IN'), ('you', 'PRP'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Our', 'PRP$'), ('generational', 'JJ'), ('commitment', 'NN'), ('to', 'TO'), ('the', 'DT'), ('advan
ce', 'NN'), ('of', 'IN'), ('freedom', 'NN'), (',', ','), ('especially', 'RB'), ('in', 'IN'), ('the',
'DT'), ('Middle', 'NNP'), ('East', 'NNP'), (',', ','), ('is', 'VBZ'), ('now', 'RB'), ('being', 'VB
G'), ('tested', 'VBN'), ('and', 'CC'), ('honored', 'VBN'), ('in', 'IN'), ('Iraq', 'NNP'), ('.',
'.')]
[('That', 'DT'), ('country', 'NN'), ('is', 'VBZ'), ('a', 'DT'), ('vital', 'JJ'), ('front', 'NN'),
('in', 'IN'), ('the', 'DT'), ('war', 'NN'), ('on', 'IN'), ('terror', 'NN'), (',', ','), ('which',
'WDT'), ('is', 'VBZ'), ('why', 'WRB'), ('the', 'DT'), ('terrorists', 'NNS'), ('have', 'VBP'), ('cho
sen', 'VBN'), ('to', 'TO'), ('make', 'VB'), ('a', 'DT'), ('stand', 'NN'), ('there', 'RB'), ('.',
'.')]
[('Our', 'PRP$'), ('men', 'NNS'), ('and', 'CC'), ('women', 'NNS'), ('in', 'IN'), ('uniform', 'NN'),
('are', 'VBP'), ('fighting', 'VBG'), ('terrorists', 'NNS'), ('in', 'IN'), ('Iraq', 'NNP'), (',',
','), ('so', 'IN'), ('we', 'PRP'), ('do', 'VBP'), ('not', 'RB'), ('have', 'VB'), ('to', 'TO'), ('fa
ce', 'VB'), ('them', 'PRP'), ('here', 'RB'), ('at', 'IN'), ('home', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('And', 'CC'), ('the', 'DT'), ('victory', 'NN'), ('of', 'IN'), ('freedom', 'NN'), ('in', 'IN'), ('I
raq', 'NNP'), ('will', 'MD'), ('strengthen', 'VB'), ('a', 'DT'), ('new', 'JJ'), ('ally', 'NN'), ('i
n', 'IN'), ('the', 'DT'), ('war', 'NN'), ('on', 'IN'), ('terror', 'NN'), (',', ','), ('inspire', 'VB
P'), ('democratic', 'JJ'), ('reformers', 'NNS'), ('from', 'IN'), ('Damascus', 'NNP'), ('to', 'TO'),
('Tehran', 'NNP'), (',', ','), ('bring', 'VBG'), ('more', 'JJR'), ('hope', 'NN'), ('and', 'CC'),
('progress', 'NN'), ('to', 'TO'), ('a', 'DT'), ('troubled', 'JJ'), ('region', 'NN'), (',', ','),
('and', 'CC'), ('thereby', 'RB'), ('lift', 'VB'), ('a', 'DT'), ('terrible', 'JJ'), ('threat', 'N
N'), ('from', 'IN'), ('the', 'DT'), ('lives', 'NNS'), ('of', 'IN'), ('our', 'PRP$'), ('children', 'N
NS'), ('and', 'CC'), ('grandchildren', 'NNS'), ('.', '.')]
[('We', 'PRP'), ('will', 'MD'), ('succeed', 'VB'), ('because', 'IN'), ('the', 'DT'), ('Iraqi', 'NN
P'), ('people', 'NNS'), ('value', 'NN'), ('their', 'PRP$'), ('own', 'JJ'), ('liberty', 'NN'), ('--',
':'), ('as', 'IN'), ('they', 'PRP'), ('showed', 'VBD'), ('the', 'DT'), ('world', 'NN'), ('last', 'J
J'), ('Sunday', 'NNP'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Across', 'IN'), ('Iraq', 'NNP'), (',', ','), ('often', 'RB'), ('at', 'IN'), ('great', 'JJ'), ('ri
sk', 'NN'), (',', ','), ('millions', 'NNS'), ('of', 'IN'), ('citizens', 'NNS'), ('went', 'VBD'), ('t
o', 'TO'), ('the', 'DT'), ('polls', 'NNS'), ('and', 'CC'), ('elected', 'VBD'), ('275', 'CD'), ('me
n', 'NNS'), ('and', 'CC'), ('women', 'NNS'), ('to', 'TO'), ('represent', 'VB'), ('them', 'PRP'), ('i
n', 'IN'), ('a', 'DT'), ('new', 'JJ'), ('Transitional', 'NNP'), ('National', 'NNP'), ('Assembly', 'N
NP'), ('.', '.')]
[('A', 'DT'), ('young', 'JJ'), ('woman', 'NN'), ('in', 'IN'), ('Baghdad', 'NNP'), ('told', 'VBD'),
('of', 'IN'), ('waking', 'VBG'), ('to', 'TO'), ('the', 'DT'), ('sound', 'NN'), ('of', 'IN'), ('mort
ar', 'NN'), ('fire', 'NN'), ('on', 'IN'), ('election', 'NN'), ('day', 'NN'), (',', ','), ('and', 'C
C'), ('wondering', 'VBG'), ('if', 'IN'), ('it', 'PRP'), ('might', 'MD'), ('be', 'VB'), ('too', 'R
B'), ('dangerous', 'JJ'), ('to', 'TO'), ('vote', 'VB'), ('.', '.')]
[('She', 'PRP'), ('said', 'VBD'), (',', ','), ('``', '``'), ('Hearing', 'VBG'), ('those', 'DT'), ('e
xplosions', 'NNS'), (',', ','), ('it', 'PRP'), ('occurred', 'VBD'), ('to', 'TO'), ('me', 'PRP'), ('-
-', ':'), ('the', 'DT'), ('insurgents', 'NNS'), ('are', 'VBP'), ('weak', 'JJ'), (',', ','), ('they',
'PRP') (' ' 'VBP') (' f id' 'JJ') (' f' 'IN') ('d ' 'NN') (' ' ' ') ('th ' 'P
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 16/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
'PRP'), ('are', 'VBP'), ('afraid', 'JJ'), ('of', 'IN'), ('democracy', 'NN'), (',', ','), ('they', 'P
RP'), ('are', 'VBP'), ('losing', 'VBG'), ('.', '.')]
[('So', 'RB'), ('I', 'PRP'), ('got', 'VBD'), ('my', 'PRP$'), ('husband', 'NN'), (',', ','), ('and',
'CC'), ('I', 'PRP'), ('got', 'VBD'), ('my', 'PRP$'), ('parents', 'NNS'), (',', ','), ('and', 'CC'),
('we', 'PRP'), ('all', 'DT'), ('came', 'VBD'), ('out', 'RP'), ('and', 'CC'), ('voted', 'VBD'), ('tog
ether', 'RB'), ('.', '.'), ("''", "''")]
[('Americans', 'NNPS'), ('recognize', 'VBP'), ('that', 'IN'), ('spirit', 'NN'), ('of', 'IN'), ('libe
rty', 'NN'), (',', ','), ('because', 'IN'), ('we', 'PRP'), ('share', 'NN'), ('it', 'PRP'), ('.',
'.')]
[('In', 'IN'), ('any', 'DT'), ('nation', 'NN'), (',', ','), ('casting', 'VBG'), ('your', 'PRP$'),
('vote', 'NN'), ('is', 'VBZ'), ('an', 'DT'), ('act', 'NN'), ('of', 'IN'), ('civic', 'JJ'), ('respon
sibility', 'NN'), (';', ':'), ('for', 'IN'), ('millions', 'NNS'), ('of', 'IN'), ('Iraqis', 'NNP'),
(',', ','), ('it', 'PRP'), ('was', 'VBD'), ('also', 'RB'), ('an', 'DT'), ('act', 'NN'), ('of', 'I
N'), ('personal', 'JJ'), ('courage', 'NN'), (',', ','), ('and', 'CC'), ('they', 'PRP'), ('have', 'VB
P'), ('earned', 'VBN'), ('the', 'DT'), ('respect', 'NN'), ('of', 'IN'), ('us', 'PRP'), ('all', 'D
T'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('One', 'CD'), ('of', 'IN'), ('Iraq', 'NNP'), ("'s", 'POS'), ('leading', 'JJ'), ('democracy', 'N
N'), ('and', 'CC'), ('human', 'JJ'), ('rights', 'NNS'), ('advocates', 'NNS'), ('is', 'VBZ'), ('Safi
a', 'NNP'), ('Taleb', 'NNP'), ('al-Suhail', 'NN'), ('.', '.')]
[('She', 'PRP'), ('says', 'VBZ'), ('of', 'IN'), ('her', 'PRP$'), ('country', 'NN'), (',', ','), ('`
`', '``'), ('We', 'PRP'), ('were', 'VBD'), ('occupied', 'VBN'), ('for', 'IN'), ('35', 'CD'), ('year
s', 'NNS'), ('by', 'IN'), ('Saddam', 'NNP'), ('Hussein', 'NNP'), ('.', '.')]
[('That', 'DT'), ('was', 'VBD'), ('the', 'DT'), ('real', 'JJ'), ('occupation', 'NN'), ('.', '.')]
[('Thank', 'NNP'), ('you', 'PRP'), ('to', 'TO'), ('the', 'DT'), ('American', 'JJ'), ('people', 'NN
S'), ('who', 'WP'), ('paid', 'VBD'), ('the', 'DT'), ('cost', 'NN'), (',', ','), ('but', 'CC'), ('mos
t', 'JJS'), ('of', 'IN'), ('all', 'DT'), (',', ','), ('to', 'TO'), ('the', 'DT'), ('soldiers', 'NN
S'), ('.', '.'), ("''", "''")]
[('Eleven', 'CD'), ('years', 'NNS'), ('ago', 'RB'), (',', ','), ('Safia', 'NNP'), ("'s", 'POS'), ('f
ather', 'NN'), ('was', 'VBD'), ('assassinated', 'VBN'), ('by', 'IN'), ('Saddam', 'NNP'), ("'s", 'PO
S'), ('intelligence', 'NN'), ('service', 'NN'), ('.', '.')]
[('Three', 'CD'), ('days', 'NNS'), ('ago', 'RB'), ('in', 'IN'), ('Baghdad', 'NNP'), (',', ','), ('Sa
fia', 'NNP'), ('was', 'VBD'), ('finally', 'RB'), ('able', 'JJ'), ('to', 'TO'), ('vote', 'VB'), ('fo
r', 'IN'), ('the', 'DT'), ('leaders', 'NNS'), ('of', 'IN'), ('her', 'PRP$'), ('country', 'NN'), ('--
', ':'), ('and', 'CC'), ('we', 'PRP'), ('are', 'VBP'), ('honored', 'VBN'), ('that', 'IN'), ('she',
'PRP'), ('is', 'VBZ'), ('with', 'IN'), ('us', 'PRP'), ('tonight', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('The', 'DT'), ('terrorists', 'NNS'), ('and', 'CC'), ('insurgents', 'NNS'), ('are', 'VBP'), ('viole
ntly', 'RB'), ('opposed', 'VBN'), ('to', 'TO'), ('democracy', 'NN'), (',', ','), ('and', 'CC'), ('wi
ll', 'MD'), ('continue', 'VB'), ('to', 'TO'), ('attack', 'VB'), ('it', 'PRP'), ('.', '.')]
[('Yet', 'RB'), (',', ','), ('the', 'DT'), ('terrorists', 'NNS'), ("'", 'POS'), ('most', 'RBS'), ('p
owerful', 'JJ'), ('myth', 'NN'), ('is', 'VBZ'), ('being', 'VBG'), ('destroyed', 'VBN'), ('.', '.')]
[('The', 'DT'), ('whole', 'JJ'), ('world', 'NN'), ('is', 'VBZ'), ('seeing', 'VBG'), ('that', 'IN'),
('the', 'DT'), ('car', 'NN'), ('bombers', 'NNS'), ('and', 'CC'), ('assassins', 'NNS'), ('are', 'VB
P'), ('not', 'RB'), ('only', 'RB'), ('fighting', 'VBG'), ('coalition', 'NN'), ('forces', 'NNS'),
(',', ','), ('they', 'PRP'), ('are', 'VBP'), ('trying', 'VBG'), ('to', 'TO'), ('destroy', 'VB'),
('the', 'DT'), ('hopes', 'NNS'), ('of', 'IN'), ('Iraqis', 'NNP'), (',', ','), ('expressed', 'VBD'),
('in', 'IN'), ('free', 'JJ'), ('elections', 'NNS'), ('.', '.')]
[('And', 'CC'), ('the', 'DT'), ('whole', 'JJ'), ('world', 'NN'), ('now', 'RB'), ('knows', 'VBZ'),
('that', 'IN'), ('a', 'DT'), ('small', 'JJ'), ('group', 'NN'), ('of', 'IN'), ('extremists', 'NNS'),
('will', 'MD'), ('not', 'RB'), ('overturn', 'VB'), ('the', 'DT'), ('will', 'MD'), ('of', 'IN'), ('th
e', 'DT'), ('Iraqi', 'NNP'), ('people', 'NNS'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('We', 'PRP'), ('will', 'MD'), ('succeed', 'VB'), ('in', 'IN'), ('Iraq', 'NNP'), ('because', 'IN'),
('Iraqis', 'NNP'), ('are', 'VBP'), ('determined', 'VBN'), ('to', 'TO'), ('fight', 'VB'), ('for', 'I
N'), ('their', 'PRP$'), ('own', 'JJ'), ('freedom', 'NN'), (',', ','), ('and', 'CC'), ('to', 'TO'),
('write', 'VB'), ('their', 'PRP$'), ('own', 'JJ'), ('history', 'NN'), ('.', '.')]
[('As', 'IN'), ('Prime', 'NNP'), ('Minister', 'NNP'), ('Allawi', 'NNP'), ('said', 'VBD'), ('in', 'I
N'), ('his', 'PRP$'), ('speech', 'NN'), ('to', 'TO'), ('Congress', 'NNP'), ('last', 'JJ'), ('Septemb
er', 'NNP'), (',', ','), ('``', '``'), ('Ordinary', 'JJ'), ('Iraqis', 'NNP'), ('are', 'VBP'), ('anxi
ous', 'JJ'), ('to', 'TO'), ('shoulder', 'VB'), ('all', 'PDT'), ('the', 'DT'), ('security', 'NN'),
('burdens', 'VBZ'), ('of', 'IN'), ('our', 'PRP$'), ('country', 'NN'), ('as', 'RB'), ('quickly', 'R
B'), ('as', 'IN'), ('possible', 'JJ'), ('.', '.'), ("''", "''")]
[('That', 'DT'), ('is', 'VBZ'), ('the', 'DT'), ('natural', 'JJ'), ('desire', 'NN'), ('of', 'IN'),
('an', 'DT'), ('independent', 'JJ'), ('nation', 'NN'), (',', ','), ('and', 'CC'), ('it', 'PRP'),
('is', 'VBZ'), ('also', 'RB'), ('the', 'DT'), ('stated', 'JJ'), ('mission', 'NN'), ('of', 'IN'),
('our', 'PRP$'), ('coalition', 'NN'), ('in', 'IN'), ('Iraq', 'NNP'), ('.', '.')]
[('The', 'DT'), ('new', 'JJ'), ('political', 'JJ'), ('situation', 'NN'), ('in', 'IN'), ('Iraq', 'NN
P'), ('opens', 'VBZ'), ('a', 'DT'), ('new', 'JJ'), ('phase', 'NN'), ('of', 'IN'), ('our', 'PRP$'),
('work', 'NN'), ('in', 'IN'), ('that', 'DT'), ('country', 'NN'), ('.', '.')]
[('At', 'IN'), ('the', 'DT'), ('recommendation', 'NN'), ('of', 'IN'), ('our', 'PRP$'), ('commander
s', 'NNS'), ('on', 'IN'), ('the', 'DT'), ('ground', 'NN'), (',', ','), ('and', 'CC'), ('in', 'IN'),
('consultation', 'NN'), ('with', 'IN'), ('the', 'DT'), ('Iraqi', 'NNP'), ('government', 'NN'),
(',', ','), ('we', 'PRP'), ('will', 'MD'), ('increasingly', 'RB'), ('focus', 'VB'), ('our', 'PRP
$'), ('efforts', 'NNS'), ('on', 'IN'), ('helping', 'VBG'), ('prepare', 'VB'), ('more', 'RBR'), ('cap
able', 'JJ'), ('Iraqi', 'NNP'), ('security', 'NN'), ('forces', 'NNS'), ('--', ':'), ('forces', 'NN
S'), ('with', 'IN'), ('skilled', 'JJ'), ('officers', 'NNS'), ('and', 'CC'), ('an', 'DT'), ('effectiv
e', 'JJ'), ('command', 'NN'), ('structure', 'NN'), ('.', '.')]
[('As', 'IN'), ('those', 'DT'), ('forces', 'NNS'), ('become', 'VBP'), ('more', 'JJR'), ('self-relian
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 17/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
t', 'JJ'), ('and', 'CC'), ('take', 'VB'), ('on', 'IN'), ('greater', 'JJR'), ('security', 'NN'), ('re
sponsibilities', 'NNS'), (',', ','), ('America', 'NNP'), ('and', 'CC'), ('its', 'PRP$'), ('coalitio
n', 'NN'), ('partners', 'NNS'), ('will', 'MD'), ('increasingly', 'RB'), ('be', 'VB'), ('in', 'IN'),
('a', 'DT'), ('supporting', 'JJ'), ('role', 'NN'), ('.', '.')]
[('In', 'IN'), ('the', 'DT'), ('end', 'NN'), (',', ','), ('Iraqis', 'NNP'), ('must', 'MD'), ('be',
'VB'), ('able', 'JJ'), ('to', 'TO'), ('defend', 'VB'), ('their', 'PRP$'), ('own', 'JJ'), ('countr
y', 'NN'), ('--', ':'), ('and', 'CC'), ('we', 'PRP'), ('will', 'MD'), ('help', 'VB'), ('that', 'D
T'), ('proud', 'NN'), (',', ','), ('new', 'JJ'), ('nation', 'NN'), ('secure', 'NN'), ('its', 'PRP
$'), ('liberty', 'NN'), ('.', '.')]
[('Recently', 'RB'), ('an', 'DT'), ('Iraqi', 'NNP'), ('interpreter', 'NN'), ('said', 'VBD'), ('to',
'TO'), ('a', 'DT'), ('reporter', 'NN'), (',', ','), ('``', '``'), ('Tell', 'NNP'), ('America', 'NN
P'), ('not', 'RB'), ('to', 'TO'), ('abandon', 'VB'), ('us', 'PRP'), ('.', '.'), ("''", "''")]
[('He', 'PRP'), ('and', 'CC'), ('all', 'DT'), ('Iraqis', 'NNP'), ('can', 'MD'), ('be', 'VB'), ('cert
ain', 'JJ'), (':', ':'), ('While', 'IN'), ('our', 'PRP$'), ('military', 'JJ'), ('strategy', 'NN'),
('is', 'VBZ'), ('adapting', 'VBG'), ('to', 'TO'), ('circumstances', 'NNS'), (',', ','), ('our', 'PR
P$'), ('commitment', 'NN'), ('remains', 'VBZ'), ('firm', 'JJ'), ('and', 'CC'), ('unchanging', 'JJ'),
('.', '.')]
[('We', 'PRP'), ('are', 'VBP'), ('standing', 'VBG'), ('for', 'IN'), ('the', 'DT'), ('freedom', 'N
N'), ('of', 'IN'), ('our', 'PRP$'), ('Iraqi', 'NNP'), ('friends', 'NNS'), (',', ','), ('and', 'CC'),
('freedom', 'NN'), ('in', 'IN'), ('Iraq', 'NNP'), ('will', 'MD'), ('make', 'VB'), ('America', 'NN
P'), ('safer', 'NN'), ('for', 'IN'), ('generations', 'NNS'), ('to', 'TO'), ('come', 'VB'), ('.',
'.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('We', 'PRP'), ('will', 'MD'), ('not', 'RB'), ('set', 'VB'), ('an', 'DT'), ('artificial', 'JJ'),
('timetable', 'NN'), ('for', 'IN'), ('leaving', 'VBG'), ('Iraq', 'NNP'), (',', ','), ('because', 'I
N'), ('that', 'DT'), ('would', 'MD'), ('embolden', 'VB'), ('the', 'DT'), ('terrorists', 'NNS'), ('an
d', 'CC'), ('make', 'VB'), ('them', 'PRP'), ('believe', 'VB'), ('they', 'PRP'), ('can', 'MD'), ('wai
t', 'VB'), ('us', 'PRP'), ('out', 'RP'), ('.', '.')]
[('We', 'PRP'), ('are', 'VBP'), ('in', 'IN'), ('Iraq', 'NNP'), ('to', 'TO'), ('achieve', 'VB'),
('a', 'DT'), ('result', 'NN'), (':', ':'), ('A', 'DT'), ('country', 'NN'), ('that', 'WDT'), ('is',
'VBZ'), ('democratic', 'JJ'), (',', ','), ('representative', 'NN'), ('of', 'IN'), ('all', 'PDT'),
('its', 'PRP$'), ('people', 'NNS'), (',', ','), ('at', 'IN'), ('peace', 'NN'), ('with', 'IN'), ('it
s', 'PRP$'), ('neighbors', 'NNS'), (',', ','), ('and', 'CC'), ('able', 'JJ'), ('to', 'TO'), ('defen
d', 'VB'), ('itself', 'PRP'), ('.', '.')]
[('And', 'CC'), ('when', 'WRB'), ('that', 'DT'), ('result', 'NN'), ('is', 'VBZ'), ('achieved', 'VB
N'), (',', ','), ('our', 'PRP$'), ('men', 'NNS'), ('and', 'CC'), ('women', 'NNS'), ('serving', 'VB
G'), ('in', 'IN'), ('Iraq', 'NNP'), ('will', 'MD'), ('return', 'VB'), ('home', 'NN'), ('with', 'I
N'), ('the', 'DT'), ('honor', 'NN'), ('they', 'PRP'), ('have', 'VBP'), ('earned', 'VBN'), ('.',
'.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('Right', 'RB'), ('now', 'RB'), (',', ','), ('Americans', 'NNPS'), ('in', 'IN'), ('uniform', 'NN'),
('are', 'VBP'), ('serving', 'VBG'), ('at', 'IN'), ('posts', 'NNS'), ('across', 'IN'), ('the', 'DT'),
('world', 'NN'), (',', ','), ('often', 'RB'), ('taking', 'VBG'), ('great', 'JJ'), ('risks', 'NNS'),
('on', 'IN'), ('my', 'PRP$'), ('orders', 'NNS'), ('.', '.')]
[('We', 'PRP'), ('have', 'VBP'), ('given', 'VBN'), ('them', 'PRP'), ('training', 'VBG'), ('and', 'C
C'), ('equipment', 'NN'), (';', ':'), ('and', 'CC'), ('they', 'PRP'), ('have', 'VBP'), ('given', 'VB
N'), ('us', 'PRP'), ('an', 'DT'), ('example', 'NN'), ('of', 'IN'), ('idealism', 'NN'), ('and', 'C
C'), ('character', 'NN'), ('that', 'WDT'), ('makes', 'VBZ'), ('every', 'DT'), ('American', 'JJ'),
('proud', 'NN'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('The', 'DT'), ('volunteers', 'NNS'), ('of', 'IN'), ('our', 'PRP$'), ('military', 'JJ'), ('are', 'V
BP'), ('unrelenting', 'VBG'), ('in', 'IN'), ('battle', 'NN'), (',', ','), ('unwavering', 'VBG'), ('i
n', 'IN'), ('loyalty', 'NN'), (',', ','), ('unmatched', 'VBN'), ('in', 'IN'), ('honor', 'NN'), ('an
d', 'CC'), ('decency', 'NN'), (',', ','), ('and', 'CC'), ('every', 'DT'), ('day', 'NN'), ('they', 'P
RP'), ("'re", 'VBP'), ('making', 'VBG'), ('our', 'PRP$'), ('nation', 'NN'), ('more', 'RBR'), ('secur
e', 'NN'), ('.', '.')]
[('Some', 'DT'), ('of', 'IN'), ('our', 'PRP$'), ('servicemen', 'NNS'), ('and', 'CC'), ('women', 'NN
S'), ('have', 'VBP'), ('survived', 'VBN'), ('terrible', 'JJ'), ('injuries', 'NNS'), (',', ','), ('an
d', 'CC'), ('this', 'DT'), ('grateful', 'JJ'), ('country', 'NN'), ('will', 'MD'), ('do', 'VB'), ('ev
erything', 'NN'), ('we', 'PRP'), ('can', 'MD'), ('to', 'TO'), ('help', 'VB'), ('them', 'PRP'), ('rec
over', 'VB'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('And', 'CC'), ('we', 'PRP'), ('have', 'VBP'), ('said', 'VBD'), ('farewell', 'NN'), ('to', 'TO'),
('some', 'DT'), ('very', 'RB'), ('good', 'JJ'), ('men', 'NNS'), ('and', 'CC'), ('women', 'NNS'),
(',', ','), ('who', 'WP'), ('died', 'VBD'), ('for', 'IN'), ('our', 'PRP$'), ('freedom', 'NN'),
(',', ','), ('and', 'CC'), ('whose', 'WP$'), ('memory', 'NN'), ('this', 'DT'), ('nation', 'NN'),
('will', 'MD'), ('honor', 'VB'), ('forever', 'RB'), ('.', '.')]
[('One', 'CD'), ('name', 'NN'), ('we', 'PRP'), ('honor', 'VBP'), ('is', 'VBZ'), ('Marine', 'NNP'),
('Corps', 'NNP'), ('Sergeant', 'NNP'), ('Byron', 'NNP'), ('Norwood', 'NNP'), ('of', 'IN'), ('Pfluge
rville', 'NNP'), (',', ','), ('Texas', 'NNP'), (',', ','), ('who', 'WP'), ('was', 'VBD'), ('killed',
'VBN'), ('during', 'IN'), ('the', 'DT'), ('assault', 'NN'), ('on', 'IN'), ('Fallujah', 'NNP'), ('.',
'.')]
[('His', 'PRP$'), ('mom', 'NN'), (',', ','), ('Janet', 'NNP'), (',', ','), ('sent', 'VBD'), ('me',
'PRP'), ('a', 'DT'), ('letter', 'NN'), ('and', 'CC'), ('told', 'VBD'), ('me', 'PRP'), ('how', 'WR
B'), ('much', 'JJ'), ('Byron', 'NNP'), ('loved', 'VBD'), ('being', 'VBG'), ('a', 'DT'), ('Marine',
'NNP'), (',', ','), ('and', 'CC'), ('how', 'WRB'), ('proud', 'JJ'), ('he', 'PRP'), ('was', 'VBD'),
('to', 'TO'), ('be', 'VB'), ('on', 'IN'), ('the', 'DT'), ('front', 'JJ'), ('line', 'NN'), ('agains
t', 'IN'), ('terror', 'NN'), ('.', '.')]
[('She', 'PRP'), ('wrote', 'VBD'), (',', ','), ('``', '``'), ('When', 'WRB'), ('Byron', 'NNP'), ('wa
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 18/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
s', 'VBD'), ('home', 'VBN'), ('the', 'DT'), ('last', 'JJ'), ('time', 'NN'), (',', ','), ('I', 'PR
P'), ('said', 'VBD'), ('that', 'IN'), ('I', 'PRP'), ('wanted', 'VBD'), ('to', 'TO'), ('protect', 'V
B'), ('him', 'PRP'), ('like', 'IN'), ('I', 'PRP'), ('had', 'VBD'), ('since', 'IN'), ('he', 'PRP'),
('was', 'VBD'), ('born', 'VBN'), ('.', '.')]
[('He', 'PRP'), ('just', 'RB'), ('hugged', 'VBD'), ('me', 'PRP'), ('and', 'CC'), ('said', 'VBD'),
(',', ','), ("'You", "''"), ("'ve", 'VBP'), ('done', 'VBN'), ('your', 'PRP$'), ('job', 'NN'), (',',
','), ('Mom', 'NNP'), ('.', '.')]
[('Now', 'RB'), ('it', 'PRP'), ('is', 'VBZ'), ('my', 'PRP$'), ('turn', 'NN'), ('to', 'TO'), ('protec
t', 'VB'), ('you', 'PRP'), ('.', '.'), ("'", "''"), ("''", "''")]
[('Ladies', 'NNS'), ('and', 'CC'), ('gentlemen', 'NNS'), (',', ','), ('with', 'IN'), ('grateful', 'J
J'), ('hearts', 'NNS'), (',', ','), ('we', 'PRP'), ('honor', 'VBP'), ('freedom', 'NN'), ("'s", 'PO
S'), ('defenders', 'NNS'), (',', ','), ('and', 'CC'), ('our', 'PRP$'), ('military', 'JJ'), ('familie
s', 'NNS'), (',', ','), ('represented', 'VBN'), ('here', 'RB'), ('this', 'DT'), ('evening', 'NN'),
('by', 'IN'), ('Sergeant', 'NNP'), ('Norwood', 'NNP'), ("'s", 'POS'), ('mom', 'NN'), ('and', 'CC'),
('dad', 'NN'), (',', ','), ('Janet', 'NNP'), ('and', 'CC'), ('Bill', 'NNP'), ('Norwood', 'NNP'),
('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('In', 'IN'), ('these', 'DT'), ('four', 'CD'), ('years', 'NNS'), (',', ','), ('Americans', 'NNPS'),
('have', 'VBP'), ('seen', 'VBN'), ('the', 'DT'), ('unfolding', 'NN'), ('of', 'IN'), ('large', 'JJ'),
('events', 'NNS'), ('.', '.')]
[('We', 'PRP'), ('have', 'VBP'), ('known', 'VBN'), ('times', 'NNS'), ('of', 'IN'), ('sorrow', 'NN'),
(',', ','), ('and', 'CC'), ('hours', 'NNS'), ('of', 'IN'), ('uncertainty', 'NN'), (',', ','), ('an
d', 'CC'), ('days', 'NNS'), ('of', 'IN'), ('victory', 'NN'), ('.', '.')]
[('In', 'IN'), ('all', 'PDT'), ('this', 'DT'), ('history', 'NN'), (',', ','), ('even', 'RB'), ('whe
n', 'WRB'), ('we', 'PRP'), ('have', 'VBP'), ('disagreed', 'VBN'), (',', ','), ('we', 'PRP'), ('hav
e', 'VBP'), ('seen', 'VBN'), ('threads', 'NNS'), ('of', 'IN'), ('purpose', 'NN'), ('that', 'IN'),
('unite', 'JJ'), ('us', 'PRP'), ('.', '.')]
[('The', 'DT'), ('attack', 'NN'), ('on', 'IN'), ('freedom', 'NN'), ('in', 'IN'), ('our', 'PRP$'),
('world', 'NN'), ('has', 'VBZ'), ('reaffirmed', 'VBN'), ('our', 'PRP$'), ('confidence', 'NN'), ('i
n', 'IN'), ('freedom', 'NN'), ("'s", 'POS'), ('power', 'NN'), ('to', 'TO'), ('change', 'VB'), ('th
e', 'DT'), ('world', 'NN'), ('.', '.')]
[('We', 'PRP'), ('are', 'VBP'), ('all', 'DT'), ('part', 'NN'), ('of', 'IN'), ('a', 'DT'), ('great',
'JJ'), ('venture', 'NN'), (':', ':'), ('To', 'TO'), ('extend', 'VB'), ('the', 'DT'), ('promise', 'N
N'), ('of', 'IN'), ('freedom', 'NN'), ('in', 'IN'), ('our', 'PRP$'), ('country', 'NN'), (',', ','),
('to', 'TO'), ('renew', 'VB'), ('the', 'DT'), ('values', 'NNS'), ('that', 'WDT'), ('sustain', 'VB
P'), ('our', 'PRP$'), ('liberty', 'NN'), (',', ','), ('and', 'CC'), ('to', 'TO'), ('spread', 'VB'),
('the', 'DT'), ('peace', 'NN'), ('that', 'WDT'), ('freedom', 'NN'), ('brings', 'NNS'), ('.', '.')]
[('As', 'IN'), ('Franklin', 'NNP'), ('Roosevelt', 'NNP'), ('once', 'RB'), ('reminded', 'VBD'), ('Ame
ricans', 'NNPS'), (',', ','), ('``', '``'), ('Each', 'DT'), ('age', 'NN'), ('is', 'VBZ'), ('a', 'D
T'), ('dream', 'NN'), ('that', 'WDT'), ('is', 'VBZ'), ('dying', 'VBG'), (',', ','), ('or', 'CC'),
('one', 'CD'), ('that', 'WDT'), ('is', 'VBZ'), ('coming', 'VBG'), ('to', 'TO'), ('birth', 'NN'),
('.', '.'), ("''", "''")]
[('And', 'CC'), ('we', 'PRP'), ('live', 'VBP'), ('in', 'IN'), ('the', 'DT'), ('country', 'NN'), ('wh
ere', 'WRB'), ('the', 'DT'), ('biggest', 'JJS'), ('dreams', 'NNS'), ('are', 'VBP'), ('born', 'VBN'),
('.', '.')]
[('The', 'DT'), ('abolition', 'NN'), ('of', 'IN'), ('slavery', 'NN'), ('was', 'VBD'), ('only', 'R
B'), ('a', 'DT'), ('dream', 'NN'), ('--', ':'), ('until', 'IN'), ('it', 'PRP'), ('was', 'VBD'), ('fu
lfilled', 'VBN'), ('.', '.')]
[('The', 'DT'), ('liberation', 'NN'), ('of', 'IN'), ('Europe', 'NNP'), ('from', 'IN'), ('fascism',
'NN'), ('was', 'VBD'), ('only', 'RB'), ('a', 'DT'), ('dream', 'NN'), ('--', ':'), ('until', 'IN'),
('it', 'PRP'), ('was', 'VBD'), ('achieved', 'VBN'), ('.', '.')]
[('The', 'DT'), ('fall', 'NN'), ('of', 'IN'), ('imperial', 'JJ'), ('communism', 'NN'), ('was', 'VB
D'), ('only', 'RB'), ('a', 'DT'), ('dream', 'NN'), ('--', ':'), ('until', 'IN'), (',', ','), ('one',
'CD'), ('day', 'NN'), (',', ','), ('it', 'PRP'), ('was', 'VBD'), ('accomplished', 'VBN'), ('.',
'.')]
[('Our', 'PRP$'), ('generation', 'NN'), ('has', 'VBZ'), ('dreams', 'NNS'), ('of', 'IN'), ('its', 'PR
P$'), ('own', 'JJ'), (',', ','), ('and', 'CC'), ('we', 'PRP'), ('also', 'RB'), ('go', 'VBP'), ('forw
ard', 'RB'), ('with', 'IN'), ('confidence', 'NN'), ('.', '.')]
[('The', 'DT'), ('road', 'NN'), ('of', 'IN'), ('Providence', 'NNP'), ('is', 'VBZ'), ('uneven', 'J
J'), ('and', 'CC'), ('unpredictable', 'JJ'), ('--', ':'), ('yet', 'RB'), ('we', 'PRP'), ('know', 'VB
P'), ('where', 'WRB'), ('it', 'PRP'), ('leads', 'VBZ'), (':', ':'), ('It', 'PRP'), ('leads', 'VBZ'),
('to', 'TO'), ('freedom', 'VB'), ('.', '.')]
[('Thank', 'NNP'), ('you', 'PRP'), (',', ','), ('and', 'CC'), ('may', 'MD'), ('God', 'NNP'), ('bles
s', 'NN'), ('America', 'NNP'), ('.', '.')]
[('(', '('), ('Applause', 'NNP'), ('.', '.'), (')', ')')]
[('END', 'NN'), ('10:03', 'CD'), ('P.M', 'NNP'), ('.', '.')]
[('EST', 'NN')]

POS tag list:

CC coordinating conjunction

CD cardinal digit

DT determiner

EX existential there (like: "there is" ... think of it like "there exists")

https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 19/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
FW foreign word

IN preposition/subordinating conjunction

JJ adjective 'big'

JJR adjective, comparative 'bigger'

JJS adjective, superlative 'biggest'

LS list marker 1)

MD modal could, will

NN noun, singular 'desk'

NNS noun plural 'desks'

NNP proper noun, singular 'Harrison'

NNPS proper noun, plural 'Americans'

PDT predeterminer 'all the kids'

POS possessive ending parent\'s

PRP personal pronoun I, he, she

PRP$ possessive pronoun my, his, hers

RB adverb very, silently,

RBR adverb, comparative better

RBS adverb, superlative best

RP particle give up

TO to go 'to' the store.

UH interjection errrrrrrrm

VB verb, base form take

VBD verb, past tense took

VBG verb, gerund/present participle taking

VBN verb, past participle taken

VBP verb, sing. present, non-3d take

VBZ verb, 3rd person sing. present takes

WDT wh-determiner which

WP wh-pronoun who, what

WP$ possessive wh-pronoun whose

WRB wh-abverb where, when

CHUNKING

One of the main goals of chunking is to group into what are known as "noun phrases." These are phrases of one or more words that contain
a noun, maybe some descriptive words, maybe a verb, and maybe something like an adverb. The idea is to group nouns with the words
that are in relation to them.

In order to chunk, we combine the part of speech tags with regular expressions. Mainly from regular expressions, we are going to utilize the
following:

+ = match 1 or more

? = match 0 or 1 repetitions.

https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 20/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-

* = match 0 or MORE repetitions

. = Any character except a new line

In [25]: train_text = state_union.raw("2006-GWBush.txt")


sample_text = state_union.raw("2005-GWBush.txt")

custom_sent_tokenizer = PunktSentenceTokenizer(train_text)

tokenized = custom_sent_tokenizer.tokenize(sample_text)

def process_content():
try:
for i in tokenized[:3]:
words = nltk.word_tokenize(i)
tagged = nltk.pos_tag(words)

chunkGram = r"""Chunk: {<RB.?>*<VB.?>*<NNP>+<NN>?}"""


chunkParser = nltk.RegexpParser(chunkGram)
chunked = chunkParser.parse(tagged)

print(chunked)
for subtree in chunked.subtrees(filter=lambda t: t.label() == 'Chunk'):
print(subtree)

chunked.draw()

except Exception as e:
print(str(e))

process_content()

(S
(Chunk PRESIDENT/NNP GEORGE/NNP W./NNP BUSH/NNP)
'S/POS
(Chunk ADDRESS/NNP)
BEFORE/IN
(Chunk A/NNP JOINT/NNP SESSION/NNP)
OF/IN
(Chunk THE/NNP CONGRESS/NNP ON/NNP THE/NNP STATE/NNP)
OF/IN
(Chunk THE/NNP UNION/NNP February/NNP)
2/CD
,/,
2005/CD
9:10/CD
(Chunk P.M/NNP)
./.)
(Chunk PRESIDENT/NNP GEORGE/NNP W./NNP BUSH/NNP)
(Chunk ADDRESS/NNP)
(Chunk A/NNP JOINT/NNP SESSION/NNP)
(Chunk THE/NNP CONGRESS/NNP ON/NNP THE/NNP STATE/NNP)
(Chunk THE/NNP UNION/NNP February/NNP)
(Chunk P.M/NNP)
(S
EST/IN
(Chunk THE/NNP PRESIDENT/NNP)
:/:
(Chunk Mr./NNP Speaker/NNP)
,/,
(Chunk Vice/NNP President/NNP Cheney/NNP)
,/,
members/NNS
of/IN
(Chunk Congress/NNP)
,/,
fellow/JJ
citizens/NNS
:/:
As/IN
a/DT
new/JJ
(Chunk Congress/NNP)
gathers/NNS
,/,
all/DT
of/IN
us/PRP
i /
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 21/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
in/IN
the/DT
elected/JJ
branches/NNS
of/IN
government/NN
share/NN
a/DT
great/JJ
privilege/NN
:/:
We/PRP
've/VBP
been/VBN
placed/VBN
in/IN
office/NN
by/IN
the/DT
votes/NNS
of/IN
the/DT
people/NNS
we/PRP
serve/VBP
./.)
(Chunk THE/NNP PRESIDENT/NNP)
(Chunk Mr./NNP Speaker/NNP)
(Chunk Vice/NNP President/NNP Cheney/NNP)
(Chunk Congress/NNP)
(Chunk Congress/NNP)
(S
And/CC
tonight/NN
that/WDT
is/VBZ
a/DT
privilege/NN
we/PRP
share/NN
with/IN
newly-elected/JJ
leaders/NNS
of/IN
(Chunk Afghanistan/NNP)
,/,
the/DT
Palestinian/JJ
(Chunk Territories/NNP)
,/,
(Chunk Ukraine/NNP)
,/,
and/CC
a/DT
free/JJ
and/CC
sovereign/JJ
(Chunk Iraq/NNP)
./.)
(Chunk Afghanistan/NNP)
(Chunk Territories/NNP)
(Chunk Ukraine/NNP)
(Chunk Iraq/NNP)

CHINKING

Chinking is a lot like chunking, it is basically a way for you to remove a chunk from a chunk. The chunk that you remove from your chunk is
your chink.

The code is very similar, you just denote the chink, after the chunk, with }{ instead of the chunk's {}.

In [6]: #train_text = state_union.raw("2005-GWBush.txt")


#sample_text = state_union.raw("2006-GWBush.txt")

#custom_sent_tokenizer = PunktSentenceTokenizer(train_text)

#tokenized custom sent tokenizer tokenize(sample text)


https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 22/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
#tokenized = custom_sent_tokenizer.tokenize(sample_text)

#def process_content():
# try:
# for i in tokenized[:5]:
# words = nltk.word_tokenize(i)
# tagged = nltk.pos_tag(words)

# chunkGram = r"""Chunk: {<.*>+}


# }<VB.?|IN|DT|TO>+{"""

# chunkParser = nltk.RegexpParser(chunkGram)
# chunked = chunkParser.parse(tagged)

# chunked.draw()

# except Exception as e:
# print(str(e))

#process_content()

NAMED ENTITY RECOGNITION

The idea is to have the machine immediately be able to pull out "entities" like people, places, things, locations, monetary figures, and more.

In [7]: import nltk


from nltk import sent_tokenize, word_tokenize
from nltk.corpus import state_union #state union adresses by various americaPunktSentenceTokenizern
presidents
from nltk.tokenize import PunktSentenceTokenizer

In [10]: train_text = state_union.raw("2006-GWBush.txt")


sample_text = state_union.raw("2005-GWBush.txt")

custom_sent_tokenizer = PunktSentenceTokenizer(train_text)

tokenized = custom_sent_tokenizer.tokenize(sample_text)

def process_content():
try:
for i in tokenized[:3]:
words = nltk.word_tokenize(i)
tagged = nltk.pos_tag(words)
namedEnt = nltk.ne_chunk(tagged, binary=False)
namedEnt.draw()
except Exception as e:
print(str(e))

process_content()

LAMMATIZING

Lammatizing is similar to stemming. The major difference between these is, as you saw earlier, stemming can often create non-existent
words, whereas lemmas are actual words.

In [52]: from nltk.stem import WordNetLemmatizer


lemmatizer = WordNetLemmatizer()

In [53]: print(lemmatizer.lemmatize("cats"))
print(lemmatizer.lemmatize("cacti"))
print(lemmatizer.lemmatize("geese"))
print(lemmatizer.lemmatize("rocks"))
print(lemmatizer.lemmatize("python"))

cat
cactus
goose
rock
python

In [56]: #(lemmatizer.lemmatize("better"))
print(lemmatizer lemmatize("worse" pos='a')) # a= adjective
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 23/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
print(lemmatizer.lemmatize( worse , pos= a )) # a= adjective
#print(lemmatizer.lemmatize("best", pos='a'))

bad

WORDNET

WordNet is a lexical database for the English language.

We can use WordNet alongside the NLTK module to find the meanings of words, synonyms, antonyms, and more. Let's cover some
examples.

In [1]: from nltk.corpus import wordnet

In [20]: syns = wordnet.synsets("good")


print(syns)

[Synset('good.n.01'), Synset('good.n.02'), Synset('good.n.03'), Synset('commodity.n.01'), Synset('go


od.a.01'), Synset('full.s.06'), Synset('good.a.03'), Synset('estimable.s.02'), Synset('beneficial.s.
01'), Synset('good.s.06'), Synset('good.s.07'), Synset('adept.s.01'), Synset('good.s.09'), Synset('d
ear.s.02'), Synset('dependable.s.04'), Synset('good.s.12'), Synset('good.s.13'), Synset('effective.
s.04'), Synset('good.s.15'), Synset('good.s.16'), Synset('good.s.17'), Synset('good.s.18'), Synset
('good.s.19'), Synset('good.s.20'), Synset('good.s.21'), Synset('well.r.01'), Synset('thoroughly.r.0
2')]

In [13]: print(syns[0].name())

good.n.01

In [14]: print(syns[0].lemmas()[0].name())

good

In [22]: print(syns[0].definition())

benefit

In [21]: print(syns[0].examples())

['for your own good', "what's the good of worrying?"]

We might be discern synonyms and antonyms to a word. The lemmas will be synonyms, and then we can use .antonyms to find the
antonyms to the lemmas. As such, we can populate some lists like

In [23]: synonyms = []

antonyms = []

for syn in wordnet.synsets("good"):


for l in syn.lemmas():
synonyms.append(l.name())
if l.antonyms():
antonyms.append(l.antonyms()[0].name())

print(set(synonyms))
print(set(antonyms))

{'serious', 'goodness', 'near', 'estimable', 'undecomposed', 'effective', 'upright', 'full', 'skillf


ul', 'thoroughly', 'ripe', 'proficient', 'salutary', 'good', 'commodity', 'in_force', 'honorable',
'unspoiled', 'just', 'in_effect', 'beneficial', 'secure', 'expert', 'well', 'dependable', 'trade_goo
d', 'honest', 'safe', 'adept', 'practiced', 'respectable', 'dear', 'unspoilt', 'soundly', 'sound',
'skilful', 'right'}
{'evilness', 'ill', 'evil', 'badness', 'bad'}

Next, we can also easily use WordNet to compare the similarity of two words and their tenses, by incorporating the Wu and Palmer method
for semantic related-ness.

Let's compare the noun of "ship" and "boat:"

In [24]: w1 = wordnet.synset('ship.n.01')
w2 = wordnet.synset('boat.n.01')
print(w1.wup_similarity(w2))

0.9090909090909091

In [27]: w1 = wordnet.synset('sheep.n.01')
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 24/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
[ ] y ( p )
w2 = wordnet.synset('dog.n.01')
print(w1.wup_similarity(w2))

0.7333333333333333

In [6]: #w1 = wordnet.synset('ship.n.01')


#w2 = wordnet.synset('cat.n.01')
#print(w1.wup_similarity(w2))

TEXT CLASSIFICATION

We're going to start by trying to use the movie reviews database that is part of the NLTK corpus. From there we'll try to use words as
"features" which are a part of either a positive or negative movie review. The NLTK corpus movie_reviews data set has the reviews, and
they are labeled already as positive or negative.

In [3]: import nltk


import random
from nltk.corpus import movie_reviews

In [4]: documents = [(list(movie_reviews.words(fileid)), category)


for category in movie_reviews.categories()
for fileid in movie_reviews.fileids(category)]

random.shuffle(documents)

print(documents[1])

all_words = []
for w in movie_reviews.words():
all_words.append(w.lower())

all_words = nltk.FreqDist(all_words)
print(all_words.most_common(15))
print(all_words["stupid"])

(['he', 'has', 'spent', 'his', 'entire', 'life', 'in', 'an', 'awful', 'little', 'apartment', ',', 'r
aised', 'and', 'cared', 'for', 'and', 'imprisoned', 'by', 'his', 'domineering', 'mother', '.', 'sh
e', 'inspires', 'his', 'love', 'and', 'his', 'fear', ',', 'and', 'instills', 'in', 'him', 'a', 'simi
lar', 'love', 'and', 'fear', 'of', 'jesus', '.', 'he', 'has', 'a', 'rudimentary', 'grasp', 'of', 'la
nguage', ',', 'mouthing', 'monosyllables', 'and', 'repetitions', 'of', 'his', 'mother', "'", 's', 'p
hrases', '.', 'he', 'is', 'taught', 'that', 'the', 'world', 'outside', 'is', 'fatally', 'poisonous',
';', 'his', 'mother', 'dons', 'a', 'gasmask', 'whenever', 'she', 'goes', 'out', 'the', 'door', '.',
'he', 'is', '35', '-', 'years', '-', 'old', 'in', 'body', ',', 'but', 'a', 'child', 'in', 'mind', 'a
nd', 'spirit', '.', 'he', 'is', 'the', 'premise', 'for', 'bad', 'boy', 'bubby', ',', 'a', 'defiantl
y', 'original', 'australian', 'movie', 'about', 'a', 'man', 'called', 'bubby', '(', 'nicholas', 'hop
e', ')', 'who', 'has', 'spent', 'his', 'entire', 'life', 'in', 'an', 'awful', 'little', 'apartment',
',', 'etc', '.', ',', 'etc', '.', 'then', 'one', 'day', 'his', 'father', '(', 'ralph', 'cotterill',
')', 'appears', '.', 'his', 'father', 'is', 'a', 'shabby', 'down', '-', 'at', '-', 'heels', 'pries
t', 'who', 'appears', 'to', 'have', 'permanently', 'misplaced', 'his', 'religion', '.', 'unsurprisin
gly', ',', 'he', 'is', 'not', 'thrilled', 'with', 'the', 'way', '"', 'his', '"', 'boy', 'has', 'turn
ed', 'out', '.', 'he', 'is', ',', 'however', ',', 'rather', 'pleased', 'at', 'renewing', 'his', 'acq
uaintance', 'with', 'the', 'mother', '(', 'claire', 'benito', ')', ',', 'and', ',', 'more', 'to', 't
he', 'point', ',', 'her', 'ample', 'breasts', '.', 'soon', 'they', 'are', 'copulating', 'on', 'the',
'dingy', 'couch', ',', 'while', 'bubby', 'crouches', ',', 'confused', ',', 'in', 'the', 'next', 'roo
m', ',', 'acutely', 'aware', 'that', 'the', 'mother', 'who', 'had', 'devoted', 'all', 'her', 'attent
ion', 'to', 'him', 'has', 'a', 'new', 'interest', '.', 'bubby', "'", 's', 'relationship', 'to', 'th
e', 'world', 'may', 'be', 'warped', ',', 'but', 'it', 'is', 'at', 'least', 'stable', '.', 'the', 'fa
ther', "'", 's', 'arrival', 'disturbs', 'his', 'precarious', 'balance', ',', 'causing', 'an', 'oedip
al', 'conflict', 'which', 'ends', '--', 'freud', 'would', 'be', 'pleased', '--', 'in', 'violence',
'and', ',', 'as', 'a', 'result', ',', 'freedom', '.', 'bubby', 'intuits', 'from', 'his', 'father',
"'", 's', 'arrival', 'that', 'the', 'air', 'outside', 'is', 'breathable', ':', 'he', 'leaves', 'th
e', 'apartment', ',', 'his', 'past', ',', 'his', 'world', ',', 'behind', '.', 'so', 'far', ',', 's
o', 'good', '.', 'the', 'first', 'thirty', 'minutes', 'or', 'so', 'of', 'bad', 'boy', 'bubby', ',',
'which', 'bring', 'us', 'to', 'this', 'point', ',', 'are', 'quite', 'brilliant', '.', 'the', 'movi
e', 'is', 'at', 'its', 'best', 'when', 'its', 'stays', 'within', 'the', 'constraints', 'of', 'bubb
y', "'", 's', 'hermetic', 'two', '-', 'room', 'universe', '.', 'it', 'follows', 'through', 'unrelent
ingly', 'on', 'the', 'implications', 'of', 'its', 'premise', ':', 'bubby', 'is', 'used', 'by', 'hi
s', 'mother', 'for', 'sex', ',', 'he', 'unwittingly', 'suffocates', 'the', 'pet', 'cat', 'with', 'ce
llophane', ',', 'he', 'is', 'terrifed', 'by', 'the', 'notion', 'that', 'jesus', 'will', 'beat', 'hi
m', 'senseless', 'if', 'he', 'sins', '.', 'it', 'is', 'grim', 'and', 'savage', 'and', 'appalling',
',', 'but', 'also', 'strangely', 'tender', '--', 'de', 'heer', ',', 'having', 'imagined', 'a', 'lif
e', 'as', 'bizarre', 'as', 'bubby', "'", 's', ',', 'does', 'not', 'exaggerate', 'for', 'comic', 'o
r', 'grotesqe', 'purposes', ',', 'but', 'simply', 'empathizes', '.', 'he', 'observes', 'what', 'it',
'might', 'be', 'like', '.', 'the', 'intensity', 'of', 'these', 'opening', 'scenes', ',', 'with', 'th
eir', 'minimalist', 'mise', '-', 'en', '-', 'scene', ',', 'immerses', 'us', 'in', 'a', 'claustrophob
ic' 'environment' 'which' 'seems' 'to' 'be' 'a' 'decayed' 'stratum' 'of' 'our' 'own' 'wo
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 25/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
ic , environment , which , seems , to , be , a , decayed , stratum , of , our , own , wo
rld', ',', 'and', 'owes', 'much', 'to', 'david', 'lynch', "'", 's', 'eraserhead', ',', 'not', 'leas
t', 'the', 'ambient', 'industrial', 'white', 'noise', 'of', 'the', 'soundtrack', '.', 'for', 'thirt
y', 'minutes', ',', 'the', 'movie', 'maintains', 'the', 'feel', 'and', 'mood', 'of', 'a', 'reality',
'that', 'does', 'not', 'seem', 'far', 'removed', 'from', 'our', 'own', '.', 'then', 'de', 'heer', 'l
ets', 'bubby', 'out', ',', 'brings', 'him', 'into', 'contact', 'with', 'our', 'world', ',', 'and',
'the', 'film', 'never', 'quite', 'recovers', '.', 'our', 'unlikely', 'hero', 'finds', 'himself', 'i
n', 'port', 'adelaide', ',', 'where', 'he', 'wanders', 'the', 'streets', 'and', 'meets', 'people',
',', 'where', 'he', 'suffers', 'and', 'learns', 'and', 'survives', '.', 'he', 'is', 'seduced', 'by',
'a', 'young', 'woman', 'from', 'a', 'salvation', 'army', 'band', '(', 'how', 'an', 'anti', '-', 'soc
ial', 'half', '-', 'wit', 'with', 'no', 'sense', 'of', 'hygiene', 'manages', 'to', 'get', 'laid', 'm
ere', 'hours', 'after', 'his', 'escape', 'is', 'not', 'the', 'sort', 'of', 'question', 'the', 'fil
m', 'encourages', ',', 'wisely', ')', ';', 'he', 'is', 'given', 'free', 'pizza', 'by', 'a', 'sympath
etic', 'waitress', ';', 'he', 'insults', 'a', 'traffic', 'cop', 'and', 'is', 'punched', 'in', 'the',
'stomach', ';', 'he', 'shares', 'a', 'few', 'beers', 'in', 'the', 'back', 'of', 'a', 'truck', 'wit
h', 'a', 'rock', 'group', ';', 'he', 'is', 'imprisoned', 'and', 'raped', ';', 'he', 'becomes', 'a',
'translator', 'for', 'mentally', 'handicapped', 'people', 'whose', 'speech', 'is', 'impaired', 'beyo
nd', 'comprehension', ';', 'he', 'is', 'loved', 'by', 'a', 'motherly', 'large', '-', 'breasted', 'nu
rse', '(', 'carmel', 'johnson', ')', '.', '.', '.', 'it', 'goes', 'on', ',', 'by', 'turns', 'inventi
ve', ',', 'silly', ',', 'tasteless', ',', 'endearing', ',', 'and', 'sometimes', 'all', 'of', 'thes
e', 'things', 'at', 'once', '.', 'de', 'heer', 'never', 'seems', 'to', 'be', 'sure', 'how', 'bubby',
'should', 'interface', 'with', 'the', 'real', 'world', ':', 'the', 'tone', 'shifts', ',', 'uneasil
y', ',', 'from', 'fable', 'to', 'realism', 'to', 'satire', 'and', 'back', 'again', '.', 'the', 'scen
es', 'which', 'try', 'to', 'touch', 'base', 'with', 'a', 'believable', 'version', 'of', 'reality',
'are', 'the', 'weakest', ';', 'the', 'film', 'is', 'best', 'understood', 'as', 'a', 'kind', 'of', 'p
arable', ',', 'and', ',', 'indeed', ',', 'the', 'religious', 'implications', 'of', 'bubby', "'",
's', 'experiences', 'are', 'foregrounded', ':', 'icons', 'of', 'jesus', 'on', 'the', 'cross', 'han
g', 'from', 'the', 'mother', "'", 's', 'walls', ',', 'bubby', 'dons', 'a', 'priest', "'", 's', 'coll
ar', 'stolen', 'from', 'his', 'father', ',', 'a', 'church', 'organ', '-', 'playing', 'atheist', 'lec
tures', 'him', 'on', 'the', 'necessity', 'of', 'unbelief', ',', 'the', 'woman', 'who', 'redeems', 'h
im', 'is', 'named', 'angel', '.', 'the', 'manifold', 'stresses', 'of', 'our', 'world', 'do', 'not',
'shatter', 'bubby', "'", 's', 'mind', ',', 'do', 'not', 'fragment', 'him', 'into', 'psychosis', ';',
'rather', ',', 'the', 'world', 'accomodates', 'him', ',', 'and', 'heals', 'him', '.', 'although', 'd
e', 'heer', "'", 's', 'touch', 'is', 'at', 'times', 'overbearing', ',', 'bubby', "'", 's', 'salvatio
n', 'is', 'touching', ';', 'what', 'seemd', 'at', 'first', 'a', 'harsh', 'lesson', 'in', 'the', 'dam
aging', 'effects', 'of', 'the', 'social', 'construction', 'of', 'reality', 'becomes', 'a', 'na',
'?', 've', 'humanist', 'tale', 'of', 'improbable', 'hope', '.', 'a', 'hapless', 'rock', 'group', 'wr
ite', 'a', 'song', 'about', 'bubby', 'and', 'sing', 'it', 'for', 'him', 'and', 'so', 'give', 'him',
'the', 'gift', 'of', 'community', '.', 'he', 'returns', 'the', 'favour', 'when', 'he', 'steps', 'o
n', 'stage', 'one', 'night', 'and', 'becomes', 'their', 'frontman', ',', 'turning', 'the', 'fragment
ed', 'impressions', 'of', 'his', 'experiences', 'into', 'performance', 'art', ',', 'and', 'turning',
'the', 'band', 'into', 'a', 'popular', 'draw', '.', 'innocence', 'triumphs', '.', 'bubby', 'become
s', 'a', 'holy', 'fool', ',', 'an', 'idiot', 'savant', ',', 'and', 'graces', 'us', 'with', 'wisdom',
'.', 'it', "'", 's', 'a', 'strange', 'turn', 'of', 'events', ',', 'but', 'by', 'now', 'we', 'should
n', "'", 't', 'be', 'surprised', ',', 'because', 'bad', 'boy', 'bubby', 'ain', "'", 't', 'like', 'ot
her', 'movies', '.'], 'pos')
[(',', 77717), ('the', 76529), ('.', 65876), ('a', 38106), ('and', 35576), ('of', 34123), ('to', 319
37), ("'", 30585), ('is', 25195), ('in', 21822), ('s', 18513), ('"', 17612), ('it', 16107), ('that',
15924), ('-', 15595)]
253

In [5]: all_words = nltk.FreqDist(all_words)


#print(all_words.most_common(15))
print(all_words["python"])

15

Words as Feature for Learning

We're going to be building and compiling feature lists of words from positive reviews and words from the negative reviews to hopefully see
trends in specific types of words in positive or negative reviews.

In [6]: import nltk


import random
from nltk.corpus import movie_reviews

In [7]: documents = [(list(movie_reviews.words(fileid)), category)


for category in movie_reviews.categories()
for fileid in movie_reviews.fileids(category)]

random.shuffle(documents)

all_words = []

for w in movie_reviews.words():
all_words.append(w.lower())

https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 26/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-

all_words = nltk.FreqDist(all_words)

word_features = list(all_words.keys())[:2500]

In [8]: def find_features(document):


words = set(document)
features = {}
for w in word_features:
features[w] = (w in words)

return features

In [9]: print((find_features(movie_reviews.words('neg/cv000_29416.txt'))))

{'plot': True, ':': True, 'two': True, 'teen': True, 'couples': True, 'go': True, 'to': True, 'a': T
rue, 'church': True, 'party': True, ',': True, 'drink': True, 'and': True, 'then': True, 'drive': Tr
ue, '.': True, 'they': True, 'get': True, 'into': True, 'an': True, 'accident': True, 'one': True,
'of': True, 'the': True, 'guys': True, 'dies': True, 'but': True, 'his': True, 'girlfriend': True,
'continues': True, 'see': True, 'him': True, 'in': True, 'her': True, 'life': True, 'has': True, 'ni
ghtmares': True, 'what': True, "'": True, 's': True, 'deal': True, '?': True, 'watch': True, 'movi
e': True, '"': True, 'sorta': True, 'find': True, 'out': True, 'critique': True, 'mind': True, '-':
True, 'fuck': True, 'for': True, 'generation': True, 'that': True, 'touches': True, 'on': True, 'ver
y': True, 'cool': True, 'idea': True, 'presents': True, 'it': True, 'bad': True, 'package': True, 'w
hich': True, 'is': True, 'makes': True, 'this': True, 'review': True, 'even': True, 'harder': True,
'write': True, 'since': True, 'i': True, 'generally': True, 'applaud': True, 'films': True, 'attemp
t': True, 'break': True, 'mold': True, 'mess': True, 'with': True, 'your': True, 'head': True, 'suc
h': True, '(': True, 'lost': True, 'highway': True, '&': True, 'memento': True, ')': True, 'there':
True, 'are': True, 'good': True, 'ways': True, 'making': True, 'all': True, 'types': True, 'these':
True, 'folks': True, 'just': True, 'didn': True, 't': True, 'snag': True, 'correctly': True, 'seem':
True, 'have': True, 'taken': True, 'pretty': True, 'neat': True, 'concept': True, 'executed': True,
'terribly': True, 'so': True, 'problems': True, 'well': True, 'its': True, 'main': True, 'problem':
True, 'simply': True, 'too': True, 'jumbled': True, 'starts': True, 'off': True, 'normal': True, 'do
wnshifts': True, 'fantasy': True, 'world': True, 'you': True, 'as': True, 'audience': True, 'membe
r': True, 'no': True, 'going': True, 'dreams': True, 'characters': True, 'coming': True, 'back': Tru
e, 'from': True, 'dead': True, 'others': True, 'who': True, 'look': True, 'like': True, 'strange': T
rue, 'apparitions': True, 'disappearances': True, 'looooot': True, 'chase': True, 'scenes': True, 't
ons': True, 'weird': True, 'things': True, 'happen': True, 'most': True, 'not': True, 'explained': T
rue, 'now': True, 'personally': True, 'don': True, 'trying': True, 'unravel': True, 'film': True, 'e
very': True, 'when': True, 'does': True, 'give': True, 'me': True, 'same': True, 'clue': True, 'ove
r': True, 'again': True, 'kind': True, 'fed': True, 'up': True, 'after': True, 'while': True, 'bigge
st': True, 'obviously': True, 'got': True, 'big': True, 'secret': True, 'hide': True, 'seems': True,
'want': True, 'completely': True, 'until': True, 'final': True, 'five': True, 'minutes': True, 'do':
True, 'make': True, 'entertaining': True, 'thrilling': True, 'or': True, 'engaging': True, 'meantim
e': True, 'really': True, 'sad': True, 'part': True, 'arrow': True, 'both': True, 'dig': True, 'flic
ks': True, 'we': True, 'actually': True, 'figured': True, 'by': True, 'half': True, 'way': True, 'po
int': True, 'strangeness': True, 'did': True, 'start': True, 'little': True, 'bit': True, 'sense': T
rue, 'still': True, 'more': True, 'guess': True, 'bottom': True, 'line': True, 'movies': True, 'shou
ld': True, 'always': True, 'sure': True, 'before': True, 'given': True, 'password': True, 'enter': T
rue, 'understanding': True, 'mean': True, 'showing': True, 'melissa': True, 'sagemiller': True, 'run
ning': True, 'away': True, 'visions': True, 'about': True, '20': True, 'throughout': True, 'plain':
True, 'lazy': True, '!': True, 'okay': True, 'people': True, 'chasing': True, 'know': True, 'need':
True, 'how': True, 'giving': True, 'us': True, 'different': True, 'offering': True, 'further': True,
'insight': True, 'down': True, 'apparently': True, 'studio': True, 'took': True, 'director': True,
'chopped': True, 'themselves': True, 'shows': True, 'might': True, 've': True, 'been': True, 'decen
t': True, 'here': True, 'somewhere': True, 'suits': True, 'decided': True, 'turning': True, 'music':
True, 'video': True, 'edge': True, 'would': True, 'actors': True, 'although': True, 'wes': True, 'be
ntley': True, 'seemed': True, 'be': True, 'playing': True, 'exact': True, 'character': True, 'he': T
rue, 'american': True, 'beauty': True, 'only': True, 'new': True, 'neighborhood': True, 'my': True,
'kudos': True, 'holds': True, 'own': True, 'entire': True, 'feeling': True, 'unraveling': True, 'ove
rall': True, 'doesn': True, 'stick': True, 'because': True, 'entertain': True, 'confusing': True, 'r
arely': True, 'excites': True, 'feels': True, 'redundant': True, 'runtime': True, 'despite': True,
'ending': True, 'explanation': True, 'craziness': True, 'came': True, 'oh': True, 'horror': True, 's
lasher': True, 'flick': True, 'packaged': True, 'someone': True, 'assuming': True, 'genre': True, 'h
ot': True, 'kids': True, 'also': True, 'wrapped': True, 'production': True, 'years': True, 'ago': Tr
ue, 'sitting': True, 'shelves': True, 'ever': True, 'whatever': True, 'skip': True, 'where': True,
'joblo': True, 'nightmare': True, 'elm': True, 'street': True, '3': True, '7': True, '/': True, '1
0': True, 'blair': True, 'witch': True, '2': True, 'crow': True, '9': True, 'salvation': True, '4':
True, 'stir': True, 'echoes': True, '8': True, 'happy': False, 'bastard': False, 'quick': False, 'da
mn': False, 'y2k': False, 'bug': False, 'starring': False, 'jamie': False, 'lee': False, 'curtis': F
alse, 'another': False, 'baldwin': False, 'brother': False, 'william': False, 'time': False, 'stor
y': False, 'regarding': False, 'crew': False, 'tugboat': False, 'comes': False, 'across': False, 'de
serted': False, 'russian': False, 'tech': False, 'ship': False, 'kick': False, 'power': False, 'with
in': False, 'gore': False, 'bringing': False, 'few': False, 'action': False, 'sequences': False, 'vi
rus': False, 'empty': False, 'flash': False, 'substance': False, 'why': False, 'was': False, 'middl
e': False, 'nowhere': False, 'origin': False, 'pink': False, 'flashy': False, 'thing': False, 'hit':
False, 'mir': False, 'course': False, 'donald': False, 'sutherland': False, 'stumbling': False, 'aro
und': False, 'drunkenly': False, 'hey': False, 'let': False, 'some': False, 'robots': False, 'actin
g': False 'below': False 'average': False 'likes': False 're': False 'likely': False 'work': F
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 27/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
g : False, below : False, average : False, likes : False, re : False, likely : False, work : F
alse, 'halloween': False, 'h20': False, 'wasted': False, 'real': False, 'star': False, 'stan': Fals
e, 'winston': False, 'robot': False, 'design': False, 'schnazzy': False, 'cgi': False, 'occasional':
False, 'shot': False, 'picking': False, 'brain': False, 'if': False, 'body': False, 'parts': False,
'turn': False, 'otherwise': False, 'much': False, 'sunken': False, 'jaded': False, 'viewer': False,
'thankful': False, 'invention': False, 'timex': False, 'indiglo': False, 'based': False, 'late': Fal
se, '1960': False, 'television': False, 'show': False, 'name': False, 'mod': False, 'squad': False,
'tells': False, 'tale': False, 'three': False, 'reformed': False, 'criminals': False, 'under': Fals
e, 'employ': False, 'police': False, 'undercover': False, 'however': False, 'wrong': False, 'evidenc
e': False, 'gets': False, 'stolen': False, 'immediately': False, 'suspicion': False, 'ads': False,
'cuts': False, 'claire': False, 'dane': False, 'nice': False, 'hair': False, 'cute': False, 'outfit
s': False, 'car': False, 'chases': False, 'stuff': False, 'blowing': False, 'sounds': False, 'firs
t': False, 'fifteen': False, 'quickly': False, 'becomes': False, 'apparent': False, 'certainly': Fal
se, 'slick': False, 'looking': False, 'complete': False, 'costumes': False, 'isn': False, 'enough':
False, 'best': False, 'described': False, 'cross': False, 'between': False, 'hour': False, 'long': F
alse, 'cop': False, 'stretched': False, 'span': False, 'single': False, 'clich': False, 'matter': Fa
lse, 'elements': False, 'recycled': False, 'everything': False, 'already': False, 'seen': False, 'no
thing': False, 'spectacular': False, 'sometimes': False, 'bordering': False, 'wooden': False, 'dane
s': False, 'omar': False, 'epps': False, 'deliver': False, 'their': False, 'lines': False, 'bored':
False, 'transfers': False, 'onto': False, 'escape': False, 'relatively': False, 'unscathed': False,
'giovanni': False, 'ribisi': False, 'plays': False, 'resident': False, 'crazy': False, 'man': False,
'ultimately': False, 'being': False, 'worth': False, 'watching': False, 'unfortunately': False, 'sav
e': False, 'convoluted': False, 'apart': False, 'occupying': False, 'screen': False, 'young': False,
'cast': False, 'clothes': False, 'hip': False, 'soundtrack': False, 'appears': False, 'geared': Fals
e, 'towards': False, 'teenage': False, 'mindset': False, 'r': False, 'rating': False, 'content': Fal
se, 'justify': False, 'juvenile': False, 'older': False, 'information': False, 'literally': False,
'spoon': False, 'hard': False, 'instead': False, 'telling': False, 'dialogue': False, 'poorly': Fals
e, 'written': False, 'extremely': False, 'predictable': False, 'progresses': False, 'won': False, 'c
are': False, 'heroes': False, 'any': False, 'jeopardy': False, 'll': False, 'aren': False, 'basing':
False, 'nobody': False, 'remembers': False, 'questionable': False, 'wisdom': False, 'especially': Fa
lse, 'considers': False, 'target': False, 'fact': False, 'number': False, 'memorable': False, 'can':
False, 'counted': False, 'hand': False, 'missing': False, 'finger': False, 'times': False, 'checke
d': False, 'six': False, 'clear': False, 'indication': False, 'them': False, 'than': False, 'cash':
False, 'spending': False, 'dollar': False, 'judging': False, 'rash': False, 'awful': False, 'seein
g': False, 'avoid': False, 'at': False, 'costs': False, 'quest': False, 'camelot': False, 'warner':
False, 'bros': False, 'feature': False, 'length': False, 'fully': False, 'animated': False, 'steal':
False, 'clout': False, 'disney': False, 'cartoon': False, 'empire': False, 'mouse': False, 'reason':
False, 'worried': False, 'other': False, 'recent': False, 'challenger': False, 'throne': False, 'las
t': False, 'fall': False, 'promising': False, 'flawed': False, '20th': False, 'century': False, 'fo
x': False, 'anastasia': False, 'hercules': False, 'lively': False, 'colorful': False, 'palate': Fals
e, 'had': False, 'beat': False, 'hands': False, 'crown': False, '1997': False, 'piece': False, 'anim
ation': False, 'year': False, 'contest': False, 'arrival': False, 'magic': False, 'kingdom': False,
'mediocre': False, '--': False, 'd': False, 'pocahontas': False, 'those': False, 'keeping': False,
'score': False, 'nearly': False, 'dull': False, 'revolves': False, 'adventures': False, 'free': Fals
e, 'spirited': False, 'kayley': False, 'voiced': False, 'jessalyn': False, 'gilsig': False, 'early':
False, 'daughter': False, 'belated': False, 'knight': False, 'king': False, 'arthur': False, 'roun
d': False, 'table': False, 'dream': False, 'follow': False, 'father': False, 'footsteps': False, 'sh
e': False, 'chance': False, 'evil': False, 'warlord': False, 'ruber': False, 'gary': False, 'oldma
n': False, 'ex': False, 'gone': False, 'steals': False, 'magical': False, 'sword': False, 'excalibu
r': False, 'accidentally': False, 'loses': False, 'dangerous': False, 'booby': False, 'trapped': Fal
se, 'forest': False, 'help': False, 'hunky': False, 'blind': False, 'timberland': False, 'dweller':
False, 'garrett': False, 'carey': False, 'elwes': False, 'headed': False, 'dragon': False, 'eric': F
alse, 'idle': False, 'rickles': False, 'arguing': False, 'itself': False, 'able': False, 'medieval':
False, 'sexist': False, 'prove': False, 'fighter': False, 'side': False, 'pure': False, 'showmanshi
p': False, 'essential': False, 'element': False, 'expected': False, 'climb': False, 'high': False,
'ranks': False, 'differentiates': False, 'something': False, 'saturday': False, 'morning': False, 's
ubpar': False, 'instantly': False, 'forgettable': False, 'songs': False, 'integrated': False, 'compu
terized': False, 'footage': False, 'compare': False, 'run': False, 'angry': False, 'ogre': False, 'h
erc': False, 'battle': False, 'hydra': False, 'rest': False, 'case': False, 'stink': False, 'none':
False, 'remotely': False, 'interesting': False, 'race': False, 'bland': False, 'end': False, 'tie':
False, 'win': False, 'comedy': False, 'shtick': False, 'awfully': False, 'cloying': False, 'least':
False, 'signs': False, 'pulse': False, 'fans': False, "-'": False, '90s': False, 'tgif': False, 'wil
l': False, 'thrilled': False, 'jaleel': False, 'urkel': False, 'white': False, 'bronson': False, 'ba
lki': False, 'pinchot': False, 'sharing': False, 'nicely': False, 'realized': False, 'though': Fals
e, 'm': False, 'loss': False, 'recall': False, 'specific': False, 'providing': False, 'voice': Fals
e, 'talent': False, 'enthusiastic': False, 'paired': False, 'singers': False, 'sound': False, 'music
al': False, 'moments': False, 'jane': False, 'seymour': False, 'celine': False, 'dion': False, 'mus
t': False, 'strain': False, 'through': False, 'aside': False, 'children': False, 'probably': False,
'adults': False, 'grievous': False, 'error': False, 'lack': False, 'personality': False, 'learn': Fa
lse, 'goes': False, 'synopsis': False, 'mentally': False, 'unstable': False, 'undergoing': False, 'p
sychotherapy': False, 'saves': False, 'boy': False, 'potentially': False, 'fatal': False, 'falls': F
alse, 'love': False, 'mother': False, 'fledgling': False, 'restauranteur': False, 'unsuccessfully':
False, 'attempting': False, 'gain': False, 'woman': False, 'favor': False, 'takes': False, 'picture
s': False, 'kills': False, 'comments': False, 'stalked': False, 'yet': False, 'seemingly': False, 'e
ndless': False, 'string': False, 'spurned': False, 'psychos': False, 'getting': False, 'revenge': Fa
lse, 'type': False, 'stable': False, 'category': False, '1990s': False, 'industry': False, 'theatric
al': False, 'direct': False, 'proliferation': False, 'may': False, 'due': False, 'typically': False,
'inexpensive': False, 'produce': False, 'special': False, 'effects': False, 'stars': False, 'serve':
False, 'vehicles': False, 'nudity': False, 'allowing': False, 'frequent': False, 'night': False, 'ca
bl ' F l ' ' F l ' li htl ' F l ' ' F l ' t' F l ' h ' F l
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 28/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
ble': False, 'wavers': False, 'slightly': False, 'norm': False, 'respect': False, 'psycho': False,
'never': False, 'affair': False, ';': False, 'contrary': False, 'rejected': False, 'rather': False,
'lover': False, 'wife': False, 'husband': False, 'entry': False, 'doomed': False, 'collect': False,
'dust': False, 'viewed': False, 'midnight': False, 'provide': False, 'suspense': False, 'sets': Fals
e, 'interspersed': False, 'opening': False, 'credits': False, 'instance': False, 'serious': False,
'sounding': False, 'narrator': False, 'spouts': False, 'statistics': False, 'stalkers': False, 'pond
ers': False, 'cause': False, 'stalk': False, 'implicitly': False, 'implied': False, 'men': False, 's
hown': False, 'snapshot': False, 'actor': False, 'jay': False, 'underwood': False, 'states': False,
'daryl': False, 'gleason': False, 'stalker': False, 'brooke': False, 'daniels': False, 'meant': Fals
e, 'called': False, 'guesswork': False, 'required': False, 'proceeds': False, 'begins': False, 'obvi
ous': False, 'sequence': False, 'contrived': False, 'quite': False, 'brings': False, 'victim': Fals
e, 'together': False, 'obsesses': False, 'follows': False, 'tries': False, 'woo': False, 'plans': Fa
lse, 'become': False, 'desperate': False, 'elaborate': False, 'include': False, 'cliche': False, 'mu
rdered': False, 'pet': False, 'require': False, 'found': False, 'exception': False, 'cat': False, 's
hower': False, 'events': False, 'lead': False, 'inevitable': False, 'showdown': False, 'survives': F
alse, 'invariably': False, 'conclusion': False, 'turkey': False, 'uniformly': False, 'adequate': Fal
se, 'anything': False, 'home': False, 'either': False, 'turns': False, 'toward': False, 'melodrama':
False, 'overdoes': False, 'words': False, 'manages': False, 'creepy': False, 'pass': False, 'demand
s': False, 'maryam': False, 'abo': False, 'close': False, 'played': False, 'bond': False, 'chick': F
alse, 'living': False, 'daylights': False, 'equally': False, 'title': False, 'ditzy': False, 'stron
g': False, 'independent': False, 'business': False, 'owner': False, 'needs': False, 'proceed': Fals
e, 'example': False, 'suspicions': False, 'ensure': False, 'use': False, 'excuse': False, 'decides':
False, 'return': False, 'toolbox': False, 'left': False, 'place': False, 'house': False, 'leave': Fa
lse, 'door': False, 'answers': False, 'opens': False, 'wanders': False, 'returns': False, 'enters':
False, 'our': False, 'heroine': False, 'danger': False, 'somehow': False, 'parked': False, 'front':
False, 'right': False, 'oblivious': False, 'presence': False, 'inside': False, 'whole': False, 'epis
ode': False, 'places': False, 'incredible': False, 'suspension': False, 'disbelief': False, 'questio
ns': False, 'validity': False, 'intelligence': False, 'receives': False, 'highly': False, 'derivativ
e': False, 'somewhat': False, 'boring': False, 'cannot': False, 'watched': False, 'rated': False, 'm
ostly': False, 'several': False, 'murder': False, 'brief': False, 'strip': False, 'bar': False, 'off
ensive': False, 'many': False, 'thrillers': False, 'mood': False, 'stake': False, 'else': False, 'ca
psule': False, '2176': False, 'planet': False, 'mars': False, 'taking': False, 'custody': False, 'ac
cused': False, 'murderer': False, 'face': False, 'menace': False, 'lot': False, 'fighting': False,
'john': False, 'carpenter': False, 'reprises': False, 'ideas': False, 'previous': False, 'assault':
False, 'precinct': False, '13': False, 'homage': False, 'himself': False, '0': False, '+': False, 'b
elieves': False, 'fight': False, 'horrible': False, 'writer': False, 'supposedly': False, 'expert':
False, 'mistake': False, 'ghosts': False, 'drawn': False, 'humans': False, 'surprisingly': False, 'l
ow': False, 'powered': False, 'alien': False, 'addition': False, 'anybody': False, 'made': False, 'g
rounds': False, 'sue': False, 'chock': False, 'full': False, 'pieces': False, 'prince': False, 'dark
ness': False, 'surprising': False, 'managed': False, 'fit': False, 'admittedly': False, 'novel': Fal
se, 'science': False, 'fiction': False, 'experience': False, 'terraformed': False, 'walk': False, 's
urface': False, 'without': False, 'breathing': False, 'gear': False, 'budget': False, 'mentioned': F
alse, 'gravity': False, 'increased': False, 'earth': False, 'easier': False, 'society': False, 'chan
ged': False, 'advanced': False, 'culture': False, 'women': False, 'positions': False, 'control': Fal
se, 'view': False, 'stagnated': False, 'female': False, 'beyond': False, 'minor': False, 'technologi
cal': False, 'advances': False, 'less': False, '175': False, 'expect': False, 'change': False, 'te
n': False, 'basic': False, 'common': False, 'except': False, 'yes': False, 'replaced': False, 'tack
y': False, 'rundown': False, 'martian': False, 'mining': False, 'colony': False, 'having': False, 'c
riminal': False, 'napolean': False, 'wilson': False, 'desolation': False, 'williams': False, 'facin
g': False, 'hoodlums': False, 'automatic': False, 'weapons': False, 'nature': False, 'behave': Fals
e, 'manner': False, 'essentially': False, 'human': False, 'savages': False, 'lapse': False, 'imagina
tion': False, 'told': False, 'flashback': False, 'entirely': False, 'filmed': False, 'almost': Fals
e, 'tones': False, 'red': False, 'yellow': False, 'black': False, 'powerful': False, 'scene': False,
'train': False, 'rushing': False, 'heavy': False, 'sadly': False, 'buildup': False, 'terror': False,
'creates': False, 'looks': False, 'fugitive': False, 'wannabes': False, 'rock': False, 'band': Fals
e, 'kiss': False, 'building': False, 'bunch': False, 'sudden': False, 'jump': False, 'sucker': Fals
e, 'thinking': False, 'scary': False, 'happening': False, 'standard': False, 'haunted': False, 'shoc
k': False, 'great': False, 'newer': False, 'unimpressive': False, 'digital': False, 'decapitations':
False, 'fights': False, 'short': False, 'stretch': False, 'release': False, 'mission': False, 'panne
d': False, 'reviewers': False, 'better': False, 'rate': False, 'scale': False, 'following': False,
'showed': False, 'liked': False, 'moderately': False, 'classic': False, 'comment': False, 'twice': F
alse, 'ask': False, 'yourself': False, '8mm': False, 'eight': False, 'millimeter': False, 'wholesom
e': False, 'surveillance': False, 'sight': False, 'values': False, 'becoming': False, 'enmeshed': Fa
lse, 'seedy': False, 'sleazy': False, 'underworld': False, 'hardcore': False, 'pornography': False,
'bubbling': False, 'beneath': False, 'town': False, 'americana': False, 'sordid': False, 'sick': Fal
se, 'depraved': False, 'necessarily': False, 'stop': False, 'order': False, 'satisfy': False, 'twist
ed': False, 'desires': False, 'position': False, 'influence': False, 'kinds': False, 'demented': Fal
se, 'talking': False, 'snuff': False, 'supposed': False, 'documentaries': False, 'victims': False,
'brutalized': False, 'killed': False, 'camera': False, 'joel': False, 'schumacher': False, 'credit':
False, 'batman': False, 'robin': False, 'kill': False, 'forever': False, 'client': False, 'thirds':
False, 'unwind': False, 'fairly': False, 'conventional': False, 'persons': False, 'drama': False, 'a
lbeit': False, 'particularly': False, 'unsavory': False, 'core': False, 'threatening': False, 'alon
g': False, 'explodes': False, 'violence': False, 'think': False, 'finally': False, 'tags': False, 'r
idiculous': False, 'self': False, 'righteous': False, 'finale': False, 'drags': False, 'unpleasant':
False, 'trust': False, 'waste': False, 'hours': False, 'nicolas': False, 'snake': False, 'eyes': Fal
se, 'cage': False, 'private': False, 'investigator': False, 'tom': False, 'welles': False, 'hired':
False, 'wealthy': False, 'philadelphia': False, 'widow': False, 'determine': False, 'whether': Fals
e, 'reel': False, 'safe': False, 'documents': False, 'girl': False, 'assignment': False, 'factly': F
alse, 'puzzle': False, 'neatly': False, 'specialized': False, 'skills': False, 'training': False, 'e
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 29/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
asy': False, 'cops': False, 'toilet': False, 'tanks': False, 'clues': False, 'deeper': False, 'dig
s': False, 'investigation': False, 'obsessed': False, 'george': False, 'c': False, 'scott': False,
'paul': False, 'schrader': False, 'occasionally': False, 'flickering': False, 'whirs': False, 'sproc
kets': False, 'winding': False, 'projector': False, 'reminding': False, 'task': False, 'hints': Fals
e, 'toll': False, 'lovely': False, 'catherine': False, 'keener': False, 'frustrated': False, 'clevel
and': False, 'ugly': False, 'split': False, 'level': False, 'harrisburg': False, 'pa': False, 'conde
mn': False, 'condone': False, 'subject': False, 'exploits': False, 'irony': False, 'seven': False,
'scribe': False, 'andrew': False, 'kevin': False, 'walker': False, 'vision': False, 'lane': False,
'limited': False, 'hollywood': False, 'product': False, 'snippets': False, 'covering': False, 'late
r': False, 'joaquin': False, 'phoenix': False, 'far': False, 'adult': False, 'bookstore': False, 'fl
unky': False, 'max': False, 'california': False, 'cover': False, 'horrid': False, 'screened': False,
'familiar': False, 'revelation': False, 'sexual': False, 'deviants': False, 'indeed': False, 'monste
rs': False, 'everyday': False, 'neither': False, 'super': False, 'nor': False, 'shocking': False, 'b
anality': False, 'exactly': False, 'felt': False, 'weren': False, 'nine': False, 'laughs': False, 'm
onths': False, 'terrible': False, 'mr': False, 'hugh': False, 'grant': False, 'huge': False, 'dork':
False, 'oral': False, 'sex': False, 'prostitution': False, 'referring': False, 'bugs': False, 'annoy
ing': False, 'adam': False, 'sandler': False, 'jim': False, 'carrey': False, 'eye': False, 'flutter
s': False, 'nervous': False, 'smiles': False, 'slapstick': False, 'fistfight': False, 'delivery': Fa
lse, 'room': False, 'culminating': False, 'joan': False, 'cusack': False, 'lap': False, 'paid': Fals
e, '$': False, '60': False, 'included': False, 'obscene': False, 'double': False, 'entendres': Fals
e, 'obstetrician': False, 'pregnant': False, 'pussy': False, 'size': False, 'hairs': False, 'coat':
False, 'nonetheless': False, 'exchange': False, 'cookie': False, 'cutter': False, 'originality': Fal
se, 'humor': False, 'successful': False, 'child': False, 'psychiatrist': False, 'psychologist': Fals
e, 'scriptwriters': False, 'could': False, 'inject': False, 'unfunny': False, 'kid': False, 'dad': F
alse, 'asshole': False, 'eyelashes': False, 'offers': False, 'smile': False, 'responds': False, 'eng
lish': False, 'accent': False, 'attitude': False, 'possibly': False, '_huge_': False, 'beside': Fals
e, 'includes': False, 'needlessly': False, 'stupid': False, 'jokes': False, 'olds': False, 'everyon
e': False, 'shakes': False, 'anyway': False, 'finds': False, 'usual': False, 'reaction': False, 'flu
ttered': False, 'paves': False, 'possible': False, 'pregnancy': False, 'birth': False, 'gag': False,
'book': False, 'friend': False, 'arnold': False, 'provides': False, 'cacophonous': False, 'funny': F
alse, 'beats': False, 'costumed': False, 'arnie': False, 'dinosaur': False, 'draw': False, 'parallel
s': False, 'toy': False, 'store': False, 'jeff': False, 'goldblum': False, 'hid': False, 'dreadful':
False, 'hideaway': False, 'artist': False, 'fear': False, 'simultaneous': False, 'longing': False,
'commitment': False, 'doctor': False, 'recently': False, 'switch': False, 'veterinary': False, 'medi
cine': False, 'obstetrics': False, 'joke': False, 'old': False, 'foreign': False, 'guy': False, 'mis
pronounces': False, 'stereotype': False, 'say': False, 'yakov': False, 'smirnov': False, 'favorite':
False, 'vodka': False, 'hence': False, 'take': False, 'volvo': False, 'nasty': False, 'unamusing': F
alse, 'heads': False, 'simultaneously': False, 'groan': False, 'failure': False, 'loud': False, 'fai
led': False, 'uninspired': False, 'lunacy': False, 'sunset': False, 'boulevard': False, 'arrest': Fa
lse, 'please': False, 'caught': False, 'pants': False, 'bring': False, 'theaters': False, 'faces': F
alse, '90': False, 'forced': False, 'unauthentic': False, 'anyone': False, 'q': False, '80': False,
'sorry': False, 'money': False, 'unfulfilled': False, 'desire': False, 'spend': False, 'bucks': Fals
e, 'call': False, 'road': False, 'trip': False, 'walking': False, 'wounded': False, 'stellan': Fals
e, 'skarsg': False, 'rd': False, 'convincingly': False, 'zombified': False, 'drunken': False, 'lose
r': False, 'difficult': False, 'smelly': False, 'boozed': False, 'reliable': False, 'swedish': Fals
e, 'adds': False, 'depth': False, 'significance': False, 'plodding': False, 'aberdeen': False, 'sent
imental': False, 'painfully': False, 'mundane': False, 'european': False, 'playwright': False, 'augu
st': False, 'strindberg': False, 'built': False, 'career': False, 'families': False, 'relationship
s': False, 'paralyzed': False, 'secrets': False, 'unable': False, 'express': False, 'longings': Fals
e, 'accurate': False, 'reflection': False, 'strives': False, 'focusing': False, 'pairing': False, 'a
lcoholic': False, 'tomas': False, 'alienated': False, 'openly': False, 'hostile': False, 'yuppie': F
alse, 'kaisa': False, 'lena': False, 'headey': False, 'gossip': False, 'haven': False, 'spoken': Fal
se, 'wouldn': False, 'norway': False, 'scotland': False, 'automobile': False, 'charlotte': False, 'r
ampling': False, 'sand': False, 'rotting': False, 'hospital': False, 'bed': False, 'cancer': False,
'soap': False, 'opera': False, 'twist': False, 'days': False, 'live': False, 'blitzed': False, 'ste
p': False, 'foot': False, 'plane': False, 'hits': False, 'open': False, 'loathing': False, 'each': F
alse, 'periodic': False, 'stops': False, 'puke': False, 'dashboard': False, 'whenever': False, 'mutt
ering': False, 'rotten': False, 'turned': False, 'sloshed': False, 'viewpoint': False, 'recognizes':
False, 'apple': False, 'hasn': False, 'fallen': False, 'tree': False, 'nosebleeds': False, 'snortin
g': False, 'coke': False, 'sabotages': False, 'personal': False, 'indifference': False, 'restrain':
False, 'vindictive': False, 'temper': False, 'ain': False, 'pair': False, 'true': False, 'notes': Fa
lse, 'unspoken': False, 'familial': False, 'empathy': False, 'note': False, 'repetitively': False,
'bitchy': False, 'screenwriters': False, 'kristin': False, 'amundsen': False, 'hans': False, 'pette
r': False, 'moland': False, 'fabricate': False, 'series': False, 'contrivances': False, 'propel': Fa
lse, 'forward': False, 'roving': False, 'hooligans': False, 'drunks': False, 'nosy': False, 'flat':
False, 'tires': False, 'figure': False, 'schematic': False, 'convenient': False, 'narrative': False,
'reach': False, 'unveil': False, 'dark': False, 'past': False, 'simplistic': False, 'devices': Fals
e, 'trivialize': False, 'conflict': False, 'mainstays': False, 'wannabe': False, 'exists': False, 'p
urely': False, 'sake': False, 'weak': False, 'unimaginative': False, 'casting': False, 'thwarts': Fa
lse, 'pivotal': False, 'role': False, 'were': False, 'stronger': False, 'actress': False, 'perhaps':
False, 'coast': False, 'performances': False, 'moody': False, 'haunting': False, 'cinematography': F
alse, 'rendering': False, 'pastoral': False, 'ghost': False, 'reference': False, 'certain': False,
'superior': False, 'indie': False, 'intentional': False, 'busy': False, 'using': False, 'furrowed':
False, 'brow': False, 'convey': False, 'twitch': False, 'insouciance': False, 'paying': False, 'atte
ntion': False, 'maybe': False, 'doing': False, 'reveal': False, 'worthwhile': False, 'earlier': Fals
e, 'released': False, '2001': False, 'jonathan': False, 'nossiter': False, 'captivating': False, 'wo
nders': False, 'disturbed': False, 'parental': False, 'figures': False, 'bound': False, 'ceremonia
l': False, 'wedlock': False, 'differences': False, 'presented': False, 'significant': False, 'lumino
us': False, 'diva': False, 'preening': False, 'static': False, 'solid': False, 'performance': False,
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 30/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
'pathetic': False, 'drunk': False, 'emote': False, 'besides': False, 'catatonic': False, 'sorrow': F
alse, 'genuine': False, 'ferocity': False, 'sexually': False, 'charged': False, 'frisson': False, 'd
uring': False, 'understated': False, 'confrontations': False, 'suggest': False, 'gray': False, 'zon
e': False, 'complications': False, 'accompany': False, 'torn': False, 'romance': False, 'stifled': F
alse, 'curiosity': False, 'thoroughly': False, 'explores': False, 'neurotic': False, 'territory': Fa
lse, 'delving': False, 'americanization': False, 'greece': False, 'mysticism': False, 'illusion': Fa
lse, 'deflect': False, 'pain': False, 'overloaded': False, 'willing': False, 'come': False, 'traditi
onal': False, 'ambitious': False, 'sleepwalk': False, 'rhythms': False, 'timing': False, 'driven': F
alse, 'stories': False, 'complexities': False, 'depressing': False, 'answer': False, 'lawrence': Fal
se, 'kasdan': False, 'trite': False, 'useful': False, 'grand': False, 'canyon': False, 'steve': Fals
e, 'martin': False, 'mogul': False, 'pronounces': False, 'riddles': False, 'answered': False, 'advic
e': False, 'heart': False, 'french': False, 'sees': False, 'parents': False, 'tim': False, 'roth': F
alse, 'oops': False, 'vows': False, 'taught': False, 'musketeer': False, 'dude': False, 'used': Fals
e, 'fourteen': False, 'arrgh': False, 'swish': False, 'zzzzzzz': False, 'original': False, 'lacks':
False, 'energy': False, 'next': False, 'hmmmm': False, 'justin': False, 'chambers': False, 'basicall
y': False, 'uncharismatic': False, 'version': False, 'chris': False, 'o': False, 'donnell': False,
'range': False, 'mena': False, 'suvari': False, 'thora': False, 'birch': False, 'dungeons': False,
'dragons': False, 'miscast': False, 'deliveries': False, 'piss': False, 'poor': False, 'ms': False,
'fault': False, 'definitely': False, 'higher': False, 'semi': False, 'saving': False, 'grace': Fals
e, 'wise': False, 'irrepressible': False, 'once': False, 'thousand': False, 'god': False, 'beg': Fal
se, 'agent': False, 'marketplace': False, 'modern': False, 'day': False, 'roles': False, 'romantic':
False, 'gunk': False, 'alright': False, 'yeah': False, 'yikes': False, 'notches': False, 'fellas': F
alse, 'blares': False, 'ear': False, 'accentuate': False, 'annoy': False, 'important': False, 'behin
d': False, 'recognize': False, 'epic': False, 'fluffy': False, 'rehashed': False, 'cake': False, 'cr
eated': False, 'shrewd': False, 'advantage': False, 'kung': False, 'fu': False, 'phenomenon': False,
'test': False, 'dudes': False, 'keep': False, 'reading': False, 'editing': False, 'shoddy': False,
'banal': False, 'stilted': False, 'plentiful': False, 'top': False, 'horse': False, 'carriage': Fals
e, 'stand': False, 'opponent': False, 'scampering': False, 'cut': False, 'mouseketeer': False, 'rop
e': False, 'tower': False, 'jumping': False, 'chords': False, 'hanging': False, 'says': False, '14':
False, 'shirt': False, 'strayed': False, 'championing': False, 'fun': False, 'stretches': False, 'at
rocious': False, 'lake': False, 'reminded': False, 'school': False, 'cringe': False, 'musketeers': F
alse, 'fat': False, 'raison': False, 'etre': False, 'numbers': False, 'hoping': False, 'packed': Fal
se, 'stuntwork': False, 'promoted': False, 'trailer': False, 'major': False, 'swashbuckling': False,
'beginning': False, 'finishes': False, 'juggling': False, 'ladders': False, 'ladder': False, 'defini
te': False, 'keeper': False, 'regurgitated': False, 'crap': False, 'tell': False, 'deneuve': False,
'placed': False, 'hullo': False, 'barely': False, 'ugh': False, 'small': False, 'annoyed': False, 't
rash': False, 'gang': False, 'vow': False, 'stay': False, 'thank': False, 'outlaws': False, '5': Fal
se, 'crouching': False, 'tiger': False, 'hidden': False, 'matrix': False, 'replacement': False, 'kil
lers': False, '6': False, 'romeo': False, 'die': False, 'shanghai': False, 'noon': False, 'remembere
d': False, 'dr': False, 'hannibal': False, 'lecter': False, 'michael': False, 'mann': False, 'forens
ics': False, 'thriller': False, 'manhunter': False, 'scottish': False, 'brian': False, 'cox': False,
'works': False, 'usually': False, 'schlock': False, 'halfway': False, 'goodnight': False, 'meaty': F
alse, 'substantial': False, 'brilliant': False, 'check': False, 'dogged': False, 'inspector': False,
'opposite': False, 'frances': False, 'mcdormand': False, 'ken': False, 'loach': False, 'agenda': Fal
se, 'harrigan': False, 'disturbing': False, 'l': False, 'e': False, '47': False, 'picked': False, 's
undance': False, 'distributors': False, 'scared': False, 'budge': False, 'dares': False, 'speak': Fa
lse, 'expresses': False, 'seeking': False, 'adolescents': False, 'pad': False, 'bothered': False, 'm
embers': False, 'presentation': False, 'oddly': False, 'empathetic': False, 'light': False, 'tempere
d': False, 'robust': False, 'listens': False, 'opposed': False, 'friends': False, 'wire': False, 'ac
t': False, 'confused': False, 'lives': False, 'pay': False, 'courtship': False, 'charming': False,
'temptations': False, 'grown': False, 'stands': False, 'island': False, 'expressway': False, 'slice
s': False, 'malls': False, 'class': False, 'homes': False, 'suburbia': False, 'filmmaker': False, 'c
uesta': False, 'uses': False, 'transparent': False, 'metaphor': False, '15': False, 'protagonist': F
alse, 'howie': False, 'franklin': False, 'dano': False, 'reveals': False, 'morbid': False, 'preoccup
ation': False, 'death': False, 'citing': False, 'deaths': False, 'alan': False, 'j': False, 'pakul
a': False, 'songwriter': False, 'harry': False, 'chapin': False, 'exit': False, '52': False, 'fascin
ated': False, 'feelings': False, 'projected': False, 'bright': False, 'move': False, 'force': False,
'complex': False, 'molesters': False, 'beast': False, 'ashamed': False, 'worked': False, 'ill': Fals
e, 'advised': False, 'foray': False, 'unnecessary': False, 'padding': False, 'miserable': False, 'br
uce': False, 'altman': False, 'seat': False, 'collar': False, 'crime': False, 'degenerate': False,
'youngsters': False, 'kicks': False, 'robbing': False, 'houses': False, 'homoerotic': False, 'shenan
igans': False, 'ass': False, 'terrio': False, 'billy': False, 'kay': False, 'handsome': False, 'artf
ul': False, 'dodger': False, 'add': False, 'themes': False, 'suburban': False, 'ennui': False, 'need
ed': False, 'awkward': False, 'subplots': False, 'concurrently': False, 'relationship': False, 'even
ly': False, 'paced': False, 'exceptionally': False, 'acted': False, 'sporting': False, 'baseball': F
alse, 'cap': False, 'faded': False, 'marine': False, 'tattoo': False, 'bluff': False, 'bluster': Fal
se, 'quiet': False, 'glance': False, 'withdrawn': False, 'whose': False, 'dramatic': False, 'choice
s': False, 'broad': False, 'calling': False, 'haley': False, 'restraint': False, 'admirable': False,
'screenplay': False, 'material': False, 'reads': False, 'walt': False, 'whitman': False, 'poem': Fal
se, 'moment': False, 'precious': False, 'lingers': False, 'ecstatic': False, 'hearing': False, 'glen
n': False, 'gould': False, 'performing': False, 'bach': False, 'goldberg': False, 'variations': Fals
e, 'involving': False, 'walter': False, 'masterson': False, 'jealous': False, 'newbie': False, 'thre
ad': False, 'predictably': False, 'leads': False, 'observational': False, 'portrait': False, 'aliena
tion': False, 'royally': False, 'screwed': False, 'terry': False, 'zwigoff': False, 'superb': False,
'confidence': False, 'ambivalent': False, 'typical': False, 'cinema': False, 'wrap': False, 'bulle
t': False, 'sparing': False, 'writers': False, 'philosophical': False, 'regard': False, 'countless':
False, 'share': False, 'blockbuster': False, 'solved': False, 'obstacle': False, 'removed': False,
'often': False, 'extend': False, 'question': False, 'striving': False, 'realism': False, 'destroy':
False, 'janeane': False, 'garofalo': False, 'couple': False, 'truth': False, 'cats': False, 'dogs':
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 31/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
False, janeane : False, garofalo : False, couple : False, truth : False, cats : False, dogs :
False, 'excruciating': False, 'matchmaker': False, 'books': False, 'plods': False, 'predestined': Fa
lse, 'surprises': False, 'jumps': False, 'popular': False, 'political': False, 'satire': False, 'ban
dwagon': False, 'campaign': False, 'aide': False, 'massacusetts': False, 'senator': False, 'sander
s': False, 'reelection': False, 'denis': False, 'leary': False, 'stereotypical': False, 'strategis
t': False, 'ethics': False, 'scandal': False, 'plagued': False, 'play': False, 'irish': False, 'root
s': False, 'boston': False, 'roman': False, 'catholic': False, 'democrat': False, 'contingent': Fals
e, 'kennedy': False, 'family': False, 'orders': False, 'ireland': False, 'relatives': False, 'exploi
t': False, 'soon': False, 'learns': False, 'said': False, 'done': False, 'mantra': False, 'tiny': Fa
lse, 'misses': False, 'bus': False, 'hotel': False, 'ends': False, 'smallest': False, 'trashiest': F
alse, 'dog': False, 'luggage': False, 'roger': False, 'ebert': False, 'calls': False, 'meet': False,
'happens': False, 'unconventional': False, 'cinematic': False, 'walks': False, 'bathroom': False, 'n
ude': False, 'sean': False, 'david': False, 'hara': False, 'bathtub': False, 'points': False, 'guess
ing': False, 'water': False, 'hates': False, 'instant': False, 'saw': False, 'irishman': False, 'hat
e': False, 'awhile': False, 'succumb': False, 'charms': False, 'happily': False, 'superficial': Fals
e, 'detail': False, 'throw': False, 'turmoil': False, 'reconcile': False, 'tune': False, 'annual': F
alse, 'matchmaking': False, 'festival': False, 'lonely': False, 'county': False, 'future': False, 'b
liss': False, 'milo': False, 'shea': False, 'snyder': False, 'pops': False, 'onscreen': False, 'spe
w': False, 'souls': False, 'assured': False, 'match': False, 'utter': False, 'predictability': Fals
e, 'message': False, 'respectable': False, 'person': False, 'comedic': False, 'distinction': False,
'sell': False, 'script': False, 'excited': False, 'stays': False, 'stateside': False, 'yelling': Fal
se, 'phone': False, 'undoes': False, 'microphone': False, 'speech': False, 'known': False, 'flying':
False, 'hong': False, 'kong': False, 'style': False, 'filmmaking': False, 'classics': False, 'nod':
False, 'asia': False, 'france': False, 'lukewarm': False, 'dumas': False, 'asian': False, 'stunt': F
alse, 'coordinator': False, 'xing': False, 'xiong': False, 'prior': False, 'attempts': False, 'chore
ography': False, 'laughable': False, 'van': False, 'damme': False, 'vehicle': False, 'team': False,
'dennis': False, 'rodman': False, 'simon': False, 'sez': False, 'thrown': False, 'air': False, 'resu
lt': False, 'tepid': False, 'adventure': False, 'rip': False, 'stinks': False, 'indiana': False, 'jo
nes': False, 'simple': False, 'grandmother': False, 'adapted': False, 'artagnan': False, 'vengeful':
False, 'son': False, 'slain': False, 'travels': False, 'paris': False, 'join': False, 'royal': Fals
e, 'meets': False, 'cunning': False, 'cardinal': False, 'richelieu': False, 'stephen': False, 'rea':
False, 'overthrow': False, 'associate': False, 'febre': False, 'killer': False, 'disbanded': False,
'rounds': False, 'aramis': False, 'nick': False, 'moran': False, 'athos': False, 'jan': False, 'greg
or': False, 'kremp': False, 'porthos': False, 'steven': False, 'spiers': False, 'wrongfully': False,
'imprisoned': False, 'leader': False, 'treville': False, 'prison': False, 'frisky': False, 'interes
t': False, 'chambermaid': False, 'francesca': False, 'footsy': False, 'coo': False, 'hunts': False,
'queen': False, 'captured': False, 'menancing': False, 'forcing': False, 'regroup': False, 'leadin
g': False, 'charge': False, 'peter': False, 'hyams': False, 'wanted': False, 'blend': False, 'easter
n': False, 'western': False, 'styles': False, 'disaster': False, 'reality': False, 'ones': False, 'j
et': False, 'li': False, 'risk': False, 'ironically': False, 'swordplay': False, 'spread': False, 'c
arry': False, 'bulk': False, '30': False, 'minute': False, 'picture': False, 'weighs': False, 'monot
onous': False, 'gene': False, 'quintano': False, 'prosaic': False, 'wedding': False, 'planner': Fals
e, 'mousy': False, 'artangnan': False, 'hyam': False, 'candles': False, 'torches': False, 'grime': F
alse, 'filth': False, '17th': False, 'noted': False, 'standout': False, 'mortal': False, 'kombat': F
alse, 'annihilation': False, 'reviewed': False, 'multiple': False, 'levels': False, 'rampant': Fals
e, 'usage': False, 'randian': False, 'subtext': False, 'pervades': False, 'occasionaly': False, 'iro
nic': False, 'depreciating': False, 'remark': False, 'tosses': False, 'clearly': False, 'marxist': F
alse, 'imagery': False, 'kidding': False, 'seriousness': False, 'fair': False, '*': False, 'necessar
y': False, 'viewpoints': False, 'watcher': False, 'unfamiliar': False, 'marginally': False, 'fan': F
alse, 'games': False, '1995': False, 'concerned': False, 'martial': False, 'arts': False, 'tournamen
t': False, 'decide': False, 'fate': False, 'billion': False, 'inhabitants': False, 'mortals': False,
'theory': False}

In [10]: featuresets = [(find_features(rev), category) for (rev, category) in documents]

NAIVE BAYES CLASSIFIER

The algorithm that we're going to use first is the Naive Bayes classifier. Before we can train and test our algorithm, we need to go ahead
and split up the data into a training set and a testing set. This is called supervised machine learning, because we're showing the machine
data, and telling it "this data is positive," or "this data is negative." Then, after that training is done, we show the machine some new data
and ask the computer, based on what we taught the computer before, what the computer thinks the category of the new data is.

In [11]: training_set =featuresets[:1900]


testing_set = featuresets[1900:]

In [12]: classifier = nltk.NaiveBayesClassifier.train(training_set)

In [13]: print("Naive Bayes Algo accuracy:", (nltk.classify.accuracy(classifier, testing_set))*100)

Naive Bayes Algo accuracy: 78.0

In [14]: classifier.show_most_informative_features(15)

Most Informative Features


annual = True pos : neg = 9.0 : 1.0
unimaginative = True neg : pos = 7 7 : 1 0
https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 32/33
11/14/2019 NLTK-Tutorial-/nltk_practice1.ipynb at master · adityaojha07/NLTK-Tutorial-
unimaginative = True neg : pos = 7.7 : 1.0
frances = True pos : neg = 7.6 : 1.0
schumacher = True neg : pos = 7.0 : 1.0
shoddy = True neg : pos = 7.0 : 1.0
mena = True neg : pos = 7.0 : 1.0
atrocious = True neg : pos = 7.0 : 1.0
suvari = True neg : pos = 7.0 : 1.0
regard = True pos : neg = 7.0 : 1.0
turkey = True neg : pos = 6.4 : 1.0
kidding = True neg : pos = 6.4 : 1.0
singers = True pos : neg = 6.3 : 1.0
stinks = True neg : pos = 5.8 : 1.0
justin = True neg : pos = 5.8 : 1.0
bothered = True neg : pos = 5.8 : 1.0

This tells is the ratio of occurences in negative to positive, or visa versa, for every word. So here, we can see that the term "insulting"
appears 10.6 more times as often in negative reviews as it does in positive reviews. Ludicrous, 10.1

Saving Classifiers with NLTK

https://github.com/adityaojha07/NLTK-Tutorial-/blob/master/nltk_practice1.ipynb 33/33

You might also like