Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Entities(NewsUrl):
- url = "http://access.alchemyapi.com/calls/url/URLGetRankedNamedEntities"
- apikey = '8be7ddf98d4d46c5658289999fe120f97d233209'
- payload = {'apikey': apikey, 'disambiguate': '1', 'outputMode': 'json', 'sentiment': '1', 'coreference': '1', 'quatations': '1', 'showSourceText': '1', 'url': NewsUrl}
- r = requests.get(url, params=payload)
- return = json.loads(r.text)
- def Entities(urls):
- url_base = 'http://access.alchemyapi.com/calls/url/URLGetRankedNamedEntities'
- url_settings_1 = '?apikey=b326f5126719969a917ee700b1b444cc24437c51&outputMode=json'
- url_settings_2 = '&disambiguate=1&coreference=1&quatations=1&sentiment=1&showSourceText=0&url='
- r = requests.get(url_base + url_settings_1 + url_settings_2 + url)
- result = json.loads(r.text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement