{"id":7018,"date":"2023-08-01T06:19:38","date_gmt":"2023-08-01T14:19:38","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=7018"},"modified":"2025-04-24T17:14:59","modified_gmt":"2025-04-24T17:14:59","slug":"web-scraping-and-sentiment-analysis-using-twint-library","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/","title":{"rendered":"Web Scraping and Sentiment Analysis Using Twint Library"},"content":{"rendered":"\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\">\n\n\n\n<div class=\"fh fi fj fk fl\">\n<div class=\"ab ca\">\n<div class=\"ch bg et eu ev ew\">\n<figure class=\"mj mk ml mm mn mo mg mh paragraph-image\">\n<div class=\"mp mq eb mr bg ms\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mt mu c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*hvZqCVeo0VzS5F2X8lgRgA.jpeg\" alt=\"\" width=\"700\" height=\"368\"><\/figure><div class=\"mg mh mi\"><picture><\/picture><\/div>\n<\/div><figcaption class=\"mv mw mx mg mh my mz be b bf z dv\" data-selectable-paragraph=\"\">Image by author<\/figcaption><\/figure>\n<h2 id=\"4cb1\" class=\"na nb fo be nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx bj\" data-selectable-paragraph=\"\">Introduction<\/h2>\n<p id=\"c2ba\" class=\"pw-post-body-paragraph ny nz fo be b gm oa ob oc gp od oe of nl og oh oi np oj ok ol nt om on oo op fh bj\" data-selectable-paragraph=\"\">Twitter is a social networking and news website where users exchange short messages known as tweets.<\/p>\n<p id=\"c7fd\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">The ease with which Twitter may be scanned is one of its biggest selling points. Hundreds of millions of intriguing individuals can be followed, and their material can be read quickly, which is convenient in today\u2019s attention-deficit society.<\/p>\n<p id=\"3ed0\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\"><strong class=\"be ov\">Web scraping<\/strong> is a widely-recognized process of extracting data from a website (like Twitter). After this website data is gathered, it is then exported into a format that is more user-friendly for analysis and modeling. Python libraries such as Beautiful Soup, Selenium, and many others can assist with the web scraping process. However, one disadvantage of some of these libraries is that many require familiarity with HTML, which is not necessarily a skill you\u2019d find in the average data analyst\u2019s toolbox.<\/p>\n<p id=\"bdbe\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">In order to scrape data from Twitter, in particular, the company has created something called a <a class=\"af ow\" href=\"https:\/\/developer.twitter.com\/en\/docs\/developer-portal\/overview\" target=\"_blank\" rel=\"noopener ugc nofollow\">Twitter Developer<\/a> account. This account allows you to create and manage your own projects and apps from data scraped from the site, but it comes with some serious limitations, which are outlined in detail in the Twitter <a class=\"af ow\" href=\"https:\/\/developer.twitter.com\/en\/docs\/twitter-api\/v1\/tweets\/timelines\/faq#:~:text=What%20are%20the%20new%20rate,auth%20and%20app%2Dauth%20requests.\" target=\"_blank\" rel=\"noopener ugc nofollow\">FAQ<\/a> section.<\/p>\n<p id=\"d1cb\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\"><strong class=\"be ov\">In this article, we will explore how to scrape Twitter data:<\/strong><\/p>\n<ol class=\"\">\n<li id=\"3777\" class=\"ny nz fo be b gm oq ob oc gp or oe of ox os oh oi oy ot ok ol oz ou on oo op pa pb pc bj\" data-selectable-paragraph=\"\"><strong class=\"be ov\">Without using the Twitter API<\/strong><\/li>\n<li id=\"775a\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pa pb pc bj\" data-selectable-paragraph=\"\"><strong class=\"be ov\">Without having to create a Twitter Developer account<\/strong><\/li>\n<li id=\"e640\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pa pb pc bj\" data-selectable-paragraph=\"\"><strong class=\"be ov\">Without domain knowledge of web development and HTML<\/strong><\/li>\n<\/ol>\n<h2 id=\"6b64\" class=\"na nb fo be nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx bj\" data-selectable-paragraph=\"\">Twint<\/h2>\n<p id=\"6bd0\" class=\"pw-post-body-paragraph ny nz fo be b gm oa ob oc gp od oe of nl og oh oi np oj ok ol nt om on oo op fh bj\" data-selectable-paragraph=\"\"><a class=\"af ow\" href=\"https:\/\/pypi.org\/project\/twint\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">Twint<\/a> is a Python-based advanced Twitter-scraping application that allows you to scrape Tweets from Twitter profiles <em class=\"pi\">without having to use Twitter\u2019s API or creating a Twitter Developer account.<\/em><\/p>\n<p id=\"8122\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">Twint makes use of Twitter\u2019s <a class=\"af ow\" href=\"https:\/\/media.sproutsocial.com\/uploads\/2016\/02\/Twitter-Search-Operators-Cheatsheet-1.pdf\" target=\"_blank\" rel=\"noopener ugc nofollow\">search operators<\/a>, which allow you to scrape Tweets from specific individuals, Tweets referring to specific themes, hashtags, and trends, and sort out sensitive information like e-mail and phone numbers from Tweets.<\/p>\n<p id=\"0534\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">Twint also creates unique Twitter queries that allow you to scrape a Twitter user\u2019s followers, Tweets they\u2019ve liked, and who they follow, all without having to utilize any login, API, Selenium, or browser emulation.<\/p>\n<h2 id=\"83da\" class=\"na nb fo be nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx bj\" data-selectable-paragraph=\"\">Twint Requirements<\/h2>\n<ul class=\"\">\n<li id=\"e2bf\" class=\"ny nz fo be b gm oa ob oc gp od oe of ox og oh oi oy oj ok ol oz om on oo op pj pb pc bj\" data-selectable-paragraph=\"\">Python 3.6<\/li>\n<li id=\"5236\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">aiohttp<\/li>\n<li id=\"a4f1\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">aiodns<\/li>\n<li id=\"f000\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">beautifulsoup4<\/li>\n<li id=\"afd2\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">cchardet<\/li>\n<li id=\"f2e3\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">elasticsearch<\/li>\n<li id=\"f9c1\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">pysocks<\/li>\n<li id=\"c4c5\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">pandas (\u22650.23.0)<\/li>\n<li id=\"5965\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">aiohttp_socks<\/li>\n<li id=\"bb58\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">schedule<\/li>\n<li id=\"d945\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">geopy<\/li>\n<li id=\"60e1\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">fake-useragent<\/li>\n<li id=\"39bb\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">py-googletransx<\/li>\n<\/ul>\n<h2 id=\"7b5b\" class=\"na nb fo be nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx bj\" data-selectable-paragraph=\"\">Benefits of Using Twint<\/h2>\n<ul class=\"\">\n<li id=\"3ee3\" class=\"ny nz fo be b gm oa ob oc gp od oe of ox og oh oi oy oj ok ol oz om on oo op pj pb pc bj\" data-selectable-paragraph=\"\">Only the last 3,200 Tweets can be scraped using the Twitter API. Twint, on the other hand, can theoretically retrieve unlimited Tweets.<\/li>\n<li id=\"cf25\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">Twint provides various formats into which you can store your scraped data, including CSV, JSON, SQLite database, and Elasticsearch database.<\/li>\n<li id=\"38b9\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">Twint has a quick initial setup.<\/li>\n<li id=\"6181\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">Twint can be used anonymously and without a Twitter account.<\/li>\n<li id=\"2814\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">There are no rate restrictions with Twint.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"fh fi fj fk fl\">\n<div class=\"ab ca\">\n<div class=\"ch bg et eu ev ew\">\n<blockquote class=\"ps\"><p id=\"7079\" class=\"pt pu fo be pv pw px py pz qa qb op dv\" data-selectable-paragraph=\"\"><a class=\"af ow\" href=\"https:\/\/www.youtube.com\/watch?v=el9eoaKYGVk&amp;list=PLX9GmL8cVn_yout9BRYNj43XJco3gsZ3r&amp;index=4\" target=\"_blank\" rel=\"noopener ugc nofollow\">What kind of challenges arise when building ML models at scale<\/a>? Chris Brossman from The RealReal discusses his team\u2019s playbook for big tasks.<\/p><\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"fh fi fj fk fl\">\n<div class=\"ab ca\">\n<div class=\"ch bg et eu ev ew\">\n<h2 id=\"b1f4\" class=\"na nb fo be nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx bj\" data-selectable-paragraph=\"\">Installation<\/h2>\n<p id=\"1f03\" class=\"pw-post-body-paragraph ny nz fo be b gm oa ob oc gp od oe of nl og oh oi np oj ok ol nt om on oo op fh bj\" data-selectable-paragraph=\"\">Twint can be installed with the pip command or straight from git. <em class=\"pi\">It is advisable you install Twint through Git as it comes up with little or no issues.<\/em><\/p>\n<p id=\"f67a\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\"><strong class=\"be ov\">Git Installation:<\/strong><\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"9341\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">git clone <a class=\"af ow\" href=\"https:\/\/github.com\/twintproject\/twint.git\" target=\"_blank\" rel=\"noopener ugc nofollow\">https:\/\/github.com\/twintproject\/twint.git<\/a>\ncd twint\npip3 install . -r requirements.txt<\/span><\/pre>\n<p id=\"98cd\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\"><strong class=\"be ov\">Using Pip:<\/strong><\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"1b2f\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">pip3 install twint<\/span><\/pre>\n<p id=\"1366\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">\u2014 or \u2014<\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"7f2e\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">pip3 install \u2014 user \u2014 upgrade -e git+https:\/\/github.com\/twintproject\/twint.git@origin\/master#egg=twint<\/span><\/pre>\n<p id=\"b626\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\"><strong class=\"be ov\">Pipenv:<\/strong><\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"b551\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">pipenv install -e git+https:\/\/github.com\/twintproject\/twint.git#egg=twint<\/span><\/pre>\n<p id=\"f1de\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">In this article we will be accessing <strong class=\"be ov\">Twint <\/strong>in two places:<\/p>\n<ol class=\"\">\n<li id=\"c59a\" class=\"ny nz fo be b gm oq ob oc gp or oe of ox os oh oi oy ot ok ol oz ou on oo op pa pb pc bj\" data-selectable-paragraph=\"\"><strong class=\"be ov\">Command line<\/strong>: cmd or Powershell<\/li>\n<li id=\"687a\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pa pb pc bj\" data-selectable-paragraph=\"\"><strong class=\"be ov\">Python IDE: <\/strong>We will be using a Jupyter notebook, but you can your choice of IDE (preferably Python-based).<\/li>\n<\/ol>\n<p id=\"1695\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">From your command line (cmd) you will need to navigate to the twint directory:<\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"e40a\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">C:\\Users\\&gt;cd twint<\/span><\/pre>\n<p id=\"b0c6\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">From your command line, we will be searching for the key #StandStrong. We will save it as a <em class=\"pi\">JSON<\/em> file in a directory of the same name:<\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"57e8\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">C:\\Users\\twint&gt;twint -s \u201c#StandStrong\u201d -o \u201cC:\/Users\/Documents\/Python Scripts\/standstrong.json\u201d \u2014 json<\/span><span id=\"7c74\" class=\"na nb fo qd b ia qk qi l iq qj\" data-selectable-paragraph=\"\">C:\\Users\\twint&gt;twint -s \u201c#StandStrong\u201d -o \u201cC:\/Users\/standstrong.csv\u201d \u2014 csv \u2014 since 2022\u201306\u201301 \/\/ Scrape Tweets and save as a csv file.<\/span><\/pre>\n<figure class=\"mj mk ml mm mn mo mg mh paragraph-image\">\n<div class=\"mp mq eb mr bg ms\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mt mu c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*EH9lyBGfGg0yQrr2eSmd8g.gif\" alt=\"\" width=\"700\" height=\"371\"><\/figure><div class=\"mg mh ql\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*EH9lyBGfGg0yQrr2eSmd8g.gif 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mv mw mx mg mh my mz be b bf z dv\" data-selectable-paragraph=\"\">GIF by author<\/figcaption>\n<\/figure>\n<h2 id=\"bd42\" class=\"na nb fo be nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx bj\" data-selectable-paragraph=\"\">Code Walkthrough and Project Building<\/h2>\n<p id=\"1b75\" class=\"pw-post-body-paragraph ny nz fo be b gm oa ob oc gp od oe of nl og oh oi np oj ok ol nt om on oo op fh bj\" data-selectable-paragraph=\"\">David Adeleke (aka \u2018Davido\u2019) announced the release of his new single \u201cSTAND STRONG\u201d FT THE SAMPLES on May 13th, 2022. Around the world, there have been some very conflicting feelings about this release, as it shows a very different aspect of Nigeria\u2019s multi-talented artists.<\/p>\n<p id=\"55fe\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">For this project, we are going to scrape data from Twitter that relates to this new song, and apply sentiment analysis.. The keyword <code class=\"cw qm qn qo qd b\">#StandStrong<\/code> will be our base search word.<\/p>\n<p id=\"eec3\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">The full code of this project can be found in my <a class=\"af ow\" href=\"https:\/\/github.com\/kiddojazz\/Web-Scrapping-and-Sentiment-Analysis-using-Twint-Library\" target=\"_blank\" rel=\"noopener ugc nofollow\"><strong class=\"be ov\">Github Repository<\/strong><\/a>. Please feel free to fork the repo and use it to build any of your future projects!<\/p>\n<p id=\"fe22\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">We will be starting this project by importing all necessary libraries that will be used when scrapping Tweets using Twint, creating sentiment analysis and visualization.<\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"7774\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">import pandas as pd\nimport numpy as np\nimport re\nimport matplotlib.pyplot as plt\nplt.style.use(\u2018fivethirtyeight\u2019)<\/span><span id=\"4924\" class=\"na nb fo qd b ia qk qi l iq qj\" data-selectable-paragraph=\"\">import twint\nimport nest_asyncio\nnest_asyncio.apply() #necessary to allow asyncio to end event loop\nimport nltk\nnltk.download(\u2018punkt\u2019)\nnltk.download(\u2018wordnet\u2019)\nfrom nltk import sent_tokenize, word_tokenize\nfrom nltk.stem.snowball import SnowballStemmer\nfrom nltk.stem.wordnet import WordNetLemmatizer\nfrom nltk.corpus import stopwords\nfrom textblob import TextBlob\nfrom wordcloud import WordCloud, STOPWORDS<\/span><\/pre>\n<h2 id=\"5760\" class=\"na nb fo be nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx bj\" data-selectable-paragraph=\"\">Search for Tweet to Scrape:<\/h2>\n<p id=\"db5e\" class=\"pw-post-body-paragraph ny nz fo be b gm oa ob oc gp od oe of nl og oh oi np oj ok ol nt om on oo op fh bj\" data-selectable-paragraph=\"\">For the code below we are going to be scraping for the keyword <code class=\"cw qm qn qo qd b\"><strong class=\"be ov\">#<\/strong>StandStrong<\/code><strong class=\"be ov\"> :<\/strong><\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"f05b\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">#Configure\ns = twint.Config()\ns.Search = \"#StandStrong\"\ns.Lang = \"en\"\n#s.Limit = 1000          # optional\ns.Since = '2022\u201305\u201301'\ns.until = '2022\u201306\u201329' <\/span><span id=\"58ba\" class=\"na nb fo qd b ia qk qi l iq qj\" data-selectable-paragraph=\"\">#Store script in csv file\ns.Store_csv = True\ns.Output = \"C:\/Users\/Twint_vv3.csv\"<\/span><span id=\"281f\" class=\"na nb fo qd b ia qk qi l iq qj\" data-selectable-paragraph=\"\">twint.run.Search(s)<\/span><\/pre>\n<p id=\"1178\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">The parameters used in the above code, along with their definitions, can be found here:<\/p>\n<ol class=\"\">\n<li id=\"0e0f\" class=\"ny nz fo be b gm oq ob oc gp or oe of ox os oh oi oy ot ok ol oz ou on oo op pa pb pc bj\" data-selectable-paragraph=\"\"><code class=\"cw qm qn qo qd b\">Lang<\/code>: Specify the language of the Tweet you want to scrape.<\/li>\n<li id=\"15e7\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pa pb pc bj\" data-selectable-paragraph=\"\"><code class=\"cw qm qn qo qd b\">Since<\/code>: Collect Tweets that were tweeted since %Y-%m-%d %H-%M-%ss.<\/li>\n<li id=\"7942\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pa pb pc bj\" data-selectable-paragraph=\"\"><code class=\"cw qm qn qo qd b\">Until<\/code>: Filter tweets up until this point in time.<\/li>\n<li id=\"0867\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pa pb pc bj\" data-selectable-paragraph=\"\"><code class=\"cw qm qn qo qd b\">Store_csv<\/code>: Save scraped tweet data in CSV format.<\/li>\n<\/ol>\n<h2 id=\"f6ac\" class=\"na nb fo be nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx bj\" data-selectable-paragraph=\"\">Data Cleaning<\/h2>\n<p id=\"68af\" class=\"pw-post-body-paragraph ny nz fo be b gm oa ob oc gp od oe of nl og oh oi np oj ok ol nt om on oo op fh bj\" data-selectable-paragraph=\"\">We will need to do a lot of cleaning to remove unnecessary text (and other characters) from the data before we can perform sentiment analysis on it. The practice of correcting or deleting incorrect, corrupted, improperly formatted, duplicate, or incomplete data from a dataset is known as <strong class=\"be ov\">data cleaning<\/strong>.<\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"9cab\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">stand_df = pd.read_csv(\"Twint_vv3.cs\")\nTweet = stand_df.filter(['tweet'])\nTweet.head(10)<\/span><\/pre>\n<p id=\"b96d\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">Next, a function is created to remove some characters, emojis, text, and hyperlinks that will not be needed when performing sentiment analysis on the Tweet column data:<\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"39ca\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\"># create a function to clean the tweets<\/span><span id=\"1079\" class=\"na nb fo qd b ia qk qi l iq qj\" data-selectable-paragraph=\"\">def cleanTxt(text):\n    #Remove <a class=\"af ow\" href=\"http:\/\/twitter.com\/mentions\" target=\"_blank\" rel=\"noopener ugc nofollow\">@mentions<\/a> and replace with blank\n    text = re.sub(r'@[A-Za-z0\u20139]+', '', text)\n\n    #Remove the '#' symbol, replace with blank\n    text = re.sub(r'#', '', text)\n\n    #Removing RT, replace with blank\n    text = re.sub(r'RT[\\s]+', '', text)\n\n    #Remove the hyperlinks\n    text = re.sub(r'https?:\\\/\\\/\\S+', '', text)\n\n    return text<\/span><span id=\"7c55\" class=\"na nb fo qd b ia qk qi l iq qj\" data-selectable-paragraph=\"\"># clean the text\nTweet['tweet']= Tweet['tweet'].apply(cleanTxt)<\/span><span id=\"bdc9\" class=\"na nb fo qd b ia qk qi l iq qj\" data-selectable-paragraph=\"\">#Show the clean text\nTweet<\/span><\/pre>\n<figure class=\"mj mk ml mm mn mo mg mh paragraph-image\">\n<div class=\"mp mq eb mr bg ms\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mt mu c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*97zF-r6Y5xNpESuwrZlWPQ.png\" alt=\"\" width=\"700\" height=\"370\"><\/figure><div class=\"mg mh qp\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*97zF-r6Y5xNpESuwrZlWPQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*97zF-r6Y5xNpESuwrZlWPQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*97zF-r6Y5xNpESuwrZlWPQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*97zF-r6Y5xNpESuwrZlWPQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*97zF-r6Y5xNpESuwrZlWPQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*97zF-r6Y5xNpESuwrZlWPQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*97zF-r6Y5xNpESuwrZlWPQ.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*97zF-r6Y5xNpESuwrZlWPQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*97zF-r6Y5xNpESuwrZlWPQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*97zF-r6Y5xNpESuwrZlWPQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*97zF-r6Y5xNpESuwrZlWPQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*97zF-r6Y5xNpESuwrZlWPQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*97zF-r6Y5xNpESuwrZlWPQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*97zF-r6Y5xNpESuwrZlWPQ.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mv mw mx mg mh my mz be b bf z dv\" data-selectable-paragraph=\"\">Image by author<\/figcaption>\n<\/figure>\n<p id=\"31ba\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">Another function is also recreated to remove emoji\u2019s and other Unicode from the data Tweet column.<\/p>\n<figure class=\"mj mk ml mm mn mo mg mh paragraph-image\">\n<div class=\"mp mq eb mr bg ms\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mt mu c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*a08hEfaj7Phu5F8LiUHnYA.png\" alt=\"\" width=\"700\" height=\"513\"><\/figure><div class=\"mg mh qq\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*a08hEfaj7Phu5F8LiUHnYA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*a08hEfaj7Phu5F8LiUHnYA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*a08hEfaj7Phu5F8LiUHnYA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*a08hEfaj7Phu5F8LiUHnYA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*a08hEfaj7Phu5F8LiUHnYA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*a08hEfaj7Phu5F8LiUHnYA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*a08hEfaj7Phu5F8LiUHnYA.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*a08hEfaj7Phu5F8LiUHnYA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*a08hEfaj7Phu5F8LiUHnYA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*a08hEfaj7Phu5F8LiUHnYA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*a08hEfaj7Phu5F8LiUHnYA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*a08hEfaj7Phu5F8LiUHnYA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*a08hEfaj7Phu5F8LiUHnYA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*a08hEfaj7Phu5F8LiUHnYA.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mv mw mx mg mh my mz be b bf z dv\" data-selectable-paragraph=\"\"><a class=\"af ow\" href=\"https:\/\/github.com\/kiddojazz\/Web-Scrapping-and-Sentiment-Analysis-using-Twint-Library\/blob\/master\/Stand%20Strong%20Sentiment%20Analysis%20using%20Twint%20Library.ipynb\" target=\"_blank\" rel=\"noopener ugc nofollow\">Image by author<\/a><\/figcaption>\n<\/figure>\n<figure class=\"mj mk ml mm mn mo mg mh paragraph-image\">\n<div class=\"mp mq eb mr bg ms\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mt mu c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*2FZNBNfsUWoSF-u9oZbn5w.png\" alt=\"\" width=\"700\" height=\"331\"><\/figure><div class=\"mg mh qr\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*2FZNBNfsUWoSF-u9oZbn5w.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*2FZNBNfsUWoSF-u9oZbn5w.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*2FZNBNfsUWoSF-u9oZbn5w.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*2FZNBNfsUWoSF-u9oZbn5w.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*2FZNBNfsUWoSF-u9oZbn5w.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*2FZNBNfsUWoSF-u9oZbn5w.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*2FZNBNfsUWoSF-u9oZbn5w.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*2FZNBNfsUWoSF-u9oZbn5w.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*2FZNBNfsUWoSF-u9oZbn5w.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*2FZNBNfsUWoSF-u9oZbn5w.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*2FZNBNfsUWoSF-u9oZbn5w.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*2FZNBNfsUWoSF-u9oZbn5w.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*2FZNBNfsUWoSF-u9oZbn5w.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*2FZNBNfsUWoSF-u9oZbn5w.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mv mw mx mg mh my mz be b bf z dv\" data-selectable-paragraph=\"\">Image by author<\/figcaption>\n<\/figure>\n<h2 id=\"4640\" class=\"na nb fo be nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx bj\" data-selectable-paragraph=\"\">Get Subjectivity and Polarity of Tweet<\/h2>\n<p id=\"7054\" class=\"pw-post-body-paragraph ny nz fo be b gm oa ob oc gp od oe of nl og oh oi np oj ok ol nt om on oo op fh bj\" data-selectable-paragraph=\"\">The process of sentiment analysis boils down to determining the attitude or the emotion of the writer (e.g., \u2018positive\u2019, \u2018negative\u2019, or \u2018neutral\u2019).<\/p>\n<ol class=\"\">\n<li id=\"7317\" class=\"ny nz fo be b gm oq ob oc gp or oe of ox os oh oi oy ot ok ol oz ou on oo op pa pb pc bj\" data-selectable-paragraph=\"\"><strong class=\"be ov\">Polarity<\/strong>: refers to the strength of an opinion. It could be positive or negative. If anything is associated with a strong good feeling or emotion, such as admiration, trust, or love, it will have a certain orientation toward all other opinions.<\/li>\n<li id=\"b96e\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pa pb pc bj\" data-selectable-paragraph=\"\"><strong class=\"be ov\">Subjectivity<\/strong>: the degree to which a person is personally connected with an object is referred to as subjectivity. Personal connections and individual experiences with that object are most important here, which may or may not differ from someone else\u2019s perspective.<\/li>\n<\/ol>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"e30e\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">#Create a function to determine the subjectivity\ndef getSubjectivity(text):\n    return TextBlob(text).sentiment.subjectivity<\/span><span id=\"5149\" class=\"na nb fo qd b ia qk qi l iq qj\" data-selectable-paragraph=\"\">#Create a function to determine polarity\ndef getPolarity(text):\n    return TextBlob(text).sentiment.polarity<\/span><span id=\"c8d9\" class=\"na nb fo qd b ia qk qi l iq qj\" data-selectable-paragraph=\"\">#Create a new column and add it to the Tweet_df dataframe\nTweet['Subjectivity'] = Tweet['tweet'].apply(getSubjectivity)\nTweet['Polarity'] = Tweet['tweet'].apply(getPolarity)<\/span><span id=\"29aa\" class=\"na nb fo qd b ia qk qi l iq qj\" data-selectable-paragraph=\"\">#Display data\nTweet<\/span><\/pre>\n<figure class=\"mj mk ml mm mn mo mg mh paragraph-image\">\n<div class=\"mp mq eb mr bg ms\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mt mu c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*P2J31A5TCo0QSi-_nGk1_w.png\" alt=\"\" width=\"700\" height=\"332\"><\/figure><div class=\"mg mh qs\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*P2J31A5TCo0QSi-_nGk1_w.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*P2J31A5TCo0QSi-_nGk1_w.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*P2J31A5TCo0QSi-_nGk1_w.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*P2J31A5TCo0QSi-_nGk1_w.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*P2J31A5TCo0QSi-_nGk1_w.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*P2J31A5TCo0QSi-_nGk1_w.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*P2J31A5TCo0QSi-_nGk1_w.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*P2J31A5TCo0QSi-_nGk1_w.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*P2J31A5TCo0QSi-_nGk1_w.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*P2J31A5TCo0QSi-_nGk1_w.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*P2J31A5TCo0QSi-_nGk1_w.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*P2J31A5TCo0QSi-_nGk1_w.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*P2J31A5TCo0QSi-_nGk1_w.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*P2J31A5TCo0QSi-_nGk1_w.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mv mw mx mg mh my mz be b bf z dv\" data-selectable-paragraph=\"\">Image by author<\/figcaption>\n<\/figure>\n<h2 id=\"5cb4\" class=\"na nb fo be nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx bj\" data-selectable-paragraph=\"\">Grouping Polarity Score of Our Data<\/h2>\n<p id=\"3904\" class=\"pw-post-body-paragraph ny nz fo be b gm oa ob oc gp od oe of nl og oh oi np oj ok ol nt om on oo op fh bj\" data-selectable-paragraph=\"\">At this stage we will create a function to help group our data into <code class=\"cw qm qn qo qd b\">negative<\/code>, <code class=\"cw qm qn qo qd b\">neutral<\/code> and <code class=\"cw qm qn qo qd b\">positive<\/code> comments.<\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"3165\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">#Group the range of polarity to different categories\ndef getInsight(score):\n    if score &lt; 0:\n        return \"Negative\"\n    elif score == 0:\n        return \"Neutral\"\n    else:\n        return \"Positive\"\n\nTweet[\"Insight\"] = Tweet[\"Polarity\"].apply(getInsight)\nTweet.head(50)<\/span><\/pre>\n<figure class=\"mj mk ml mm mn mo mg mh paragraph-image\">\n<div class=\"mp mq eb mr bg ms\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mt mu c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*HY_6xis1Eukz-hl3Fvlhsg.png\" alt=\"\" width=\"700\" height=\"301\"><\/figure><div class=\"mg mh qt\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*HY_6xis1Eukz-hl3Fvlhsg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*HY_6xis1Eukz-hl3Fvlhsg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*HY_6xis1Eukz-hl3Fvlhsg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*HY_6xis1Eukz-hl3Fvlhsg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*HY_6xis1Eukz-hl3Fvlhsg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*HY_6xis1Eukz-hl3Fvlhsg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*HY_6xis1Eukz-hl3Fvlhsg.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*HY_6xis1Eukz-hl3Fvlhsg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*HY_6xis1Eukz-hl3Fvlhsg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*HY_6xis1Eukz-hl3Fvlhsg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*HY_6xis1Eukz-hl3Fvlhsg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*HY_6xis1Eukz-hl3Fvlhsg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*HY_6xis1Eukz-hl3Fvlhsg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*HY_6xis1Eukz-hl3Fvlhsg.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mv mw mx mg mh my mz be b bf z dv\" data-selectable-paragraph=\"\">Image by author<\/figcaption>\n<\/figure>\n<h2 id=\"0261\" class=\"na nb fo be nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx bj\" data-selectable-paragraph=\"\">Data Visualization and Insight<\/h2>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"f47f\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">#Get value counts\nTweet[\"Insight\"].value_counts()<\/span><\/pre>\n<figure class=\"mj mk ml mm mn mo mg mh paragraph-image\">\n<div class=\"mp mq eb mr bg ms\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mt mu c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*TrcbwDfrzj8iduu_z6SQOA.png\" alt=\"\" width=\"700\" height=\"73\"><\/figure><div class=\"mg mh qu\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*TrcbwDfrzj8iduu_z6SQOA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*TrcbwDfrzj8iduu_z6SQOA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*TrcbwDfrzj8iduu_z6SQOA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*TrcbwDfrzj8iduu_z6SQOA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*TrcbwDfrzj8iduu_z6SQOA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*TrcbwDfrzj8iduu_z6SQOA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*TrcbwDfrzj8iduu_z6SQOA.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*TrcbwDfrzj8iduu_z6SQOA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*TrcbwDfrzj8iduu_z6SQOA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*TrcbwDfrzj8iduu_z6SQOA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*TrcbwDfrzj8iduu_z6SQOA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*TrcbwDfrzj8iduu_z6SQOA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*TrcbwDfrzj8iduu_z6SQOA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*TrcbwDfrzj8iduu_z6SQOA.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"9cb6\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">#Plot the values count of polarity\nplt.title(\u201cStandStrong Sentiment Score\u201d)\nplt.xlabel(\u201cSentiment\u201d)\nplt.ylabel(\u201cValues\u201d)\nTweet[\u201cInsight\u201d].value_counts().plot(kind=\u201dbarh\u201d, color=\u201dGray\u201d)\nplt.show()<\/span><\/pre>\n<figure class=\"mj mk ml mm mn mo mg mh paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mt mu c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:539\/0*-E9yxcKXI9km_Zok\" alt=\"\" width=\"539\" height=\"348\"><\/figure><div class=\"mg mh qv\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*-E9yxcKXI9km_Zok 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*-E9yxcKXI9km_Zok 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*-E9yxcKXI9km_Zok 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*-E9yxcKXI9km_Zok 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*-E9yxcKXI9km_Zok 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*-E9yxcKXI9km_Zok 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1078\/0*-E9yxcKXI9km_Zok 1078w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 539px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*-E9yxcKXI9km_Zok 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*-E9yxcKXI9km_Zok 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*-E9yxcKXI9km_Zok 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*-E9yxcKXI9km_Zok 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*-E9yxcKXI9km_Zok 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*-E9yxcKXI9km_Zok 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1078\/0*-E9yxcKXI9km_Zok 1078w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 539px\" data-testid=\"og\"><\/picture><\/div>\n<figcaption class=\"mv mw mx mg mh my mz be b bf z dv\" data-selectable-paragraph=\"\">Chart by author<\/figcaption>\n<\/figure>\n<p id=\"4127\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">From the bar cluster chart above, you may notice the keyword <code class=\"cw qm qn qo qd b\">#StandStrong<\/code> had far more neutral comments.<\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"1e22\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">#Plot the values count of polarity\nplt.title(\u201cTop Fans\u201d)\nplt.xlabel(\u201cUsers\u201d)\nplt.ylabel(\u201cValues\u201d)\nstand_df[\u201cusername\u201d].value_counts()[:20].plot(kind=\u201dbarh\u201d, color=\u201dGray\u201d)\nplt.show()<\/span><\/pre>\n<figure class=\"mj mk ml mm mn mo mg mh paragraph-image\">\n<div class=\"mp mq eb mr bg ms\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mt mu c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:626\/0*jM5BRSp4Aka79tMt\" alt=\"\" width=\"626\" height=\"351\"><\/figure><div class=\"mg mh qw\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*jM5BRSp4Aka79tMt 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*jM5BRSp4Aka79tMt 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*jM5BRSp4Aka79tMt 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*jM5BRSp4Aka79tMt 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*jM5BRSp4Aka79tMt 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*jM5BRSp4Aka79tMt 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1252\/0*jM5BRSp4Aka79tMt 1252w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 626px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*jM5BRSp4Aka79tMt 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*jM5BRSp4Aka79tMt 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*jM5BRSp4Aka79tMt 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*jM5BRSp4Aka79tMt 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*jM5BRSp4Aka79tMt 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*jM5BRSp4Aka79tMt 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1252\/0*jM5BRSp4Aka79tMt 1252w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 626px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mv mw mx mg mh my mz be b bf z dv\" data-selectable-paragraph=\"\">Chart by author<\/figcaption>\n<\/figure>\n<p id=\"0164\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">Above we plotted the top 20 fans of the song; this is based on the amount of time they tweet about the keyword.<\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"e829\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">import seaborn as sns\nimport warnings\nstand_df[\u201cdate\u201d] = pd.to_datetime(stand_df[\u201cdate\u201d]).dt.date\n#Helps change the datatype from datetime to date only\nsns.countplot(stand_df[\u201cdate\u201d])\nplt.xticks(rotation = 45)<\/span><\/pre>\n<figure class=\"mj mk ml mm mn mo mg mh paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mt mu c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:506\/0*ECAcgAl_EUrLl_9D\" alt=\"\" width=\"506\" height=\"385\"><\/figure><div class=\"mg mh qx\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*ECAcgAl_EUrLl_9D 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*ECAcgAl_EUrLl_9D 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*ECAcgAl_EUrLl_9D 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*ECAcgAl_EUrLl_9D 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*ECAcgAl_EUrLl_9D 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*ECAcgAl_EUrLl_9D 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1012\/0*ECAcgAl_EUrLl_9D 1012w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 506px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*ECAcgAl_EUrLl_9D 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*ECAcgAl_EUrLl_9D 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*ECAcgAl_EUrLl_9D 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*ECAcgAl_EUrLl_9D 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*ECAcgAl_EUrLl_9D 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*ECAcgAl_EUrLl_9D 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1012\/0*ECAcgAl_EUrLl_9D 1012w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 506px\" data-testid=\"og\"><\/picture><\/div>\n<figcaption class=\"mv mw mx mg mh my mz be b bf z dv\" data-selectable-paragraph=\"\">Chart by author<\/figcaption>\n<\/figure>\n<p id=\"0126\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">Plotted above is the frequency of people tweeting the keyword per day.<\/p>\n<p id=\"5a8e\" class=\"pw-post-body-paragraph ny nz fo be b gm oq ob oc gp or oe of nl os oh oi np ot ok ol nt ou on oo op fh bj\" data-selectable-paragraph=\"\">Before we create our final visualization, let\u2019s examine our list of stopwords:<\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"7129\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">stopwords = STOPWORDS\nprint(stopwords)<\/span><\/pre>\n<figure class=\"mj mk ml mm mn mo mg mh paragraph-image\">\n<div class=\"mp mq eb mr bg ms\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mt mu c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*YvrrJmWCQ9xk8vDwdywtdg.png\" alt=\"\" width=\"814\" height=\"150\"><\/figure><div class=\"mg mh qy\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*YvrrJmWCQ9xk8vDwdywtdg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*YvrrJmWCQ9xk8vDwdywtdg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*YvrrJmWCQ9xk8vDwdywtdg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*YvrrJmWCQ9xk8vDwdywtdg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*YvrrJmWCQ9xk8vDwdywtdg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*YvrrJmWCQ9xk8vDwdywtdg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*YvrrJmWCQ9xk8vDwdywtdg.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*YvrrJmWCQ9xk8vDwdywtdg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*YvrrJmWCQ9xk8vDwdywtdg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*YvrrJmWCQ9xk8vDwdywtdg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*YvrrJmWCQ9xk8vDwdywtdg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*YvrrJmWCQ9xk8vDwdywtdg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*YvrrJmWCQ9xk8vDwdywtdg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*YvrrJmWCQ9xk8vDwdywtdg.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mv mw mx mg mh my mz be b bf z dv\" data-selectable-paragraph=\"\">Image by author<\/figcaption>\n<\/figure>\n<h2 id=\"3c7d\" class=\"na nb fo be nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx bj\" data-selectable-paragraph=\"\">Word Cloud<\/h2>\n<p id=\"25b9\" class=\"pw-post-body-paragraph ny nz fo be b gm oa ob oc gp od oe of nl og oh oi np oj ok ol nt om on oo op fh bj\" data-selectable-paragraph=\"\">A word cloud is a grouping of words that are displayed in various sizes to depict the frequency that a term appears in a document or corpus. Generally, the more important the word is, the larger and bolder it is. You will notice the word StandStrong appears bold in our word cloud below, because it is the most used word, followed by Davido who is the artist that sang it.<\/p>\n<pre class=\"mj mk ml mm mn qc qd qe qf ax qg bj\"><span id=\"e777\" class=\"na nb fo qd b ia qh qi l iq qj\" data-selectable-paragraph=\"\">#Let's create a wordcloud for a visual representation of the data:<\/span><span id=\"03c0\" class=\"na nb fo qd b ia qk qi l iq qj\" data-selectable-paragraph=\"\">Tweet_Word = ' '.join([twts for twts in stand_df['tweet']])\nwc = WordCloud(\n    background_color = \"black\",\n    stopwords = stopwords,\n    height = 500,\n    width = 800,\n    random_state = 21,\n    max_font_size = 120\n)<\/span><span id=\"7d87\" class=\"na nb fo qd b ia qk qi l iq qj\" data-selectable-paragraph=\"\">wc.generate(Tweet_Word)\nplt.imshow(wc, interpolation = 'bilinear')\nplt.axis('off')\nplt.show()<\/span><\/pre>\n<figure class=\"mj mk ml mm mn mo mg mh paragraph-image\">\n<div class=\"mp mq eb mr bg ms\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mt mu c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*bf6OzoNUm2grMNult3AwiQ.png\" alt=\"\" width=\"700\" height=\"437\"><\/figure><div class=\"mg mh qz\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*bf6OzoNUm2grMNult3AwiQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*bf6OzoNUm2grMNult3AwiQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*bf6OzoNUm2grMNult3AwiQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*bf6OzoNUm2grMNult3AwiQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*bf6OzoNUm2grMNult3AwiQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*bf6OzoNUm2grMNult3AwiQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*bf6OzoNUm2grMNult3AwiQ.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*bf6OzoNUm2grMNult3AwiQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*bf6OzoNUm2grMNult3AwiQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*bf6OzoNUm2grMNult3AwiQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*bf6OzoNUm2grMNult3AwiQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*bf6OzoNUm2grMNult3AwiQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*bf6OzoNUm2grMNult3AwiQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*bf6OzoNUm2grMNult3AwiQ.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mv mw mx mg mh my mz be b bf z dv\" data-selectable-paragraph=\"\">WordCloud visualization by author<\/figcaption>\n<\/figure>\n<h1 id=\"8ba4\" class=\"ra nb fo be nc rb rc go ng rd re gr nk rf rg rh ri rj rk rl rm rn ro rp rq rr bj\" data-selectable-paragraph=\"\">Conclusion<\/h1>\n<p id=\"ba5b\" class=\"pw-post-body-paragraph ny nz fo be b gm oa ob oc gp od oe of nl og oh oi np oj ok ol nt om on oo op fh bj\" data-selectable-paragraph=\"\">In conclusion, Twint is a fantastic package for creating social media monitoring apps that aren\u2019t restricted by the Twitter API. In this article, we learned how to utilize Twint to pull data from Twitter. We also performed sentiment analysis of our explore people\u2019s opinions of the keyword.<\/p>\n<h1 id=\"3033\" class=\"ra nb fo be nc rb rc go ng rd re gr nk rf rg rh ri rj rk rl rm rn ro rp rq rr bj\" data-selectable-paragraph=\"\">Social Media<\/h1>\n<p id=\"dfcc\" class=\"pw-post-body-paragraph ny nz fo be b gm oa ob oc gp od oe of nl og oh oi np oj ok ol nt om on oo op fh bj\" data-selectable-paragraph=\"\">You can follow me on social media:<\/p>\n<ul class=\"\">\n<li id=\"19fe\" class=\"ny nz fo be b gm oq ob oc gp or oe of ox os oh oi oy ot ok ol oz ou on oo op pj pb pc bj\" data-selectable-paragraph=\"\">Twitter: <a class=\"af ow\" href=\"https:\/\/twitter.com\/Kiddojazz\" target=\"_blank\" rel=\"noopener ugc nofollow\">@kiddojazz<\/a>.<\/li>\n<li id=\"d321\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">LinkedIn: <a class=\"af ow\" href=\"https:\/\/www.linkedin.com\/in\/temidayo-omoniyi-222b211a6\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">Temidayo Omoniyi<\/a>.<\/li>\n<li id=\"2832\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\">Github: <a class=\"af ow\" href=\"https:\/\/github.com\/kiddojazz\" target=\"_blank\" rel=\"noopener ugc nofollow\">Kiddojazz<\/a>.<\/li>\n<\/ul>\n<h1 id=\"8857\" class=\"ra nb fo be nc rb rc go ng rd re gr nk rf rg rh ri rj rk rl rm rn ro rp rq rr bj\" data-selectable-paragraph=\"\">References:<\/h1>\n<ul class=\"\">\n<li id=\"560f\" class=\"ny nz fo be b gm oa ob oc gp od oe of ox og oh oi oy oj ok ol oz om on oo op pj pb pc bj\" data-selectable-paragraph=\"\"><a class=\"af ow\" href=\"https:\/\/pypi.org\/project\/twint\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">https:\/\/pypi.org\/project\/twint\/<\/a><\/li>\n<li id=\"46f7\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\"><a class=\"af ow\" href=\"https:\/\/basilkjose.medium.com\/twint-twitter-scraping-without-twitters-api-aca8ba1b210e\" rel=\"noopener\">https:\/\/basilkjose.medium.com\/twint-twitter-scraping-without-twitters-api-aca8ba1b210e<\/a><\/li>\n<li id=\"1269\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\"><a class=\"af ow\" href=\"https:\/\/github.com\/twintproject\/twint\/issues\/1357\" target=\"_blank\" rel=\"noopener ugc nofollow\">https:\/\/github.com\/twintproject\/twint\/issues\/1357<\/a><\/li>\n<li id=\"9fa7\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\"><a class=\"af ow\" href=\"https:\/\/github.com\/twintproject\/twint\/issues\/1297\" target=\"_blank\" rel=\"noopener ugc nofollow\">https:\/\/github.com\/twintproject\/twint\/issues\/1297<\/a><\/li>\n<li id=\"73d5\" class=\"ny nz fo be b gm pd ob oc gp pe oe of ox pf oh oi oy pg ok ol oz ph on oo op pj pb pc bj\" data-selectable-paragraph=\"\"><a class=\"af ow\" href=\"https:\/\/www.youtube.com\/watch?v=8Bf6-KtrlIo\" target=\"_blank\" rel=\"noopener ugc nofollow\">https:\/\/www.youtube.com\/watch?v=8Bf6-KtrlIo<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Image by author Introduction Twitter is a social networking and news website where users exchange short messages known as tweets. The ease with which Twitter may be scanned is one of its biggest selling points. Hundreds of millions of intriguing individuals can be followed, and their material can be read quickly, which is convenient in [&hellip;]<\/p>\n","protected":false},"author":64,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[],"coauthors":[164],"class_list":["post-7018","post","type-post","status-publish","format-standard","hentry","category-machine-learning"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Web Scraping and Sentiment Analysis Using Twint Library - Comet<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Web Scraping and Sentiment Analysis Using Twint Library\" \/>\n<meta property=\"og:description\" content=\"Image by author Introduction Twitter is a social networking and news website where users exchange short messages known as tweets. The ease with which Twitter may be scanned is one of its biggest selling points. Hundreds of millions of intriguing individuals can be followed, and their material can be read quickly, which is convenient in [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/\" \/>\n<meta property=\"og:site_name\" content=\"Comet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cometdotml\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-01T14:19:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T17:14:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*hvZqCVeo0VzS5F2X8lgRgA.jpeg\" \/>\n<meta name=\"author\" content=\"Temidayo Omoniyi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Cometml\" \/>\n<meta name=\"twitter:site\" content=\"@Cometml\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Temidayo Omoniyi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Web Scraping and Sentiment Analysis Using Twint Library - Comet","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:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/","og_locale":"en_US","og_type":"article","og_title":"Web Scraping and Sentiment Analysis Using Twint Library","og_description":"Image by author Introduction Twitter is a social networking and news website where users exchange short messages known as tweets. The ease with which Twitter may be scanned is one of its biggest selling points. Hundreds of millions of intriguing individuals can be followed, and their material can be read quickly, which is convenient in [&hellip;]","og_url":"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2023-08-01T14:19:38+00:00","article_modified_time":"2025-04-24T17:14:59+00:00","og_image":[{"url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*hvZqCVeo0VzS5F2X8lgRgA.jpeg","type":"","width":"","height":""}],"author":"Temidayo Omoniyi","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"Temidayo Omoniyi","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/"},"author":{"name":"Temidayo Omoniyi","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/4923ece33ccc43e575fe105375ce2b67"},"headline":"Web Scraping and Sentiment Analysis Using Twint Library","datePublished":"2023-08-01T14:19:38+00:00","dateModified":"2025-04-24T17:14:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/"},"wordCount":1263,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*hvZqCVeo0VzS5F2X8lgRgA.jpeg","articleSection":["Machine Learning"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/","url":"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/","name":"Web Scraping and Sentiment Analysis Using Twint Library - Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*hvZqCVeo0VzS5F2X8lgRgA.jpeg","datePublished":"2023-08-01T14:19:38+00:00","dateModified":"2025-04-24T17:14:59+00:00","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/#primaryimage","url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*hvZqCVeo0VzS5F2X8lgRgA.jpeg","contentUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*hvZqCVeo0VzS5F2X8lgRgA.jpeg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/web-scraping-and-sentiment-analysis-using-twint-library\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"Web Scraping and Sentiment Analysis Using Twint Library"}]},{"@type":"WebSite","@id":"https:\/\/www.comet.com\/site\/#website","url":"https:\/\/www.comet.com\/site\/","name":"Comet","description":"Build Better Models Faster","publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.comet.com\/site\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.comet.com\/site\/#organization","name":"Comet ML, Inc.","alternateName":"Comet","url":"https:\/\/www.comet.com\/site\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","width":310,"height":310,"caption":"Comet ML, Inc."},"image":{"@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cometdotml","https:\/\/x.com\/Cometml","https:\/\/www.youtube.com\/channel\/UCmN63HKvfXSCS-UwVwmK8Hw"]},{"@type":"Person","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/4923ece33ccc43e575fe105375ce2b67","name":"Temidayo Omoniyi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/58f9909d16feca06094631a04429ca8c","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/1672668717395-96x96.jpg","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/1672668717395-96x96.jpg","caption":"Temidayo Omoniyi"},"url":"https:\/\/www.comet.com\/site\/blog\/author\/omoniyiandrewaigmail-com\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7018","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/users\/64"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=7018"}],"version-history":[{"count":1,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7018\/revisions"}],"predecessor-version":[{"id":15591,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7018\/revisions\/15591"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=7018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=7018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=7018"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=7018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}