Financial News Mining @ PyData Amsterdam

David Graus
David GrausLead Data Scientist
Onderdeel van FD MediagroepOnderdeel van FD Mediagroep
Financial News Mining
PyData Hilversum edition: RTL hosts PyData, 8 Feb 2018
Onderdeel van FD Mediagroep
David Graus
@dvdgrs
Onderdeel van FD Mediagroep
Outline
• Financial News @ FDMG/Company.info
• Entity Linking
• Building an Entity Linker
• Method/Algorithms
• Implementation
• [Applications]
3
Onderdeel van FD Mediagroep
FD Mediagroep
4
Onderdeel van FD Mediagroep5
Onderdeel van FD Mediagroep6
Onderdeel van FD Mediagroep7
Onderdeel van FD Mediagroep8
Onderdeel van FD Mediagroep9
Financial News
Onderdeel van FD Mediagroep10
Onderdeel van FD Mediagroep11
Onderdeel van FD Mediagroep12
Onderdeel van FD Mediagroep13
Onderdeel van FD Mediagroep15
Onderdeel van FD Mediagroep
Link
• News articles:
• >900 sources (Dutch, online)
• From Het Financieele Dagblad to the Groninger Gezinsbode
• Around ~4k articles per day
• Multiple years of archive
• Knowledge Base:
• ~2.8M companies & organization profiles
• Rich metadata: sector information, financial information, people,
buildings, etc…
16
Onderdeel van FD Mediagroep
How?
• Anno 2012: human labor
• Since March 2017: machine
17
Onderdeel van FD Mediagroep18
Entity Linking
Onderdeel van FD Mediagroep19
Onderdeel van FD Mediagroep
Step 1: Named-entity Recognition
20
Onderdeel van FD Mediagroep
Step 2: Entity Linking
21
34225913 0000
32105893 0000
Onderdeel van FD Mediagroep
Step 2: EL
22
342259130000
32105893 0000
Onderdeel van FD Mediagroep
Challenges
• A single entity mention can refer to multiple entities
23
Onderdeel van FD Mediagroep
Challenges
• A single entity can be referred to by multiple entity mentions
24
Onderdeel van FD Mediagroep25
Approach
Onderdeel van FD Mediagroep
NER: Approach
• Sequence classification
• E.g.: “Daarnaast sloot het bedrijf twee nieuwe
overeenkomsten met Xenos en Big Bazar
voor in totaal 2000 vierkante meter voor
een periode van 10 jaar.”
• Predict:
• Beginning of entity mention
• Inside entity mention
• Outside entity mention
26
Daarnaast O
sloot O
het O
bedrijf O
twee O
nieuwe O
overeenkomsten O
met O
Xenos B-ORG
en O
Big B-ORG
Bazar I-ORG
voor O
in O
totaal O
2000 O
vierkante O
meter O
voor O
een O
periode O
van O
10 O
jaar O
. O
Onderdeel van FD Mediagroep
NER: Features
• for token t in sentence s:
• Token-identity: token=Xenos
• Word-shape: TokenIsCaps={1,0},
TokenIsNumber={1,0}, …
• Context: prevToken=met, nextToken=en, …
• Dictionary: TokenInCompanyDict={1,0},
InPersonNameDict={1,0}, …
• Corpus: token’s TF-IDF weight, token’s word-cluster
membership, …
• And more…
• Structured Perceptron
• Predict {B, I, O}
27
Daarnaast O
sloot O
het O
bedrijf O
twee O
nieuwe O
overeenkomsten O
met O
Xenos B-ORG
en O
Big B-ORG
Bazar I-ORG
voor O
in O
totaal O
2000 O
vierkante O
meter O
voor O
een O
periode O
van O
10 O
jaar O
. O
Onderdeel van FD Mediagroep
NER: Implementation
• NER: Sequence Classification
• Custom implementation using seqlearn1: “Sequence learning toolkit for Python”
• Based on [Graus et al., ECIR ‘14]
• Flask App
28
1 https://github.com/larsmans/seqlearn
Onderdeel van FD Mediagroep
EL: Approach
• Common: Linking to Wikipedia
29
Onderdeel van FD Mediagroep
EL: Approach
• Custom KB; Custom implementation
• Binary classification (based on [Meij et al., WSDM ‘12])
• Issue entity mention as query to KB [Elasticsearch]
• Retrieve list of candidate organizations
• For each candidate:
• predict 1 (link), 0 (no-link)
30
Onderdeel van FD Mediagroep
EL: Features
For each <document, mention, entity candidate>:
1. Entity features:
• Turnover,
• Size,
• …
2. Mention features:
• MentionLength,
• …
3. Mention-Entity features:
• RetrievalScorePerField,
• TokenOverlapPerField
• …
4. Doc features:
• WoonplaatsInDocument,
• …
31
Onderdeel van FD Mediagroep
EL: Implementation
• sklearn RandomForestClassifier
• Served in a Flask app
32
Onderdeel van FD Mediagroep
Pipeline
33
1. 0. 1. 1. 0.
Doc
NER mention1 org1
org2
org3
…
org n
Extract
Features
1. 0. 0. 1. 0.
1. 1. 0. 0. 0.
1. 0. 1. 1. 0.
RF
1
0
mention2
mention3
0.647
…
0.873
0.780
0.342
…
Onderdeel van FD Mediagroep
Pipeline
34
1. 0. 1. 1. 0.
NER mention1 org1
org2
org3
org n
Extract
Features
1. 0. 0. 1. 0.
1. 1. 0. 0. 0.
1. 0. 1. 1. 0.
RF
1
0
mention2
mention3
0.647
0.873
0.780
0.342
…… …
Onderdeel van FD Mediagroep
Pipeline
35
1. 0. 1. 1. 0.
NER mention1 org2
org3
org1
org n
Extract
Features
1. 0. 0. 1. 0.
1. 1. 0. 0. 0.
1. 0. 1. 1. 0.
RF
1
0
mention2
mention3
0.873
0.780
0.647
0.342
…… …
Onderdeel van FD Mediagroep
org3 1. 0. 1. 1. 0. 0.780
Pipeline
36
1. 0. 1. 1. 0.
NER mention1
org1
…
org n
Extract
Features
1. 0. 0. 1. 0.
RF
1
0
mention2
mention3 0.647
0.342
…
org2 1. 1. 0. 0. 0. 0.873
…
Onderdeel van FD Mediagroep
Training Data
• Multiple years of (hand-labeled) articles.
• NER:
• Split article into sentences
• Filter sentences with [at least 2] entity mentions
• EL:
• Apply NER to article
• For each mention (m) in doc:
• Query ES (retrieve 40 candidates (c))
• For each <m, c, doc>-tuple:
• Extract features
• If c in groundtruth: label POS, else NEG
37
Onderdeel van FD Mediagroep
Evaluation
• Take data, make train/test-split
• NER: ~85%
• EL: ~85%
• But: Data is noisy/biased
• + Manual inspection
38
Onderdeel van FD Mediagroep
Bonus: Entity Salience
• Based on [Reinanda et al., CIKM ‘16]
• Simple baseline approach:
• Prominence: where in the document is entity first mentioned?
• Frequency: how often is entity mentioned?
• Salience: math.sqrt(Prominence*Frequency)
39
Mention Company Salience
SpotX SpotXchange Benelux B.V. 0.913
RTL Nederland RTL Nederland B.V. 0.369
Onderdeel van FD Mediagroep
Bonus: Entity Salience
• Based on [Reinanda et al., CIKM ‘16]
• Simple baseline approach:
• Prominence: where in the document is entity first mentioned?
• Frequency: how often is entity mentioned?
• Salience: math.sqrt(Prominence*Frequency)
40
Onderdeel van FD Mediagroep
Bonus: Sentiment analysis
• Simple Bag-of-Words binary classifier (Naive Bayes)
• Trained on hand-labeled data (~10k articles) (labeled POS/NEG)
• Given article (TF-IDF weighted vector), predict {POS, NEG}
41
Onderdeel van FD Mediagroep
Document Enrichment Pipeline
• On average; 0.24s/article;
1. NER: Feature extraction + Prediction
2. EL: Retrieve Candidates (one query per mention)
• Caching w/ Redis
3. EL: Feature Extraction+Classification (for each candidate)
4. Entity Salience Scoring
5. Sentiment analysis
• Number of articles per day: approx. +160%
• Number of linked orgs: approx. +310%
• Works 24h/day
• More “long tail” articles
42
Onderdeel van FD Mediagroep43
Applications
Onderdeel van FD Mediagroep
Burst detection/summarization
• Simple burst detection algo:
• Take rolling average of time series
• Take cutoff (e.g., mean+std)
• Any point over cutoff = burst
44
2016-08
• Groen licht voor oliewinning in Drenthe
• Robotkraan RoBorg aan boord van de Kroonborg
• Afvalwater NAM weer door Hardenberg naar Twente
• Minister Kamp: NAM mag weer afvalwater injecteren in Twentse bodem
• Nam hervat volgende maand waterinjectie
• “Vertrouwen in NAM en CVW naar absoluut dieptepunt.”
• Groen licht voor herstart oliewinning in Schoonebeek
• Groen licht voor oliewinning in Drenthe
• Oliewinning in Schoonebeek half september hervat
• TU Delft: 'Schadeonderzoek Arcadis deugt niet'
2017-03
- NAM aansprakelijk voor immateriële schade aardbevingen
- NAM aansprakelijk psychologische schade aardbevingen
- Aardbevingsellende: 'Het vreet aan ons'
- NAM aansprakelijk voor psychische schade bewoners aardbevingsgebied
- NAM aansprakelijk immateriële schade inwoners Groningenveld
- NAM ook aansprakelijk voor immateriële schade door aardbevingen
- Live: Rechtszaak immateriële schade door aardbevingen [afgelopen]
- NAM moet ook immateriële schade aardbevingen vergoeden
- 'Uitspraak is een mokerslag voor NAM en minister Kamp'
Nederlandse Aardolie Maatschappij B.V.
Onderdeel van FD Mediagroep
Burst detection/summarization
• Simple burst detection algo:
• Take rolling average of time series
• Take cutoff (e.g., mean+std)
• Any point over cutoff = burst
45
Nederlandse Aardolie Maatschappij B.V.
Onderdeel van FD Mediagroep
Sentiment+events
46
Onderdeel van FD Mediagroep
Sentiment+events
47
Onderdeel van FD Mediagroep
Sentiment+events
48
Onderdeel van FD Mediagroep
Sentiment: Rankings per sector/alerts?
Top 3 POS:
1. ASN Bank N.V. 0.574
2. Aegon Bank N.V. 0.540
3. de Volksbank N.V. 0.447
Top 3 NEG:
1. The Royal Bank of Scotland N.V. -0.130
2. Deutsche Bank -0.010
3. BinckBank N.V. 0.047
49
Onderdeel van FD Mediagroep
Affiliation Networks
50
Onderdeel van FD Mediagroep
As a feature
51
Onderdeel van FD Mediagroep
Fin
52
Onderdeel van FD Mediagroep
Fin
Questions?
@dvdgrs
www.graus.co
david.graus@fdmediagroep.nl
Refs:
D. Graus, M. Tsagkias, L. Buitinck, and M. de Rijke, “Generating pseudo-ground truth for predicting new concepts in social streams,” ECIR 2014
E. Meij, W. Weerkamp, and M. de Rijke, “Adding semantics to microblog posts,” WSDM 2012
R. Reinanda, E. Meij, and M. de Rijke, “Document Filtering for Long-tail Entities,” CIKM 2016
53
1 of 51

Recommended

Financial News Mining @ FD Mediagroep/Company.info by
Financial News Mining @ FD Mediagroep/Company.infoFinancial News Mining @ FD Mediagroep/Company.info
Financial News Mining @ FD Mediagroep/Company.infoDavid Graus
2.5K views47 slides
Ecg v-ict-or - werktafel november 2011 2 by
Ecg   v-ict-or - werktafel november 2011 2Ecg   v-ict-or - werktafel november 2011 2
Ecg v-ict-or - werktafel november 2011 2bl1133a
308 views41 slides
Rotterdam Open Data initiatief zoekt partners by
Rotterdam Open Data initiatief zoekt partnersRotterdam Open Data initiatief zoekt partners
Rotterdam Open Data initiatief zoekt partnersSuzanne Hansen
350 views25 slides

More Related Content

Similar to Financial News Mining @ PyData Amsterdam

Tno rapport-herkenning-van-digitale-informatie-definitief-31-maart-2010-anani... by
Tno rapport-herkenning-van-digitale-informatie-definitief-31-maart-2010-anani...Tno rapport-herkenning-van-digitale-informatie-definitief-31-maart-2010-anani...
Tno rapport-herkenning-van-digitale-informatie-definitief-31-maart-2010-anani...Twittercrisis
2.3K views115 slides
Interreg Informatiesessie Cofinanciering by
Interreg Informatiesessie CofinancieringInterreg Informatiesessie Cofinanciering
Interreg Informatiesessie CofinancieringBoris de Jong
1.4K views33 slides
Cinematek presentation open data bootcamp by
Cinematek presentation open data bootcampCinematek presentation open data bootcamp
Cinematek presentation open data bootcampmeemoo, Vlaams instituut voor het archief
117 views32 slides
20191018_Cinematek_presentation_open_data_bootcamp by
20191018_Cinematek_presentation_open_data_bootcamp20191018_Cinematek_presentation_open_data_bootcamp
20191018_Cinematek_presentation_open_data_bootcampPACKED vzw
350 views32 slides
ICT en Subsidies - De Breed en Partners - 24 maart 2015 by
ICT en Subsidies - De Breed en Partners - 24 maart 2015ICT en Subsidies - De Breed en Partners - 24 maart 2015
ICT en Subsidies - De Breed en Partners - 24 maart 2015ICT Valley
363 views16 slides
Kansen professioneel beheer in het kader van assetmanagement | Dag van de Ope... by
Kansen professioneel beheer in het kader van assetmanagement | Dag van de Ope...Kansen professioneel beheer in het kader van assetmanagement | Dag van de Ope...
Kansen professioneel beheer in het kader van assetmanagement | Dag van de Ope...CROW
967 views35 slides

Similar to Financial News Mining @ PyData Amsterdam(20)

Tno rapport-herkenning-van-digitale-informatie-definitief-31-maart-2010-anani... by Twittercrisis
Tno rapport-herkenning-van-digitale-informatie-definitief-31-maart-2010-anani...Tno rapport-herkenning-van-digitale-informatie-definitief-31-maart-2010-anani...
Tno rapport-herkenning-van-digitale-informatie-definitief-31-maart-2010-anani...
Twittercrisis2.3K views
Interreg Informatiesessie Cofinanciering by Boris de Jong
Interreg Informatiesessie CofinancieringInterreg Informatiesessie Cofinanciering
Interreg Informatiesessie Cofinanciering
Boris de Jong1.4K views
20191018_Cinematek_presentation_open_data_bootcamp by PACKED vzw
20191018_Cinematek_presentation_open_data_bootcamp20191018_Cinematek_presentation_open_data_bootcamp
20191018_Cinematek_presentation_open_data_bootcamp
PACKED vzw350 views
ICT en Subsidies - De Breed en Partners - 24 maart 2015 by ICT Valley
ICT en Subsidies - De Breed en Partners - 24 maart 2015ICT en Subsidies - De Breed en Partners - 24 maart 2015
ICT en Subsidies - De Breed en Partners - 24 maart 2015
ICT Valley363 views
Kansen professioneel beheer in het kader van assetmanagement | Dag van de Ope... by CROW
Kansen professioneel beheer in het kader van assetmanagement | Dag van de Ope...Kansen professioneel beheer in het kader van assetmanagement | Dag van de Ope...
Kansen professioneel beheer in het kader van assetmanagement | Dag van de Ope...
CROW967 views
Opensource zou onbetaalbaar moeten zijn, de kracht van de TYPO3 Community by ★Ric van Westhreenen
Opensource zou onbetaalbaar moeten zijn, de kracht van de TYPO3 CommunityOpensource zou onbetaalbaar moeten zijn, de kracht van de TYPO3 Community
Opensource zou onbetaalbaar moeten zijn, de kracht van de TYPO3 Community
Geen internet zonder Open Source by overheidict11
Geen internet zonder Open SourceGeen internet zonder Open Source
Geen internet zonder Open Source
overheidict11244 views
Internationale clusters in vergelijkend perpsectief by Anika Snel
Internationale  clusters in vergelijkend perpsectiefInternationale  clusters in vergelijkend perpsectief
Internationale clusters in vergelijkend perpsectief
Anika Snel962 views
Informatiesessie cofinanciering v2 by Boris de Jong
Informatiesessie cofinanciering v2Informatiesessie cofinanciering v2
Informatiesessie cofinanciering v2
Boris de Jong1.6K views
C-content by ingron
C-contentC-content
C-content
ingron334 views
Informatiesessie ehv co financiering by Boris de Jong
Informatiesessie ehv co financieringInformatiesessie ehv co financiering
Informatiesessie ehv co financiering
Boris de Jong1.2K views
DOCument 2011 Editie 3 by gleduc
DOCument 2011 Editie 3DOCument 2011 Editie 3
DOCument 2011 Editie 3
gleduc291 views
Infosessie proeftuin zorginnovatie : 3/ modaliteiten by liesl
Infosessie proeftuin zorginnovatie : 3/ modaliteitenInfosessie proeftuin zorginnovatie : 3/ modaliteiten
Infosessie proeftuin zorginnovatie : 3/ modaliteiten
liesl747 views
170613 grip op complexiteit ict fysieke domein omgevingscongres v1.0 by Hans van Gurchom
170613 grip op complexiteit ict fysieke domein omgevingscongres v1.0170613 grip op complexiteit ict fysieke domein omgevingscongres v1.0
170613 grip op complexiteit ict fysieke domein omgevingscongres v1.0
Hans van Gurchom723 views

More from David Graus

Pragmatic ethical and fair AI for data scientists by
Pragmatic ethical and fair AI for data scientistsPragmatic ethical and fair AI for data scientists
Pragmatic ethical and fair AI for data scientistsDavid Graus
177 views36 slides
Bias in Recommendations by
Bias in RecommendationsBias in Recommendations
Bias in RecommendationsDavid Graus
2.8K views191 slides
RecSys in the Media Industry: Relevance, Recency, Popularity, and Diversity. by
RecSys in the Media Industry: Relevance, Recency, Popularity, and Diversity.RecSys in the Media Industry: Relevance, Recency, Popularity, and Diversity.
RecSys in the Media Industry: Relevance, Recency, Popularity, and Diversity.David Graus
2.4K views104 slides
CAT/AI: Computer Assisted Translation 
Assessment for Impact by
CAT/AI: Computer Assisted Translation 
Assessment for ImpactCAT/AI: Computer Assisted Translation 
Assessment for Impact
CAT/AI: Computer Assisted Translation 
Assessment for ImpactDavid Graus
208 views60 slides
Opening the Black Box of User Profiles in Content-based Recommender Systems by
Opening the Black Box of User Profiles in Content-based Recommender SystemsOpening the Black Box of User Profiles in Content-based Recommender Systems
Opening the Black Box of User Profiles in Content-based Recommender SystemsDavid Graus
108 views43 slides
Zoeken, vinden, en aanbevelen: personalisatie vs. privacy by
Zoeken, vinden, en aanbevelen: personalisatie vs. privacyZoeken, vinden, en aanbevelen: personalisatie vs. privacy
Zoeken, vinden, en aanbevelen: personalisatie vs. privacyDavid Graus
2.9K views76 slides

More from David Graus(20)

Pragmatic ethical and fair AI for data scientists by David Graus
Pragmatic ethical and fair AI for data scientistsPragmatic ethical and fair AI for data scientists
Pragmatic ethical and fair AI for data scientists
David Graus177 views
Bias in Recommendations by David Graus
Bias in RecommendationsBias in Recommendations
Bias in Recommendations
David Graus2.8K views
RecSys in the Media Industry: Relevance, Recency, Popularity, and Diversity. by David Graus
RecSys in the Media Industry: Relevance, Recency, Popularity, and Diversity.RecSys in the Media Industry: Relevance, Recency, Popularity, and Diversity.
RecSys in the Media Industry: Relevance, Recency, Popularity, and Diversity.
David Graus2.4K views
CAT/AI: Computer Assisted Translation 
Assessment for Impact by David Graus
CAT/AI: Computer Assisted Translation 
Assessment for ImpactCAT/AI: Computer Assisted Translation 
Assessment for Impact
CAT/AI: Computer Assisted Translation 
Assessment for Impact
David Graus208 views
Opening the Black Box of User Profiles in Content-based Recommender Systems by David Graus
Opening the Black Box of User Profiles in Content-based Recommender SystemsOpening the Black Box of User Profiles in Content-based Recommender Systems
Opening the Black Box of User Profiles in Content-based Recommender Systems
David Graus108 views
Zoeken, vinden, en aanbevelen: personalisatie vs. privacy by David Graus
Zoeken, vinden, en aanbevelen: personalisatie vs. privacyZoeken, vinden, en aanbevelen: personalisatie vs. privacy
Zoeken, vinden, en aanbevelen: personalisatie vs. privacy
David Graus2.9K views
Layman's Talk: Entities of Interest --- Discovery in Digital Traces by David Graus
Layman's Talk: Entities of Interest --- Discovery in Digital TracesLayman's Talk: Entities of Interest --- Discovery in Digital Traces
Layman's Talk: Entities of Interest --- Discovery in Digital Traces
David Graus265 views
De Macht van Data --- Hoe algoritmen ons leven vormgeven by David Graus
De Macht van Data --- Hoe algoritmen ons leven vormgevenDe Macht van Data --- Hoe algoritmen ons leven vormgeven
De Macht van Data --- Hoe algoritmen ons leven vormgeven
David Graus293 views
Big Data & Machine Learning - Mogelijkheden & Valkuilen by David Graus
Big Data & Machine Learning - Mogelijkheden & ValkuilenBig Data & Machine Learning - Mogelijkheden & Valkuilen
Big Data & Machine Learning - Mogelijkheden & Valkuilen
David Graus4.5K views
Analyzing and Predicting Task Reminders by David Graus
Analyzing and Predicting Task RemindersAnalyzing and Predicting Task Reminders
Analyzing and Predicting Task Reminders
David Graus415 views
Dynamic Collective Entity Representations for Entity Ranking by David Graus
Dynamic Collective Entity Representations for Entity RankingDynamic Collective Entity Representations for Entity Ranking
Dynamic Collective Entity Representations for Entity Ranking
David Graus497 views
Dynamic Collective Entity Representations for Entity Ranking by David Graus
Dynamic Collective Entity Representations for Entity RankingDynamic Collective Entity Representations for Entity Ranking
Dynamic Collective Entity Representations for Entity Ranking
David Graus566 views
Understanding Email Traffic by David Graus
Understanding Email TrafficUnderstanding Email Traffic
Understanding Email Traffic
David Graus530 views
David Graus - Entity Linking (at SEA), Search Engines Amsterdam, Fri June 27th by David Graus
David Graus - Entity Linking (at SEA), Search Engines Amsterdam, Fri June 27thDavid Graus - Entity Linking (at SEA), Search Engines Amsterdam, Fri June 27th
David Graus - Entity Linking (at SEA), Search Engines Amsterdam, Fri June 27th
David Graus554 views
Understanding Email Traffic (talk @ E-Discovery NL Symposium) by David Graus
Understanding Email Traffic (talk @ E-Discovery NL Symposium)Understanding Email Traffic (talk @ E-Discovery NL Symposium)
Understanding Email Traffic (talk @ E-Discovery NL Symposium)
David Graus4.7K views
Generating Pseudo-ground Truth for Detecting New Concepts in Social Streams by David Graus
Generating Pseudo-ground Truth for Detecting New Concepts in Social StreamsGenerating Pseudo-ground Truth for Detecting New Concepts in Social Streams
Generating Pseudo-ground Truth for Detecting New Concepts in Social Streams
David Graus2.6K views
yourHistory - entity linking for a personalized timeline of historic events by David Graus
yourHistory - entity linking for a personalized timeline of historic eventsyourHistory - entity linking for a personalized timeline of historic events
yourHistory - entity linking for a personalized timeline of historic events
David Graus3.7K views
Semantic Search in E-Discovery by David Graus
Semantic Search in E-DiscoverySemantic Search in E-Discovery
Semantic Search in E-Discovery
David Graus939 views
Semantic Annotation of the Cyttron Database by David Graus
Semantic Annotation of the Cyttron DatabaseSemantic Annotation of the Cyttron Database
Semantic Annotation of the Cyttron Database
David Graus805 views
Semantic annotation, clustering and visualization by David Graus
Semantic annotation, clustering and visualizationSemantic annotation, clustering and visualization
Semantic annotation, clustering and visualization
David Graus546 views

Financial News Mining @ PyData Amsterdam

  • 1. Onderdeel van FD MediagroepOnderdeel van FD Mediagroep Financial News Mining PyData Hilversum edition: RTL hosts PyData, 8 Feb 2018 Onderdeel van FD Mediagroep David Graus @dvdgrs
  • 2. Onderdeel van FD Mediagroep Outline • Financial News @ FDMG/Company.info • Entity Linking • Building an Entity Linker • Method/Algorithms • Implementation • [Applications] 3
  • 3. Onderdeel van FD Mediagroep FD Mediagroep 4
  • 4. Onderdeel van FD Mediagroep5
  • 5. Onderdeel van FD Mediagroep6
  • 6. Onderdeel van FD Mediagroep7
  • 7. Onderdeel van FD Mediagroep8
  • 8. Onderdeel van FD Mediagroep9 Financial News
  • 9. Onderdeel van FD Mediagroep10
  • 10. Onderdeel van FD Mediagroep11
  • 11. Onderdeel van FD Mediagroep12
  • 12. Onderdeel van FD Mediagroep13
  • 13. Onderdeel van FD Mediagroep15
  • 14. Onderdeel van FD Mediagroep Link • News articles: • >900 sources (Dutch, online) • From Het Financieele Dagblad to the Groninger Gezinsbode • Around ~4k articles per day • Multiple years of archive • Knowledge Base: • ~2.8M companies & organization profiles • Rich metadata: sector information, financial information, people, buildings, etc… 16
  • 15. Onderdeel van FD Mediagroep How? • Anno 2012: human labor • Since March 2017: machine 17
  • 16. Onderdeel van FD Mediagroep18 Entity Linking
  • 17. Onderdeel van FD Mediagroep19
  • 18. Onderdeel van FD Mediagroep Step 1: Named-entity Recognition 20
  • 19. Onderdeel van FD Mediagroep Step 2: Entity Linking 21 34225913 0000 32105893 0000
  • 20. Onderdeel van FD Mediagroep Step 2: EL 22 342259130000 32105893 0000
  • 21. Onderdeel van FD Mediagroep Challenges • A single entity mention can refer to multiple entities 23
  • 22. Onderdeel van FD Mediagroep Challenges • A single entity can be referred to by multiple entity mentions 24
  • 23. Onderdeel van FD Mediagroep25 Approach
  • 24. Onderdeel van FD Mediagroep NER: Approach • Sequence classification • E.g.: “Daarnaast sloot het bedrijf twee nieuwe overeenkomsten met Xenos en Big Bazar voor in totaal 2000 vierkante meter voor een periode van 10 jaar.” • Predict: • Beginning of entity mention • Inside entity mention • Outside entity mention 26 Daarnaast O sloot O het O bedrijf O twee O nieuwe O overeenkomsten O met O Xenos B-ORG en O Big B-ORG Bazar I-ORG voor O in O totaal O 2000 O vierkante O meter O voor O een O periode O van O 10 O jaar O . O
  • 25. Onderdeel van FD Mediagroep NER: Features • for token t in sentence s: • Token-identity: token=Xenos • Word-shape: TokenIsCaps={1,0}, TokenIsNumber={1,0}, … • Context: prevToken=met, nextToken=en, … • Dictionary: TokenInCompanyDict={1,0}, InPersonNameDict={1,0}, … • Corpus: token’s TF-IDF weight, token’s word-cluster membership, … • And more… • Structured Perceptron • Predict {B, I, O} 27 Daarnaast O sloot O het O bedrijf O twee O nieuwe O overeenkomsten O met O Xenos B-ORG en O Big B-ORG Bazar I-ORG voor O in O totaal O 2000 O vierkante O meter O voor O een O periode O van O 10 O jaar O . O
  • 26. Onderdeel van FD Mediagroep NER: Implementation • NER: Sequence Classification • Custom implementation using seqlearn1: “Sequence learning toolkit for Python” • Based on [Graus et al., ECIR ‘14] • Flask App 28 1 https://github.com/larsmans/seqlearn
  • 27. Onderdeel van FD Mediagroep EL: Approach • Common: Linking to Wikipedia 29
  • 28. Onderdeel van FD Mediagroep EL: Approach • Custom KB; Custom implementation • Binary classification (based on [Meij et al., WSDM ‘12]) • Issue entity mention as query to KB [Elasticsearch] • Retrieve list of candidate organizations • For each candidate: • predict 1 (link), 0 (no-link) 30
  • 29. Onderdeel van FD Mediagroep EL: Features For each <document, mention, entity candidate>: 1. Entity features: • Turnover, • Size, • … 2. Mention features: • MentionLength, • … 3. Mention-Entity features: • RetrievalScorePerField, • TokenOverlapPerField • … 4. Doc features: • WoonplaatsInDocument, • … 31
  • 30. Onderdeel van FD Mediagroep EL: Implementation • sklearn RandomForestClassifier • Served in a Flask app 32
  • 31. Onderdeel van FD Mediagroep Pipeline 33 1. 0. 1. 1. 0. Doc NER mention1 org1 org2 org3 … org n Extract Features 1. 0. 0. 1. 0. 1. 1. 0. 0. 0. 1. 0. 1. 1. 0. RF 1 0 mention2 mention3 0.647 … 0.873 0.780 0.342 …
  • 32. Onderdeel van FD Mediagroep Pipeline 34 1. 0. 1. 1. 0. NER mention1 org1 org2 org3 org n Extract Features 1. 0. 0. 1. 0. 1. 1. 0. 0. 0. 1. 0. 1. 1. 0. RF 1 0 mention2 mention3 0.647 0.873 0.780 0.342 …… …
  • 33. Onderdeel van FD Mediagroep Pipeline 35 1. 0. 1. 1. 0. NER mention1 org2 org3 org1 org n Extract Features 1. 0. 0. 1. 0. 1. 1. 0. 0. 0. 1. 0. 1. 1. 0. RF 1 0 mention2 mention3 0.873 0.780 0.647 0.342 …… …
  • 34. Onderdeel van FD Mediagroep org3 1. 0. 1. 1. 0. 0.780 Pipeline 36 1. 0. 1. 1. 0. NER mention1 org1 … org n Extract Features 1. 0. 0. 1. 0. RF 1 0 mention2 mention3 0.647 0.342 … org2 1. 1. 0. 0. 0. 0.873 …
  • 35. Onderdeel van FD Mediagroep Training Data • Multiple years of (hand-labeled) articles. • NER: • Split article into sentences • Filter sentences with [at least 2] entity mentions • EL: • Apply NER to article • For each mention (m) in doc: • Query ES (retrieve 40 candidates (c)) • For each <m, c, doc>-tuple: • Extract features • If c in groundtruth: label POS, else NEG 37
  • 36. Onderdeel van FD Mediagroep Evaluation • Take data, make train/test-split • NER: ~85% • EL: ~85% • But: Data is noisy/biased • + Manual inspection 38
  • 37. Onderdeel van FD Mediagroep Bonus: Entity Salience • Based on [Reinanda et al., CIKM ‘16] • Simple baseline approach: • Prominence: where in the document is entity first mentioned? • Frequency: how often is entity mentioned? • Salience: math.sqrt(Prominence*Frequency) 39 Mention Company Salience SpotX SpotXchange Benelux B.V. 0.913 RTL Nederland RTL Nederland B.V. 0.369
  • 38. Onderdeel van FD Mediagroep Bonus: Entity Salience • Based on [Reinanda et al., CIKM ‘16] • Simple baseline approach: • Prominence: where in the document is entity first mentioned? • Frequency: how often is entity mentioned? • Salience: math.sqrt(Prominence*Frequency) 40
  • 39. Onderdeel van FD Mediagroep Bonus: Sentiment analysis • Simple Bag-of-Words binary classifier (Naive Bayes) • Trained on hand-labeled data (~10k articles) (labeled POS/NEG) • Given article (TF-IDF weighted vector), predict {POS, NEG} 41
  • 40. Onderdeel van FD Mediagroep Document Enrichment Pipeline • On average; 0.24s/article; 1. NER: Feature extraction + Prediction 2. EL: Retrieve Candidates (one query per mention) • Caching w/ Redis 3. EL: Feature Extraction+Classification (for each candidate) 4. Entity Salience Scoring 5. Sentiment analysis • Number of articles per day: approx. +160% • Number of linked orgs: approx. +310% • Works 24h/day • More “long tail” articles 42
  • 41. Onderdeel van FD Mediagroep43 Applications
  • 42. Onderdeel van FD Mediagroep Burst detection/summarization • Simple burst detection algo: • Take rolling average of time series • Take cutoff (e.g., mean+std) • Any point over cutoff = burst 44 2016-08 • Groen licht voor oliewinning in Drenthe • Robotkraan RoBorg aan boord van de Kroonborg • Afvalwater NAM weer door Hardenberg naar Twente • Minister Kamp: NAM mag weer afvalwater injecteren in Twentse bodem • Nam hervat volgende maand waterinjectie • “Vertrouwen in NAM en CVW naar absoluut dieptepunt.” • Groen licht voor herstart oliewinning in Schoonebeek • Groen licht voor oliewinning in Drenthe • Oliewinning in Schoonebeek half september hervat • TU Delft: 'Schadeonderzoek Arcadis deugt niet' 2017-03 - NAM aansprakelijk voor immateriële schade aardbevingen - NAM aansprakelijk psychologische schade aardbevingen - Aardbevingsellende: 'Het vreet aan ons' - NAM aansprakelijk voor psychische schade bewoners aardbevingsgebied - NAM aansprakelijk immateriële schade inwoners Groningenveld - NAM ook aansprakelijk voor immateriële schade door aardbevingen - Live: Rechtszaak immateriële schade door aardbevingen [afgelopen] - NAM moet ook immateriële schade aardbevingen vergoeden - 'Uitspraak is een mokerslag voor NAM en minister Kamp' Nederlandse Aardolie Maatschappij B.V.
  • 43. Onderdeel van FD Mediagroep Burst detection/summarization • Simple burst detection algo: • Take rolling average of time series • Take cutoff (e.g., mean+std) • Any point over cutoff = burst 45 Nederlandse Aardolie Maatschappij B.V.
  • 44. Onderdeel van FD Mediagroep Sentiment+events 46
  • 45. Onderdeel van FD Mediagroep Sentiment+events 47
  • 46. Onderdeel van FD Mediagroep Sentiment+events 48
  • 47. Onderdeel van FD Mediagroep Sentiment: Rankings per sector/alerts? Top 3 POS: 1. ASN Bank N.V. 0.574 2. Aegon Bank N.V. 0.540 3. de Volksbank N.V. 0.447 Top 3 NEG: 1. The Royal Bank of Scotland N.V. -0.130 2. Deutsche Bank -0.010 3. BinckBank N.V. 0.047 49
  • 48. Onderdeel van FD Mediagroep Affiliation Networks 50
  • 49. Onderdeel van FD Mediagroep As a feature 51
  • 50. Onderdeel van FD Mediagroep Fin 52
  • 51. Onderdeel van FD Mediagroep Fin Questions? @dvdgrs www.graus.co david.graus@fdmediagroep.nl Refs: D. Graus, M. Tsagkias, L. Buitinck, and M. de Rijke, “Generating pseudo-ground truth for predicting new concepts in social streams,” ECIR 2014 E. Meij, W. Weerkamp, and M. de Rijke, “Adding semantics to microblog posts,” WSDM 2012 R. Reinanda, E. Meij, and M. de Rijke, “Document Filtering for Long-tail Entities,” CIKM 2016 53