Run sentiment analysis
Tags: #newsapi #news #sentimentanalysis
Author: Unknown

Input

Import library

1
from naas_drivers import newsapi
2
from naas_drivers import sentiment
Copied!

Model

Connect to newsAPI and get the data

1
data = newsapi.connect().get("bitcoin", fields=["title", "image", "link", "description"])
Copied!

Get sentiment analysis

1
sentiment = sentiment.get(data, column_name="title")
Copied!

Output

Display results

1
data
Copied!
1
sentiment
Copied!
Copy link
Edit on GitHub