Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

avatar image
Question by azzopardic · Jul 30, 2021 at 10:38 AM · eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonnews

Sentiment does not correspond to currency pair in filter.

I'm currently working on a market sentiment report and utilizing Python's get_news_headlines function to collect data. Because the function is run for each currency pair, if more than one currency pair is referenced in the same news, there may be duplicates. The dashboard shows the news' sentiment and how it relates to the currency pair in question. The problem is that there are times when a news piece discusses only one currency pair, and the sentiment of that news article is directed toward that currency pair, but it also includes mentions to other currency pairs. Hence, when the filters for the other currency pairs are applied, this news story is also caught. As a result, the sentiment gathered in this news story does not correspond to the other currency pairs indicated, causing the statistics gathered to be erroneous. Is there any way to resolve this problem, please?


Examples of filters used currently: EURGBP=, EUR=, EURJPY=


Example of this issue:

1627640974602.jpeg


Thanks in advance.

1627640974602.jpeg (11.8 KiB)

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

3 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by jason.ramchandani01 · Jul 30, 2021 at 01:55 PM

@azzopardic So this is essentially an NLP (Natural Language Processing) and classification problem set - not really an API issue. So if I am right you are looking to separate articles that only talk about one currency pair and ignore articles that mention more than one currency pair. In this case you would need to download the news story and then scan for mentions of any other pairs (ie you should have a list of all pairs) and then only pass the news item to the sentiment engine if only the pair you are referring to is mentioned or you could say then weight the sentiment of the article according to the number of mentions of a currency pair - please see the following example:

from IPython.display import HTML
from bs4 import BeautifulSoup

df = ek.get_news_headlines('GBP=',count=100)
df

this returns us a list of headlines and storyIds. So we then download a news story like this:

1627652969599.png

We could then count the number of mentions of particular phrases - in our case from currency pairs or rics even:

fx_list = ['GBP','JPY','USD','EUR','EUR/GBP','GBP/EUR']


for fx in fx_list:
    soup = BeautifulSoup(story,"html")
    wordcount = sum(fx == word for word in soup.get_text().split())
    print(fx, wordcount)

1627653113442.png

So once you have this data you could then decide whether the article was more about one pair or more about other pairs. I don't think this would be the holy grail but its a simple way for you to perhaps experiment a bit to see how things are working in real life. I hope this simple sample can help.


1627652969599.png (83.3 KiB)
1627653113442.png (7.0 KiB)
Comment
wasin.w

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by Alex Putkov.1 · Jul 30, 2021 at 02:10 PM

@azzopardic

I'm not sure I'm following you. Please, correct me if I'm wrong, but from your description it seems to me that the issue is squarely within the proprietary logic in your application. get_news_headlines method only returns the headlines. The sentiment analysis you do with these headlines does not utilize any Refinitiv capabilities, right? If this is correct, I don't see how this forum could possibly help you.

Comment
wasin.w

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by zoya faberov · Jul 30, 2021 at 02:40 PM

Hello @azzopardic ,

Fully agree with @jason.ramchandani and @Alex Putkov's answers, and would like to mention, that if you require the relevance of the news, to specific RIC, as a score (i.e. 0.9 is very relevant and 0.15 is just a passing mention), as well as other news analytics, this information is available for Realtime news, as part of Refinitiv Machine Readable News Analytics product, and history of MRN news analytics as Refinitiv Machine Readable News History product. These are separate enterprise products, not part of Eikon/Refinitiv Workspace space.

If this may be of interest to your organization, please discuss your requirements in detail with your Refinitiv account team so they able to help you best address the requirement.

Comment
wasin.w

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
14 People are following this question.

Related Questions

How do I apply short-term and long-term filters in Python?

Is it possible to retrieve news history with or without sentiment score since 1990 ?

Query news in English via python API

Is it possible to get real time news headlines into Excel?

EIKON API to see news flag and sentiment

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges