Last active
September 3, 2022 17:01
-
-
Save JarrydWannenburg/8389406001f6af8e4e06f1314781051e to your computer and use it in GitHub Desktop.
Google_News_Extraction_Article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# installations | |
## Spacy | |
pip install -U pip setuptools wheel | |
pip install -U spacy | |
python -m spacy download en_core_web_sm | |
## NewsAPI | |
pip install newsapi-python | |
## Newspaper3k | |
pip install newspaper3k | |
## TextBlob | |
pip install -U textblob | |
# loading libraries | |
from newspaper import Article | |
from newsapi import NewsApiClient | |
import pandas as pd | |
from textblob import TextBlob | |
import spacy | |
# Create our nlp object using the small class. While it's not as accurate as the large class, it is much more efficent | |
# and plenty accurate for this demo. | |
import en_core_web_sm | |
nlp = spacy.load("en_core_web_sm") | |
# Read in key | |
with open("NewsAPI_key.txt", 'r') as f: | |
key = f.read() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment