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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started