Sentiment Analysis (Climate Summit-COP26): Jumpstart with ML coding
Sentiment Analysis (Climate Summit-COP26): Jumpstart with ML coding

Sentiment Analysis (Climate Summit-COP26): Jumpstart with ML coding

Full-Time 30000 - 42000 £ / year (est.) No home office possible
T

Problem statement: 2021 UN Climate Change Conference event COP26 has been held in Glasgow, Scotland, UK. Analyze sentiments of people on this topic relative to the effectiveness of the summit.

Resources used: Jupyter Notebook as an IDE, Twitter API v1.1, NLTK, Tweepy and TextBlob library and Python 3.8.

Approach: My objective here is to create a PoC for “Sentiment Analysis about Climate Summit effectiveness – COP26 Summit Model” while adopting a “minimal coding with maximum efficiency” approach. We take tweets from Twitter by querying text like “COP26”, storing in a file and data frame, calling NLTK/TextBlob package/method to score sentiments against each text, and finally display relevant output. The output should provide a reasonable indication (at minimum qualitatively) to pull off a full-blown ML model investment. Let’s dive into making stage 1 analytics.

Step 1: Create App in Twitter and save API key and secret code for later use following steps below:

  • Create an App in the same account (You give a name to APP under project name).
  • Store all credentials such as API Key, Secret code, Bearer Token etc. (Tokens & Keys are generated from the previous step).
  • Test some of Twitter API endpoints (from its LAB with V2 versions which is still evolving) such as “Recent Search”.
  • $ curl –request GET “https://api.twitter.com/2/tweets/search/recent?query=from:” –header “Authorization: Bearer ”.

Bearer Token will look something like this …

The above cURL command gets your output as a string in JSON format with the respective tweet message that you have tweeted in the last 7 days.

Step 2: Coding in Jupyter Notebook or any IDE that supports Python 3.6 and above.

Check tweets with extreme sentiment values. TextBlob reads each sentence and outputs sentiment score between -1 to +1 as negative to positive sentiments:

Summary: Sentiment analysis about COP26 summit doesn’t end here; we have just scratched the surface from an analysis standpoint. There are various other dimensions that I didn’t capture here such as views about COP26 summit across countries, demography, occupations, communities, etc. Twitter captures tons of metadata (e.g., location, time, followers, likes, retweets, etc.) while we tweet. We can further enhance the level of analysis by adding business, political, time-series context to name a few. The main purpose is to highlight ease and speed in completing ML PoC to take further business decisions without putting much effort into coding and building expensive data pipelines. Hope you find this approach useful in applying in the journey of digital transformation by creating small use cases or PoC solutions before going full-blown in product development.

#J-18808-Ljbffr

T

Contact Detail:

Techmanthan Recruiting Team

Sentiment Analysis (Climate Summit-COP26): Jumpstart with ML coding
Techmanthan
T
  • Sentiment Analysis (Climate Summit-COP26): Jumpstart with ML coding

    Full-Time
    30000 - 42000 £ / year (est.)

    Application deadline: 2027-07-06

  • T

    Techmanthan

Similar positions in other companies
UK’s top job board for Gen Z
discover-jobs-cta
Discover now
>