Test Hypotheses on Human Trafficking




Pay Notebook Creator: Roy Hyunjin Han0
Set Container: Numerical CPU with TINY Memory for 10 Minutes 0
Total0
In [ ]:
import feedparser
d = feedparser.parse('https://news.google.com/news?q=apple&output=rss')
d.entries[2]['summary']
from bs4 import BeautifulSoup
soup = BeautifulSoup(d.entries[2]['summary'], 'lxml')
soup.find('body').text
In [ ]:
from eventregistry import EventRegistry
e = EventRegistry(apiKey='7ce08850-ac44-4e1f-94c3-8589b32860db')
from eventregistry import QueryArticlesIter
q = QueryArticlesIter(keywords='sex trafficker')
q.count(e)
In [ ]:
g = q.execQuery(e)
x = next(g)
In [ ]:
import spacy
nlp = spacy.load('en_core_web_lg', disable=['tagger', 'parser', 'textcat'])
doc = nlp(x['body'])
for entity in doc.ents:
    print(entity.label_, str(entity).strip())