

{"id":20790,"date":"2018-07-12T04:00:09","date_gmt":"2018-07-12T04:00:09","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=20790"},"modified":"2026-04-28T15:32:53","modified_gmt":"2026-04-28T10:02:53","slug":"python-stemming","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/python-stemming\/","title":{"rendered":"Learn Python Stemming and Lemmatization &#8211; Python NLTK"},"content":{"rendered":"<p>In this Python Stemming\u00a0tutorial, we will discuss Stemming and Lemmatization in <a href=\"https:\/\/data-flair.training\/blogs\/python-tutorial-for-beginners\/\" target=\"_blank\" rel=\"noopener\"><strong>Python Programming Language<\/strong><\/a>&#8211; two basics when working with<a href=\"https:\/\/data-flair.training\/blogs\/future-of-data-science\/\" target=\"_blank\" rel=\"noopener\"> <strong>data science<\/strong><\/a> in Python. Moreover, we will discuss Python NLTK and Python Stemming examples. Along with this, we will learn Python Stemming vs Lemmatization.<\/p>\n<p>So, let\u2019s begin\u00a0Python Stemming and Lemmatization.<\/p>\n<h3>Prerequisites for Python Stemming and Lemmatization<\/h3>\n<p>For our purpose, we will use the following library-<\/p>\n<h4 class=\"western\">a. Python NLTK<\/h4>\n<p>Python NLTK is an acronym for <em>Natural Language Toolkit<\/em>. It is a set of libraries that let us perform Natural Language Processing (NLP) on English with Python. It lets us do so symbolically and statistically. This also provides sample data and supports graphical representation.<\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/python-rename-file\/\" target=\"_blank\" rel=\"noopener\">Do you How Python Rename File \u2013 Single &amp; Multiple Files With Example<\/a><\/strong><\/p>\n<p>You can install it using pip-<br \/>\n<strong>C:\\Users\\lifei&gt;pip install nltk<\/strong><br \/>\n<strong>Collecting nltk<\/strong><\/p>\n<p>Downloading<\/p>\n<p>https:\/\/files.pythonhosted.org\/packages\/50\/09\/3b1755d528ad9156ee7243d52aa5cd2b809ef053a0f31b53d92853dd653a\/nltk-3.3.0.zip (1.4MB)<br \/>\n100% |<span style=\"font-family: Arial, serif\">\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588<\/span>| 1.4MB 669kB\/s<\/p>\n<p>Requirement already satisfied: six in c:\\users\\lifei\\appdata\\local\\programs\\python\\python36\\lib\\site-packages (from nltk) (1.11.0)<\/p>\n<p>Installing collected packages: nltk<br \/>\nRunning setup.py install for nltk &#8230; done<br \/>\nSuccessfully installed nltk-3.3<\/p>\n<h3 class=\"western\">What is Python Stemming?<\/h3>\n<p>Python Stemming is the act of taking a word and reducing it into a stem. A stem is like a root for a word- that for <i>writing<\/i> is writing. But this doesn\u2019t always have to be a word; words like <i>study<\/i>, <i>studies<\/i>, and <i>studying <\/i>all stem into the word <i>studi<\/i>, which isn\u2019t actually a word.<\/p>\n<div id=\"attachment_20808\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Stemming-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-20808\" class=\"wp-image-20808 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Stemming-01.jpg\" alt=\"Python Stemming and Lemmatization - NLTK\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Stemming-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Stemming-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Stemming-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Stemming-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Stemming-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-20808\" class=\"wp-caption-text\">Python Lemmatization and Stemming &#8211; Python NLTK<\/p><\/div>\n<p>It is almost like these words are synonyms; this lets us normalize sentences and makes searching for words easier and faster. The Python stemming algorithms we have are often based on rules applying to suffix-stripping. The most common is the Porter-Stemmer, which has been around since 1979.<\/p>\n<p><strong>Features of stemming in Python:<\/strong><\/p>\n<ul>\n<li><strong>Rule-based reduction:<\/strong> Stemming removes the words ending in ( ing, ed, es, etc).<\/li>\n<li><strong>Group similar words:<\/strong> It considers the different versions of a word in one group. Example. Dance, dancer, dancing.<\/li>\n<li><strong>High speed:<\/strong> It is faster as it can consider thousands of sentences in a second.<\/li>\n<li><strong>Works for many languages:<\/strong> It has designed many versions of tools that can run in different languages like English, French, Spanish, and more.<\/li>\n<\/ul>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/python-read-and-write-file\/\" target=\"_blank\" rel=\"noopener\">Read about Python Read And Write File \u2013 File Handling In Python<\/a><\/strong><\/p>\n<h4 class=\"western\">a. Python Stemming Individual Words<\/h4>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt;import nltk\r\n&gt;&gt;&gt; from nltk.stem import PorterStemmer\r\n&gt;&gt;&gt; words=['write','writer','writing','writers']\r\n&gt;&gt;&gt; ps=PorterStemmer()\r\n&gt;&gt;&gt; for word in words:\r\n          print(f\"{word}: {ps.stem(word)}\")\r\n<\/pre>\n<p><strong>Output-\u00a0<\/strong><br \/>\nwrite: write<br \/>\nwriter: writer<br \/>\nwriting: write<br \/>\nwriters: writer<br \/>\nNow let\u2019s try some more words.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; ps.stem('written')<\/pre>\n<p>&#8216;written&#8217;<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; ps.stem('wrote')<\/pre>\n<p>&#8216;wrote&#8217;<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; ps.stem('writable')<\/pre>\n<p>&#8216;writabl&#8217;<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; ps.stem('writes')<\/pre>\n<p>&#8216;write&#8217;<\/p>\n<h4 class=\"western\">b. Another Example of Python\u00a0Stemming<\/h4>\n<p>Let\u2019s try more words.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; ps.stem('game')<\/pre>\n<p>&#8216;game&#8217;<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; ps.stem('gaming')<\/pre>\n<p>&#8216;game&#8217;<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; ps.stem('gamed')<\/pre>\n<p>&#8216;game&#8217;<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; ps.stem('games')<\/pre>\n<p>&#8216;game&#8217;<br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-method-vs-function\/\" target=\"_blank\" rel=\"noopener\">Let&#8217;s Explore the Difference Between Method and Function in Python<\/a><\/strong><\/p>\n<h4 class=\"western\">c. Python Stemming an Entire Sentence<\/h4>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; from nltk.tokenize import word_tokenize\r\n&gt;&gt;&gt; nltk.download('punkt')\r\n&gt;&gt;&gt; sentence='I am enjoying writing this tutorial; I love to write and I have written 266 words so far. I wrote more than you did; I am a writer.'\r\n&gt;&gt;&gt; words=word_tokenize(sentence)\r\n&gt;&gt;&gt; for word in words:\r\n          print(f\"{word}: {ps.stem(word)}\")             \r\n<\/pre>\n<p>I: I<br \/>\nam: am<br \/>\nenjoying: enjoy<br \/>\nwriting: write<br \/>\nthis: thi<br \/>\ntutorial: tutori<br \/>\n;: ;<br \/>\nI: I<br \/>\nlove: love<br \/>\nto: to<br \/>\nwrite: write<br \/>\nand: and<br \/>\nI: I<br \/>\nhave: have<br \/>\nwritten: written<br \/>\n266: 266<br \/>\nwords: word<br \/>\nso: so<br \/>\nfar: far<br \/>\n.: .<br \/>\nI: I<br \/>\nwrote: wrote<br \/>\nmore: more<br \/>\nthan: than<br \/>\nyou: you<br \/>\ndid: did<br \/>\n;: ;<br \/>\nI: I<br \/>\nam: am<br \/>\na: a<br \/>\nwriter: writer<br \/>\n.: .<\/p>\n<h3 class=\"western\">What is Python Lemmatization?<\/h3>\n<p>Python Lemmatization lets us group together inflected forms of a word. It links words with similar meanings to one word and maps various words onto one root.<br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-regex-tutorial\/\" target=\"_blank\" rel=\"noopener\">Let&#8217;s Discuss Python Regular Expressions | Python Regex Tutorial<\/a><\/strong><\/p>\n<div id=\"attachment_20826\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Lemmatization-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-20826\" class=\"wp-image-20826 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Lemmatization-01.jpg\" alt=\"Learn Python Stemming and Lemmatization - NLTK\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Lemmatization-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Lemmatization-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Lemmatization-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Lemmatization-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Lemmatization-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-20826\" class=\"wp-caption-text\">What is Python Lemmatization?<\/p><\/div>\n<h4 class=\"western\">a. Python Stemming vs Lemmatization<\/h4>\n<p>But how is Python Lemmatization different from stemming? While stemming can create words that do not actually exist, Python lemmatization will only result in words that do. <i>lemma<\/i>s are actual words.<\/p>\n<p>For example, &#8220;playing&#8221;, &#8220;played&#8221;, and &#8220;plays&#8221; all come from the root word &#8220;play&#8221;. Stemming helps by trimming words to their root form. It uses basic rules to cut suffixes like -ing, -ed, or -s. Though it&#8217;s fast and simple, stemming can sometimes produce roots that are not actual words (e.g., &#8220;running&#8221; becomes &#8220;run&#8221; or &#8220;runn&#8221;).<\/p>\n<p>These processes help reduce word variety, making the dataset more consistent and easier to analyze.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; ps.stem('indetify')<\/pre>\n<p>&#8216;indetifi&#8217;<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; lemmatizer.lemmatize('identify')<\/pre>\n<p>&#8216;identify&#8217;<\/p>\n<h4 class=\"western\">b. Python\u00a0Lemmatization Examples<\/h4>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; from nltk.stem import WordNetLemmatizer\r\n&gt;&gt;&gt; lemmatizer=WordNetLemmatizer()\r\n&gt;&gt;&gt; nltk.download('wordnet')\r\n&gt;&gt;&gt; lemmatizer.lemmatize('dogs')<\/pre>\n<p>&#8216;dog&#8217;<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; lemmatizer.lemmatize('geese')<\/pre>\n<p>&#8216;goose&#8217;<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; lemmatizer.lemmatize('cacti')<\/pre>\n<p>&#8216;cactus&#8217;<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; lemmatizer.lemmatize('erasers')<\/pre>\n<p>&#8216;eraser&#8217;<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; lemmatizer.lemmatize('children')<\/pre>\n<p>&#8216;child&#8217;<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; lemmatizer.lemmatize('feet')<\/pre>\n<p>&#8216;foot&#8217;<br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-debugger\/\" target=\"_blank\" rel=\"noopener\">Let&#8217;s Learn Python Debugger with Examples<\/a><\/strong><\/p>\n<h4 class=\"western\">c. Using Pos<\/h4>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; lemmatizer.lemmatize('better',pos='a')<\/pre>\n<p>&#8216;good&#8217;<\/p>\n<p>Here, <i>pos<\/i> is a speech parameter, which is a <i>noun<\/i> by default. This means Python will try to find the closest noun.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; lemmatizer.lemmatize('redder','a')<\/pre>\n<p>\u2018red\u2019<br \/>\nSince Python lemmatization considers whether a word is a noun, a verb, an adjective, or an adverb, Python needs to find out about a word\u2019s context.<\/p>\n<p>So, this was all about Stemming and Lemmatization in Python &amp; Python NLTK. Hope you like our explanation.<\/p>\n<h3 class=\"western\">Conclusion<\/h3>\n<p>Hence, in this Python tutorial, we studied Python Stemming and Lemmatization. In addition, we studied NLTK, an example of Stemming and Lemmatization in Python, and the difference between Python Stemming and Lemmatization. Tell us what you think about this Python Lemmatization and Stemming tutorial in the comments Box.<br \/>\nRelated Topic-\u00a0<strong><a href=\"https:\/\/data-flair.training\/blogs\/cgi-programming-python\/\" target=\"_blank\" rel=\"noopener\">CGI Programming in Python with Functions and Modules<\/a><\/strong><br \/>\n<strong><a href=\"https:\/\/www.python.org\/\">For reference<\/a><\/strong><span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:149,&quot;href&quot;:&quot;https:\\\/\\\/www.python.org&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251206090101\\\/https:\\\/\\\/www.python.org\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-06 12:20:59&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-09 12:44:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-12 13:49:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-15 14:13:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-18 15:26:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-21 17:05:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-24 19:33:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-28 02:44:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-31 04:43:13&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-03 07:01:16&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-06 07:15:14&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-09 07:16:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-12 10:01:16&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-15 10:07:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-18 10:11:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-21 10:20:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-24 10:47:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-27 10:58:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-30 10:59:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-02 12:28:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-05 13:05:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-08 15:11:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-11 15:46:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-14 17:21:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-17 18:37:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 18:52:05&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-23 19:52:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 01:02:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-02 03:50:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-05 05:18:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-08 06:18:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-11 07:24:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-14 08:33:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-17 08:58:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-20 12:26:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-23 14:32:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-26 16:21:46&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-29 17:22:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-01 18:18:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-04 18:27:04&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-08 02:33:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-11 04:53:57&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-14 06:48:30&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-17 07:17:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-20 07:32:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-23 09:34:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-26 10:13:17&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-29 10:35:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-02 11:50:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-05 12:07:03&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-08 13:08:24&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-11 14:46:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-14 21:24:09&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-05-18 03:08:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-21 06:27:39&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-24 07:06:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-27 07:30:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-30 08:47:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-02 09:37:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-05 09:43:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-08 10:40:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-11 10:49:02&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-14 16:29:16&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-14 16:29:16&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this Python Stemming\u00a0tutorial, we will discuss Stemming and Lemmatization in Python Programming Language&#8211; two basics when working with data science in Python. Moreover, we will discuss Python NLTK and Python Stemming examples. Along&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":20807,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[8203,9018,9078,9081,10636,10720,10860,13019,13739,13817],"class_list":["post-20790","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-lemmatization-in-python","tag-natural-language-toolkit","tag-nltk-lemmatizer-pos","tag-nltk-stemming","tag-python-lemmatization","tag-python-nltk","tag-python-stemming","tag-spacy-lemmatizer","tag-stanford-lemmatizer","tag-stemming-vs-lemmatization"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Learn Python Stemming and Lemmatization - Python NLTK - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn What is Python Stemming and Lemmatization. See about NLTK, Python Stemming vs Lemmatization with examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/python-stemming\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learn Python Stemming and Lemmatization - Python NLTK - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn What is Python Stemming and Lemmatization. See about NLTK, Python Stemming vs Lemmatization with examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/python-stemming\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-12T04:00:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-28T10:02:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Stemming-and-Lemmatization-in-Python-01.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Learn Python Stemming and Lemmatization - Python NLTK - DataFlair","description":"Learn What is Python Stemming and Lemmatization. See about NLTK, Python Stemming vs Lemmatization with examples.","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:\/\/data-flair.training\/blogs\/python-stemming\/","og_locale":"en_US","og_type":"article","og_title":"Learn Python Stemming and Lemmatization - Python NLTK - DataFlair","og_description":"Learn What is Python Stemming and Lemmatization. See about NLTK, Python Stemming vs Lemmatization with examples.","og_url":"https:\/\/data-flair.training\/blogs\/python-stemming\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-07-12T04:00:09+00:00","article_modified_time":"2026-04-28T10:02:53+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Stemming-and-Lemmatization-in-Python-01.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/python-stemming\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/python-stemming\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Learn Python Stemming and Lemmatization &#8211; Python NLTK","datePublished":"2018-07-12T04:00:09+00:00","dateModified":"2026-04-28T10:02:53+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-stemming\/"},"wordCount":835,"commentCount":4,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-stemming\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Stemming-and-Lemmatization-in-Python-01.jpg","keywords":["lemmatization in Python","Natural Language Toolkit","nltk lemmatizer pos","nltk stemming","Python lemmatization","Python NLTK","Python stemming","spacy lemmatizer","stanford lemmatizer","Stemming vs Lemmatization"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/python-stemming\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/python-stemming\/","url":"https:\/\/data-flair.training\/blogs\/python-stemming\/","name":"Learn Python Stemming and Lemmatization - Python NLTK - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-stemming\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-stemming\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Stemming-and-Lemmatization-in-Python-01.jpg","datePublished":"2018-07-12T04:00:09+00:00","dateModified":"2026-04-28T10:02:53+00:00","description":"Learn What is Python Stemming and Lemmatization. See about NLTK, Python Stemming vs Lemmatization with examples.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/python-stemming\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/python-stemming\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/python-stemming\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Stemming-and-Lemmatization-in-Python-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Stemming-and-Lemmatization-in-Python-01.jpg","width":1200,"height":628,"caption":"Python Stemming and Lemmatization - NLTK"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/python-stemming\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Python Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/python\/"},{"@type":"ListItem","position":3,"name":"Learn Python Stemming and Lemmatization &#8211; Python NLTK"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/20790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=20790"}],"version-history":[{"count":10,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/20790\/revisions"}],"predecessor-version":[{"id":148025,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/20790\/revisions\/148025"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/20807"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=20790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=20790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=20790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}