Open:FactSet Forum

Using NLP to extract sentiment from news: US and China 2018 Trade War


(Peter Davaney-Graham) #1

Alexandria Technology has an awesome pair of offerings on the Open:FactSet Marketplace, both that use Machine Learning and NLP to extract sentiment from new stories at an incredibly fast pace.

The feeds include information that allow a user to create robust and granular sentiment indexes which can be plugged into the portfolio management process as another point of reference or an investment factor.

With all of the trade war and tariff talk in the news, I thought it would be interesting to use the economic feed to create a “net sentiment” factor and to compare the sentiment in the US v. China.

Looking at the chart for the US in 2017, you probably wouldn’t be surprised to see a prevailing negative sentiment for the Trade Balance Event Tag.

United States

Somewhat surprisingly, the sentiment around Trade Balance in China has been predominantly positive for most of 2018 - though as you might expect, there has been a a pretty sharp drop off towards the end of the year.


It will be curious to see how things change in early 2019 and whether an agreement can be reached or the trade war will escalate. If you are interested in checking out the code behind these charts, the SQL and Python attached are a good starting point.

3.1 Calculating Net Sentiment Scores with Alexandria Text Analytics - Economic.ipynb (1.2 MB)