FT1 / utils /sentiment_analysis.py
Devendra21's picture
Create sentiment_analysis.py
3b92bf9 verified
raw
history blame contribute delete
324 Bytes
import requests
def fetch_sentiment(currency_pair, api_key):
# Fetch news and perform sentiment analysis
response = requests.get(f"https://newsapi.org/v2/everything?q={currency_pair}&apiKey={api_key}")
data = response.json()
# Perform sentiment logic (e.g., positive/negative/neutral)
return "Positive"