Presidential Debate Twitter Sentiment Analysis using Python and NLTK

Поделиться
HTML-код
  • Опубликовано: 10 янв 2025

Комментарии • 81

  • @gabrielfreay
    @gabrielfreay 3 года назад +1

    You are the Best, I supposed to be sleeping 😴 but I prefer being watching your videos. Seriously 😳 it's amazing how easy you make things looks like.

  • @grahamwalker512
    @grahamwalker512 4 года назад +2

    Great video! Always great to see a tutorial that uses current events to make it "real". Keep up the great work.

    • @NicholasRenotte
      @NicholasRenotte  4 года назад

      @Graham Walker! Yes, definitely! Trying to keep it relevant and a little bit fun as well.

    • @hectortobias8840
      @hectortobias8840 3 года назад

      instablaster

  • @vipinsainilol
    @vipinsainilol 3 года назад +2

    I appreciate you for making this video!...a great help to learn sentiment analysis

  • @pantsuslayer8631
    @pantsuslayer8631 4 года назад +1

    Thanks, i learned a lot;. Thought im just starting and couldn´t understand every single thing i got the basic idea. please keep making this type of videos!

    • @NicholasRenotte
      @NicholasRenotte  4 года назад

      👏 awesome, thank you soo much @Pantsu Slayer! If there’s anything you want me to dive deeper into, let me know! Plenty more videos coming 👨‍💻!

  • @nishadseeraj7034
    @nishadseeraj7034 4 года назад +3

    Great tutorial! i love your teaching style and how you explain everything as well as the great flow of your video! Looking forward to more python tutorials. I'm new to python having most of my prior experience in R

  • @Tourismmj
    @Tourismmj 2 года назад +1

    Thank you so much for sharing the great tutorial, Nick!!!!

  • @anukarthika4ever
    @anukarthika4ever 3 года назад +2

    Love your content! Condensed and to the point👍👍

  • @sakethgupta2885
    @sakethgupta2885 3 года назад +1

    underrated channel

  • @musicpatron1693
    @musicpatron1693 3 года назад +1

    YOUUUUU ARREEE TOOOO FASTTTTT FOR MEEE!!! GOOD JOB!

    • @NicholasRenotte
      @NicholasRenotte  3 года назад +1

      Thanks sooo much! Glad you enjoyed it. Check out the code in the description as well!

  • @christophercrager1925
    @christophercrager1925 2 года назад

    You make it look so easy. Thank you for sharing!

  • @meeramaurya7670
    @meeramaurya7670 3 года назад +1

    Great Video, clear explanation..thanks a lot

  • @princevladimierdelosreyes2025
    @princevladimierdelosreyes2025 3 года назад +1

    this is a great help. thanks! i subscribed

  • @mihaelbos
    @mihaelbos 2 года назад

    Which sentiment library/tool/model do you recommend for analyzing customer reviews? It tried using vader, bert, roberta, textblob...so far bert was the most accurate.

  • @closed252
    @closed252 3 года назад +1

    Great Video!!!! Thank you so much for that!

  • @yeancahogundipe268
    @yeancahogundipe268 2 года назад

    Please How do we balance the dataset ?Great tutorial btw!

  • @kartikyadav7421
    @kartikyadav7421 2 года назад

    Twitter error response: status code = 403; whenever i try to run the tweets command in the beginning

  • @wilsonwilson137
    @wilsonwilson137 2 года назад

    Hey, great videos!

  • @abdullahbutt1800
    @abdullahbutt1800 3 года назад

    Great video Nicholas! I'm struggling to put a condition where I want to get tweets from a specific time period. can you please guide me through it. Thanks!

    • @NicholasRenotte
      @NicholasRenotte  3 года назад

      Definitely you can apply a filter like so df[df['Timestamp']=='your period']

  • @ghosthanded
    @ghosthanded 2 года назад

    I keep getting the error TypeError: expected string or bytes-like object when I apply the cleaning functions

  • @MeetMoyele
    @MeetMoyele 3 года назад

    Thank you for the guidance. How much tweets can I retrieve from Twitter?

  • @explorenations892
    @explorenations892 3 года назад

    what if we want to create a flag for multiple references ??

  • @nitinluthra1751
    @nitinluthra1751 2 года назад

    Dear Nicholas, thank you for this very helpful and condensed video. I am completely new to coding so please answer this novice question. How does one get to the Jupyter Debate Analyser page (before you begin all your analysis)? Until now I have been following Visual Code Studio so this is new for me.

    • @ralphumo7152
      @ralphumo7152 2 года назад

      Its just a regular Jupyter page. He named it as "Debate Analyser". Hence you have the Jupyter logo beside the page name.

  • @kwabsbotwe6124
    @kwabsbotwe6124 4 года назад

    To identify the subject from 15:20 onwards how do you differentiate a subject that has both Biden and Trump?

    • @NicholasRenotte
      @NicholasRenotte  4 года назад +1

      Heya @kwabs, you can do that from step four, instead of identifying a single candidate. You can filter on tweets that mention both like so:
      Old code:
      df[df['Biden']==1][['Biden','polarity','subjectivity']].groupby('Biden').agg([np.mean, np.max, np.min, np.median])
      New code:
      df[(df['Biden']==1) and (df['Trump']==1)][['Biden','polarity','subjectivity']].groupby('Biden').agg([np.mean, np.max, np.min, np.median])

    • @kwabsbotwe6124
      @kwabsbotwe6124 4 года назад +1

      @@NicholasRenotte thanks 🙏

    • @kwabsbotwe6124
      @kwabsbotwe6124 4 года назад +1

      In situations where you want to know the general political sentiments of the country over a period of time what are the factors to consider in your analysis?

    • @NicholasRenotte
      @NicholasRenotte  4 года назад

      @@kwabsbotwe6124 anytime amigo!!

    • @NicholasRenotte
      @NicholasRenotte  4 года назад

      @@kwabsbotwe6124 great question, although I wouldn't set out with too many pre-conceived notions as to what the factors might be. This is where exploratory data analysis, clustering and topic modelling come in handy to allow you to determine these factors.

  • @ashleysami1640
    @ashleysami1640 4 года назад +2

    Only you could make the debate about Pizza 😂. Where's that #Dominos sponsorship at?
    #nickforpizzapresident

    • @NicholasRenotte
      @NicholasRenotte  4 года назад +1

      🤷🏾‍♂️ I’m with you @Ashley Sami! #Dominos hit me up! 🤣

  • @nwh9926
    @nwh9926 3 года назад

    Hi , I have problem on applying verification from twitter, this have been a second time because first application have been rejected. Any tips to avoid from been rejected? My project is for my final year project T.T which is for academic purpose T.T it's really important

  • @ademhilmibozkurt7085
    @ademhilmibozkurt7085 2 года назад

    thank you so much

  • @dwikiahmamaulana2176
    @dwikiahmamaulana2176 3 года назад +1

    excuse me sir, what kind of method is used for this tutorial ?

    • @NicholasRenotte
      @NicholasRenotte  3 года назад +1

      Heya @Dwiki, it's using the native sentiment method from TextBlob I don't believe they go into much detail as to how it works though: textblob.readthedocs.io/en/dev/api_reference.html#textblob.blob.TextBlob.sentiment

  • @voiceofheart9873
    @voiceofheart9873 3 года назад

    Could you please tell me how to calculate positive , negative and neutral tweets ?

    • @NicholasRenotte
      @NicholasRenotte  3 года назад +1

      All covered in the video 😊!

    • @voiceofheart9873
      @voiceofheart9873 3 года назад

      @@NicholasRenotte how can i visualize positive, negative and neutral for each individual with bar chart graph?

    • @NicholasRenotte
      @NicholasRenotte  3 года назад +1

      @@voiceofheart9873 try taking a look at the matplotlib package, there is example with a line graph shown towards the end of the video.

    • @voiceofheart9873
      @voiceofheart9873 3 года назад

      @@NicholasRenotte Thanks for your valuable information sir. Could you please give your Email for contact with you?

    • @voiceofheart9873
      @voiceofheart9873 3 года назад

      @@NicholasRenotte Please make tutorial about Twitter new feature Covid-19 stream for sentiment analysis.

  • @hemalshah1410
    @hemalshah1410 2 года назад +1

    Hi Nic , while trying to perform -- tweets = [{'Tweet':tweet.text, 'Timestamp':tweet.created_at} for tweet in query] -- the line gives Twitter error response: status code = 403 . What could be reason ? I am having essential access on my twitter Dev account. any Help appreciated.

    • @sricharangovindolla7044
      @sricharangovindolla7044 2 года назад

      mine too! same problem

    • @hemalshah1410
      @hemalshah1410 2 года назад +1

      @@sricharangovindolla7044 I figured this is due to lack of permissions on your Twitter dev account. You need to get elevated access.

    • @sricharangovindolla7044
      @sricharangovindolla7044 2 года назад

      @@hemalshah1410 Ho ok thanks for sharing the information.

    • @Megtheanalyst_
      @Megtheanalyst_ 2 года назад

      @@hemalshah1410 I Was Approved Of Elevated Access But I Got An Error On That Code 🥹

  • @nikhilshetty1212
    @nikhilshetty1212 3 года назад

    Hey bro Nicholas, I have downloaded a year's data on breast cancer awareness, and now I want to perform a sentiment analysis on it. Will this method be able to process those tweets?

    • @NicholasRenotte
      @NicholasRenotte  3 года назад +1

      Sure will! Just get it into a dataframe and it should be relatively the same process!

    • @nikhilshetty1212
      @nikhilshetty1212 3 года назад +1

      @@NicholasRenottebrother I'm stuck in the preprocessing step please help err says : 'float' object has no attribute 'replace'

    • @NicholasRenotte
      @NicholasRenotte  3 года назад

      @@nikhilshetty1212 sounds like it's trying to update a number instead of a string. Are you processing on a number based column or a string?

    • @nikhilshetty1212
      @nikhilshetty1212 3 года назад +1

      @@NicholasRenotte string. Actually It would be so great if I could share the issue pic with you

    • @NicholasRenotte
      @NicholasRenotte  3 года назад

      @@nikhilshetty1212 jump on the Discord server and shoot it through to me!

  • @bronsonranga5770
    @bronsonranga5770 4 года назад +4

    Vote pineapples hahah crack up

    • @NicholasRenotte
      @NicholasRenotte  4 года назад

      🤣 #PepperoniLife for days @Bronson Ranga!!

  • @musicpatron1693
    @musicpatron1693 3 года назад +2

    hahah you act like getting a developer account is easy...i'm a student and i am not makign an app..it took like a volleying of discussions for a couple days to get a twitter account.. you have to specifically indicate literally what you're doing.

    • @NicholasRenotte
      @NicholasRenotte  3 года назад +1

      FR? I honestly managed to breeze through it, although my explanation was a little different to what I actually ended up using it for 😬

    • @musicpatron1693
      @musicpatron1693 3 года назад +2

      @@NicholasRenotte i'm just saying, cuz some people might need to know they need to be very literal about what they're using it for..they didn't initially accept my "I'm using it for a school project to do sentiment analysis on Donald Trump's tweets" ...they wanted more info than that. it was frustrating.

    • @NicholasRenotte
      @NicholasRenotte  3 года назад

      @@musicpatron1693 ah got it, did you end up getting it in the end though?

    • @musicpatron1693
      @musicpatron1693 3 года назад +1

      @@NicholasRenotte yessir!

    • @NicholasRenotte
      @NicholasRenotte  3 года назад +1

      @@musicpatron1693 yessss! Awesome work!

  • @iTzDharma
    @iTzDharma 2 года назад

    Update 04.01.2023 Change this:
    tweets = [{"Tweets":tweet.text, "Timestamp":tweet.created_at} for tweet in query]
    with
    tweets = [{"Tweets":tweepy.Tweet.text, "Timestamp":tweepy.Tweet.created_at} for tweet in query]