{"id":12845,"date":"2020-03-03T16:01:21","date_gmt":"2020-03-03T10:31:21","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/"},"modified":"2024-10-15T00:25:22","modified_gmt":"2024-10-14T18:55:22","slug":"nltk-tutorial-with-python","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/","title":{"rendered":"Natural Language Toolkit (NLTK) Tutorial with Python"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"what-is-nltk\"><strong><span style=\"text-decoration: underline\">What is NLTK?<\/span><\/strong><\/h2>\n\n\n\n<p>NLTK is a standard python library with prebuilt functions and utilities for the ease of use and implementation. It is one of the most used libraries for natural language processing and computational linguistics.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"nltk-installation-process\"><strong>NLTK Installation Process<\/strong><\/h3>\n\n\n\n<p>With a system running windows OS and having python preinstalled<\/p>\n\n\n\n<p>Open a command prompt and type:<\/p>\n\n\n\n<p>pip install nltk<\/p>\n\n\n\n<p>Note:&nbsp;<\/p>\n\n\n\n<p><strong>!pip install nltk<\/strong><br>will download nltk in a specific file\/editor for the current session<br><strong>nltk dataset download<\/strong><\/p>\n\n\n\n<p>There are several datasets which can be used with nltk. To use them, we need to download them.<br>We can download them by executing this:<br>#code<br>import nltk<br>nltk.download()<\/p>\n\n\n\n<p>Click download in the pop up<\/p>\n\n\n\n<p>Once it downloads, we are set to go.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"accessing-a-dataset-in-nltk\"><strong><span style=\"text-decoration: underline\">Accessing a dataset in NLTK<\/span><\/strong><\/h2>\n\n\n\n<p>A dataset is referred to as corpus in nltk.<\/p>\n\n\n\n<p>A corpus is essentially a collection of sentences which serves as an input. For further processing a corpus is broken down into smaller pieces and processed which we would see in later sections.<\/p>\n\n\n\n<p>There are several of them which we downloaded in the earlier step, but we have used the movie_reviews corpus for the demonstration.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nimport nltk\nfrom nltk.corpus import movie_reviews\nmovie_reviews.words()<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>So now we are all setup for some real time text processing using nltk.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"data-pre-processing\"><strong><span style=\"text-decoration: underline\">Data pre-processing&nbsp;<\/span><\/strong><\/h2>\n\n\n\n<p>Data pre-processing is the process of making the machine understand things better or making the input more machine understandable. Some standard practices for doing that are:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-tokenization\"><strong><span style=\"text-decoration: underline\">1.Tokenization<\/span><\/strong><\/h3>\n\n\n\n<p>Tokenization is the process of breaking text up into smaller chunks as per our requirements.<\/p>\n\n\n\n<p>nltk has a cool submodule \u201ctokenize\u201d which we will be using.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Word Tokenization<\/li>\n<\/ul>\n\n\n\n<p>Word tokenization is the process of breaking a sentence into words. word_tokenize function has been used, which returns a list of words as output.[]<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nfrom nltk.tokenize import word_tokenize\ndata = \"I pledge to be a data scientist one day\"\ntokenized_text=word_tokenize(data)\nprint(tokenized_text)\nprint(type(tokenized_text))<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Sentence Tokenization<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Sentence tokenization is the process of breaking a corpus into sentence level tokens. It\u2019s essentially used when the corps consists of multiple paragraphs. Each paragraph is broken down into sentences.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nfrom nltk.tokenize import sent_tokenize\npara=\"\"\"Cake is a form of sweet food made from flour, sugar, and other ingredients, that is usually baked.In their oldest forms, cakes were modifications of bread, but cakes now cover a wide range of preparations that can be simple or elaborate, and that share features with other desserts such as pastries, meringues, custards, and pies.The most commonly used cake ingredients include flour, sugar, eggs, butter or oil or margarine, a liquid, and leavening agents, such as baking soda or baking powder. Common additional ingredients and flavourings include dried, candied, or fresh fruit, nuts, cocoa, and extracts such as vanilla, with numerous substitutions for the primary ingredients.Cakes can also be filled with fruit preserves, nuts or dessert sauces (like pastry cream), iced with buttercream or other icings, and decorated with marzipan, piped borders, or candied fruit.\"\"\"\ntokenized_para=sent_tokenize(para)\nprint(tokenized_para)\nprint(type(tokenized_para))<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-punctuation-removal\"><span style=\"text-decoration: underline\">2. <strong>Punctuation Removal<\/strong><\/span><\/h3>\n\n\n\n<p>Punctuations are of little use in NLP so they are removed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nfrom nltk.tokenize import RegexpTokenizer\ntokenizer = RegexpTokenizer(r'w+')\nresult = tokenizer.tokenize(\"Wow! I am excited to learn data science\")\nprint(result)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-stop-words-removal\"><span style=\"text-decoration: underline\"><strong>3.<\/strong> <strong>Stop Words Removal<\/strong><\/span><\/h3>\n\n\n\n<p>Stop words are words which occur frequently in a corpus. e.g a, an, the, in. Frequently occurring words are removed from the corpus for the sake of text-normalization.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nfrom nltk.corpus import stopwords\nfrom nltk.tokenize import word_tokenize\nto_be_removed = set(stopwords.words('english'))\npara=\"\"\"Cake is a form of sweet food made from flour, sugar, and other ingredients, that is usually baked.\nIn their oldest forms, cakes were modifications of bread, but cakes now cover a wide range of preparations \nthat can be simple or elaborate, and that share features with other desserts such as pastries, meringues, custards, \nand pies.\"\"\"\ntokenized_para=word_tokenize(para)\nprint(tokenized_para)\nmodified_token_list=&#91;word for word in tokenized_para if not word in to_be_removed]\nprint(modified_token_list)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"4-stemming\"><strong><span style=\"text-decoration: underline\">4. Stemming<\/span><\/strong><\/h3>\n\n\n\n<p>It is reduction of inflection from words. Words with same origin will get reduced to a form which may or may not be a word.<\/p>\n\n\n\n<p>NLTK has different stemmers which implement different methodologies.<\/p>\n\n\n\n<p>Some of which are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Porter Stemmer<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>\nfrom nltk.stem import PorterStemmer\nfrom nltk.tokenize import word_tokenize\nstemmer = PorterStemmer()\ncontent = \"\"\"Cake is a form of sweet food made from flour, sugar, and other ingredients, that is usually baked.In their oldest forms, cakes were modifications of bread, but cakes now cover a wide range of preparations \nthat can be simple or elaborate, and that share features with other desserts such as pastries, meringues, custards, and pies.\"\"\"\ntk_content=word_tokenize(content)\nstemmed_words = &#91;stemmer.stem(i) for i in tk_content] \nprint(stemmed_words)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Lancaster Stemmer<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>\nfrom nltk.stem import LancasterStemmer\nfrom nltk.tokenize import word_tokenize\nstemmer = PorterStemmer()\ncontent = \"\"\"Cake is a form of sweet food made from flour, sugar, and other ingredients, that is usually baked.\nIn their oldest forms, cakes were modifications of bread, but cakes now cover a wide range of preparations \nthat can be simple or elaborate, and that share features with other desserts such as pastries, meringues, custards, \nand pies.\"\"\"\n\ntk_content=word_tokenize(content)\nstemmed_words = &#91;stemmer.stem(i) for i in tk_content]\nprint(stemmed_words)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"5-lemmatization\"><strong><span style=\"text-decoration: underline\">5. Lemmatization<\/span><\/strong><\/h3>\n\n\n\n<p>It is another process of reducing inflection from words. The way its different from stemming is that it reduces words to their origins which have actual meaning. Stemming sometimes generates words which are not even words.<\/p>\n\n\n\n<p><strong>WordNet Lemmatizer<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nimport nltk\nfrom nltk.stem import WordNetLemmatizer\nlemmatizer=WordNetLemmatizer()\ncontent = \"\"\"Cake is a form of sweet food made from flour, sugar, and other ingredients, that is usually baked.\nIn their oldest forms, cakes were modifications of bread, but cakes now cover a wide range of preparations \nthat can be simple or elaborate, and that share features with other desserts such as pastries, meringues, custards, \nand pies.\"\"\"\n\ntk_content=word_tokenize(content)\nlemmatized_words = &#91;lemmatizer.lemmatize(i) for i in tk_content] \nprint(lemmatized_words)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"6-pos-tagging\"><strong><span style=\"text-decoration: underline\"> 6. POS Tagging <\/span><\/strong><\/h3>\n\n\n\n<p>POS tagging is the process of identifying parts of speech of a sentence. It is able to identify nouns, pronouns, adjectives etc. in a sentence and assigns a POS token to each word. There are different methods to tag, but we will be using the universal style of tagging.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nimport nltk\nfrom nltk.tokenize import sent_tokenize, word_tokenize\ncontent = \"\"\"Cake is a form of sweet food made from flour, sugar, and other ingredients, that is usually baked.\nIn their oldest forms, cakes were modifications of bread, but cakes now cover a wide range of preparations \nthat can be simple or elaborate, and that share features with other desserts such as pastries, meringues, custards, \nand pies.\"\"\"\nwords= &#91;word_tokenize(i) for i in sent_tokenize(content)]\npos_tag= &#91;nltk.pos_tag(i,tagset=\"universal\") for i in words]\nprint(pos_tag)<\/code><\/pre>\n\n\n\n<p>Also Read: <a href=\"https:\/\/www.mygreatlearning.com\/blog\/deep-learning-tools-you-should-know\/\">Best Natural Language Processing Tools<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"7-chunking\"><strong><span style=\"text-decoration: underline\"> 7. Chunking <\/span><\/strong><\/h3>\n\n\n\n<p>Chunking also known as shallow parsing, is practically a method in NLP applied to POS tagged data to gain further insights from it. It is done by grouping certain words on the basis of a pre-defined rule. The text is then parsed according to the rule to group data for phrase creation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nimport nltk\nfrom nltk.tokenize import word_tokenize\ncontent = \"Cake is a form of sweet food made from flour, sugar, and other ingredients, that is usually baked.\"\ntokenized_text = nltk.word_tokenize(content)\ntagged_token = nltk.pos_tag(tokenized_text)\ngrammer = \"NP: {&lt;DT&gt;?&lt;JJ&gt;*&lt;NN&gt;}\"\nphrases = nltk.RegexpParser(grammer)\nresult = phrases.parse(tagged_token)\nprint(result)\nresult.draw()<\/code><\/pre>\n\n\n\n<p><strong>Bag Of Words<\/strong> <\/p>\n\n\n\n<p>Bag of words is a simplistic model which gives information about the contents of a corpus in terms of number of occurrences of words. It ignores the grammar and context of the documents and is a mapping of words to their counts in the corpus.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nfrom sklearn.feature_extraction.text import CountVectorizer\nimport pandas as pd\n\ncontent = \"\"\"Cake is a form of sweet food made from flour, sugar, and other ingredients, that is usually baked.\nIn their oldest forms, cakes were modifications of bread, but cakes now cover a wide range of preparations that can be simple or elaborate, and that share features with other desserts such as pastries, meringues, custards, and pies.\"\"\"\n\ncount_vectorizer = CountVectorizer()\n\nbag_of_words = count_vectorizer.fit_transform(content.splitlines())\n\npd.DataFrame(bag_of_words.toarray(), columns = count_vectorizer.get_feature_names())<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"synonyms-using-wordnet\"><strong><span style=\"text-decoration: underline\">Synonyms using wordnet<\/span><\/strong><\/h2>\n\n\n\n<p>Wordnet is a cool corpus in NLTK which can be used to generate synonyms antonyms of words.<\/p>\n\n\n\n<p>Here is a cool program to generate synonyms:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nfrom nltk.corpus import wordnet\nsyns = wordnet.synsets(\"dog\") \n  \nprint(syns&#91;0].name()) \n  \nprint(syns&#91;0].lemmas()&#91;0].name()) \n  \nprint(syns&#91;0].definition()) \n  \nprint(syns&#91;0].examples())<\/code><\/pre>\n\n\n\n<p><strong>Frequency distribution of words<\/strong><\/p>\n\n\n\n<p>We can generate frequency distribution of words in a corpus by using the FreqDist() function in nlp. The results generated when plotted give a nice plot as illustrated by the code output below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nimport nltk\nimport matplotlib.pyplot as plt\ncontent = \"\"\"Cake is a form of sweet food made from flour, sugar, and other ingredients, that is usually baked.\nIn their oldest forms, cakes were modifications of bread\"\"\"\nwords = nltk.tokenize.word_tokenize(content)\nfd = nltk.FreqDist(words)\nfd.plot()<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"word-embeddings\"><strong><span style=\"text-decoration: underline\">Word Embeddings<\/span><\/strong><\/h2>\n\n\n\n<p>Word Embeddings is a NLP technique in which we try to capture the context, semantic meaning and inter relation of words with each other. It is done by creation of a word vector. Word vectors when projected upon a vector space can also show similarity between words.The technique or word embeddings which we discuss here today is Word-to-vec. We would be doing so with the help of Gensim which is another cool library like NLTK.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nfrom gensim.models import Word2Vec\nimport nltk\n# define training data\ncontent=\"\"\"Cake is a form of sweet food made from flour, sugar, and other ingredients, that is usually baked.\nIn their oldest forms, cakes were modifications of bread, but cakes now cover a wide range of preparations that can be simple or elaborate, and that share features with other desserts such as pastries, meringues, custards, and pies.\"\"\"\nsentences=nltk.sent_tokenize(content)\nwords=&#91;]\n\nfor i in sentences:\n    words.append(nltk.word_tokenize(i))\n\n# train model\nmodel = Word2Vec(words, min_count=1)\n\n# summarize the loaded model\nprint(model)\n\n# summarize vocabulary\nword_vec_words = list(model.wv.vocab)\nprint(word_vec_words)\n\n# access vector for one word\nprint(model&#91;'sugar'])\n\n# save model\nmodel.save('model.bin')\n\n# load model\nnew_model = Word2Vec.load('model.bin')\nprint(new_model)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"project-in-nlp\"><strong><span style=\"text-decoration: underline\">Project in NLP<\/span><\/strong><\/h2>\n\n\n\n<p>As a final project in NLP, we will be building a text classification model using NLP.<\/p>\n\n\n\n<p>The dataset we will be using is the IMDB dataset which is prebuilt in keras for faster execution.<\/p>\n\n\n\n<p>The dataset contains movie data along with genres.<\/p>\n\n\n\n<p>The task we would be doing is to classify the movie in their respective genres.<\/p>\n\n\n\n<p>For the sake of simplicity, we use the first 10,000 records. You are free to explore with more data. The execution time increases with more data.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nimport numpy as np\nfrom keras.utils import to_categorical\nfrom keras import models\nfrom keras import layers\nfrom keras.datasets import imdb\n \n(train_data, train_target), (test_data, test_target) = imdb.load_data(num_words=10000)\ndt = np.concatenate((train_data, test_data), axis=0)\ntar = np.concatenate((train_target, test_target), axis=0)\n \ndef convert(sequences, dimension = 10000):\n results = np.zeros((len(sequences), dimension))\n for i, sequence in enumerate(sequences):\n  results&#91;i, sequence] = 1\n return results\n \ndt = convert(dt)\ntar = np.array(tar).astype(\"float32\")\ntest_x = dt&#91;:9000]\ntest_y = tar&#91;:9000]\ntrain_x = dt&#91;9000:]\ntrain_y = tar&#91;9000:]\nmodel = models.Sequential()\n# Input - Layer\nmodel.add(layers.Dense(50, activation = \"relu\", input_shape=(10000, )))\n# Hidden - Layers\nmodel.add(layers.Dropout(0.4, noise_shape=None, seed=None))\nmodel.add(layers.Dense(50, activation = \"relu\"))\nmodel.add(layers.Dropout(0.3, noise_shape=None, seed=None))\nmodel.add(layers.Dense(50, activation = \"relu\"))\n# Output- Layer\nmodel.add(layers.Dense(1, activation = \"sigmoid\"))\nmodel.summary()\n# compiling the model\n \nmodel.compile(\n optimizer = \"adam\",\n loss = \"binary_crossentropy\",\n metrics = &#91;\"accuracy\"]\n)\nresults = model.fit(\n train_x, train_y,\n epochs= 2,\n batch_size = 500,\n validation_data = (test_x, test_y)\n)\nprint(\"Test-Accuracy:\", np.mean(results.history&#91;\"val_acc\"]))<\/code><\/pre>\n\n\n\n<p>In the above code, we first import the prebuilt dataset along with the other dependencies.<\/p>\n\n\n\n<p>We have a function convert, to convert the words into vectors for processing.<\/p>\n\n\n\n<p>We then divide our dataset into train and test sets.<\/p>\n\n\n\n<p>Finally we compile our model using compile() with the optimizer set as adam which is one of the most robust optimizers keras has to offer. The thing to take note here is that we have used binary cross_entropy as the loss function. The output we are getting is a sparse matrix with the probability of genres most suited are returned as 1.<\/p>\n\n\n\n<p>The dropout layers in the model help us regularize the model.<\/p>\n\n\n\n<p>We have used only two epochs for the demonstration. You can obviously increase them to get more accuracy.<br>Learn all about <strong>Python<\/strong> and other AIML technologies - check out Great Learning's <strong><a href=\"https:\/\/www.mygreatlearning.com\/pg-program-machine-learning-course\">PGP- Machine Learning course<\/a><\/strong>.<\/p>\n\n\n\n<p>Embarking on a journey towards a career in data science opens up a world of limitless possibilities. Whether you\u2019re an aspiring data scientist or someone intrigued by the power of data, understanding the key factors that contribute to success in this field is crucial. The below path will guide you to become a proficient data scientist.<\/p>\n\n\n\n<figure class=\"wp-block-table aligncenter\"><table class=\"has-cyan-bluish-gray-background-color has-background\"><tbody><tr><td><a href=\"https:\/\/www.mygreatlearning.com\/data-science\/courses\/certificates\" target=\"_blank\" rel=\"noreferrer noopener\">Data Science Course Certificates<\/a><\/td><\/tr><tr><td><a href=\"https:\/\/www.mygreatlearning.com\/data-science\/courses\/placements\" target=\"_blank\" rel=\"noreferrer noopener\">Data Science Course Placements<\/a><\/td><\/tr><tr><td><a href=\"https:\/\/www.mygreatlearning.com\/data-science\/courses\/syllabus\" target=\"_blank\" rel=\"noreferrer noopener\">Data Science Course Syllabus<\/a><\/td><\/tr><tr><td><a href=\"https:\/\/www.mygreatlearning.com\/data-science\/courses\/eligibility\" target=\"_blank\" rel=\"noreferrer noopener\">Data Science Course Eligibility<\/a><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>What is NLTK? NLTK is a standard python library with prebuilt functions and utilities for the ease of use and implementation. It is one of the most used libraries for natural language processing and computational linguistics. NLTK Installation Process With a system running windows OS and having python preinstalled Open a command prompt and type: [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":12864,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[2],"tags":[36798,36796],"content_type":[],"class_list":["post-12845","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-artificial-intelligence","tag-nlp","tag-python"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Natural Languate Toolkit (NLTK) Tutorial in Python<\/title>\n<meta name=\"description\" content=\"NLTK Tutorial: Natural Language Toolkit is a standard python library with prebuilt functions. It is one of the most used libraries for natural language processing.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Natural Language Toolkit (NLTK) Tutorial with Python\" \/>\n<meta property=\"og:description\" content=\"NLTK Tutorial: Natural Language Toolkit is a standard python library with prebuilt functions. It is one of the most used libraries for natural language processing.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-03T10:31:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-14T18:55:22+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"700\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nltk-tutorial-with-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nltk-tutorial-with-python\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Natural Language Toolkit (NLTK) Tutorial with Python\",\"datePublished\":\"2020-03-03T10:31:21+00:00\",\"dateModified\":\"2024-10-14T18:55:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nltk-tutorial-with-python\\\/\"},\"wordCount\":1061,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nltk-tutorial-with-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/shutterstock_712320088.jpg\",\"keywords\":[\"NLP\",\"python\"],\"articleSection\":[\"AI and Machine Learning\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nltk-tutorial-with-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nltk-tutorial-with-python\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nltk-tutorial-with-python\\\/\",\"name\":\"Natural Languate Toolkit (NLTK) Tutorial in Python\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nltk-tutorial-with-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nltk-tutorial-with-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/shutterstock_712320088.jpg\",\"datePublished\":\"2020-03-03T10:31:21+00:00\",\"dateModified\":\"2024-10-14T18:55:22+00:00\",\"description\":\"NLTK Tutorial: Natural Language Toolkit is a standard python library with prebuilt functions. It is one of the most used libraries for natural language processing.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nltk-tutorial-with-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nltk-tutorial-with-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nltk-tutorial-with-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/shutterstock_712320088.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/shutterstock_712320088.jpg\",\"width\":1200,\"height\":700,\"caption\":\"NLTK with Python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nltk-tutorial-with-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI and Machine Learning\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/artificial-intelligence\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Natural Language Toolkit (NLTK) Tutorial with Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Natural Languate Toolkit (NLTK) Tutorial in Python","description":"NLTK Tutorial: Natural Language Toolkit is a standard python library with prebuilt functions. It is one of the most used libraries for natural language processing.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/","og_locale":"en_US","og_type":"article","og_title":"Natural Language Toolkit (NLTK) Tutorial with Python","og_description":"NLTK Tutorial: Natural Language Toolkit is a standard python library with prebuilt functions. It is one of the most used libraries for natural language processing.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2020-03-03T10:31:21+00:00","article_modified_time":"2024-10-14T18:55:22+00:00","og_image":[{"width":1200,"height":700,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088.jpg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Natural Language Toolkit (NLTK) Tutorial with Python","datePublished":"2020-03-03T10:31:21+00:00","dateModified":"2024-10-14T18:55:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/"},"wordCount":1061,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088.jpg","keywords":["NLP","python"],"articleSection":["AI and Machine Learning"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/","url":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/","name":"Natural Languate Toolkit (NLTK) Tutorial in Python","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088.jpg","datePublished":"2020-03-03T10:31:21+00:00","dateModified":"2024-10-14T18:55:22+00:00","description":"NLTK Tutorial: Natural Language Toolkit is a standard python library with prebuilt functions. It is one of the most used libraries for natural language processing.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088.jpg","width":1200,"height":700,"caption":"NLTK with Python"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/nltk-tutorial-with-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"AI and Machine Learning","item":"https:\/\/www.mygreatlearning.com\/blog\/artificial-intelligence\/"},{"@type":"ListItem","position":3,"name":"Natural Language Toolkit (NLTK) Tutorial with Python"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088.jpg",1200,700,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088-300x175.jpg",300,175,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088-768x448.jpg",768,448,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088-1024x597.jpg",1024,597,true],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088.jpg",1200,700,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088.jpg",1200,700,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088.jpg",640,373,false],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088.jpg",96,56,false],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/shutterstock_712320088.jpg",150,88,false]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":2,"uagb_excerpt":"What is NLTK? NLTK is a standard python library with prebuilt functions and utilities for the ease of use and implementation. It is one of the most used libraries for natural language processing and computational linguistics. NLTK Installation Process With a system running windows OS and having python preinstalled Open a command prompt and type:&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/12845","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=12845"}],"version-history":[{"count":53,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/12845\/revisions"}],"predecessor-version":[{"id":111593,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/12845\/revisions\/111593"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/12864"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=12845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=12845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=12845"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=12845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}