Using Web Scraping, Data Science and Machine Learning techniques to conduct sentiment analysis on news articles using Google's Natural Language Processing API.
Our goals involved the following:
- Part 1: Web scraping media stories with the purpose of extracting relevant information for sentiment analysis.
- Part 2: Extracting the articles using an API and cleaning the text information
- Part 3: Using Google's Natural Language API for calculating the Sentiment and Magnitude of news articles.
This analysis will allow us to analyze the slant (or bias) of media articles, as well as the degree to which emotion plays into the journalism of many news articles.
#Data
I used data from All Sides to extract stories, relevant articles, information related to the articles, and the bias for each source. We also used the news-please API to extract information related to the articles, such as the text and the author.
- requests
- BeautifulSoup
- csv
- re
- pandas
- pickle
- itertools
- difflib
- matplotlib
- newsplease
- seaborn
- nltk