Slides of the talk I gave at PyData Amsterdam.
Abstract:
"The FD Mediagroep collects, analyses and filters valuable and relevant information, 24/7, for an influential group of professionals, business executives and high net worth individuals. Company.info (part of FDMG) provides complete, reliable, up-to-date company information and business news about no less than 2.7 million companies and other legal entities in the Netherlands. For Company.info we continuously monitor and crawl hundreds of (online) news sources, resulting in a large archive of (Dutch) business-related news, spanning hundreds of thousands of articles. These articles are automatically enriched, by linking the profiles of companies that are mentioned in the articles, using a custom in-house entity linking framework built in Python. In this talk, I will briefly explain the entity linking task, I will detail the implementation of our custom entity linking framework, and our pipeline for crawling and enriching news articles."
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
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
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
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.
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
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