The Real Python Podcast

Exploring Modern Sentiment Analysis Approaches in Python


Listen Later

What are the current approaches for analyzing emotions within a piece of text? Which tools and Python packages should you use for sentiment analysis? This week, Jodie Burchell, developer advocate for data science at JetBrains, returns to the show to discuss modern sentiment analysis in Python.

Jodie holds a PhD in clinical psychology. We discuss how her interest in studying emotions has continued throughout her career.

In this episode, Jodie covers three ways to approach sentiment analysis. We start by discussing traditional lexicon-based and machine-learning approaches. Then, we dive into how specific types of LLMs can be used for the task. We also share multiple resources so you can continue to explore sentiment analysis on your own.

This week’s episode is brought to you by Sentry.

Course Spotlight: Learn Text Classification With Python and Keras

In this course, you’ll learn about Python text classification with Keras, working your way from a bag-of-words model with logistic regression to more advanced methods, such as convolutional neural networks. You’ll see how you can use pretrained word embeddings, and you’ll squeeze more performance out of your model through hyperparameter optimization.

Topics:

  • 00:00:00 – Introduction
  • 00:02:31 – Conference talks in 2024
  • 00:04:23 – Background on sentiment analysis and studying feelings
  • 00:07:09 – What led you to study emotions?
  • 00:08:57 – Dimensional emotion classification
  • 00:10:42 – Different types of sentiment analysis
  • 00:14:28 – Lexicon-based approaches
  • 00:17:50 – VADER - Valence Aware Dictionary and sEntiment Reasoner
  • 00:19:41 – TextBlob and subjectivity scoring
  • 00:21:48 – Sponsor: Sentry
  • 00:22:52 – Measuring sentiment of New Year’s resolutions
  • 00:27:28 – Lexicon-based approaches links for experimenting
  • 00:28:35 – Multiple language support in lexicon-based packages
  • 00:35:23 – Machine learning techniques
  • 00:39:20 – Tools for this approach
  • 00:42:54 – Video Course Spotlight
  • 00:44:15 – Advantages to the machine learning models approach
  • 00:45:55 – Large language model approach
  • 00:48:44 – Encoder vs decoder models
  • 00:52:09 – Comparing the concept of fine-tuning
  • 00:56:49 – Is this a recent development?
  • 00:58:08 – Ways to practice with these techniques
  • 01:00:10 – Do you find this to be a promising approach?
  • 01:07:45 – Resources to practice with all the techniques
  • 01:11:06 – Upcoming conference talks
  • 01:11:56 – Thanks and goodbye
  • Show Links:

    • Introduction to Sentiment Analysis in Python - The PyCharm Blog
    • How to Do Sentiment Analysis With Large Language Models - The PyCharm Blog
    • Talks - Jodie Burchell: Lies, damned lies and large language models - YouTube
    • Mirror, mirror: LLMs and the illusion of humanity - Jodie Burchell - YouTube
    • Separating fact from fiction in a world of AI fairytales - Jodie Burchell - NDC London 2024 - YouTube
    • Hurt Feelings (Rap Version) - Flight Of The Conchords (Lyrics) - YouTube
    • Universal Emotions - What are Emotions? - Paul Ekman Group
    • VADER - nltk.sentiment.vader module
    • clips/pattern: Web mining module for Python, with tools for scraping, natural language processing, machine learning
    • TextBlob: Simplified Text Processing — TextBlob documentation
    • Power vs. Force: The Hidden Determinants of Human Behavior by David R. Hawkins - Goodreads
    • Episode #36: Sentiment Analysis, Fourier Transforms, and More Python Data Science – The Real Python Podcast
    • Use Sentiment Analysis With Python to Classify Movie Reviews – Real Python
    • Sentiment Analysis: First Steps With Python’s NLTK Library – Real Python
    • Sentiment Analysis in DataSpell with @JetBrainsTV - YouTube
    • Episode #119: Natural Language Processing and How ML Models Understand Text – The Real Python Podcast
    • spaCy - Industrial-strength Natural Language Processing in Python
    • amazon_polarity - Datasets at Hugging Face
    • Introduction to Sentiment Analysis in Python - The PyCharm Blog
    • Kaggle: Your Machine Learning and Data Science Community
    • ZS BIT
    • AI Community Day - 10 December 2024
    • Jodie Burchell - The JetBrains Blog
    • Jodie Burchell’s Blog - Standard error
    • Jodie Burchell 🇦🇺🇩🇪 (@t_redactyl) - Twitter
    • Jodie Burchell (@t-redactyl.bsky.social) — Bluesky
    • Jodie Burchell 🇦🇺🇩🇪 (@[email protected]) - Fosstodon
    • JetBrains: Essential tools for software developers and teams
    • Level up your Python skills with our expert-led courses:

      • Data Cleaning With pandas and NumPy
      • Learn Text Classification With Python and Keras
      • Exploring Astrophysics in Python With pandas and Matplotlib
      • Support the podcast & join our community of Pythonistas

        ...more
        View all episodesView all episodes
        Download on the App Store

        The Real Python PodcastBy Real Python

        • 4.7
        • 4.7
        • 4.7
        • 4.7
        • 4.7

        4.7

        134 ratings


        More shows like The Real Python Podcast

        View all
        Hanselminutes with Scott Hanselman by Scott Hanselman

        Hanselminutes with Scott Hanselman

        378 Listeners

        Software Engineering Radio - the podcast for professional software developers by se-radio@computer.org

        Software Engineering Radio - the podcast for professional software developers

        262 Listeners

        The Changelog: Software Development, Open Source by Changelog Media

        The Changelog: Software Development, Open Source

        285 Listeners

        LINUX Unplugged by Jupiter Broadcasting

        LINUX Unplugged

        263 Listeners

        Thoughtworks Technology Podcast by Thoughtworks

        Thoughtworks Technology Podcast

        43 Listeners

        Talk Python To Me by Michael Kennedy

        Talk Python To Me

        584 Listeners

        Software Engineering Daily by Software Engineering Daily

        Software Engineering Daily

        630 Listeners

        Super Data Science: ML & AI Podcast with Jon Krohn by Jon Krohn

        Super Data Science: ML & AI Podcast with Jon Krohn

        295 Listeners

        Python Bytes by Michael Kennedy and Brian Okken

        Python Bytes

        212 Listeners

        Data Engineering Podcast by Tobias Macey

        Data Engineering Podcast

        143 Listeners

        Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

        Syntax - Tasty Web Development Treats

        985 Listeners

        CoRecursive: Coding Stories by Adam Gordon Bell - Software Developer

        CoRecursive: Coding Stories

        185 Listeners

        DataFramed by DataCamp

        DataFramed

        267 Listeners

        Practical AI by Practical AI LLC

        Practical AI

        196 Listeners

        The Stack Overflow Podcast by The Stack Overflow Podcast

        The Stack Overflow Podcast

        63 Listeners