<div dir="ltr"><p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Date: 19 Dec 2022</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:18px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Module : nltk</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:18px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Installation : pip install nltk</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:18px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">About:</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Natural Language Toolkit (NLTK) is one of the leading Python platforms for processing language data. It is a set of language processing libraries and programs that provide a toolkit for:</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>- Classification</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>- Tokenization</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>- Stemming</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>- Tagging</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>- Parsing</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>- Semantic reasoning</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:18px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Sample:</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">>>> import nltk</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">>>> sentence = """At eight o'clock on Thursday morning</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">... Arthur didn't feel very good."""</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:18px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"># Tokenization in NLP is the process by which a large quantity of text is divided into smaller parts called tokens.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">>>> tokens = nltk.word_tokenize(sentence)</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">>>> tokens</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">['At', 'eight', "o'clock", 'on', 'Thursday', 'morning',</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">'Arthur', 'did', "n't", 'feel', 'very', 'good', '.']</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:18px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"># POS Tagging in NLTK is a process to mark up the words in text format for a particular part of a speech based on its definition and context.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">>>> tagged = nltk.pos_tag(tokens)<span class="gmail-Apple-converted-space"> </span></span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">>>> tagged[0:6]</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">[('At', 'IN'), ('eight', 'CD'), ("o'clock", 'JJ'), ('on', 'IN'),</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">('Thursday', 'NNP'), ('morning', 'NN')]</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:18px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:18px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Reference:</span></p>
<p style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><a href="https://pypi.org/project/nltk/">https://pypi.org/project/nltk/</a></span></p></div>