Training Deep Neural Network Models for Unsupervised Information Extraction
Qwant
23 mai 2019

Benjamin Piwowarski
with Vincent Guigue & Étienne Simon (PhD)
CNRS / LIP6, Sorbonne Université
(tapez ? pour obtenir de l'aide pour la navigation)
CNRSLIP6UPMC
$\def \given{;} \def \expectation{\mathop{\mathbb{E}}} \def \kldivergence#1#2{{\text{KL}}\left(#1 \middle\| #2 \right)} \def \params#1{\color{blue}{#1}} \def \paramsw{\params{\textbf{w}}} \def \paramstheta{\color{blue}{\mathbf{\theta}}}$

MLIA Team (LIP6)

Members

  • 9 permanent members (3 Professors, 5 Associate prof., 1 CNRS)
  • 29 PhD students (9 industrials)

Main research topics

Machine learning
Representation learning and Deep Learning
Transversal activity, models and algorithms, several application domains
Structured outputs
e.g. Xtreme classification, graphs, image segmentation
Sequential and Deep Reinforcement learning
Learn optimal sequences of actions for generic ML problems
Application domains
Natural Language Processing and Information Retrieval
Computer Vision (Visual QA, reasoning, Multimodality, Object detection)
Complex data analysis
Social data, mobility data, interaction traces, recommendation, transport, etc

Myself

CNRS Researcher

  • until 2004 (PhD)... and since 2011 in LIP6
  • 7 years of post-doc (user models at Yahoo, and quantum-based IR in Glasgow Univ)

Current research areas

  • Recommendation (Gaussian Representations)
  • Grounding Language
  • Information Extraction
  • Automated Summarization
  • Question Answering

Transversal activities

  • Text representation
  • Deep Learning
  • Reinforcement Learning
  • Representation Learning for Complex Objects

Information Extraction

Information Extraction

Cover many different tasks:

  • Named Entity Recognition
  • Co-Reference Resolution
  • Relation Extraction
  • Event Extraction

Applications

Why should we care about building knowledge bases???
  • Information Retrieval: Infoboxes, document enrichment
  • Question answering
  • Summarization and translation
  • Logical Reasoning

Event extraction: Template-based Slot Filling

Driven by Message Understanding Conferences (1987-97)

Bombing template
Perpetrator
Person who detonates, plants, blows up
Instrument
Object that is planted, detonated, defused
Target
Object that is destroyed, is blown up
Rich information
Necessitate a lot of manual annotation
Note: Some works explored unsupervised template IE, e.g
Chambers, N. and Jurafsky, D.
2011. Template-Based Information Extraction without the Templates.

Relation Extraction

A simpler task : extract (binary) relationships

The relationship « currency of »
The problem is to predict a relationship $r\in\mathcal{R}$ from text
Previously,
infix
The sol
entity 1
was the currency of
infix
Peru
Entity 2
between 1863 and 1985.
suffix
Triplet (the sol, currency_of, Peru)

Input data

Sentences annotated with:
  • Two entities
  • The relation $r\in\mathcal{R}$

Pre-neural models: Logical Models

Generate patterns based on a set of occurrences

An occurrence of an (author,title)
Tuple (author, title, order, url, prefix, middle, suffix)
Some parts are matched regular expression; e.g. author:
[A-Z][A-Za-z .,&]5;30 [A-Za-z.]
Some are learned: prefix, middle, suffix
Brin, S.
1999. Extracting Patterns and Relations from the World Wide Web.

Inductive logic

Rapier uses inductive logic programming techniques to discover rules for extracting fields from documents

Califf, M.E. and Mooney, R.J.
2003. Bottom-Up Relational Learning of Pattern Matching Rules for Information Extraction.

Pre-neural models: Machine Learning (Generative models)

  • Hidden Markov Models (2000-2006): used e.g. to extract information named entities
  • Previously,
    U
    the
    E_B
    sol
    E_E
    was
    CURR_B
    the
    CURR_I
    currency
    CURR_I
    of
    CURR_E
    Peru
    E_BE
Models $p(w_t | s_t)$ and $p(s_{t+1}|s_t)$ with values of $s_t$ in {U, E_B, E_E, CURR_B, CURR_I, CURR_E, ...}
Freitag, D. and McCallum, A.
1999. Information Extraction with HMMs and Shrinkage.
Freitag, D. and McCallum, A.
2000. Information Extraction with HMM Structures Learned by Stochastic Optimization.
Able to process raw text
Model insight
Hard to train / Generalization

Pre-neural models: Machine Learning (Generative/Classification models)

  • Maximum Entropy Classifiers / Conditional Random Fields (2000-2005)
    • For NER / tagging: $$ P_{\lambda}(\mathbf{y} | \mathbf{x})=\frac{1}{Z_{\mathbf{x}}} \exp \left(\sum_{t=1}^{T} \sum_{k} \lambda_{k} f_{k}\left(y_{t-1}, y_{t}, \mathbf{x}, t\right)\right) $$
      Peng, F. and McCallum, A.
      2004. Accurate Information Extraction from Research Papers Using Conditional Random Fields.
    • For relation detection $$ P_{\lambda}(r | \mathbf{x})=\frac{1}{Z_{\mathbf{x}}} \exp \left( \sum_{k} \lambda_{k} f_{k}\left(\mathbf{x}, t\right)\right) $$
  • Support Vector Machines (2003-2005)
  • Multi-Class Logistic Classifier (Softmax)
    Mintz, M. et al.
    2009. Distant Supervision for Relation Extraction without Labeled Data.
More expressiveness than generative models
Need to design features!

Pre-neural models: Features for Machine Learning Models

Example of features used for information extraction (each line = a feature for a pair)

Mintz, M. et al.
2009. Distant Supervision for Relation Extraction without Labeled Data.

Neural Network Models

Zeng, D. et al.
2015. Distant Supervision for Relation Extraction via Piecewise Convolutional Neural Networks.
Model architecture
State of the art
Basis for other works; e.g. in multi-instance learning in
Lin, Y. et al.
2016. Neural Relation Extraction with Selective Attention over Instances.
In summary
Powerful model
Necessitate lots of data
Precision@k (human assessments) for PCNN vs Mintz, and MultiR/MIML (multi-instance) on the NYT corpus

Unsupervised Information Extraction

Towards no supervision: Distant supervision

Distant relationship
Detect entities from the KB in sentences
Each time $(e_1, e_2)$ appears = corresponding relationship from KB
Mintz, M. et al.
2009. Distant Supervision for Relation Extraction without Labeled Data.

Towards no supervision: Bootstrapping

Start with a small set of annotated examples

Repeat the following procedure until ...:

  1. Classify candidates
  2. Add the most likely candidates to the training set
Riloff, E.
1996. Automatically Generating Extraction Patterns from Untagged Text.

Learning relations without supervision

Why?
Reasons
  • Text mining: discover relationships
  • Alternative to Bootstrapping: pre-training
No supervision
The distant supervision hypothesis cannot be used
New hypothesis
Two entities always share the same relationship

Clustering models

Clustering context
Hasegawa, T. et al.
2004. Discovering Relations among Named Entities from Large Corpora.
Using a dependency tree
Banko, M. et al.
2007. Open Information Extraction from the Web.

Generative models

Yao, L. et al.
2011. Structured Relation Discovery Using Generative Models.
LDA-based model
Generated features for
Gamma Knife, made by the Swedish medical technology firm Elekta, focuses low- dosage gamma radiation ...
Generative process
  • A set of relationships generate the sentence below
  • Seen as features
  • Objective : maximize the likelihood $p(obs) = \sum_r p(obs | r) p(r)$

Generative model limits

Generative/clustering models have several limitations
Less expressiveness (common to all generative approaches)
Might focus on features not related to the relationship
Use discriminitative models
More expressiveness
How to learn?

Proposed approach

Previous Work: Discrete State Variational Auto-Encoder

Marcheggiani, D. and Titov, I.
2016. Discrete-State Variational Autoencoders for Joint Discovery and Factorization of Relations.

Discrete State Variational Auto-Encoder

Idea: Filling the blank task
Hubel received the ___?___ for his discovery
Proxy: rely only on the prediction of the relationship

Overall loss

$$\sum_{r \in \mathcal{R}} q(r | s; \paramsw) \log p\left(e_{i} | e_{-i}, r; \paramstheta\right)+H(q(\cdot | x ; \paramsw))$$
where
  • $q$ is a classifier that depends on the sentence $s$ (parameters $\paramsw$)
  • $p(e_i | e_{-i}, r; \paramstheta)$ is a relation prediction
  • $H$ is the entropy of the distribution over relations

Discrete State Variational Auto-Encoder :
(1) relation classifier

The relation classifier is expressed as a softmax:

$$q(r | x, \paramsw)=\frac{\exp \left(\paramsw^{T} \mathbf{g}(r, x)\right) )}{\sum_{r^{\prime} \in \mathcal{R}} \exp \left(\paramsw^{T} \mathbf{g}\left(r^{\prime}, x\right)\right)}$$
where $\mathbf{g}$ is a vector of features for relation $r$ and sentence $x$ (same as
Yao, L. et al.
2011. Structured Relation Discovery Using Generative Models.
)

Discrete State Variational Auto-Encoder :
(2) link regularisation

$$p\left(e_{i} | e_{-i}, r \given \theta\right) \propto \left( \exp ( -E ( e_i, r, e_{-i} ) \right)$$ with $E=\psi^{RS}+\psi^{SP}$ is an energy function associated with the triplet $(e_i, r, e_{-i})$ based on two existing energy functions:

Bilinear energy function

$$\psi^{R S}\left(e_{1}, e_{2}, r, \theta\right)=\mathbf{u}_{e_{1}}^{T} \color{blue}{C_{r}} \mathbf{u}_{e_{2}}$$
Nickel, M. et al.
2011. A Three-Way Model for Collective Learning on Multi-Relational Data.

Selectional preferences

$$\psi^{S P}\left(e_{1}, e_{2}, r, \theta\right)= \mathbf{u}_{e_{1}}^{T} \color{blue}{\mathbf{c}_{1 r}}+ \mathbf{u}_{e_{2}}^{T} \color{blue}{\mathbf{c}_{2 r}} $$
Riedel, S. et al.
2013. Relation Extraction with Matrix Factorization and Universal Schemas.

Discrete State Variational Auto-Encoder :
(2) Final Loss and Entropy

For a given sentence, the loss is expressed as:

$$ -\sum_{i=1}^{2} \mathbb{E}_{q(\cdot | x; \paramsw )} \left[ \log p\left(e_{i} | e_{-i}, r \given \paramstheta\right) + \sum_{e_{i}^{n e g} \in S} \log \sigma\left(-\psi\left(e_{i}^{n e g}, e_{-i}, r; \paramstheta\right)\right) \right] - \alpha \color{red}{H(q(\cdot | x; \mathbf{w}))} $$
The entry term pushes towards a deterministic model
Necessary for convergence
Very unstable

Problems observed with the VAE

The loss collapses into two regimes
  1. The classifier is very uncertain (uniform distribution) (low $\alpha$)
  2. The classifier only predicts one relation (high $\alpha$)

Reason

The link predictor can do a good job minimizing the loss by ignoring the output of the classifier, simply exploiting entities co-occurrences
$$ - \sum_{i=1}^{2} \mathbb{E}_{q(\cdot | x; \paramsw )} \left[ \log p\left(e_{i} | e_{-i}, \color{orange}{r} \given \paramstheta\right) + \sum_{e_{i}^{n e g} \in S} \log \sigma\left(-\psi\left(e_{i}^{n e g}, e_{-i}, \color{orange}{r}; \paramstheta\right)\right) \right] - \alpha \color{red}{H(q(\cdot | x; \mathbf{w}))} $$

RelDist: Skewness and uniformity

Skewness

We want the classifier to be as deterministic as possible
$$ \mathcal{L}_\text{S} = \expectation\nolimits_{(e_1, e_2, s)\sim \chi} \left[ H( \mathbf{R} \given e_1, e_2, s) \right] $$

Uniformity

We want the classifier distribution over sentences to be uniform
$$\begin{split} \mathcal{L}_\text{U} & = \kldivergence{p(R)}{U} \\ & \color{red}{\approx} \sum_r \left( \sum\limits_{i=1}^B \frac{f_\text{PCNN}(r; s_i)}{B} \right) \log \left( \sum\limits_{i=1}^B \frac{f_\text{PCNN}(r; s_i)}{B} \right) \\ \end{split} $$
with $U$ the uniform distribution, $B$ the sample size

Datasets

We used 3 datasets for evaluation

New Yort Times + FreeBase (distant)
Mintz, M. et al.
2009. Distant Supervision for Relation Extraction without Labeled Data.
  • 2M sentences
  • 41K relations
  • 258 unique relations
T-REx
  • 12M sentences/relations
  • 1189 relations
T-REx (SPO)
Requires the predicate to appear explicitely
= Filtered T-REx
  • 763K sentences (6%)
  • 615 relations
Elsahar, H. et al.
2018. T-REx: A Large Scale Alignment of Natural Language with Knowledge Base Triples.

Metrics

B3
$$ \begin{array}{l}{\mathrm{B}^{3} \text { Precision }=\underset{X, Y}{\mathbb{E}} P(g(X)=g(Y) | c(X)=c(Y))} \\ {\mathrm{B}^{3} \text { Recall } \quad=\underset{X, Y}{\mathbb{E}} P(c(X)=c(Y) | g(X)=g(Y))}\end{array}$$
We report the harmonic mean (F1)
V-measure
$$\begin{array}{l}{\text { Homogeneity }=1-H(c(X) | g(X)) / H(c(X))} \\ {\text { Completeness }=1-H(g(X) | c(X)) / H(g(X))}\end{array}$$
We report the harmonic mean (F1)
More sensitive to a degradation of purity of clusters
Adjusted Rand Index (ARI)
$$\mathrm{RI}=\underset{X, Y}{\mathbb{E}}[P(c(X)=c(Y) \Leftrightarrow g(X)=g(Y))]$$
ARI = normalized RI (random = 0, perfect = 1)
Less sensitive to unbalance between precision/recall

Metrics - analysis

PCA projection (2D) of the obtained results

Results

DatasetModelB3V-measureARI
ClassifierReg.F1Prec.Rec.F1Hom.Comp.
NYT+FBrel-LDA29.124.835.230.026.135.113.3
rel-LDA136.930.447.037.431.945.124.2
March.$-\mathcal{L}_\text{S}$35.223.867.127.018.649.618.7
PCNN$-\mathcal{L}_\text{S}$27.624.331.924.721.229.615.7
March.$\mathcal{L}_\text{S} + \mathcal{L}_\text{U}$37.531.147.438.732.647.827.6
PCNN$\mathcal{L}_\text{S} + \mathcal{L}_\text{U}$39.432.250.738.332.247.233.8
T-REx SPOrel-LDA11.910.214.15.94.97.43.9
rel-LDA118.514.326.119.416.124.58.6
March.$-\mathcal{L}_\text{S}$24.820.631.323.619.130.612.6
PCNN$-\mathcal{L}_\text{S}$25.319.237.023.118.131.910.8
March.$\mathcal{L}_\text{S} + \mathcal{L}_\text{U}$29.522.742.034.828.445.120.3
PCNN$\mathcal{L}_\text{S} + \mathcal{L}_\text{U}$36.328.450.341.433.753.621.3
T-REx DSrel-LDA9.76.817.08.36.611.42.2
rel-LDA112.78.326.617.013.323.53.4
March.$-\mathcal{L}_\text{S}$9.06.415.55.74.57.91.9
PCNN$-\mathcal{L}_\text{S}$12.28.621.112.910.118.02.9
March.$\mathcal{L}_\text{S} + \mathcal{L}_\text{U}$19.513.336.730.624.142.111.5
PCNN$\mathcal{L}_\text{S} + \mathcal{L}_\text{U}$19.714.033.426.620.836.89.4
Dataset difficulty:
T-REx SPO > NYT+FB > T-REx DS
Regularization works:
$\mathcal{L}_\text{S} + \mathcal{L}_\text{U} > -\mathcal{L}_\text{S}$
Discriminative > generative
No clear advantage for P-CNN

Matrice de confusion

For our loss
Cluster split in two (due to $\mathcal{L}_\mathcal{U}$)
Understandable = Shared cluster (e.g. "located in"/"in country", "cast member"/"director of")

Main results

(compared to other works)
  • Two new regularization losses for unsupervised information extraction
    We improved substantially over previous work
    We were able to train a neural network model
  • A step forward to train powerful discriminative models
  • Much more stable than previous works
(similarly to other works)
  • We rely on a correct energy function for (entity 1, relation, entity 2) triplets
  • Still no relation between relations, i.e. relation ontology (i.e. "contained" vs "containing")
  • Pre-specified number of relationships
  • Wrong hypothesis: One relationship between two entities

Future and Ongoing work

[ongoing] No more KB space! (or less...)

Main idea = exploit other ways to formalize the main hypothesis (two entities = same relation each time)

[ongoing] Representation space

Main idea = Work directly in a representation space and perform a posteriori clustering

Interest:
  • Naturally handles relation ontology
  • No pre-specified number of relationships
[future] Multiple relationships

When two entities have multiple relationships, we need to capture this information

Software: Experimaestro and Datamaestro

Available on github
 # Defines the workspace
workspace = experiment("/tmp/xp1", "grec.local.ger")
workspace.server(12345)

# Download/prepare datasets
ds = Dataset.find("org.acm.recsys.cb2014").prepare()
ds = tag("dataset", "cbrecsys2014", ds)

for dim in [50, 100]:
    # Run a model
    model = GrecModel(dim=tag("dim", dim), dataset=ds)
    model.submit()

    Evaluation(model=model, dataset=ds).submit()

Thanks!

Questions?

This work

Simon, E., Guigue, V., & Piwowarski, B. (2019). Unsupervised Information Extraction: Regularizing Discriminative Approaches with Relation Distribution Losses. In Proceedings of ACL 2019. Firenze, Italia.

Overviews

Claire, N., Nazarenko, A., & Bossy, R. (2009). Information Extraction.
Piskorski, J., & Yangarber, R. (2013). Information Extraction: Past, Present and Future. In T. Poibeau, H. Saggion, J. Piskorski, & R. Yangarber (Eds.), Multi-Source, Multilingual Information Extraction and Summarization (pp. 23–49). Berlin, Heidelberg: Springer Berlin Heidelberg. https://doi.org/10.1007/978-3-642-28569-1_2