NYC Data Science Academy| Blog
Bootcamps
Lifetime Job Support Available Financing Available
Bootcamps
Data Science with Machine Learning Flagship ๐Ÿ† Data Analytics Bootcamp Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lesson
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories Testimonials Alumni Directory Alumni Exclusive Study Program
Courses
View Bundled Courses
Financing Available
Bootcamp Prep Popular ๐Ÿ”ฅ Data Science Mastery Data Science Launchpad with Python View AI Courses Generative AI for Everyone New ๐ŸŽ‰ Generative AI for Finance New ๐ŸŽ‰ Generative AI for Marketing New ๐ŸŽ‰
Bundle Up
Learn More and Save More
Combination of data science courses.
View Data Science Courses
Beginner
Introductory Python
Intermediate
Data Science Python: Data Analysis and Visualization Popular ๐Ÿ”ฅ Data Science R: Data Analysis and Visualization
Advanced
Data Science Python: Machine Learning Popular ๐Ÿ”ฅ Data Science R: Machine Learning Designing and Implementing Production MLOps New ๐ŸŽ‰ Natural Language Processing for Production (NLP) New ๐ŸŽ‰
Find Inspiration
Get Course Recommendation Must Try ๐Ÿ’Ž An Ultimate Guide to Become a Data Scientist
For Companies
For Companies
Corporate Offerings Hiring Partners Candidate Portfolio Hire Our Graduates
Students Work
Students Work
All Posts Capstone Data Visualization Machine Learning Python Projects R Projects
Tutorials
About
About
About Us Accreditation Contact Us Join Us FAQ Webinars Subscription An Ultimate Guide to
Become a Data Scientist
    Login
NYC Data Science Acedemy
Bootcamps
Courses
Students Work
About
Bootcamps
Bootcamps
Data Science with Machine Learning Flagship
Data Analytics Bootcamp
Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lessons
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook
Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories
Testimonials
Alumni Directory
Alumni Exclusive Study Program
Courses
Bundles
financing available
View All Bundles
Bootcamp Prep
Data Science Mastery
Data Science Launchpad with Python NEW!
View AI Courses
Generative AI for Everyone
Generative AI for Finance
Generative AI for Marketing
View Data Science Courses
View All Professional Development Courses
Beginner
Introductory Python
Intermediate
Python: Data Analysis and Visualization
R: Data Analysis and Visualization
Advanced
Python: Machine Learning
R: Machine Learning
Designing and Implementing Production MLOps
Natural Language Processing for Production (NLP)
For Companies
Corporate Offerings
Hiring Partners
Candidate Portfolio
Hire Our Graduates
Students Work
All Posts
Capstone
Data Visualization
Machine Learning
Python Projects
R Projects
About
Accreditation
About Us
Contact Us
Join Us
FAQ
Webinars
Subscription
An Ultimate Guide to Become a Data Scientist
Tutorials
Data Analytics
  • Learn Pandas
  • Learn NumPy
  • Learn SciPy
  • Learn Matplotlib
Machine Learning
  • Boosting
  • Random Forest
  • Linear Regression
  • Decision Tree
  • PCA
Interview by Companies
  • JPMC
  • Google
  • Facebook
Artificial Intelligence
  • Learn Generative AI
  • Learn ChatGPT-3.5
  • Learn ChatGPT-4
  • Learn Google Bard
Coding
  • Learn Python
  • Learn SQL
  • Learn MySQL
  • Learn NoSQL
  • Learn PySpark
  • Learn PyTorch
Interview Questions
  • Python Hard
  • R Easy
  • R Hard
  • SQL Easy
  • SQL Hard
  • Python Easy
Data Science Blog > Machine Learning > Sentiment Analysis of Media Coverage of Presidential Candidates

Sentiment Analysis of Media Coverage of Presidential Candidates

David Comfort
Posted on Dec 16, 2015

Contributed by David Comfort. He took NYC Data Science Academy 12 week full time Data Science Bootcamp program between Sept 23 to Dec 18, 2015. The post was based on his fourth class project(due at 8th week of the program).

===================

My overall goal was to determine if the sentiment of US Presidential Candidates in news coverage can be detected. Specifically, I extracted articles about the major presidential candidates in the New York Times and attempted to perform sentiment analysis.

Outline

  1. Identifying Articles in the New York Times using their API
  2. Web scraping tricks and tips
  3. Content Extraction Algorithms for Python
  4. Scraping the New York Times and extracting the content
  5. AlchemyAPI
  6. Sentiment Analysis
  7. Demonstrate Indico, TextBlob and other Sentiment Analysis packages
  8. Comparison of Indico and TextBlob for Movie Reviews
  9. Conclusions

A screen capture of the presentation is below:

[youtube http://www.youtube.com/watch?v=a2yW7OLC_2s?rel=0&w=560&h=315]

1. Identifying Articles in the New York Times using their API

I utilized the New York Times api and python packages to pull out article titles for the candidates in the past year. Specifically, I used a Python Package nytimesarticle, a fully-functional Python wrapper for the New York Times Article Search API. I borrowed some of the code below from the excellent tutorial,  Scraping New York Times Articles with Python: A Tutorial.

The New York Times API will not return the full text of articles. However, it will return metadata such as subject terms, abstract, and date, as well as the URL, which I will subsequently use to scrape the full text of articles.

To begin, you first need to obtain an API key from the New York Times. See here for more information.

You also need to install the nytimesarticle Python package, which allows you to query the API through Python.

Load the API

Parse the Articles

Put the Articles in a Dataframe

Dataframe of Parsed Articles

Figure 1: Dataframe of Parsed Articles

Now that we have a function to parse results into a clean list, we can easily write another function that collects all articles for a search query in a given year.

Now I can get articles for each candidate. For instance, for Bernie Sanders:

Figure 2: Data Frame of articles about Bernie Sanders

Figure 2: Data Frame of articles about Bernie Sanders

2. Web scraping tricks and tips

In the course of doing this project, I discovered several web scraping tips and tricks. I learned some of these techniques from the book, Web Scraping with Python: Collecting Data from the Modern Web, although I wish the author went into a little bit more detail sometimes.

Adjusting Headers

HTTP headers are a list of attributes, or preferences, sent by you every time you make a request to a web server. A typical Python scraper using the default urllib library might send the following header:

  • User-Agent Python-urllib/3.4

We can utilize the following code to examine what a server would "see" if I tried to scrape their site:

Notice that the USER_AGENT is set to python-requests/2.3.0 CPython/2.7.10, which might alert the site that I am scraping that I am indeed scraping their site.

However, we can change the header using the code below so that our web scraper appears "more human":

Now, the USER_AGENT is set to Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5), so the website will think that I am a human using a browser to view their site.

Handling Cookies

Browser plug-ins that can show you how cookies are being set as you visit and move around a site.

In the above code, I first send the login parameters to the welcome page, which acts as the processor for the login form. I then retrieve the cookies from the results of the last request, print the result for verification, and the send them to the profile page by setting the cookies argument.

The session object (retrieved by calling requests.Session()) keeps track of session information, such as cookies, headers, and even information about protocols you might be running on top of HTTP, such as HTTPAdapters.

The first request to the URL will fill the jar. The second request will send the cookies back to the server. The same goes for the standard library's urllib module cookielib.

There are some excellent Stackoverflow posts which cover how to handle cookies while you are web scraping:

  • requests.Session() load cookies from CookieJar
  • Putting a Cookie in a CookieJar
  • Using requests module, how to handle 'set-cookie' in request response?

Space out requests

You can also space out requests so you are not overloading somebody else's server:

Scraping remotely

Tor

The Onion Router network, better known by the acronym Tor, is a network of volunโ€ teer servers set up to route and reroute traffic through many layers (hence the onion reference) of different servers in order to obscure its origin. Data is encrypted before it enters the network so that if any particular server is eavesdropped on the nature of the communication cannot be revealed. In addition, although the inbound and outโ€ bound communications of any particular server can be compromised, one would need to know the details of inbound and outbound communication for all the servers along the path of communication in order to decipher the true start and endpoints of a communicationโ€”a near-impossible feat.

Having Tor installed and running is a requirement for using Python with Tor, as we will see in the next section. Fortunately, the Tor service is extremely easy to install and start running with. Just go to the Tor downloads page (https://www.torproject.org/ download/download) and download, install, open, and connect! Keep in mind that your Internet speed might appear to be slower while using Tor. Be patientโ€”it might be going around the world several times!

PySocks

PySocks is a remarkably simple Python module that is capable of routing traffic through proxy servers and that works fantastically in conjunction with Tor. You can download it from its website or use any number of third-party module managers to install it.

pip install PySocks

Although not much in the way of documentation exists for this module, using it is extremely straightforward. The Tor service must be running on port 9150 (the default port) while running this code:

3. Content Extraction Algorithms for Python

There are several packages in Python for extracting content from Web pages. A brief overview of these packages follows:

Goose

Goose was originally an article extractor written in Java.

The aim of the software is to take any news article or article-type web page and not only extract what is the main body of the article but also all meta data and most probable image candidate.

Goose will try to extract the following information:

  • Main text of an article
  • Main image of article
  • Any YouTube/Vimeo movies embedded in article
  • Meta Description
  • Meta tags

We can utilize Goose to extract the content, the title, the meta description, and the top image of an article based upon the URL of an article:

http://www.nytimes.com/politics/first-draft/2015/10/30/death-penalty-could-provide-debate-fodder-for-hillary-clinton-and-bernie-sanders/
Hillary Rodham Clinton, who leads most Democratic polls nationally and in Iowa, has for months moved to her partyโ€™s left on a range of issues, from immigration overhaul to criminal justice reform to, more recently, opposition to the Trans-Pacific Partnership trade deal.
Yet on Wednesday, Mrs. Clinton bluntly told attendees at a campaign event that she supports the death penalty โ€” in limited use and in limited cases, but she still supports it. And thatโ€™s a position that isnโ€™t shared by much of the Democratic primary base.
Senator Bernie Sanders of Vermont, her main opponent in the Democratic contest, called for the abolition of the death penalty in a speech on the Senate floor on Thursday, a move that highlighted the issue and the fact that he is to her left on it.
โ€œWe are all shocked and disgusted by some of the horrific murders that we see in this country, seemingly every week,โ€ Mr. Sanders said. โ€œAnd that is precisely why we should abolish the death penalty. At a time of rampant violence and murder, the state should not be part of that process.โ€
The other Democratic candidate, Martin Oโ€™Malley, also favors abolishing the death penalty. And Mrs. Clintonโ€™s position and her rivalsโ€™ disagreement with it virtually guarantees it will be a topic at the next Democratic debate.
u'Death Penalty Could Provide Debate Fodder for Hillary Clinton and Bernie Sanders'
u'Mrs. Clinton\u2019s comments that she supported limited use of the death penalty put her on the opposite side of much of the Democratic base and prompted a response on the Senate floor from Bernie Sanders, all but assuring the topic will be raised at the next debate.'
'http://graphics8.nytimes.com/images/2015/10/29/us/politics/29firstdraftnl-sanders/29firstdraftnl-sanders-tmagArticle.jpg'

BeautifulSoup

I also examined BeautifulSoup, although I found it less easy to use than Goose. In retrospect, BeautifulSoup is good to use if you really need to target specific elements on a web page.

http://www.nytimes.com/politics/first-draft/2015/10/30/death-penalty-could-provide-debate-fodder-for-hillary-clinton-and-bernie-sanders/

Readability

This is a python port of a ruby port of arc90โ€™s readability project. Given a html document, Readability pulls out the main body text and cleans it up.

http://www.reuters.com/article/2015/10/29/us-indonesia-elnino-idUSKCN0SM2SK20151029

<html><body><div><span id="articleText"> <span id="midArticle_start"/> <span id="midArticle_0"/><span class="focusParagraph"><p><span class="articleLocation">KARANG JATI, Indonesia</span> On a dry and dusty sports field in central Java, Indonesian men dressed as traditional warriors take turns to battle with wooden staves, while village women crowd around, chanting: "All farmers let us pray that rain comes and washes our sorrow away."</p></span><span id="midArticle_1"/><p>As in many parts of Java, Indonesia's main rice-growing island, seasonal rains are late coming to Karang Jati. A drought caused by the El Nino weather pattern, which scientists say could be the worst on record, means fields are fallow weeks after they would normally be sown. So the villagers have turned to a rain-making ritual to hasten the planting season.</p><span id="midArticle_2"/><p>Crop failures caused by an El Nino drought presage more pain for Southeast Asia's largest economy, which is already growing at its slowest pace in six years, by squeezing incomes, fanning inflation and pushing more people into poverty.</p><span id="midArticle_3"/><p>All this piles pressure on Joko Widodo, Indonesia's first president from humble origins, on top of the haze crisis caused by slash-and-burn forest clearances, who made poverty reduction a priority but has seen it swell across this archipelago of 250 million people since he took office a year ago.</p><span id="midArticle_4"/><p>The number of people officially classed as poor actually rose in the first six months of his presidency to 28.6 million in March from 27.7 million in September 2014.</p><span id="midArticle_5"/><p>Twenty of Indonesia's 34 provinces are currently stricken by severe drought, according to the meteorology agency.</p><span id="midArticle_6"/><p>The World Bank says that if there is a severe El Nino this year, rice production will fall by 2.1 million tonnes, or 2.9 percent, and rice prices will rise by 10.2 percent.</p><span id="midArticle_7"/> <span class="first-article-divide"/><p>That price rise will hit the poor hardest because they spend more of their income on food than the well off.</p><span id="midArticle_8"/><p>"Reduced agricultural incomes and higher prices could be devastating for poor households," the Bank said in a report, adding that rice imports may be needed if El Nino intensifies.</p><span id="midArticle_9"/><p/><span id="midArticle_10"/><p>"NO RAIN, NO MONEY"</p><span id="midArticle_11"/> <span class="second-article-divide"/><p>Widodo has provided more funds for cash transfers and social schemes, but so far has refused to sanction rice imports, keen that Indonesia should be self-sufficient in food.</p><span id="midArticle_12"/><p>"We are not talking about imports," Finance Minister Bambang Brodjonegoro told Reuters in a recent interview. "We are trying to make sure the domestic stocks are available and accessible."</p><span id="midArticle_13"/><p>Other countries at risk of an El Nino drought, such as the Philippines, have taken advantage of low global rice prices to boost stocks with foreign imports.</p><span id="midArticle_14"/><p>Such measures at least cap inflation if crops fail, though they mostly benefit people in towns who consume rice, rather than the farmers who produce it - all they can do is pray for the weather to change.</p><span id="midArticle_15"/> <span class="third-article-divide"/><p>"Our paddy fields depend on rainwater, so if there is no rain we suffer," said Darijan, a 60-year-old farmer in central Java who has started selling his soil to brick-makers to make ends meet.</p><span id="midArticle_0"/><p>Agriculture accounts for nearly 14 percent of Indonesia's gross domestic product, the highest among Southeast Asia's five main economies. One-third of the labour force works in farming, and more than half of poor households live off the land.</p><span id="midArticle_1"/><p>"What is very important ... to the poverty numbers is rice production and rice prices," Steven Tabor, the Asian Development Bank's head in Indonesia, told a recent conference. "And the beginnings of El Nino seem to suggest that we may be in for rising poverty towards the end of the year."</p><span id="midArticle_2"/><p>As the drought drags on, Karang Jati's farmers such as 70-year-old Rohadi Rustam are anxious. </p><span id="midArticle_3"/><p>"If there's no rain, we have no money," he said, sitting by his sun-cracked fields. "That's how we farmers live."</p><span id="midArticle_4"/><p/><span id="midArticle_5"/><p> (Additional reporting by Heru Asprihanto, Quincy de Neve and Arzia Tivany Wargadiredja in JAKARTA; Editing by <a href="http://blogs.reuters.com/search/journalist.php?edition=us&amp;n=john.chalmers&amp;">John Chalmers</a> and <a href="http://blogs.reuters.com/search/journalist.php?edition=us&amp;n=simon.cameron.moore&amp;">Simon Cameron-Moore</a>)</p><span id="midArticle_6"/></span> </div></body></html>
Beyond haze, El Nino drought poses poverty challenge for Indonesia

Other Packages include:

  • libextract
  • eatiht
  • Dragnet

A recent blog post benchmarked one content extraction algorithm, Dragnet, against a few other Python content extraction repositories in execution speed and accuracy. Their post describes those benchmarks and the recent improvements in Dragnet.

Python Web Scraping Resources

This list contains python libraries related to web scraping and data processing:
Python Web Scraping

  • Network
  • Web-scraping Frameworks
  • HTML/XML Parsing
  • Text processing
  • Specific Formats Processing
  • Natural Language Processing
  • Browser automation and emulation
  • Multiprocessing
  • Queue
  • Cloud Computing
  • Email
  • URL and Network Address Manipulation
  • Web Content Extracting
  • Asynchronous
  • WebSocket
  • DNS Resolving
  • Computer Vision
  • Proxy Server
  • Misc
  • Other Python Lists

4. Scraping the New York Times and extracting the content

Looping through each candidate and each URL

5. AlchemyAPI

AlchemyAPI uses machine learning (specifically, deep learning) to do natural language processing (specifically, semantic text analysis, including sentiment analysis) and computer vision (specifically, face detection and recognition)

  • Entity Extraction
  • Keyword Extraction
  • Concept Tagging
  • Sentiment Analysis
  • Targeted Sentiment Analysis
  • Relation Extraction
  • Text Categorization
  • Taxonomy

Key: ba25019e0990c87c9c4965c4898672b8ddb3f3e1 was written to api_key.txt You are now ready to start using AlchemyAPI. For an example, run: python example.py Mayor Bill de Blasioโ€™s slow, awkward march toward endorsing Hillary Rodham Clinton โ€” the woman who jump-started his political career โ€” reached its widely predicted conclusion on Friday, as the mayor extended his presidential blessing on MSNBCโ€™s โ€œMorning Joe.โ€ โ€œThe candidate who I believe can fundamentally address income inequality effectively, the candidate who has the right vision, the right experience and the ability to get the job done, is Hillary Clinton,โ€ Mr. de Blasio said. Mrs. Clinton, a fellow Democrat, did not appear on the program. Nor did she issue a statement about Mr. de Blasio. Instead, the Clinton campaign emailed a note to reporters calling the New York City mayorโ€™s support โ€œa sign of the campaignโ€™s continued momentum.โ€ The note added, โ€œThe Clinton campaign will also announce that an additional 85 mayors from across the country will endorse her today.โ€ The circumstances of Mr. de Blasioโ€™s endorsement offered a sign of the reduced interest in his presidential preferences since he initially denied Mrs. Clinton his blessing in April. When the Clinton campaign issued an official announcement about its latest wave of endorsements, Mr. de Blasioโ€™s was given fourth billing, after the mayors of Chicago, Houston and Philadelphia. By this week, Mr. de Blasioโ€™s six-month delay in issuing an endorsement was viewed in political circles as quixotic at best. Virtually all leading Democrats in New York have already thrown their support behind Mrs. Clinton, along with leading liberal Democrats like Senator Sherrod Brown of Ohio. But the mayorโ€™s vow of neutrality was initially taken as a liberal line in the sand, part of Mr. de Blasioโ€™s effort to kick-start a national movement to nudge presidential contenders leftward. His public vacillation started in political prime time with a bold declaration during an interview on NBCโ€™s โ€œMeet the Pressโ€ โ€” โ€œI want to see a vision,โ€ he said โ€” hours before Mrs. Clinton formally began her candidacy. For months, the mayorโ€™s allies objected to accusations that Mr. de Blasio wanted to play kingmaker, saying that he simply wanted to hear more detail about the policy plans of presidential contenders, particularly in the early stages of the contest. More recently, however, many members of the mayorโ€™s inner circle had grown frustrated with his delay, saying that the uncertainty had become a distraction. The mayorโ€™s liberal advocacy group, the Progressive Agenda Committee, also announced plans to hold a forum for presidential contenders in Iowa in December, complicating Mr. de Blasioโ€™s calculus about whether to remain unaffiliated with a candidate. The โ€œwill he or wonโ€™t heโ€ soap opera ended shortly after sunrise on Friday, on a low-rated basic-cable talk show amid banter about baseball and jokes about Citi Bike. โ€œMorning Joeโ€ is familiar, relatively friendly territory for Mr. de Blasio, who has visited its set at least six times during his 22-month term. But the mayor still faced skeptical questions from the hosts, who wondered what, exactly, had changed in the past few months to make him want to endorse Mrs. Clinton now. At one point, Mark Halperin, a political analyst, urged Mr. de Blasio to face a camera and explain his decision directly to supporters of Senator Bernie Sanders of Vermont, an independent who has been embraced by many left-leaning Democrats. โ€œI like Bernie a lot,โ€ Mr. de Blasio said. But he quickly added that Mrs. Clinton was โ€œthe most capable of executing the vision.โ€ (A spokesman for Mr. Sanders did not return a request for comment.) Katrina vanden Heuvel, the editor and publisher of The Nation and one of Mr. de Blasioโ€™s closest supporters, wrote in an email that the mayorโ€™s endorsement โ€œgets de Blasio on the Clinton team,โ€ adding: โ€œThatโ€™s good for him, good for New York, good for an urban agenda.โ€ But she also urged Mr. de Blasio to stay vigilant in encouraging Mrs. Clinton to adopt positions supported by the left. โ€œThere is still room for her to move, and de Blasio should keep the pressure on for that movement,โ€ Ms. vanden Heuvel wrote. For his part, Mr. de Blasio said on MSNBC that Mrs. Clinton had โ€œa very sharp progressive platformโ€ and โ€œthe ability to follow through on it.โ€ He added: โ€œThereโ€™s a lot of spine there. Thereโ€™s a steel there.โ€ Reflecting on his own thought process, Mr. de Blasio suggested that Mrs. Clinton had increasingly fit his criteria for a candidate, saying, โ€œAs youโ€™ve seen in each successive speech, Hillary has filled in the blanks forcefully.โ€ At the same time, he urged voters to pay more attention to her accomplishments in the past. โ€œI think whatโ€™s missing here in this discussion,โ€ Mr. de Blasio said, โ€œis who Hillary has always been.โ€

Entity Extraction

An example of using AlchemyAPI for entity extraction is below:

Example code for keyword extraction, concept tagging, relation extraction, text categorization, taxonomy, and sentiment analysis is at the AlchemyAPI github.

6. Sentiment Analysis

"Sentiment analysis and opinion mining is the field of study that analyzes peopleโ€™s opinions, sentiments, evaluations, attitudes, and emotions from written language." - Liu, Bing. "Sentiment analysis and opinion mining." Synthesis Lectures on Human Language Technologies 5.1 (2012): 1-167.

I examined a couple of different packages to implement sentiment analysis.

Indico Sentiment Analysis API

Indico appears to be using Recurrent neural networks.

'NASHUA, N.H. \xe2\x80\x93 Most presidential candidates don\xe2\x80\x99t talk openly about electoral strategy, preferring to keep the focus on voters\xe2\x80\x99 needs and not their own. But Senator Bernie Sanders of Vermont, in remarks here Friday at one of his campaign offices, made a blunt appeal to New Hampshire voters as he described the state\xe2\x80\x99s February primary as critical to his survival as a candidate.\n\nSaying that he had an \xe2\x80\x9cexcellent chance\xe2\x80\x9d of beating Hillary Rodham Clinton in New Hampshire, and that he could also win the Iowa caucuses a week before, Mr. Sanders said, \xe2\x80\x9cIf we win Iowa and New Hampshire, it opens up for us a path toward victory.\xe2\x80\x9d\n\nMr. Sanders rarely talks about the caucuses and primaries as must-win affairs, but he was seeking to send a sharp message to voters \xe2\x80\x93 through the bank of television cameras and a dozen reporters \xe2\x80\x93 that his campaign will rise or fall in the nominating race\xe2\x80\x99s first two voting states. Mrs. Clinton\xe2\x80\x99s aides, by contrast, are building a political firewall through Southern states to keep her on track to capture the Democratic nomination even if she loses in Iowa and New Hampshire.\n\nAfter an earlier event where he promised to do more than Mrs. Clinton to protect and expand Social Security benefits, Mr. Sanders dwelled largely on campaign dynamics here as he said he faced \xe2\x80\x9ca tough road \xe2\x80\x93 we are taking on establishment politics, we are taking on establishment economics, we will be outspent.\xe2\x80\x9d\n\nMr. Sanders dropped Mrs. Clinton\xe2\x80\x99s name as he pointedly noted that unlike him, she has support from a \xe2\x80\x9csuper PAC\xe2\x80\x9d \xe2\x80\x93 the sort of big-money political outfit that he sees as a corrupting influence in government.\n\n\xe2\x80\x9cWhen you have a super PAC, you can sit down in a room with a handful of very wealthy families and then walk out with millions of dollars,\xe2\x80\x9d said Mr. Sanders, who is well aware that many New Hampshire voters strongly support campaign finance reform. \xe2\x80\x9cI\xe2\x80\x99m proud of the way we\xe2\x80\x99ve raised our money.\xe2\x80\x9d\n\nMr. Sanders, who holds a modest lead in New Hampshire polls, is campaigning in the state through Saturday evening, while Mrs. Clinton held events here on Wednesday and Thursday \xe2\x80\x93 a pace that is sure to continue for the next three months.'

{u'Libertarian': 0.13097386225896757, u'Green': 0.011191867696439881, u'Liberal': 0.7681282251289556, u'Conservative': 0.08970604491563688}

I should note that the political sentiment for Bernie Sanders scored the highest for "Liberal."

The Bernie Sanders also scored very positively for both sentiment analysis algorithms used by Indico. Sentiment_hq is supposed to be a High Quality Sentiment Analysis.

About Author

David Comfort

David Comfort, D.Phil. is a data scientist, scientist, activist and writer. His doctoral research at Oxford University was in protein nuclear magnetic resonance (NMR) and computational biology. His post-doctoral research at UCLA involved genomics, bioinformatics as well as...
View all posts by David Comfort >

Leave a Comment

Cancel reply

You must be logged in to post a comment.

Google January 4, 2020
Google Always a big fan of linking to bloggers that I really like but really don't get a lot of link really like from.
http proxy protocol February 13, 2017
Country - string Alpha-2 country code of the country in which the proxy is geo-located.
Gulvafslibning Pris December 11, 2016
When you see that you are down to the new wood, then you will want to use the edge sander now for skirting boards and other elements that you couldn't access with the primary equipment.
http://www.kurt-gulvmand.dk/gulvafslibning-kastrup/ November 2, 2016
What is a flooring sanding?
Vivian Zhang December 16, 2015
David, unbelievable! You did this on your last day in bootcamp!! Bravo

View Posts by Categories

All Posts 2399 posts
AI 7 posts
AI Agent 2 posts
AI-based hotel recommendation 1 posts
AIForGood 1 posts
Alumni 60 posts
Animated Maps 1 posts
APIs 41 posts
Artificial Intelligence 2 posts
Artificial Intelligence 2 posts
AWS 13 posts
Banking 1 posts
Big Data 50 posts
Branch Analysis 1 posts
Capstone 206 posts
Career Education 7 posts
CLIP 1 posts
Community 72 posts
Congestion Zone 1 posts
Content Recommendation 1 posts
Cosine SImilarity 1 posts
Data Analysis 5 posts
Data Engineering 1 posts
Data Engineering 3 posts
Data Science 7 posts
Data Science News and Sharing 73 posts
Data Visualization 324 posts
Events 5 posts
Featured 37 posts
Function calling 1 posts
FutureTech 1 posts
Generative AI 5 posts
Hadoop 13 posts
Image Classification 1 posts
Innovation 2 posts
Kmeans Cluster 1 posts
LLM 6 posts
Machine Learning 364 posts
Marketing 1 posts
Meetup 144 posts
MLOPs 1 posts
Model Deployment 1 posts
Nagamas69 1 posts
NLP 1 posts
OpenAI 5 posts
OpenNYC Data 1 posts
pySpark 1 posts
Python 16 posts
Python 458 posts
Python data analysis 4 posts
Python Shiny 2 posts
R 404 posts
R Data Analysis 1 posts
R Shiny 560 posts
R Visualization 445 posts
RAG 1 posts
RoBERTa 1 posts
semantic rearch 2 posts
Spark 17 posts
SQL 1 posts
Streamlit 2 posts
Student Works 1687 posts
Tableau 12 posts
TensorFlow 3 posts
Traffic 1 posts
User Preference Modeling 1 posts
Vector database 2 posts
Web Scraping 483 posts
wukong138 1 posts

Our Recent Popular Posts

AI 4 AI: ChatGPT Unifies My Blog Posts
by Vinod Chugani
Dec 18, 2022
Meet Your Machine Learning Mentors: Kyle Gallatin
by Vivian Zhang
Nov 4, 2020
NICU Admissions and CCHD: Predicting Based on Data Analysis
by Paul Lee, Aron Berke, Bee Kim, Bettina Meier and Ira Villar
Jan 7, 2020

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day ChatGPT citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay football gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income industry Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI

NYC Data Science Academy

NYC Data Science Academy teaches data science, trains companies and their employees to better profit from data, excels at big data project consulting, and connects trained Data Scientists to our industry.

NYC Data Science Academy is licensed by New York State Education Department.

Get detailed curriculum information about our
amazing bootcamp!

Please enter a valid email address
Sign up completed. Thank you!

Offerings

  • HOME
  • DATA SCIENCE BOOTCAMP
  • ONLINE DATA SCIENCE BOOTCAMP
  • Professional Development Courses
  • CORPORATE OFFERINGS
  • HIRING PARTNERS
  • About

  • About Us
  • Alumni
  • Blog
  • FAQ
  • Contact Us
  • Refund Policy
  • Join Us
  • SOCIAL MEDIA

    ยฉ 2025 NYC Data Science Academy
    All rights reserved. | Site Map
    Privacy Policy | Terms of Service
    Bootcamp Application