René's URL Explorer Experiment


Title: Sentiment Analysis: First Steps With Python's NLTK Library – Real Python

Open Graph Title: Sentiment Analysis: First Steps With Python's NLTK Library – Real Python

Description: In this tutorial, you'll learn how to work with Python's Natural Language Toolkit (NLTK) to process and analyze text. You'll also learn how to perform sentiment analysis with built-in as well as custom classifiers!

Open Graph Description: In this tutorial, you'll learn how to work with Python's Natural Language Toolkit (NLTK) to process and analyze text. You'll also learn how to perform sentiment analysis with built-in as well as custom classifiers!

Mail addresses
?subject=Python article for you&body=Sentiment Analysis: First Steps With Python's NLTK Library on Real Python https://realpython.com/python-nltk-sentiment-analysis/

Opengraph URL: https://realpython.com/python-nltk-sentiment-analysis/

X: @realpython

direct link

Domain: realpython.com


Hey, it has json ld scripts:
{
  "@context": "http://schema.org",
  "@type": "Article",
  "headline": "Sentiment Analysis: First Steps With Python's NLTK Library",
  "image": {
    "@type": "ImageObject",
    "url": "https://files.realpython.com/media/How-to-use-NLTK-for-Sentiment-Analysis-in-Python_Watermarked.05ff07ca7ec7.jpg",
    "width": 1920,
    "height": 1080
  },
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://realpython.com/python-nltk-sentiment-analysis/",
    "lastReviewed": "2022-09-01",
    "author": {
      "@type": "Person",
      "name": "Marius Mogyorosi",
      "image": "https://realpython.com/cdn-cgi/image/width=1920,height=1920,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/real-python-logo-square.28474fda9228_1.146e987bf77c.png",
      "url": "https://realpython.com/team/mmogyorosi/",
      "affiliation": {
        "@type": "Organization",
        "@id": "https://realpython.com/#organization",
        "name": "Real Python",
        "url": "https://realpython.com",
        "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
      }
    },
    "reviewedBy": [
      {
        "@type": "Person",
        "name": "Aldren Santos",
        "image": "https://realpython.com/cdn-cgi/image/width=500,height=500,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/Aldren_Santos_Real_Python.6b0861d8b841.png",
        "url": "https://realpython.com/team/asantos/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "Brad Solomon",
        "image": "https://realpython.com/cdn-cgi/image/width=1188,height=1188,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/Screen_Shot_2021-09-28_at_3.13.21_PM.3310c56e90bd.jpg",
        "url": "https://realpython.com/team/bsolomon/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "Geir Arne Hjelle",
        "image": "https://realpython.com/cdn-cgi/image/width=800,height=800,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/gahjelle.470149ee709e.jpg",
        "url": "https://realpython.com/team/gahjelle/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "Joanna Jablonski",
        "image": "https://realpython.com/cdn-cgi/image/width=800,height=800,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/jjablonksi-avatar.e37c4f83308e.jpg",
        "url": "https://realpython.com/team/jjablonski/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "Jacob Schmitt",
        "image": "https://realpython.com/cdn-cgi/image/width=400,height=400,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/profile-small_js.2f4d0d8da1ca.jpg",
        "url": "https://realpython.com/team/jschmitt/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      }
    ]
  },
  "datePublished": "2021-01-13T14:00:00+00:00",
  "dateModified": "2022-09-01T07:43:05.594236+00:00",
  "publisher": {
    "@type": "Organization",
    "@id": "https://realpython.com/#organization",
    "name": "Real Python",
    "url": "https://realpython.com",
    "logo": {
      "@type": "ImageObject",
      "url": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png",
      "width": 512,
      "height": 512
    },
    "description": "Real Python is a leading provider of online Python education and one of the largest language-specific online communities for software developers. It publishes high-quality learning resources, such as tutorials, books, and courses to an audience of millions of developers, data scientists, and machine learning engineers each month.",
    "slogan": "Become a Python Expert",
    "email": "info@realpython.com",
    "sameAs": [
      "https://github.com/realpython",
      "https://www.youtube.com/realpython",
      "https://twitter.com/realpython",
      "https://x.com/realpython",
      "https://www.linkedin.com/company/realpython-com/",
      "https://www.facebook.com/learnrealpython",
      "https://www.instagram.com/realpython",
      "https://www.tiktok.com/@realpython.com"
    ]
  },
  "author": {
    "@type": "Person",
    "name": "Marius Mogyorosi",
    "image": "https://realpython.com/cdn-cgi/image/width=1920,height=1920,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/real-python-logo-square.28474fda9228_1.146e987bf77c.png",
    "url": "https://realpython.com/team/mmogyorosi/",
    "affiliation": {
      "@type": "Organization",
      "@id": "https://realpython.com/#organization",
      "name": "Real Python",
      "url": "https://realpython.com",
      "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
    }
  },
  "description": "In this tutorial, you'll learn how to work with Python's Natural Language Toolkit (NLTK) to process and analyze text. You'll also learn how to perform sentiment analysis with built-in as well as custom classifiers!"
}

authorReal Python
twitter:cardsummary_large_image
twitter:imagehttps://files.realpython.com/media/How-to-use-NLTK-for-Sentiment-Analysis-in-Python_Watermarked.05ff07ca7ec7.jpg
og:imagehttps://files.realpython.com/media/How-to-use-NLTK-for-Sentiment-Analysis-in-Python_Watermarked.05ff07ca7ec7.jpg
twitter:creator@realpython
og:typearticle

Links:

https://realpython.com/
Start Herehttps://realpython.com/start-here/
Learn Python https://realpython.com/python-nltk-sentiment-analysis/
Python Tutorials →In-depth articles and video courseshttps://realpython.com/search?kind=article&kind=course&order=newest
Learning Paths →Guided study plans for accelerated learninghttps://realpython.com/learning-paths/
Quizzes & Exercises →Check your learning progresshttps://realpython.com/quizzes/
Browse Topics →Focus on a specific area or skill levelhttps://realpython.com/tutorials/all/
Community Chat →Learn with other Pythonistashttps://realpython.com/community/
Office Hours →Live Q&A calls with Python expertshttps://realpython.com/office-hours/
Podcast →Hear what’s new in the world of Pythonhttps://realpython.com/podcasts/rpp/
Books →Round out your knowledge and learn offlinehttps://realpython.com/products/books/
Reference →Concise definitions for common Python termshttps://realpython.com/ref/
Code Mentor →BetaPersonalized code assistance & learning toolshttps://realpython.com/mentor/
Unlock All Content →https://realpython.com/account/join/
More https://realpython.com/python-nltk-sentiment-analysis/
Learner Storieshttps://realpython.com/learner-stories/
Python Newsletterhttps://realpython.com/newsletter/
Python Job Boardhttps://www.pythonjobshq.com
Meet the Teamhttps://realpython.com/team/
Become a Tutorial Writerhttps://realpython.com/write-for-us/
Become a Video Instructorhttps://realpython.com/become-an-instructor/
Searchhttps://realpython.com/search
https://realpython.com/search
Joinhttps://realpython.com/account/join/
Sign‑Inhttps://realpython.com/account/login/?next=%2Fpython-nltk-sentiment-analysis%2F
Browse Topicshttps://realpython.com/tutorials/all/
Guided Learning Pathshttps://realpython.com/learning-paths/
Basicshttps://realpython.com/search?level=basics
Intermediatehttps://realpython.com/search?level=intermediate
Advancedhttps://realpython.com/search?level=advanced
aihttps://realpython.com/tutorials/ai/
algorithmshttps://realpython.com/tutorials/algorithms/
apihttps://realpython.com/tutorials/api/
best-practiceshttps://realpython.com/tutorials/best-practices/
careerhttps://realpython.com/tutorials/career/
communityhttps://realpython.com/tutorials/community/
databaseshttps://realpython.com/tutorials/databases/
data-sciencehttps://realpython.com/tutorials/data-science/
data-structureshttps://realpython.com/tutorials/data-structures/
data-vizhttps://realpython.com/tutorials/data-viz/
devopshttps://realpython.com/tutorials/devops/
djangohttps://realpython.com/tutorials/django/
dockerhttps://realpython.com/tutorials/docker/
editorshttps://realpython.com/tutorials/editors/
flaskhttps://realpython.com/tutorials/flask/
front-endhttps://realpython.com/tutorials/front-end/
gamedevhttps://realpython.com/tutorials/gamedev/
guihttps://realpython.com/tutorials/gui/
machine-learninghttps://realpython.com/tutorials/machine-learning/
newshttps://realpython.com/tutorials/news/
numpyhttps://realpython.com/tutorials/numpy/
projectshttps://realpython.com/tutorials/projects/
pythonhttps://realpython.com/tutorials/python/
stdlibhttps://realpython.com/tutorials/stdlib/
testinghttps://realpython.com/tutorials/testing/
toolshttps://realpython.com/tutorials/tools/
web-devhttps://realpython.com/tutorials/web-dev/
web-scrapinghttps://realpython.com/tutorials/web-scraping/
Table of Contentshttps://realpython.com/python-nltk-sentiment-analysis/#toc
Getting Started With NLTKhttps://realpython.com/python-nltk-sentiment-analysis/#getting-started-with-nltk
Installing and Importinghttps://realpython.com/python-nltk-sentiment-analysis/#installing-and-importing
Compiling Datahttps://realpython.com/python-nltk-sentiment-analysis/#compiling-data
Creating Frequency Distributionshttps://realpython.com/python-nltk-sentiment-analysis/#creating-frequency-distributions
Extracting Concordance and Collocationshttps://realpython.com/python-nltk-sentiment-analysis/#extracting-concordance-and-collocations
Using NLTK’s Pre-Trained Sentiment Analyzerhttps://realpython.com/python-nltk-sentiment-analysis/#using-nltks-pre-trained-sentiment-analyzer
Customizing NLTK’s Sentiment Analysishttps://realpython.com/python-nltk-sentiment-analysis/#customizing-nltks-sentiment-analysis
Selecting Useful Featureshttps://realpython.com/python-nltk-sentiment-analysis/#selecting-useful-features
Training and Using a Classifierhttps://realpython.com/python-nltk-sentiment-analysis/#training-and-using-a-classifier
Comparing Additional Classifiershttps://realpython.com/python-nltk-sentiment-analysis/#comparing-additional-classifiers
Installing and Importing scikit-learnhttps://realpython.com/python-nltk-sentiment-analysis/#installing-and-importing-scikit-learn
Using scikit-learn Classifiers With NLTKhttps://realpython.com/python-nltk-sentiment-analysis/#using-scikit-learn-classifiers-with-nltk
Conclusionhttps://realpython.com/python-nltk-sentiment-analysis/#conclusion
https://realpython.com/feedback/survey/article/python-nltk-sentiment-analysis/liked/?from=article-sidebar
https://realpython.com/feedback/survey/article/python-nltk-sentiment-analysis/disliked/?from=article-sidebar
Marius Mogyorosihttps://realpython.com/python-nltk-sentiment-analysis/#author
https://realpython.com/python-nltk-sentiment-analysis/#reader-comments
intermediatehttps://realpython.com/tutorials/intermediate/
algorithmshttps://realpython.com/tutorials/algorithms/
data-sciencehttps://realpython.com/tutorials/data-science/
machine-learninghttps://realpython.com/tutorials/machine-learning/
Getting Started With NLTKhttps://realpython.com/python-nltk-sentiment-analysis/#getting-started-with-nltk
Installing and Importinghttps://realpython.com/python-nltk-sentiment-analysis/#installing-and-importing
Compiling Datahttps://realpython.com/python-nltk-sentiment-analysis/#compiling-data
Creating Frequency Distributionshttps://realpython.com/python-nltk-sentiment-analysis/#creating-frequency-distributions
Extracting Concordance and Collocationshttps://realpython.com/python-nltk-sentiment-analysis/#extracting-concordance-and-collocations
Using NLTK’s Pre-Trained Sentiment Analyzerhttps://realpython.com/python-nltk-sentiment-analysis/#using-nltks-pre-trained-sentiment-analyzer
Customizing NLTK’s Sentiment Analysishttps://realpython.com/python-nltk-sentiment-analysis/#customizing-nltks-sentiment-analysis
Selecting Useful Featureshttps://realpython.com/python-nltk-sentiment-analysis/#selecting-useful-features
Training and Using a Classifierhttps://realpython.com/python-nltk-sentiment-analysis/#training-and-using-a-classifier
Comparing Additional Classifiershttps://realpython.com/python-nltk-sentiment-analysis/#comparing-additional-classifiers
Installing and Importing scikit-learnhttps://realpython.com/python-nltk-sentiment-analysis/#installing-and-importing-scikit-learn
Using scikit-learn Classifiers With NLTKhttps://realpython.com/python-nltk-sentiment-analysis/#using-scikit-learn-classifiers-with-nltk
Conclusionhttps://realpython.com/python-nltk-sentiment-analysis/#conclusion
Remove adshttps://realpython.com/account/join/
basics of Pythonhttps://realpython.com/learning-paths/python-basics-book/
functionshttps://realpython.com/defining-your-own-python-function/
sentiment analysishttps://realpython.com/sentiment-analysis-python/
machine learninghttps://realpython.com/learning-paths/machine-learning-python/
Click here to get our free Python Cheat Sheethttps://realpython.com/bonus/python-cheat-sheet-experiment/
https://realpython.com/python-nltk-sentiment-analysis/#getting-started-with-nltk
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-nltk-sentiment-analysis/#installing-and-importing
piphttps://realpython.com/what-is-pip/
list of common English nameshttp://www-2.cs.cmu.edu/afs/cs/project/ai-repository/ai/areas/nlp/corpora/names/
State of the Unionhttps://en.wikipedia.org/wiki/State_of_the_Union
Two thousand movie reviewshttp://www.cs.cornell.edu/people/pabo/movie-review-data/
part of speechhttps://en.wikipedia.org/wiki/Part_of_speech
list of words and jargonhttps://github.com/cjhutto/vaderSentiment
natural language processing (NLP)https://en.wikipedia.org/wiki/Natural_language_processing
listhttps://realpython.com/python-lists-tuples/
https://realpython.com/python-nltk-sentiment-analysis/#compiling-data
how to work with corpus readershttps://www.nltk.org/howto/corpus.html
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-nltk-sentiment-analysis/#creating-frequency-distributions
Python dictionaryhttps://realpython.com/python-dicts/
new feature in Python 3.9https://realpython.com/python39-new-features/#type-hint-lists-and-dictionaries-directly
iterablehttps://realpython.com/python-for-loop/#iterables
list comprehensionshttps://realpython.com/list-comprehension-python/
https://realpython.com/python-nltk-sentiment-analysis/#extracting-concordance-and-collocations
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-nltk-sentiment-analysis/#using-nltks-pre-trained-sentiment-analyzer
stringhttps://realpython.com/python-strings/
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-nltk-sentiment-analysis/#customizing-nltks-sentiment-analysis
feature selectionhttps://en.wikipedia.org/wiki/Feature_selection
feature engineeringhttps://en.wikipedia.org/wiki/Feature_engineering
https://realpython.com/python-nltk-sentiment-analysis/#selecting-useful-features
default tag sethttps://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html
https://realpython.com/python-nltk-sentiment-analysis/#training-and-using-a-classifier
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-nltk-sentiment-analysis/#comparing-additional-classifiers
scikit-learnhttps://scikit-learn.org/stable/
https://realpython.com/python-nltk-sentiment-analysis/#installing-and-importing-scikit-learn
https://realpython.com/python-nltk-sentiment-analysis/#using-scikit-learn-classifiers-with-nltk
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-nltk-sentiment-analysis/#conclusion
sentiment analysis visualizerhttps://realpython.com/twitter-sentiment-python-docker-elasticsearch-kibana/
Python web applicationhttps://realpython.com/flask-by-example-part-3-text-processing-with-requests-beautifulsoup-nltk/
https://realpython.com/feedback/survey/article/python-nltk-sentiment-analysis/liked/?from=article-footer
https://realpython.com/feedback/survey/article/python-nltk-sentiment-analysis/disliked/?from=article-footer
https://realpython.com/team/mmogyorosi/
» More about Mariushttps://realpython.com/team/mmogyorosi/
https://realpython.com/team/asantos/
Aldrenhttps://realpython.com/team/asantos/
https://realpython.com/team/bsolomon/
Bradhttps://realpython.com/team/bsolomon/
https://realpython.com/team/gahjelle/
Geir Arnehttps://realpython.com/team/gahjelle/
https://realpython.com/team/jjablonski/
Joannahttps://realpython.com/team/jjablonski/
https://realpython.com/team/jschmitt/
Jacobhttps://realpython.com/team/jschmitt/
Level Up Your Python Skills »https://realpython.com/account/join/?utm_source=rp_article_footer&utm_content=python-nltk-sentiment-analysis
Level Up Your Python Skills »https://realpython.com/account/join/?utm_source=rp_article_footer&utm_content=python-nltk-sentiment-analysis
https://realpython.com/feedback/survey/article/python-nltk-sentiment-analysis/liked/?from=article-comments
https://realpython.com/feedback/survey/article/python-nltk-sentiment-analysis/disliked/?from=article-comments
LinkedInhttps://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Frealpython.com%2Fpython-nltk-sentiment-analysis%2F
Twitterhttps://twitter.com/intent/tweet/?text=Interesting%20Python%20article%20on%20%40realpython%3A%20Sentiment%20Analysis%3A%20First%20Steps%20With%20Python%27s%20NLTK%20Library&url=https%3A%2F%2Frealpython.com%2Fpython-nltk-sentiment-analysis%2F
Blueskyhttps://bsky.app/intent/compose?text=Interesting%20Python%20article%20on%20%40realpython.com%3A%20Sentiment%20Analysis%3A%20First%20Steps%20With%20Python%27s%20NLTK%20Library%20https%3A%2F%2Frealpython.com%2Fpython-nltk-sentiment-analysis%2F
Facebookhttps://facebook.com/sharer/sharer.php?u=https%3A%2F%2Frealpython.com%2Fpython-nltk-sentiment-analysis%2F
Get tips for asking good questionshttps://realpython.com/python-beginner-tips/#tip-9-ask-good-questions
get answers to common questions in our support portalhttps://support.realpython.com
Real Python Community Chathttps://realpython.com/community/
“Office Hours” Live Q&A Sessionhttps://realpython.com/office-hours/
intermediatehttps://realpython.com/tutorials/intermediate/
algorithmshttps://realpython.com/tutorials/algorithms/
data-sciencehttps://realpython.com/tutorials/data-science/
machine-learninghttps://realpython.com/tutorials/machine-learning/
Natural Language Processing With Python's NLTK Packagehttps://realpython.com/nltk-nlp-python/?utm_source=realpython&utm_medium=web&utm_campaign=related-post&utm_content=python-nltk-sentiment-analysis
Natural Language Processing With spaCy in Pythonhttps://realpython.com/natural-language-processing-spacy-python/?utm_source=realpython&utm_medium=web&utm_campaign=related-post&utm_content=python-nltk-sentiment-analysis
Use Sentiment Analysis With Python to Classify Movie Reviewshttps://realpython.com/sentiment-analysis-python/?utm_source=realpython&utm_medium=web&utm_campaign=related-post&utm_content=python-nltk-sentiment-analysis
https://realpython.com/account/signup/?intent=continue_reading&utm_source=rp&utm_medium=web&utm_campaign=rwn&utm_content=v1&next=%2Fpython-nltk-sentiment-analysis%2F
Continue »https://realpython.com/account/signup/?intent=continue_reading&utm_source=rp&utm_medium=web&utm_campaign=rwn&utm_content=v1&next=%2Fpython-nltk-sentiment-analysis%2F
Sign-Inhttps://realpython.com/account/login/?next=/python-nltk-sentiment-analysis/
Start Herehttps://realpython.com/start-here/
Learning Resourceshttps://realpython.com/search
Code Mentorhttps://realpython.com/mentor/
Python Referencehttps://realpython.com/ref/
Python Cheat Sheethttps://realpython.com/cheatsheets/python/
Support Centerhttps://support.realpython.com/
Learning Pathshttps://realpython.com/learning-paths/
Quizzes & Exerciseshttps://realpython.com/quizzes/
Browse Topicshttps://realpython.com/tutorials/all/
Live Courseshttps://realpython.com/live/
Bookshttps://realpython.com/books/
Podcasthttps://realpython.com/podcasts/rpp/
Newsletterhttps://realpython.com/newsletter/
Community Chathttps://realpython.com/community/
Office Hourshttps://realpython.com/office-hours/
Learner Storieshttps://realpython.com/learner-stories/
Plans & Pricinghttps://realpython.com/account/join/
Team Planshttps://realpython.com/account/join-team/
For Businesshttps://realpython.com/account/join-team/inquiry/
For Schoolshttps://realpython.com/account/join-team/education-inquiry/
Reviewshttps://realpython.com/learner-stories/
About Ushttps://realpython.com/about/
Teamhttps://realpython.com/team/
Mission & Valueshttps://realpython.com/mission/
Editorial Guidelineshttps://realpython.com/editorial-guidelines/
Sponsorshipshttps://realpython.com/sponsorships/
Careershttps://realpython.workable.com
Press Kithttps://realpython.com/media-kit/
Merchhttps://realpython.com/merch
https://www.youtube.com/realpython
https://x.com/realpython
https://www.linkedin.com/company/realpython-com
https://www.facebook.com/LearnRealPython
https://github.com/realpython/
Privacy Policyhttps://realpython.com/privacy-policy/
Terms of Usehttps://realpython.com/terms/
Securityhttps://realpython.com/security/
Contacthttps://realpython.com/contact/
https://realpython.com/

Viewport: width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover

Robots: max-image-preview:large


URLs of crawlers that visited me.