Question: Use the IBM Watson Natural Language Understanding API, and write a function extractEntities(url) that takes as input a URL, and returns a list of dictionaries,
Use the IBM Watson Natural Language Understanding API, and write a function extractEntities(url) that takes as input a URL, and returns a list of dictionaries, with every dictionary containing the entity name, the URL where the entity appeared, the relevance of the entity to the article, and the sentiment about the entity. For example a dictionary for one entity may look like:
{ 'entity': 'Donald Trump', 'url': 'http://www.politico.com/story/2017/05/23/infrastructure-transportation-trump-budget-238741', 'source': 'politico', 'relevance': 0.882851, 'sentiment': -0.25 }
The function extractEntities should return a list of dictionaries, with each dictionary in the list corresponding to one entity.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
