paper_id
stringlengths 9
16
| version
stringclasses 26
values | yymm
stringclasses 311
values | created
timestamp[s] | title
stringlengths 6
335
| secondary_subfield
sequencelengths 1
8
| abstract
stringlengths 25
3.93k
| primary_subfield
stringclasses 124
values | field
stringclasses 20
values | fulltext
stringlengths 0
2.84M
|
---|---|---|---|---|---|---|---|---|---|
1812.08044 | 1 | 1812 | 2018-12-19T15:59:31 | FrameNet automatic analysis : a study on a French corpus of encyclopedic texts | [
"cs.CL"
] | This article presents an automatic frame analysis system evaluated on a corpus of French encyclopedic history texts annotated according to the FrameNet formalism. The chosen approach relies on an integrated sequence labeling model which jointly optimizes frame identification and semantic role segmentation and identification. The purpose of this study is to analyze the task complexity from several dimensions. Hence we provide detailed evaluations from a feature selection point of view and from the data point of view. | cs.CL | cs | Analyse automatique FrameNet : une étude sur un corpus
français de textes encyclopédiques
.
(1) Orange Labs, Lannion, France
(2) Aix-Marseille Université, Marseille, France
[email protected]
{gabriel.marzinotto,geraldine.damnati}@orange.com
Gabriel Marzinotto1, 2 Géraldine Damnati1 Frédéric Béchet2
]
L
C
.
s
c
[
RÉSUMÉ
1
Cet article présente un système d'analyse automatique en cadres sémantiques évalué sur un corpus
v
de textes encyclopédiques d'histoire annotés selon le formalisme FrameNet. L'approche choisie re-
4
pose sur un modèle intégré d'étiquetage de séquence qui optimise conjointement l'identification des
4
0
cadres, la segmentation et l'identification des rôles sémantiques associés. Nous cherchons dans cette
8
étude à analyser la complexité de la tâche selon plusieurs dimensions. Une analyse détaillée des
0
performances du système est ainsi proposée, à la fois selon l'angle des paramètres du modèle et de
2
la nature des données.
1
ABSTRACT
8
1
FrameNet automatic analysis : a study on a French corpus of encyclopedic texts
:
v
This article presents an automatic frame analysis system evaluated on a corpus of French encyclope-
i
dic history texts annotated according to the FrameNet formalism. The chosen approach relies on an
X
integrated sequence labeling model which jointly optimizes frame identification and semantic role
r
a
segmentation and identification. The purpose of this study is to analyze the task complexity from
several dimensions. Hence we provide detailed evaluations from a feature selection point of view
and from the data point of view.
MOTS-CLÉS : Analyse en cadres sémantiques, étiquetage de séquence, textes encyclopédiques.
KEYWORDS: Semantic frame analysis, sequence labeling, encyclopedic texts.
1 Introduction
L'extraction d'informations structurées dans des textes est un préalable qui favorise l'accès aux
connaissances qu'ils contiennent par des outils de Traitement Automatique du Langage. Dans cette
étude, nous nous intéressons au cas particulier de textes encyclopédiques historiques et nous nous
plaçons dans le contexte de la représentation sémantique FrameNet. Dans l'approche FrameNet ini-
tiée par l'Institut ICSI de Berkeley (Baker et al., 1998), un cadre sémantique (Frame) peut être évo-
qué par des unités lexicales (les triggers ou cibles). Par exemple, le cadre "Commitment" peut être
évoqué par "promettre", "promesse", "s'engager" et le cadre "Becoming_aware" peut être déclenché
par "découvrir" et "découverte". Les unités lexicales (UL) qui déclenchent un cadre peuvent être
nominales ou verbales. Par ailleurs, un cadre englobe la définition des participants et des propriétés
qui peuvent lui être attachés : ce sont les Frame Elements (FE). Ils sont spécifiques à chaque cadre
et sont nommés par des labels explicites. Par exemple, dans la phrase suivante, l'agent de l'action de
découvrir, est représenté par le FE "Cognizer" qui a deux instances :
[le premier Européen]Cognizer à avoir [découvert]Becoming_aware
[Mammoth Cave]Phenomenon était [John Houchin]Cognizer, [en 1797]Time.
Les cadres peuvent être liés entre eux par des relations (Fillmore et al., 2004) (ex : inheritence,
using, . . . ) auquel cas les FE peuvent être mis en correspondance. Dans cette étude, nous réalisons
une analyse "à plat" sans mettre les cadres en relation. Si les ressources linguistiques décrivant ces
cadres sont de plus en plus nombreuses pour la langue anglaise, leur constitution pour le français
n'en est qu'au début avec les contributions du projet ASFALDA qui s'est attaché à produire des
ressources sur la base de FrameNet pour le français (Djemaa et al., 2016). Pour notre part, nous
avons constitué le corpus CALOR Béchet et al. (2017) annoté en cadres sémantiques sur des textes
encyclopédiques issus de différentes sources, dans le domaine de l'histoire, décrit plus en détail à la
section 3.1.
L'analyse en cadres sémantiques a pour objectif de repérer dans des documents des instances de
cadres avec l'ensemble des rôles permettant de les caractériser, et se fait classiquement en deux
étapes. La première est une étape de désambiguïsation afin d'identifier un cadre étant donnée la pré-
sence d'un déclencheur potentiel (UL) La seconde consiste à identifier les rôles sémantiques (FE)
et est le plus souvent traitée de façon séquentielle comme l'enchaînement d'une étape de détection
de segment et de classification de ce segment (Johansson et al., 2012; Lechelle & Langlais, 2014).
Le système Semafor (Das et al., 2014) constitue à l'heure actuelle une référence dans le domaine.
Dans Semafor, l'étape d'identification de cadre, étant donné un déclencheur, est réalisée à l'aide
d'un classifieur probabiliste par Maximum d'Entropie. Ensuite, l'étape de labélisation des rôles sé-
mantiques est réalisée à l'aide d'un modèle log-linéaire conditionnel qui catégorise des segments
(labélisation des FE). Dans cette étape, les segments candidats sont obtenus à partir de l'analyse en
dépendance et correspondent aux sous-arbres produits. De cette façon, le modèle arrive à gérer à la
fois la classification et la segmentation.
Dans cette étude, nous adoptons une approche plus intégrée où les étapes de désambiguïsation, de dé-
tection des FE et de labélisation des FE se font de façon simultanée à l'aide de modèles d'étiquetage
de séquences de type Conditional Random Fields (CRF). Notre modélisation du problème n'impose
pas la contrainte que les FE soient toujours la projection d'une tête dans l'arbre de dépendances, ce
qui rend le système robuste aux erreurs d'analyse en dépendance. Nous avons décidé de travailler
avec les CRF car ce sont des modèles simples qui ne nécessitent pas de grandes puissances de cal-
cul, ni de gros volumes de données en comparaison avec les méthodes neuronales, mais qui sont
suffisamment performants pour nous permettre la mise en place de nos expériences contrastives.
La section 2 présente en détail cette approche avec un focus sur le choix des paramètres des modèles.
La section 3 présente un ensemble d'expériences visant à montrer l'influence du choix des para-
mètres, l'impact de la complexité intrinsèque des textes, et l'influence des données d'apprentissage.
2 Analyse en cadres comme une tâche d'étiquetage de séquence
Les CRF ont été utilisés dans de nombreuses tâches du TALN ainsi que les modèles neuronaux de
type RNN ou LSTM (Hakkani-Tür et al., 2016; Tafforeau et al., 2016). Nous avons choisi dans cet
article d'utiliser des modèles CRF en se focalisant sur des comparaisons entre différents systèmes
de traits et différents corpus pour entraîner et tester nos systèmes. Nous nous intéressons également
à évaluer les effets du choix du corpus d'apprentissage en considérant des textes de différents styles
(encyclopédique, encyclopédique adressé aux enfants, etc.) et qui traitent de sujets différents (ar-
chéologie, histoire, etc.). Vu que l'apprentissage se fait sur des corpus de taille moyenne et que notre
objectif est de faire une étude comparative de la tâche, et non pas d'arriver aux meilleures perfor-
mances possibles du système final, nous avons décidé de travailler avec les modèles CRF, car ils sont
plus simples, plus rapides en apprentissage et présentent moins de paramètres à régler.
Apprendre un seul CRF avec tous les exemples de phrases annotées résulterait en un très grand
nombre d'étiquettes, ce qui peut être rédhibitoire lorsqu'on augmente le nombre de cadres. Une autre
possibilité est de modéliser chaque cadre (sens) avec un CRF, mais cela nous obligerait à mettre en
place un modèle de désambiguïsation en amont, de manière à savoir quel est le CRF qui doit être
appliqué à chaque unité lexicale. Pour éviter ces problèmes nous avons décidé de modéliser chaque
UL avec un CRF, cela permet de faire en même temps la désambiguïsation de cadres, la détection
et la sélection des rôles sémantiques. Ce choix n'est pas nécessairement optimal dans le sens où il
disperse les données d'apprentissage et ne permet pas le partage d'information entre des UL qui se
ressemblent. Néanmoins il permet de passer à l'échelle lorsqu'on augmente le nombre de cadres.
Ainsi, pour analyser en cadres une nouvelle phrase, nous allons d'abord extraire les UL de la phrase
qui apparaissent dans notre liste de 145 UL possibles. Pour chaque phrase il y aura autant d'appli-
cations de CRF qu'il y a d'UL, puis une étape de post-traitement permet de vérifier la cohérence
des résultats d'étiquetages. Ici nous vérifions que les étiquettes mises sur les rôles sémantiques sont
compatibles et rattachables aux types de cadres sémantiques prédits par les CRF. Il est possible en
effet que le CRF prédise un rôle sémantique qui ne fasse pas partie des rôles possibles du cadre mais
qui ferait partie des rôles d'un autre cadre qui pourrait être déclenché par la même UL. Dans notre
modèle tous les rôles qui ne sont pas rattachables à leur cible sont systématiquement rejetés.
Pour extraire des caractéristiques pertinentes à la tâche nous avons évalué plusieurs types de para-
mètres et de codages inspirés de la littérature (Das et al., 2014; Michalon et al., 2016). Une sélection
incrémentale a été faite pour ne retenir que les 5 paramètres les plus pertinents pour chaque token :
-- son lemme, le lemme du mot parent, sa partie du discours (POS), la distance linéaire à la
cible et les deux derniers niveaux du chemin de dépendances entre le mot et la cible.
La distance linéaire à la cible est le nombre de tokens entre le token courant et l'UL qui déclenche le
cadre (cible). Ce nombre est négatif si le token est avant la cible, ou positif s'il est après. Le chemin
de dépendance vers la cible se construit comme la concaténation des dépendances entre le token
courant et la cible. L'analyse syntaxique est réalisée à l'aide de l'analyseur MACAON (Nasr et al.,
2010) qui construit des arbres syntaxiques avec un jeu de dépendances très similaire à celui du French
TreeBank (Abeillé et al., 2003; Abeillé & Barrier, 2004). Dans le cas général la cible qui déclenche
un cadre n'est pas nécessairement la racine de l'arbre de dépendance de la phrase, cela implique
que le chemin de dépendances entre un token et une cible est composé des dépendances non pas
seulement de fils à parent (relations ascendante), mais aussi de parent à fils (relations descendantes).
Nous faisons cette distinction de manière explicite en codant les chemins ascendants et descendants
avec des symboles différents. Par ailleurs, nous avons observé que les chemins syntaxiques très longs
étaient difficiles à modéliser. Pour contourner ce problème nous avons étudié la simplification de ces
chemins en limitant leur longueur maximale, c'est-à-dire, lorsque le chemin de dépendances d'un
token vers la cible du cadre sémantique dépasse une certaine longueur, nous allons le représenter avec
un chemin plus court qui garde la plus grand quantité d'information possible. Dans nos expériences,
nous avons obtenu que la simplification qui produisait les meilleures performances consiste à garder
les deux dépendances du chemin les plus proches de la cible, qui sont souvent les plus pertinents.
3 Evaluation
3.1 Protocole expérimental
Nous avons réalisé toutes nos expériences sur le corpus CALOR. Il est constitué de documents issus
de 4 sources différentes : le portail Wikipédia sur l'Archéologie (WA, 201 documents), le portail
Wikipédia sur la Première Guerre Mondiale (WGM, 355 documents), des textes issus de Vikidia
(VKH, 183 documents), l'encyclopédie en ligne pour enfants, à partir de deux portails (Préhistoire
et Antiquité) et des textes historiques de ClioTexte (https ://clio-texte.clionautes.org/) sur la Première
Guerre Mondiale (CTGM, 16 documents). Annoter un corpus en cadres sémantiques n'est pas une
tâche facile à aborder car le nombre de cadres et d'unités lexicales (UL) porteuses de sens que l'on
pourrait définir est énorme. Dans le cas de FrameNet (Baker et al., 1998), le dictionnaire des cadres
sémantiques pour l'anglais, propose 1222 cadres possibles et 13615 UL à ce jour. Pour cette raison,
un corpus annoté en cadres n'est souvent étiqueté que sur une sélection des cadres et UL les plus
pertinents. Les UL en dehors de cette sélection restent sans annotation et une UL sélectionnée appa-
raissant dans un texte avec un sens qui n'est pas prévu dans notre dictionnaire de cadres sémantiques
simplifié, nous lui attribuons un cadre spécial « OTHER ». Sur le corpus CALOR, 21.398 occur-
rences de cadres sémantiques ont été annotées, déclenchées par une des 145 UL présentes dans notre
liste de UL traitables. Au total, 53 cadres sémantiques différents ont été annotés, auxquels s'ajoute
le cadre OTHER.
Lorsqu'une phrase est étiquetée en cadres sémantiques, il y a 4 sous-tâches qui se développent, par-
fois de façon implicite. Nous les avons incluses dans notre protocole car elles permettent d'évaluer
très précisément les systèmes d'analyse en cadres sémantiques. Ce sont les tâches de : détection de
cibles (DC) qui revient à décider si une UL doit être associée à OTHER ou non ; sélection du bon
cadre (SC) pour chaque cible détectée ; détection des segments qui constituent des rôles sémantiques
(DR) ; sélection des types de rôles sémantiques (SR). Même si l'ensemble de ces tâches est réalisé
par un seul modèle intégré nous présentons les différents niveaux d'évaluation, avec un accent plus
particulier sur le SR, sous-tâche qui est, de façon générale, la plus difficile de l'analyse en cadres
sémantiques.
Le corpus a été divisé en cinq parties de sorte qu'aucun document ne soit jamais sous divisé et de
sorte que la distribution des cadres soit la plus homogène possible entre chaque partie. Pour chaque
expérience nous mesurons la précision, le rappel et la F-mesure moyennés entre les 5-Folds ainsi
que l'écart type des mesures de performances sur les 5 folds.
3.2 Évaluation globale et influence des paramètres
Dans le tableau 1 nous montrons les performances du meilleur système développé à partir des 5 ca-
ractéristiques les plus pertinentes pour la tâche. Sur ce corpus les tâches DC et SC ont une complexité
assez basse car nous traitons un nombre de cadres limité. Sur ces deux tâches, notre système CRF
augmente la précision de 5 points par rapport à un système naïf qui choisirait la classe majoritaire.
Comme ces sont des tâches simples dans notre corpus, nous arrivons à des performances élevées et
assez proches car la proportion d'UL pouvant conduire à plusieurs cadres différents est assez faible
(seulement 12 UL). La détermination de la catégorie OTHER demeure la principale difficulté à ce
niveau. Par ailleurs, la tâche de SR qui est la plus complexe, présente un taux de précision acceptable
(82.2%) étant donné le nombre de rôles possibles (150 au total), mais les performances en termes de
rappel sont à peine de 51.2%. La performance élevée du système en termes de précision est due au
fait d'avoir un modèle CRF pour chaque UL, car ceci diminue le nombre d'étiquettes (et le nombre
de confusions) possibles au moment des prédictions.
Détection de Cible (DC)
Sélection de Cadre (SC)
Détection des Roles (DR)
Sélection des Roles (SR)
Précision
96.4 ± 0.2
Rappel
96.4 ± 0.2
Fmesure
96.4 ± 0.1
95.3 ± 0.4
95.2 ± 0.2
95.3 ± 0.2
89.7 ± 0.5
55.9 ± 0.7
68.8 ± 0.5
82.2 ± 0.6
51.2 ± 0.7
63.1 ± 0.6
TABLE 1 -- évaluation par niveaux avec la meilleure configuration (CRF à 5 paramètres)
S'il est difficile de comparer avec les résultats obtenus par le système SEMAFOR (données en an-
glais en plus grande quantité, nombre de cadres modélisés supérieur,...), notons cependant que notre
évaluation (SR) correspondrait à la tâche Argument Identification, avec la configuration full parsing
car nous ne fixons pas de valeurs Oracle dans les étapes intermédiaires, et l'évaluation partial mat-
ching car nous ne comptons pas les erreurs de frontière sur les rôles sémantiques. Dans ces conditions
le meilleur système évalué dans (Das et al., 2014) conduit à une F-mesure de 50.24.
Pour chaque cadre, ses rôles sémantiques peuvent être interprétés comme des réponses à certaines
questions que l'on peut poser sur le cadre. Par exemple, pour le cadre Deciding nous avons :
Cognizer (qui est l'agent ?) prend une Decision (quoi ?) parmi Possibilities (parmi quoi ?)
parce que Explanation (pour quelle raison ?) à un Time (quand ?) et dans un Place (où ?).
Ceci permet de regrouper les rôles sémantiques de différents cadres et de leur donner une interpré-
tation simple qui aide à analyser quelles sont les questions génériques pour lesquelles notre système
est capable de trouver le plus grand nombre de réponses correctes. En évaluant nos résultats de cette
manière nous observons que les questions à quoi, de quand ont des performances excellentes, ceci
est dû au fait que ces questions sont fortement reliées à une préposition. Les questions les plus fré-
quentes sont qui est l'agent, quoi
liées aux sujets et COD dans la syntaxe, avec des F-mesures
avoisinant les 70% ensuite nous avons les quand, où, qui
liées aux CCT, CCL et COD. Pour tous
ceux-ci, nous avons des performances à peu près équivalentes, de l'ordre de 55%. Les sujets et COD
sont plus faciles à détecter, car leurs chemins de dépendances sont souvent plus simples et le nombre
d'exemples d'apprentissage est plus grand. Les questions pour lesquelles nous obtenons les perfor-
mances les plus basses sont dans quelle circonstance, avec quelle conséquence, de quelle manière
ce sont des questions qui ont une énorme variabilité au niveau syntaxique, sont moins fréquentes et
ne sont pas ancrées à une préposition spécifique.
Dans le tableau 2, nous cherchons à mesurer l'impact de chaque caractéristique sur les performances.
L'analyse est faite sur la tâche de SR. Le chemin de dépendances simplifié et la partie du discours
(POS) sont les caractéristiques les plus importantes pour améliorer les performances de notre sys-
tème. Par ailleurs, nous voyons que la précision est plus affectée par les lemmes, alors que le rappel
est affecté par les POS, le chemin de dépendances et la distance linéaire à la cible. Le lemme du mot
parent dans l'analyse en dépendances permet aussi d'augmenter la précision de notre système. En
effet lorsque deux compléments ont des chemins de dépendances similaires (par exemple « dans le
journal » et « pendant la guerre »), ils sont faciles à classer grâce à leur tête syntaxique.La pertinence
de ce paramètre est liée au fait que l'analyse en dépendances a été faite en suivant une conven-
tion similaire à celle du French Treebank (Abeillé et al., 2003; Abeillé & Barrier, 2004) et donc en
considérant les prépositions comme tête des sous-arbres. Pour la dernière ligne du tableau, seuls les
paramètres Lemme, POS et distance linéaire sont utilisés, et nous pouvons constater une perte de 4.5
points de F-mesure par rapport au système qui se sert de l'analyse en dépendances.
Paramètres
Tous les paramètres
Tous sauf Chemin Dépendance
Tous sauf Partie du Discours (POS)
Tous sauf Distance Linéaire
Tous sauf Lemme
Tous sauf Lemme Parent
Tous sauf Analyse en Dépendance
Précision
82.2 ± 0.6
Rappel
51.2 ± 0.7
82.5 ± 0.8
47.2 ± 0.7
83.0 ± 1.0
47.1 ± 1.0
82.2 ± 0.7
48.6 ± 0.7
F-mesure
63.1 ± 0.6
60.0 ± 0.6
60.1 ± 1.0
61.1 ± 0.7
80.2 ± 0.6
50.9 ± 0.7
62.2 ± 0.6
81.0 ± 0.9
51.0 ± 0.8
80.8 ± 1.2
45.9 ± 0.7
62.6 ± 0.8
58.6 ± 0.7
TABLE 2 -- Effets de l'élimination de chaque paramètre sur les performances
3.3 Influence de la complexité des textes
Chaque phrase a une complexité inhérente, qui est due à divers facteurs. D'une façon très simpliste,
une phrase plus longue est souvent plus complexe et difficile à traiter. Si nous n'observons pas
d'influence sur la sélection des cadres (SC), la longueur des phrases s'avère très importante pour la
tâche de SR. Nous avons observé en effet une perte de précision de plus de 7 points et une perte en
rappel de plus de 22 points entre les phrases du premier décile (8 mots par phrase en moyenne) et
les phrases du dernier décile (50 mots par phrase en moyenne), avec une décroissance monotone du
rappel sur les 10 déciles. Ceci est dû au fait que les phrases très longues ont souvent plus de rôles
sémantiques et des rôles sémantiques plus rares. De façon analogue, chaque UL a une complexité
inhérente, qui dépend du fait que ce soit un verbe ou un substantif, et de la position qu'elle occupe
dans l'arbre de dépendances de la phrase. Une cible est dite « racine » lorsqu'elle constitue la racine
de l'arbre de dépendance de sa phrase, et « non racine » dans le cas contraire. En analysant le
Type de Cible
Verbe Racine
Verbe non Racine
Nom Racine
Nom non Racine
Total
Nb Cibles Nb FE
13592
5389
19496
Précision
85.4 ± 0.3
83.0 ± 0.9
Rappel
68.2 ± 1.4
51.3 ± 1.2
Fmesure
75.9 ± 0.9
63.4 ± 0.8
8532
279
7198
252
72.2 ± 7.6
50.2 ± 6.9
59.0 ± 6.5
13538
75.4 ± 2.1
34.2 ± 0.8
47.0 ± 0.9
21398
46878
82.2 ± 0.6
51.2 ± 0.7
63.1 ± 0.6
TABLE 3 -- Résultats de la sélection de rôles par type de cible
détail des performances par Unité Lexicale, on observe de grandes disparités dans les résultats, avec
8 UL qui produisent une F-mesure supérieure à 75%, et 8 qui conduisent à une F-mesure inférieure
à 25%. La quantité de données d'apprentissage n'est pas le seul facteur explicatif. Parmi les UL qui
ont plus de 1000 occurrences dans le corpus, 2 UL nominales ont des performances très moyennes
autour de 40% ( combat et attaque) alors que les deux UL (provenir et contenir) qui produisent les
meilleurs résultats (F-mesure supérieure à 80%) n'ont que 200 échantillons dans le corpus. Dans
le tableau 3 nous montrons que la position de la cible dans l'arbre de dépendance a un impact
important sur le rappel, avec une différence de plus de 15 points entre le cas des cibles « racine » et
« non racine ». Les cibles « non racine » présentent des chemins plus compliqués et moins fiables
vers leurs rôles sémantiques. Lorsqu'on compare les UL nominales avec les UL verbales, il y a une
différence d'environ 10 points sur la précision et d'environ 17 points pour le rappel. Même si les
cibles nominales ont moins de rôles sémantiques associés (2.3 rôles sémantiques par cadre verbal
contre 1.8 par cadre nominal en moyenne) elles demeurent plus complexes à traiter, car les chemins
de dépendance vers leurs rôles sémantiques sont très variables. Il faut aussi prendre en compte le fait
que les UL nominales sont plus rares et ont moins de données d'apprentissage associées.
3.4 Influence des données d'apprentissage
Vue la complexité de l'annotation manuelle des cadres sémantiques, la génération de nouvelles res-
sources n'est pas toujours possible. Pour extraire ces cadres sur des documents d'un nouveau do-
maine ou issus d'une nouvelle source, nous nous intéressons à évaluer les performances des mo-
dèles appris sur des données d'autres sources annotées. Comme dans cette expérience nous nous
intéressons à évaluer l'impact de la similarité thématique sur les performances du système, nous
avons réduit notre jeux de données aux 54 UL qui étaient présentes dans nos 4 corpus. Pour cette
80% CTGM
80% WA
40% WGM
80% WGM
80% WGM + 80% WA + 80%VKH
80% WGM + 80% CTGM
80% ALL
Taille App.
304
3264
2918
5836
9413
6140
9717
Précision
83.1 ± 9.7
Rappel
15.1 ± 2.0
Fmesure
25.5 ± 3.2
78.6 ± 8.1
26.1 ± 4.6
39.1 ± 5.9
77.1 ± 8.4
32.2 ± 5.4
45.2 ± 5.8
80.3 ± 7.1
37.8 ± 4.6
51.3 ± 4.8
78.6 ± 7.7
39.0 ± 5.2
52.0 ± 5.7
79.8 ± 5.4
39.9 ± 3.5
53.1 ± 3.6
79.3 ± 5.9
41.2 ± 2.3
54.1 ± 2.7
TABLE 4 -- Effets de la constitution du corpus d'apprentissage
expérience nous considérons que nos documents issus de CTGM sont une nouvelle source. Cliotexte
regroupe des textes historiques (discours, déclarations, ...) qui ne correspondent pas exactement à un
style encyclopédique. Nous proposons diverses répartitions du corpus d'apprentissage et nous me-
surons les performances des systèmes pour chaque configuration. Dans le tableau 4 nous montrons
que pour une même taille de corpus d'apprentissage et un style fixe (données issues de Wikipedia,
80%WA vs. 40%WGM) les performances obtenues avec un corpus du même domaine thématique
(40%WGM) sont supérieures par 6 points de F-mesure. Nous arrivons à des performances moyennes
rien qu'avec un apprentissage fait avec un corpus du même domaine (80%WGM), sans avoir utilisé
aucune données annotées de CTGM. De plus, à partir du moment où WGM est inclus dans le corpus
d'apprentissage, l'ajout de 3500 exemples hors domaine n'a pas eu d'impact important alors que le
simple ajout de 304 exemples de cadres issus du CTGM, augmente les performances de 2 points
de F-mesure. Ceci met en évidence le fait qu'il est toujours utile d'annoter quelques exemples des
phrases de la même source, pour franchir les différences de vocabulaire et de style.
4 Conclusion
Dans cet article nous avons présenté la tâche d'analyse en cadres sémantiques comme un problème
d'étiquetage de séquences que nous avons abordé à l'aide de modèles CRF. Nous avons effectué
diverses expériences faites sur le corpus CALOR constitué de données encyclopédiques annotées en
cadres sémantiques, montrant des performances encourageantes à partir de données d'apprentissage
de taille moyenne. Les résultats obtenus révèlent une grande variabilité des performances en fonc-
tion des types d'unité lexicale (verbales ou nominales), des types de rôles sémantiques (relations
directes ou circonstancielles) mais également en fonction de la complexité intrinsèque des phrases
considérées (longueur, structure de dépendance). Dans nos futurs travaux, nous allons explorer des
modélisations par étiquetage de séquences à l'aide de modèles neuronaux RNN, LSTM ; et nous
allons nous intéresser également au partage d'information entre les rôles des différents cadres sé-
mantiques et UL, pour pouvoir mieux traiter les cas des cibles et cadres sémantiques peu fréquents.
Références
ABEILLÉ A. & BARRIER N. (2004). Enriching a french treebank. In LREC.
ABEILLÉ A., CLÉMENT L. & TOUSSENEL F. (2003). Building a treebank for french. Treebanks,
p. 165 -- 187.
BAKER C. F., FILLMORE C. J. & LOWE J. B. (1998). The berkeley framenet project. In Pro-
ceedings of the 36th Annual Meeting of the Association for Computational Linguistics and 17th
International Conference on Computational Linguistics - Volume 1, ACL '98, p. 86 -- 90, Stroud-
sburg, PA, USA : Association for Computational Linguistics.
BÉCHET F., DAMNATI G., HEINECKE J., MARZINOTTO G. & NASR A. (2017). Calor-frame : un
corpus de textes encyclopédiques annoté en cadres sémantiques. Atelier ACor4French - Les corpus
annotés du français, TALN.
DAS D., CHEN D., MARTINS A. F., SCHNEIDER N. & SMITH N. A. (2014). Frame-semantic
parsing. Computational linguistics, 40(1), 9 -- 56.
DJEMAA M., CANDITO M., MULLER P. & VIEU L. (2016). Corpus annotation within the french
framenet : methodology and results. Proceedings of the Tenth International Conference on Lan-
guage Resources and Evaluation (LREC), X, 3794 -- 3801.
FILLMORE C. J., BAKER C. F. & SATO H. (2004). Framenet as a "net". In LREC.
HAKKANI-TÜR D., TUR G., CELIKYILMAZ A., CHEN Y.-N., GAO J., DENG L. & WANG Y.-Y.
(2016). Multi-domain joint semantic frame parsing using bi-directional rnn-lstm. In Proceedings
of The 17th Annual Meeting of the International Speech Communication Association.
JOHANSSON R., HEPPIN K. F. & KOKKINAKIS D. (2012). Semantic role labeling with the swe-
dish framenet. In LREC, p. 3697 -- 3700.
LECHELLE W. & LANGLAIS P. (2014). Utilisation de représentations de mots pour l'étiquetage
de rôles sémantiques suivant framenet. In TALN.
MICHALON O., RIBEYRE C., CANDITO M. & NASR A. (2016). Deeper syntax for better semantic
parsing.
In Coling 2016 - 26th International Conference on Computational Linguistics, Osaka,
Japan.
NASR A., BÉCHET F. & REY J.-F. (2010). Macaon : Une chaîne linguistique pour le traitement de
graphes de mots. In Traitement Automatique des Langues Naturelles - session de démonstrations,
Montréal.
TAFFOREAU J., BECHET F., ARTIERE T. & FAVRE B. (2016). Joint syntactic and semantic ana-
lysis with a multitask deep learning framework for spoken language understanding. Interspeech
2016, p. 3260 -- 3264.
This figure "figure_1_perf_questions.png" is available in "png"(cid:10) format from:
http://arxiv.org/ps/1812.08044v1
This figure "figure_percentils.png" is available in "png"(cid:10) format from:
http://arxiv.org/ps/1812.08044v1
|
1810.06898 | 1 | 1810 | 2018-10-16T09:37:24 | Creating a New Persian Poet Based on Machine Learning | [
"cs.CL"
] | In this article we describe an application of Machine Learning (ML) and Linguistic Modeling to generate persian poems. In fact we teach machine by reading and learning persian poems to generate fake poems in the same style of the original poems. As two well known poets we used Hafez (1310-1390) and Saadi (1210-1292) poems. First we feed the machine with Hafez poems to generate fake poems with the same style and then we feed the machine with the both Hafez and Saadi poems to generate a new style poems which is combination of these two poets styles with emotional (Hafez) and rational (Saadi) elements. This idea of combination of different styles with ML opens new gates for extending the treasure of past literature of different cultures. Results show with enough memory, processing power and time it is possible to generate reasonable good poems. | cs.CL | cs | Creating a New Persian Poet Based on Machine Learning
Mehdi Hosseini Moghadam Bardia Panahbehagh
Department of Mathematics, Faculty of Mathematics and Computer Science,
Kharazmi University, Tehran, Iran 1
Oct 16, 2018
In this article we describe an application of Machine Learning (ML) and Linguistic
Modeling to generate persian poems. In fact we teach machine by reading and learning persian
poems to generate fake poems in the same style of the original poems. As two well known poets
we used Hafez (1310-1390) and Saadi (1210-1292) poems. First we feed the machine with Hafez
poems to generate fake poems with the same style and then we feed the machine with the both
Hafez and Saadi poems to generate a new style poems which is combination of these two poets
styles with emotional (Hafez) and rational (Saadi) elements. This idea of combination of different
styles with ML opens new gates for extending the treasure of past literature of different cultures.
Results show with enough memory, processing power and time it is possible to generate
reasonable good poems.
Keywords and phrases: Machine learning; Deep learning; Text generation; Persian
poem; Hafez; Saadi
1 Introduction
Have a moment and think how we use our brain and intelligence to make words and
sentences that have meaning and can express our ideas and insights. For example as pointed by
McKeown (1992): " in the process of producing discourse, speakers and writers must decide what
it is that they want to say and how to present it effectively. They are capable of disregarding
information in their large body of knowledge about the world which is not specific to the task at
hand and they manage to integrate pertinent information into a coherent unit. They determine
how to appropriately start the discourse, how to order its elements, and how to close it. These
decisions are all part of the process of deciding what to say and when to say it. Speakers and
writers must also determine what words to use and how to group them into sentences. In order
for a system to generate text, it, too, must be able to make these kinds of decisions." Now
imagine how hard that would be to teach such ability to a computer. Recently there have been
many attempts to generate texts that are both syntactically and semantically correct by
computers (Misztal-Radecka and Indurkhya, 2016; Wang et al., 2017; Vinyals and Le, 2015;
Leopold, 2014). With the help of artificial intelligence, computers are now able to do such difficult
tasks. Also with the help of deep learning (recurrent neural network), computers can generate
words and sentences that make sense (Xie et al., 2017; Sutskever et al., 2011; Graves, 2014). But
first lets have a historical example of text generation. George Philipp Harsdörffer was a German
poet in the 1600s who belonged to a literary society. He created the Fünffacher Denckring der
Teutschen Sprache in 1651 (Figure 1). This contraption (which translates as "The Five-fold
Thought-ring of the German Language") was a set of five concentric circles with letters and word
1 [email protected] ; [email protected]
fragments written on them: prefixes on one ring, starting letters on another, then middle letters,
ending letters and finally suffixes. The idea was that you stacked the circles together and twisted
them around independently to generate different words to act as poetic inspiration. You could
leave the end-word rings in place while twisting around the start-word rings, so it acts as a kind
of rhyming dictionary. You could make an existing word and then change a syllable or two to see
what happened. Or you could just twist all the circles round to make new words and look at them
and think about what they would mean if they were real.2
Figure 1: Fünffacher Denckring der Teutschen Sprache; set of five concentric circles with letters and word fragments
written on them: prefixes on one ring, starting letters on another, then middle letters, ending letters and finally
suffixes.
In the field of literature, text generation can be used as a tool for reproducing historical
texts and literary legacy. As we know in the history of every culture there exist many famous and
well known poets and writers with brilliant works, so the ability to generating poem and text
almost based on their styles can be of a great interest.
Here our purposes are:
• By feeding our text generator model the poems of Hafez, make machine able to
compose Hafez style poems.
• By feeding our text generator model the poems of Hafez and Saadi, make machine able to
compose combined style poems.
For the models we use the data set of Ghazaliat-e-Hafez and Ghazaliat-e-Saadi3.
2 Initial concepts
We define some concepts which may be useful for understanding the process of ML text
2 http://mathesonmarcault.com/index.php/2015/12/15/randomly-generated-title-goes-here/
3 the Mohammad Qazvini/Ghāsem Ghani 1941 edition
generation:
Sequential data: Is a type of data which stores in a chronological order.
Long term dependency: Consider this phrase 'Clouds are in the __', in order to fill in the the blank
we have enough information. Just 4 words before the blank is enough to predict the blank, so we
need a little information, this little dependency is called short term dependency. Now consider
'John was born in London and has passed first 5 years of his life in London … and his mother toung
is__'. Now in order to fill in the blank we need more information in comparison to the first
example, may be even pages of information. This long dependency to the previous words is called
long term dependency.
Artificial neural network (ANN): Artificial neural networks (ANNs) are computing systems
vaguely inspired by the biological neural networks that constitute animal brains such systems
"learn" to perform tasks by considering examples, generally without being programmed with any
task-specific rules.
Recurrent neural network (RNN): Is a class of artificial neural network where connections
between nodes form a directed graph along a sequence. This allows it to exhibit dynamic
temporal behavior for a time sequence. Unlike feedforward neural networks, RNNs can use their
internal state (memory) to process sequences of inputs.
Word cloud: An image composed of words used in a particular text or subject, in which the size
of each word indicates its frequency or importance.
3 Model and its mechanism
In this section we describe our model.
The model is an improvement of model which is presented By Jason Brownlee on August 4, 2016
in Natural Language Processing 4, with some major changes5.
The original model had three layers including: LSTM, Dropout, Dense; which can be run on both
CPU and GPU (Figure2).
The model has seven layers including: CuDNNGRU-1, Dropout, CuDNNGRU-2, Dropout, Dense-1,
Dense-2, Dense-3 (Figure 3). CuDNNGRU is a Fast GRU implementation backed by CuDNN which
4 https://machinelearningmastery.com/text-generation-lstm-recurrent-neural-networks-python-keras/
5 Please contact with the writers for receiving the complete code
can only be run on GPU, with the TensorFlow backend. The model how ever is deeper than the
original model with five times more number of parmeters but faster than the original one.
Figure 2: The original model with three layers including: LSTM, Dropout, Dense. The numbers show the shape of
data which we feed in to the model.
Figure 3: New model with seven layers including: CuDNNGRU-1, Dropout, CuDNNGRU-2, Dropout, Dense-1, Dense-
2, Dense-3. The numbers show the shape of data which we feed in to the model.
Given any textual data to the model (in our case the poems of Hafez), after encoding, it works in
three steps as follows:
• First it selects a predetermined size of characters called the first pattern. Then the second
pattern is obtained by shifting the first pattern to the right with one character. For instance
consider the first four patterns of the following poem6:
لد ام ار
"
اراخب
ار
و
درا
دنقرمس
هب تسد
مشخب
If we choose length of each pattern 20, we have the following patterns:
کرت
رگا
یزاریش
نا
هب لاخ شیودنه
"
لد ام
ار
"
درا
هب تسد
"
"
لد ام ر
درا
ی هب تسد
"
لد
ام
"
درا
یز هب تسد
"
P1:
P2:
P3:
P4:
If we present the patterns in a list shape we would have the following:
"
لد ام
درا
هب تسد
یزا
"
P1:
--
ا
ر
ا
م --
ل
د
--
د
ر
ا
-- ت س
د
--
ه ب --
ا
ا
--
د
ر
ل
م --
د --
P2:
ر --
د
The character " -- " means blank space.
Then all these patterns will be added into a list "list of patterns". Next, the first character which
comes exactly after each pattern will be added into another list "list of characters"(Figure4).
ه ب -- ی
-- ت س
• Next, data (consisting "list of patterns" and "list of characters") feed into the model
(deep network). By observing each pattern and also based on long term dependency and
frequency of characters, the model memories (learns) what word come next after each pattern.
For example by observing P1 and P2 it memories the words "ی" or "ز" respectively (Figure 5).
Then the model uses this information (learned from whole text and all the patterns) to predict
each next word and arrange them to compose a poem or any textual data.
6 Note that, Persian is written from right to left, but computer reads and processes the words from left to right.
Figure 4: Textual data will be divided into patterns, then all these patterns will be added into a list ("list of patterns")
and the first character which comes exactly after each pattern will be added into another list ("list of characters").
Figure 5: Deep Network; by observing each pattern and also based on long term dependency and frequency of
characters, the model memories (learns) what word come next after each pattern.
Assume P1 and also S1 from
where:
S1:
--
ا
ر
ار
"
امعم
نیا
هب تمکح
دیاشگن
دوشگن
و
هک سک
"
ا
م
ع
م
--
ن ی
ا
-- ت
م ک ح
--
ه ب --
", and then the first case leads to predict next word as "ی" and
" it will uses all the information of epochs
Both of S1 and P1 end with" -- ب ه
in the second, "د". Now if the machine face to " -- ب ه
(long term dependency) and frequencies to predict the best characters.
• Based on our time and processing power the machine reads and processes the whole data
several times, each called one epoch. Learning machines use iterative algorithms often need
many epochs during their learning phase. In this step, after each epoch, the machine becomes
better in predicting the characters. After processing, we give it a starting sentence (called Seed)
and with the use of information stored in saved weights we can generate fake poems (Figure 6).
Figure 6: Once the data has been processed, we can give the model a starting sentence (called Seed) and with the
use of information stored in saved weights we can generate fake poems.
4 Results
In this section we present the results of our model to generate poems in Hafez style and
also a new style result of combination of Hafez and Saadi. Because of limitation of processing
power, the generated text needs a little manipulation to make better sense. According to Oxford
Advanced Learner's Dictionary, 8th edition, a poem is:
"a piece of writing in which the words are chosen for their sound and the images they
suggest, not just for their obvious meanings. The words are arranged in separate lines, usually
with a repeated rhythm, and often the lines rhyme at the end."
Our generated poems have some differencesses and similarities with this definition, as
follows:
Similarities:
• In both cases The words are arranged in separate lines.
• Often the lines rhyme at the end.
Differencesses:
• Not all lines suggest obvious meanings.
• Not all lines are connected in meaning, so they don't necessarily tell a coherent
story.
In addition, in our generated poems not all lines necessarily obey a particular Poetry style,
however majority of them do. Also with this model we can generate as many couplets as we wish,
even millions of them. Firstly we give the seed, secondly we set a limit number for example 200,
finally model generates a poem with 200 characters as follows.
Seed:
200 characters generated poem:
اه
اهلوان
لکشم
داتفا
و
يلو
ردا
اساک
يقاسلا
اهیا
لاا
ای
لوا
ناسآ
هک قشع
دومن
رخاک
هب یوب
هفان
یا
ابص
تسب
هناخیم
زا رد
نم
دربب
لایخ ام ار
ار ات
دسرب
وت
رد بآ
تسا
تاباسخ
وک نیلعم
هاقناخ
تسین
هب نم
تشماد
رد راک ام هب رد نیا
هاش
ز
دهاس
يم
و فلز
درد وت
ات هب
هب
هناخیم
هک اب ز نم
دابآ
هب رد
ت
لد رب
هب کاخ
4.1 A poet like Hafez
Our model, first trained on poems of Hafez. Relation between epoch and accuracy of the
model to make syntactically and semantically better words is presented in (Figure 7). As
mentioned before if our model observes and analyses the whole Ghazaliat-e-Hafez, it has passed
one epoch. It is notable that in the first epoch, the machine starts without any background about
the text, but for the second epoch the machine proceed with information of the first epoch about
the whole text and so on. Also accuracy is defined as the percentage of correct prediction of
characters.
The results of accuracy over epochs are interesting. As we can see in (Figure 7), in initial epochs
the learning rate (improving accuracy) is fast and substantial but as the time passes this rate
decreases significantly. For understanding the process better, consider a new born baby. From
the first day the baby begins the process of learning to speak and putting words next to each
other. Consider each epoch as a week, in the first weeks, the baby learns many words and
sentences since they are all new, but as the time passes the learning process gets slower because
now the baby has learned a lot of sentence and there are a few words which are new for it. In
the same way our model born in the first pattern in epoch 1. In the initial epochs our model is
exactly like a new born baby (learns faster) but at the end of training (epoch 150) we have a baby
of 3 years old!
Our model on hafez style model contains the data (text) of whole Ghazaliat-e-hafez and it has
been trained over 500 epochs.
Word clouds of the real and generated texts are in (Figure 8) and (Figure 9) which again show
that frequencies of the used words in the both real and generated text are similar. Now please
look at some of results with different number of epochs: 50 epochs: With small number of
epochs as we can see below, the machine has learned very little and it has repeated a hemistich
four times:
هب داب
هب داب
هب ناود
هب ناود
دود
دود
هب
هب
دود
دود
هب
هب
هب يم
هب يم
هب
دود
هب
دود
160 epochs: In this number of epochs, the results is better but there is no rhyme:
اب يم
دنک لد زا تسد
هب ناود
هب ناود
نم
مریزون
زا رس نیوک
هب داب
هب داب
دود
دود
دیشک
هب
هب
يم
رگنب
هک زا رس نم
زا وت
رس یوم
وت
500 epochs: With 500 epochs, the results are better both in meaning and rhyme:
ينکی
يناد
تسیچ
اب نم
هب نوخ لد
هک رب
نم
هب يم
هب يم
هک وت
زا يم
ناج تسا
تسا
نیا
راک و ناشن
رس هک نم
یراب
نیا
هک اب وت
درذگب
بشعم
نابایب
و
لزنم
هب داب
لد هک وت
لد نم
یا
نیا
ردنا
زا کاخ
وچ راک
هک نیا
نورب
راهب
4.2 A new created poet
داب
Now it is easy to feed our model a certain type of data and generate text in the same
style. For instance if we feed our model the poems of hafez the model can generate hafez style
poems and if we feed the model saadi style poems then we get those of like saadi's.
Now if we feed our model both hafez and saadi poems, we can generate poems in the style of
both. In other words, we can create a new poet with both hafez and saadi perspective. It can lead
us to era of new poets. In order to create such new poems we feed our model both Ghazaliat-e-
hafez and Ghazaliat-e-saadi. Word clouds of the real and generated texts are in (Figure 10) and
(Figure 11) which again show that frequencies of the used words in the both real and generated
text are similar. Some results were as following:
يسک
زا تیلاخ
ار رد يسک
و تسد
ينک اب وت
رد دنب
رب
دوخ
داهن
داهن
دوخ
رد
رد زاب
هب بادرد
نم
هک رب
هک رد زاب
هک اب شوه
هب تسد
هب رد راب
As we can see, these poems are neither like Hafez, nor saadi, but their styles are very similar to
the both which is very interesting.
دیما
ار رب
يسک
رب
دیما
نمدود
زا وت
رد داب
5 Conclusion
Using machine learning, an idea to create a new poet based on poets that have passed
away, is presented. For this purpose, we let the machine to read and process the text based on
machine learning algorithms to find some probabilistic patterns for arranging the characters of
the original texts. Then with giving some characters in the form of words to machine as the seed,
the machine based on the probabilistic patterns can generate as many characters as we want.
With this method, style of the generated text will be similar to the original one. With this idea of
combination of the styles of poets, we will give our poets a new life and also our culture and
history a new chance to have some new poets with some new styles not previously exist.
Two of the challenges of this method are limitation of processing power and limitation of the text
size. More powerful computers in processing power and the greater size of the original text leads
to generating better text in terms of rhyme and concept.
For future works, it would be interesting if we combine the style of writers instead of poets. Also
it would be interesting if we feed the machine with poems of some old poets and some new born
words in our literature to see if our previous poets want to compose poem using new born words,
what they would compose.
References
[1] Bahdanau, D., Cho, K., and Bengio, Y., 2014, Neural machine translation by jointly learning to
align and translate. arXiv:1409.0473.
[2] Bengio, Y., Ducharme, R., Vincent, P., and Janvin, C., 2003, A neural probabilistic language
model. The Journal of Machine Learning Research, 3:1137 -- 1155.
[3] Bengio, Y., Simard, P., and Frasconi, P., 1994, Learning long-term dependencies with gradient
descent is difficult. IEEE Transactions on Neural Networks, 5(2):157 -- 166.
[4] Buduma, N. and Lacascio, N., 2017, Fundamentals of Deep Learning, O'Reilly.
[5] Deng, L., and Liu, Y., 2018, Deep Learning in Natural Language Processing, Springer Singapore.
[6] Goyal, P., Pandey, S., and Jain, K., 2018, Deep Learning for Natural Language Processing,
Apress.
Graves, A., 2014, Generating Sequences With Recurrent Neural Networks,
[7]
arXiv:1308.0850v5.
[8] Goodfellow, I., Bengio, Y., and Courville, A., 2016, Deep Learning, MIT press.
[9] Leopold, H., Mendling, J., and Polyvyanyy, A., 2012, Generating natural language texts from
business process models, in Proc. 24th Int. Conf. Adv. Inf. Syst. Eng., 64 -- 79.
[10] Leopold, H., Mendling, J., and Polyvyanyy, A., 2014, Supporting Process Model Validation
through Natural Language Generation, IEEE Transaction On Software Enginieering, 40(8):818-
840.
[11] McKeown, K.R., 1992, Text Generation, Cambridge University Press.
[12] Misztal-Radecka, J. and Indurkhya, B., 2016, A Black Board System For Generating Poetry,
Computer Science, 17(2):265 -- 294.
[13] Liu, Q., Zou, L., Che, H., Wang, H., Jin, Y. and Yang, H., 2017, A Creative Computing Based
Inspiration Assistant to Poem Generation," 2017 14th International Symposium on Pervasive
Systems, Algorithms and Networks 2017 11th International Conference on Frontier of Computer
Science and Technology 2017 Third International Symposium of Creative Computing , 469-476.
[14] Sutskever, I., Martens, J., and Hinton, G., 2011, Generating Text with Recurrent Neural
Networks, ICML'11 Proceedings of the 28th International Conference on International
Conference on Machine Learning, 1017-1024.
[15] Vinyals, O. and V. Le, Q., 2015, A Neural Conversational Model arXiv:1506.05869v3.
[16] Wang, Z., He, W., Wu, Hau, Wu, Haiyang, Li, W., Wang, H., Chen, E., 2016, Chinese Poetry
Generation with Planning based Neural Network arXiv:1610.09889v2.
Figure 7: Relation between epoch and accuracy of the model to make syntactically and semantically better words.
In initial epochs the learning rate (improving accuracy) is fast and substantial but as the time passes this rate
decreases significantly.
Figure 8: Word cloud of the real hafez poems.
Figure 9: Word cloud of the fake generated poems of hafez.
Figure 10: Word cloud of the real hafez and saadi poems.
Figure 11: Word cloud of the fake hafez and saadi generated poems.
|
1909.08859 | 1 | 1909 | 2019-09-19T08:39:00 | Procedural Reasoning Networks for Understanding Multimodal Procedures | [
"cs.CL",
"cs.CV"
] | This paper addresses the problem of comprehending procedural commonsense knowledge. This is a challenging task as it requires identifying key entities, keeping track of their state changes, and understanding temporal and causal relations. Contrary to most of the previous work, in this study, we do not rely on strong inductive bias and explore the question of how multimodality can be exploited to provide a complementary semantic signal. Towards this end, we introduce a new entity-aware neural comprehension model augmented with external relational memory units. Our model learns to dynamically update entity states in relation to each other while reading the text instructions. Our experimental analysis on the visual reasoning tasks in the recently proposed RecipeQA dataset reveals that our approach improves the accuracy of the previously reported models by a large margin. Moreover, we find that our model learns effective dynamic representations of entities even though we do not use any supervision at the level of entity states. | cs.CL | cs | Procedural Reasoning Networks for Understanding Multimodal
Procedures
Mustafa Sercan Amac
Semih Yagcioglu Aykut Erdem Erkut Erdem
Hacettepe University Computer Vision Lab
Dept. of Computer Engineering, Hacettepe University, Ankara, TURKEY
{b21626915,n13242994,aykut,erkut}@cs.hacettepe.edu.tr
9
1
0
2
p
e
S
9
1
]
L
C
.
s
c
[
1
v
9
5
8
8
0
.
9
0
9
1
:
v
i
X
r
a
Abstract
This paper addresses the problem of com-
prehending procedural commonsense knowl-
edge. This is a challenging task as it re-
quires identifying key entities, keeping track
of their state changes, and understanding tem-
poral and causal relations. Contrary to most
of the previous work, in this study, we do
not rely on strong inductive bias and explore
the question of how multimodality can be ex-
ploited to provide a complementary semantic
signal. Towards this end, we introduce a new
entity-aware neural comprehension model aug-
mented with external relational memory units.
Our model learns to dynamically update en-
tity states in relation to each other while read-
ing the text instructions. Our experimental
analysis on the visual reasoning tasks in the
recently proposed RecipeQA dataset reveals
that our approach improves the accuracy of the
previously reported models by a large margin.
Moreover, we find that our model learns effec-
tive dynamic representations of entities even
though we do not use any supervision at the
level of entity states.1
Introduction
1
A great deal of commonsense knowledge about the
world we live is procedural in nature and involves
steps that show ways to achieve specific goals. Un-
derstanding and reasoning about procedural texts
(e.g. cooking recipes, how-to guides, scientific pro-
cesses) are very hard for machines as it demands
modeling the intrinsic dynamics of the procedures
(Bosselut et al., 2018; Dalvi et al., 2018; Yagcioglu
et al., 2018). That is, one must be aware of the
entities present in the text, infer relations among
them and even anticipate changes in the states of
the entities after each action. For example, consider
the cheeseburger recipe presented in Fig. 1. The
1The project website with code and demo is available at
https://hucvl.github.io/prn/
instruction "salt and pepper each patty and cook
for 2 to 3 minutes on the first side" in Step 5 entails
mixing three basic ingredients, the ground beef,
salt and pepper, together and then applying heat
to the mix, which in turn causes chemical changes
that alter both the appearance and the taste. From
a natural language understanding perspective, the
main difficulty arises when a model sees the word
patty again at a later stage of the recipe. It still cor-
responds to the same entity, but its form is totally
different.
Over the past few years, many new datasets and
approaches have been proposed that address this in-
herently hard problem (Bosselut et al., 2018; Dalvi
et al., 2018; Tandon et al., 2018; Du et al., 2019).
To mitigate the aforementioned challenges, the ex-
isting works rely mostly on heavy supervision and
focus on predicting the individual state changes
of entities at each step. Although these models
can accurately learn to make local predictions, they
may lack global consistency (Tandon et al., 2018;
Du et al., 2019), not to mention that building such
annotated corpora is very labor-intensive. In this
work, we take a different direction and explore the
problem from a multimodal standpoint. Our basic
motivation, as illustrated in Fig. 1, is that accompa-
nying images provide complementary cues about
causal effects and state changes. For instance, it
is quite easy to distinguish raw meat from cooked
one in visual domain.
In particular, we take advantage of recently pro-
posed RecipeQA dataset (Yagcioglu et al., 2018), a
dataset for multimodal comprehension of cooking
recipes, and ask whether it is possible to have a
model which employs dynamic representations of
entities in answering questions that require multi-
modal understanding of procedures. To this end, in-
spired from (Santoro et al., 2018), we propose Pro-
cedural Reasoning Networks (PRN) that incorpo-
rates entities into the comprehension process and al-
Figure 1: A recipe for preparing a cheeseburger (adapted from the cooking instructions available at https:
//www.instructables.com/id/In-N-Out-Double-Double-Cheeseburger-Copycat). Each basic in-
gredient (entity) is highlighted by a different color in the text and with bounding boxes on the accompanying
images. Over the course of the recipe instructions, ingredients interact with each other, change their states by
each cooking action (underlined in the text), which in turn alter the visual and physical properties of entities. For
instance, the tomato changes it form by being sliced up and then stacked on a hamburger bun.
lows to keep track of entities, understand their inter-
actions and accordingly update their states across
time. We report that our proposed approach signifi-
cantly improves upon previously published results
on visual reasoning tasks in RecipeQA, which test
understanding causal and temporal relations from
images and text. We further show that the dynamic
entity representations can capture semantics of the
state information in the corresponding steps.
2 Visual Reasoning in RecipeQA
In our study, we particularly focus on the visual
reasoning tasks of RecipeQA, namely visual cloze,
visual coherence, and visual ordering tasks, each
of which examines a different reasoning skill2. We
briefly describe these tasks below.
Visual Cloze. In the visual cloze task, the question
is formed by a sequence of four images from
consecutive steps of a recipe where one of them is
replaced by a placeholder. A model should select
the correct one from a multiple-choice list of four
answer candidates to fill in the missing piece. In
that regard, the task inherently requires aligning
visual and textual information and understanding
2We intentionally leave the textual cloze task out from our
experiments as the questions in this task does not necessarily
need multimodality.
temporal relationships between the cooking actions
and the entities.
Visual Coherence. The visual coherence task tests
the ability to identify the image within a sequence
of four images that is inconsistent with the text
instructions of a cooking recipe. To succeed in this
task, a model should have a clear understanding
of the procedure described in the recipe and at the
same time connect language and vision.
Visual Ordering. The visual ordering task is about
grasping the temporal flow of visual events with
the help of the given recipe text. The questions
show a set of four images from the recipe and the
task is to sort jumbled images into the correct order.
Here, a model needs to infer the temporal relations
between the images and align them with the recipe
steps.
3 Procedural Reasoning Networks
In the following, we explain our Procedural Reason-
ing Networks model. Its architecture is based on a
bi-directional attention flow (BiDAF) model (Gard-
ner et al., 2018)3, but also equipped with an explicit
reasoning module that acts on entity-specific rela-
3Our implementation is based on the implementation pub-
licly available in AllenNLP (Gardner et al., 2018).
dressingStep 1: Ingredients and ToolsStep 2: Form PattiesStep 3: SeasonStep 4: Toast BunsLightly toast the both halves of the hamburgerbun, face down in the pan. Set aside.Step 5: CookStep 6: Chop Onions & TomatoesFor the "authentic" feel you want to get a largeonion and a large tomato, then slice a large slicefrom the middle to use on the hamburger.Step 7: Chop Onions & TomatoesStep 8: EnjoyAll that's left to do is enjoy this copycat doubledouble! To be honest, this was impressively closeto the real taste. I would definitely make this oneagain.ground beeflettuce leafonionsaltpepperdressinghamburger bunAmerican cheesetomatoground beefground beefground beefground beefground beefground beefground beefground beefground beefground beefground beefground beefground beefground beefhamburger bunhamburger bunhamburger bunhamburger bunhamburger bunhamburger bunhamburger bunhamburger bunsaltsaltsaltpepperpeppertomatolettuce leaflettuce leafoniononiononiononiontomatotomatodressingdressingSalt and pepper one side of the patty now, the otherhalf will be done when grilling.Set the patty seasoned side down on the skillet, salt and peppereach patty and cook for 2 to 3 minutes on the first side. Flip thepatties over and season with salt and pepper and immediatelyplace one slice of cheese on each one. Cook for 2-3 minutes onthe other side.1 hamburger bun, 4 oz. ground beef (25-30% fatif available) (2 ounce per patty), salt andpepper, Thousand Island dressing (or In-N-Outofficial spread), 1 large tomato, 1 large lettuceleaf, 1 whole onion, 2 slices real AmericancheeseAssemble the burger in the following stacking order from thebottom up: bottom bun, thousand island dressing, tomato, lettuce,beef patty with cheese, onion slice, beef patty with cheese, topbunBegin by preheating a cast iron skillet over medium heat. Make four patties byrolling 2-ounce portions of beef into balls and weigh it out on the kitchen scale.In-N-Out uses a 25-30% fat beef patty which is not easily available at a localgrocery store, in many cases it would have to be ground by hand. Forming themslightly larger than buns. I do this by placing the 2 ounce beef in between 2pieces of parchment paper then taking my large cast iron skillet and applying alittle force to smash the beef into a patty. You will want to form them into aperfect circle with your hand if they do not come out right after the initial smash.Figure 2: An illustration of our Procedural Reasoning Networks (PRN). For a sample question from visual coher-
ence task in RecipeQA, while reading the cooking recipe, the model constantly performs updates on the representa-
tions of the entities (ingredients) after each step and makes use of their representations along with the whole recipe
when it scores a candidate answer. Please refer to the main text for more details.
tional memory units. Fig. 2 shows an overview of
the network architecture. It consists of five main
modules: An input module, an attention module, a
reasoning module, a modeling module, and an out-
put module. Note that the question answering tasks
we consider here are multimodal in that while the
context is a procedural text, the question and the
multiple choice answers are composed of images.
1. Input Module extracts vector representations
of inputs at different levels of granularity by
using several different encoders.
2. Reasoning Module scans the procedural text
and tracks the states of the entities and their re-
lations through a recurrent relational memory
core unit (Santoro et al., 2018).
3. Attention Module computes context-aware
query vectors and query-aware context vectors
as well as query-aware memory vectors.
4. Modeling Module employs
two multi-
layered RNNs to encode previous layers out-
puts.
5. Output Module scores a candidate answer
from the given multiple-choice list.
At a high level, as the model is reading the
cooking recipe, it continually updates the internal
memory representations of the entities (ingredients)
based on the content of each step -- it keeps track
of changes in the states of the entities, providing an
entity-centric summary of the recipe. The response
to a question and a possible answer depends on the
representation of the recipe text as well as the last
states of the entities. All this happens in a series of
implicit relational reasoning steps and there is no
need for explicitly encoding the state in terms of a
predefined vocabulary.
Input Module
3.1
Let the triple (R, Q, A) be a sample input. Here,
R denotes the input recipe which contains textual
instructions composed of N words in total. Q
represents the question that consists of a sequence
of M images. A denotes an answer that is either
a single image or a series of L images depending
on the reasoning task. In particular, for the visual
cloze and the visual coherence type questions, the
answer contains a single image (L = 1) and for the
visual ordering task, it includes a sequence.
We encode the input recipe R at character, word,
and step levels. Character-level embedding layer
uses a convolutional neural network, namely Char-
CNN model by Kim (2014), which outputs charac-
ter level embeddings for each word and alleviates
the issue of out-of-vocabulary (OOV) words. In
word embedding layer, we use a pretrained GloVe
model (Pennington et al., 2014) and extract word-
level embeddings4. The concatenation of the char-
acter and the word embeddings are then fed to a
two-layer highway network (Srivastava et al., 2015)
to obtain a contextual embedding for each word in
the recipe. This results in the matrix R(cid:48) ∈ R2d×N .
On top of these layers, we have another layer
that encodes the steps of the recipe in an individual
manner. Specifically, we obtain a step-level con-
4We also consider pretrained ELMo embeddings (Peters
et al., 2018) in our experiments but found out that the perfor-
mance gain does not justify the computational overhead.
CNNCNNCNNLSTMLSTMLSTMStep 1: Ingredients8-12 oz (225-350g) gingersnap cookies (depending onhow much crust you like!) 1/4 cup (57g) butter, melted(or slightly more if you're going full-hog on the crust) 24oz.. (680g) cream cheese, softened 15 oz. (425g)pumpkin puree 2/3 cup (75g) sugar 4 eggs 1 teaspoonvanilla 1/4 cup (30g) flour Pinch of salt Freshly groundcinnamon, ginger and nutmeg to taste (I use 1/2teaspoon each!) Optional: fresh ground pepper - I knowit sounds weird, but it adds depth to the spice profile!In a mixer or food processor,combine the softened creamcheese, pumpkin puree, sugar,and vanilla extract until wellblended. Add the eggs, one at atime, mixing after each until justincorporated. Combine flour andspices and slowly add to the liquidmixture. Pour mixture into crust.Step 3: The FillingBake the pumpkin cheesecake for 80-90minutes, until the center is almost set., andbarely jiggles in the middle. Use a knife to gentlyloosen the crust from the edge of the pan. Allowcheesecake to cool before removing the rim ofthe pan. Refrigerate for at least 4 hours and upto overnight. If you are traveling with thecheesecake, leave the pan in tact until ready toeat! You're gonna love this one, I just know it!Step 4: BakeStep 2: The CrustCNNLSTMChar EmbedEmbedCNNConcatBiLSTMEmbedCNNConcatBiLSTMChar Embedfresh ground peppergingersnap cookiesground cinnamonpumpkin pureecream cheesenutmegvanillagingerbuttersugareggsfloursaltEmbedPreheat your oven to 350F (180C). Using a food processor (ora mallet and a baggie - go for it!), turn your gingersnaps intocrumbs! Add butter to crumbs and process until wellincorporated. (If you're using the mallet method, you can use afork for this part!) I like to line just the bottom of a 9" springformpan with parchment, but that is optional. Pat the crust mixtureinto your pan, covering just the bottom, or going up the sides asfar as you dare! If you're going full-crust, it's a good idea to par-bake your crust (meaning bake it before filling) for 5-10 mins. EmbedCNNConcatBiLSTMChar EmbedChar EmbedEmbedCNNConcatBiLSTMBi-AttentionBi-AttentionEntities (Ingredients)R-RNNR-RNNR-RNNR-RNNQuestion (Visual Coherence Task)AnswerCandidateConcatBiLSTMBiLSTMSimilarityChar EmbedCNNConcatBiLSTMEmbedRecipe (4 Steps)MLPCNNMLPtextual embedding of the input recipe containing
T steps as S = (s1, s2, . . . , sT ) where si repre-
sents the final state of a BiLSTM encoding the i-th
step of the recipe obtained from the character and
word-level embeddings of the tokens exist in the
corresponding step.
We represent both the question Q and the answer
A in terms of visual embeddings. Here, we employ
a pretrained ResNet-50 model (He et al., 2016)
trained on ImageNet dataset (Deng et al., 2009)
and represent each image as a real-valued 2048-d
vector using features from the penultimate average-
pool layer. Then these embeddings are passed first
to a multilayer perceptron (MLP) and then its out-
puts are fed to a BiLSTM. We then form a matrix
Q(cid:48) ∈ R2d×M for the question by concatenating the
cell states of the BiLSTM. For the visual ordering
task, to represent the sequence of images in the
answer with a single vector, we additionally use a
BiLSTM and define the answering embedding by
the summation of the cell states of the BiLSTM.
Finally, for all tasks, these computations produce
answer embeddings denoted by a ∈ R2d×1.
3.2 Reasoning Module
As mentioned before, comprehending a cooking
recipe is mostly about entities (basic ingredients)
and actions (cooking activities) described in the
recipe instructions. Each action leads to changes
in the states of the entities, which usually affects
their visual characteristics. A change rarely oc-
curs in isolation; in most cases, the action affects
multiple entities at once. Hence, in our reasoning
module, we have an explicit memory component
implemented with relational memory units (San-
toro et al., 2018). This helps us to keep track of the
entities, their state changes and their relations in
relation to each other over the course of the recipe
(see Fig. 3). As we will examine in more detail in
Section 4, it also greatly improves the interpretabil-
ity of model outputs.
Specifically, we set up the memory with a mem-
ory matrix E ∈ RdE×K by extracting K entities
(ingredients) from the first step of the recipe5. We
initialize each memory cell ei representing a spe-
cific entity by its CharCNN and pre-trained GloVe
embeddings6. From now on, we will use the terms
5The first steps of the recipes in RecipeQA commonly
contain a list of ingredients.
6Multi-word entities (e.g. minced garlic) are represented
by the average embedding vector of the words that they con-
tain, and OOV words are expressed with the average word
memory cells and entities interchangeably through-
out the paper. Since the input recipe is given in
the form of a procedural text decomposed into a
number of steps, we update the memory cells after
each step, reflecting the state changes happened on
the entities. This update procedure is modelled via
a relational recurrent neural network (R-RNN), re-
cently proposed by Santoro et al. (2018). It is built
on a 2-dimensional LSTM model whose matrix of
cell states represent our memory matrix E. Here,
each row i of the matrix E refers to a specific entity
ei and is updated after each recipe step t as follows:
φi,t = R-RNN(φi,t−1, st)
(1)
where st denotes the embedding of recipe step t
and φi,t = (hi,t, ei,t) is the cell state of the R-RNN
at step t with hi,t and ei,t being the i-th row of
the hidden state of the R-RNN and the dynamic
representation of entity ei at the step t, respectively.
The R-RNN model exploits a multi-headed self-
attention mechanism (Vaswani et al., 2017) that
allows memory cells to interact with each other and
attend multiple locations simultaneously during the
update phase.
In Fig. 3, we illustrate how this interaction takes
place in our relational memory module by consider-
ing a sample cooking recipe and by presenting how
the attention matrix changes throughout the recipe.
In particular, the attention matrix at a specific time
shows the attention flow from one entity (memory
cell) to another along with the attention weights
to the corresponding recipe step (offset column).
The color intensity shows the magnitude of the at-
tention weights. As can be seen from the figure,
the internal representations of the entities are ac-
tively updated at each step. Moreover, as argued
in (Santoro et al., 2018), this can be interpreted as
a form of relational reasoning as each update on a
specific memory cell is operated in relation to oth-
ers. Here, we should note that it is often difficult
to make sense of these attention weights. However,
we observe that the attention matrix changes very
gradually near the completion of the recipe.
3.3 Attention Module
Attention module is in charge of linking the ques-
tion with the recipe text and the entities present in
the recipe. It takes the matrices Q(cid:48) and R(cid:48) from the
input module, and E from the reasoning module
vector of all the words.
Figure 3: Sample visualizations of the self-attention weights demonstrating both the interactions among the ingre-
dients and between the ingredients and the textual instructions throughout the steps of a sample cooking recipe
from RecipeQA (darker colors imply higher attention weights). The attention maps do not change much after the
third step as the steps after that mostly provide some redundant information about the completed recipe.
and constructs the question-aware recipe represen-
tation G and the question-aware entity representa-
tion Y. Following the attention flow mechanism
described in (Seo et al., 2017a), we specifically
calculate attentions in four different directions: (1)
from question to recipe, (2) from recipe to question,
(3) from question to entities, and (4) from entities
to question.
The first two of these attentions require comput-
ing a shared affinity matrix SR ∈ RN×M with SR
i,j
indicating the similarity between i-th recipe word
and j-th image in the question estimated by
i; Q(cid:48)
j; R(cid:48)
R[R(cid:48)
i ◦ Q(cid:48)
j]
i,j = w(cid:62)
SR
(2)
R is a trainable weight vector, ◦ and [; ] de-
where w(cid:62)
note elementwise multiplication and concatenation
operations, respectively.
its i-th column being given by Qi = (cid:80)
Recipe-to-question attention determines the im-
ages within the question that is most relevant to
each word of the recipe. Let Q ∈ R2d×N repre-
sent the recipe-to-question attention matrix with
j aijQ(cid:48)
j
where the attention weight is computed by ai =
softmax(SR
i ) ∈ RM .
attended recipe vector given by r = (cid:80)
Question-to-recipe attention signifies the words
within the recipe that have the closest similarity
to each image in the question, and construct an
i biR(cid:48)
i
with the attention weight is calculated by b =
softmax(maxcol (SR)) ∈ RN where maxcol de-
notes the maximum function across the column.
The question-to-recipe matrix is then obtained by
replicating r N times across the column, giving
R ∈ R2d×N .
Then, we construct the question aware represen-
tation of the input recipe, G, with its i-th column
Gi ∈ R8d×N denoting the final embedding of i-th
word given by
Gi = [R(cid:48)
i ◦ Ri; ] .
i ◦ Qi; R(cid:48)
i; Qi; R(cid:48)
(3)
Attentions from question to entities, and from
entities to question are computed in a way similar
to the ones described above. The only difference is
that it uses a different shared affinity matrix to be
computed between the memory encoding entities E
and the question Q(cid:48). These attentions are then used
to construct the question aware representation of
entities, denoted by Y, that links and integrates the
images in the question and the entities in the input
recipe.
3.4 Modeling Module
Modeling module takes the question-aware repre-
sentations of the recipe G and the entities Y, and
forms their combined vector representation. For
this purpose, we first use a two-layer BiLSTM to
read the question-aware recipe G and to encode the
interactions among the words conditioned on the
question. For each direction of BiLSTM , we use
its hidden state after reading the last token as its
output. In the end, we obtain a vector embedding
c ∈ R2d×1. Similarly, we employ a second BiL-
STM, this time, over the entities Y, which results
in another vector embedding f ∈ R2dE×1. Finally,
these vector representations are concatenated and
then projected to a fixed size representation using
o = ϕo([c; f ]) ∈ R2d×1 where ϕo is a multilayer
perceptron with tanh activation function.
We'll start with a nice piece ofroast, mine was 1 kilo and ahalf, but you can do less if youwant.We'll have to cut thepieces so that it eventually fit inthe bottle. This dependsentirely from the size of thebottle itself, that said rememberthe meat will shrink in the oven.Step 1: Slicin', Dicin'...saltoilpotatoesrosemarythymecrushed garlicpork tenderloinblackpepperThen comes the phase that isknown in italian as "Pillottare".Using a mortar, grind togetherthe spices, the salt, thecrushed garlic and add a dropor two of olive oil so that themixture sticks together Afterthat, take a knife, stab the meatand start filling the cavities withthe spices. When you'refinished it should look like yourmeat had grown a beard.Quickly clean the potatoes andthe onion and chop them inmedium sized pieces. Put halfan inch of Olive oil in the panand put everything in it. Addthe remaining spices and, ifyou like, add some more.Preheat the oven to 180C(356F) and then put this babyto roast. Turn it from time totime so that both sides cookevenly. I kept it one hour andten, but it depends really fromthe size of your roast. You canalways go old school andcheck with a toothpic from timeto time.Bottle has to be clean, so afterwashing and drying it, and rightbefore putting the meat in it,boil some water and pour it infor a quick rinse off. To avoidbreaking the bottle pour somecold water in it and pour theboiling water into the coldwater. You do not need much ofit, just a cup or so, quickly rinsethe bottle and throw the wateraway. Wait till the meat is cold, thenput it into the freshly sterilizedbottle and cover in olive oil.The meat has to rest for atleast two days, then you canstart eating it.Step 2: ... and Spicin'Step 3: Bring Company!Step 4: Burn Baby Burn!Step 5: Ready the Bottle.Step 6: Put the Piggies to Sleep.step 1step 2step 3step 4step 5step 6saltoilpotatoesrosemarythymecrushed garlicpork tenderloinblackpepperTimeRecipe: OilBottled PorkTenderloinattendingfromattendingto0.00.20.40.60.81.03.5 Output Module
The output module takes the output of the mod-
eling module, encoding vector embeddings of the
question-aware recipe and the entities Y, and the
embedding of the answer A, and returns a simi-
larity score which is used while determining the
correct answer. Among all the candidate answer,
the one having the highest similarity score is cho-
sen as the correct answer. To train our proposed
procedural reasoning network, we employ a hinge
ranking loss (Collobert et al., 2011), similar to the
one used in (Yagcioglu et al., 2018), given below.
L = max{0, γ − cos(o, a+) + cos(o, a−)} (4)
where γ is the margin parameter, a+ and a− are
the correct and the incorrect answers, respectively.
4 Experiments
In this section, we describe our experimental setup
and then analyze the results of the proposed Proce-
dural Reasoning Networks (PRN) model.
4.1 Entity Extraction
Given a recipe, we automatically extract the entities
from the initial step of a recipe by using a dictionary
of ingredients. While determining the ingredients,
we exploit Recipe1M (Marin et al., 2018) and
Kaggle Whats Cooking Recipes (Yummly, 2015)
datasets, and form our dictionary using the most
commonly used ingredients in the training set of
RecipeQA. For the cases when no entity can be
extracted from the recipe automatically (20 recipes
in total), we manually annotate those recipes with
the related entities.
4.2 Training Details
In our experiments, we separately trained models
on each task, as well as we investigated multi-task
learning where a single model is trained to solve all
these tasks at once. In total, the PRN architecture
consists of ∼12M trainable parameters. We imple-
mented our models in PyTorch (Paszke et al., 2017)
using AllenNLP library (Gardner et al., 2018). We
used Adam optimizer with a learning rate of 1e-4
with an early stopping criteria with the patience set
to 10 indicating that the training procedure ends
after 10 iterations if the performance would not
improve. We considered a batch size of 32 due to
our hardware constraints. In the multi-task setting,
batches are sampled round-robin from all tasks,
where each batch is solely composed of examples
from one task. We performed our experiments on
a system containing four NVIDIA GTX-1080Ti
GPUs, and training a single model took around 2
hours. We employed the same hyperparameters
for all the baseline systems. We plan to share our
code and model implementation after the review
process.
4.3 Baselines
We compare our model with several baseline
models as described below. We note that the
results of the first two are previously reported
in (Yagcioglu et al., 2018).
Hasty Student (Yagcioglu et al., 2018) is a
heuristics-based simple model which ignores the
recipe and gives an answer by examining only the
question and the answer set using distances in the
visual feature space.
Impatient Reader (Hermann et al., 2015) is a
simple neural model that takes its name from the
fact that it repeatedly computes attention over the
recipe after observing each image in the query.
BiDAF (Seo et al., 2017a) is a strong reading
comprehension model that employs a bi-directional
attention flow mechanism to obtain a question-
aware representation and bases its predictions on
this representation. Originally, it is a span-selection
model from the input context. Here, we adapt it to
work in a multimodal setting and answer multiple
choice questions instead.
BiDAF w/ static memory is an extended version
of the BiDAF model which resembles our proposed
PRN model in that it includes a memory unit for the
entities. However, it does not make any updates on
the memory cells. That is, it uses the static entity
embeeddings initialized with GloVe word vectors.
We propose this baseline to test the significance of
the use of relational memory updates.
4.4 Results
Table 1 presents the quantitative results for the vi-
sual reasoning tasks in RecipeQA. In single-task
training setting, PRN gives state-of-the-art results
compared to other neural models. Moreover, it
achieves the best performance on average. These
results demonstrate the importance of having a dy-
namic memory and keeping track of entities ex-
tracted from the recipe. In multi-task training set-
Figure 4: t-SNE visualizations of learned embeddings from each memory snapshot mapping to each entity and
their corresponding states from each step for visual cloze task.
Single-task Training
Multi-task Training
Model
Human∗
Hasty Student
Impatient Reader
BIDAF
BIDAF w/ static memory
PRN
∗ Taken from the RecipeQA project website, based on 100 questions sampled randomly from the validation set.
Cloze Coherence Ordering Average
74.40
77.60
44.68
27.35
27.36
27.39
55.06
53.95
52.87
51.82
56.31
57.57
81.60
65.80
28.08
48.82
45.88
53.64
64.00
40.88
26.74
62.42
60.90
62.77
44.62
47.81
46.45
Cloze Coherence Ordering All
--
--
--
--
--
--
--
--
--
--
--
--
36.00
40.23
40.58
63.93
62.94
62.67
48.67
50.59
50.17
Table 1: Quantitative comparison of the proposed PRN model against the baselines.
ting where a single model is trained to solve all the
tasks at once, PRN and BIDAF w/ static memory
perform comparably and give much better results
than BIDAF. Note that the model performances
in the multi-task training setting are worse than
single-task performances. We believe that this is
due to the nature of the tasks that some are more
difficult than the others. We think that the perfor-
mance could be improved by employing a carefully
selected curriculum strategy (McCann et al., 2018).
In Fig. 4, we illustrate the entity embeddings
space by projecting the learned embeddings from
the step-by-step memory snapshots through time
with t-SNE to 3-d space from 200-d vector space.
Color codes denote the categories of the cook-
ing recipes. As can be seen, these step-aware
embeddings show clear clustering of these cate-
gories. Moreover, within each cluster, the entities
are grouped together in terms of their state charac-
teristics. For instance, in the zoomed parts of the
figure, chopped and sliced, or stirred and whisked
entities are placed close to each other.
Fig. 5 demonstrates the entity arithmetics us-
ing the learned embeddings from each entity step.
Here, we show that the learned embedding from the
memory snapshots can effectively capture the con-
textual information about the entities at each time
point in the corresponding step while taking into
account of the recipe data. This basic arithmetic
operation suggests that the proposed model can
successfully capture the semantics of each entity's
state in the corresponding step7.
5 Related Work
In recent years, tracking entities and their state
changes have been explored in the literature from
a variety of perspectives. In an early work, Henaff
et al. (2017) proposed a dynamic memory based
network which updates entity states using a gat-
ing mechanism while reading the text. Bansal
et al. (2017) presented a more structured memory
augmented model which employs memory slots
for representing both entities and their relations.
Pavez et al. (2018) suggested a conceptually simi-
lar model in which the pairwise relations between
attended memories are utilized to encode the world
7We used Gensim for calculating entity arithmetics using
cosine distances between entity embeddings.
Vanilla-Apricot Shortbread CookiesAdd to the whipped butter 1 cup of baker's sugar. Stir until the sugar and butter mix thoroughly. Add the whole egg and the egg yolk and stir well.Toffee Bottomed BrowniesCut the brownie into small squares, cleaning your knife after each cut.The topload of cocoa powder makes this dessert so very rich that you don't need much, and there will be ...Cherry Almond Torrone (Italian Nougat)I used a knife, spatula, and pizza roller. Use what you've got. Corn starch and butter will help to prevent sticking....Apple Pie...the apple pie filling should not have the skins on them, BUT... I made this one for a friend of mine who is a health conscious women and she insisted on me leaving the skins on for all the nutritional values....Henderson's SauceAfter it has been simmering for around 5 minutes, it is time to add some other ingredients. Add all these being; Add around 1 soup-spoon of sugar (1 soup spoon brown or 2 soup spoons white)....Absolutely Amazing Cream of Celery SoupAdd cream, lemon juice, hot sauce, salt and pepper. Reheat and simmer for about five minutes. ...Miniature Doughnut Coconut CreaturesChill a can of coconut milk or cream in the fridge overnight. When you're ready to make the whipped cream, open the can and scoop out the hardened coconut. ...Mango Mint Ice TeaTake the measured amount of water and heat it till hot. I used the microwave here. You can heat the water even on the stove top. To the hot water add the Black tea powder or the Black tea bags.Creme Brulee RecipePlace the ramekins into a pan with high sides and carefully fill the pan with hot water until half way up the sides of the ramekins. Make sure not to splash any water into the custard.breadStep: 4Entity: waterStep: 3Entity: waterStep: 1Entity: creamStep: 6Entity: creamStep: 2Entity: sugarStep: 6Entity: sugarStep: 5Entity: butterStep: 6Entity: butterStep: 3Entity: sugarFood Categoriesvegetarian-and-vegansnacks-and-appetizerssaladcocktails-and-mocktailssandwichespizzasoups-and-stewspiecoffeecanning-and-preservesbbq-and-grillingdessertbaconhomebrewcupcakescakebreakfastpastamain-coursebeveragescookiesrecipescandyStep: 4Entity: sugar(perfect) Lemon Meringue Pie...Add half the sugar (150g) and whisk again...Figure 5: Step-aware entity representations can be used to discover the changes occurred in the states of the
ingredients between two different recipe steps. The difference vector between two entities can then be added to
other entities to find their next states. For instance, in the first example, the difference vector encodes the chopping
action done on onions. In the second example, it encodes the pouring action done on the water. When these vectors
are added to the representations of raw tomatoes and milk, the three most likely next states capture the semantics
of state changes in an accurate manner.
state. The main difference between our approach
and these works is that by utilizing relational mem-
ory core units we also allow memories to interact
with each other during each update.
Perez and Liu (2017) showed that similar ideas
can be used to compile supporting memories in
tracking dialogue state. Wang et al. (2017) has
shown the importance of coreference signals for
reading comprehension task. More recently, Dhin-
gra et al. (2018) introduced a specialized recur-
rent layer which uses coreference annotations for
improving reading comprehension tasks. On lan-
guage modeling task, Ji et al. (2017) proposed a
language model which can explicitly incorporate
entities while dynamically updating their represen-
tations for a variety of tasks such as language mod-
eling, coreference resolution, and entity prediction.
Our work builds upon and contributes to the
growing literature on tracking states changes in
procedural text. Bosselut et al. (2018) presented
a neural model that can learn to explicitly predict
state changes of ingredients at different points in
a cooking recipe. Dalvi et al. (2018) proposed an-
other entity-aware model to track entity states in
scientific processes. Tandon et al. (2018) demon-
strated that the prediction quality can be boosted by
including hard and soft constraints to eliminate un-
likely or favor probable state changes. In a follow-
up work, Du et al. (2019) exploited the notion of
label consistency in training to enforce similar pre-
dictions in similar procedural contexts. Das et al.
(2019) proposed a model that dynamically con-
structs a knowledge graph while reading the proce-
dural text to track the ever-changing entities states.
As discussed in the introduction, however, these
previous methods use a strong inductive bias and
assume that state labels are present during training.
In our study, we deliberately focus on unlabeled
procedural data and ask the question: Can multi-
modality help to identify and provide insights to
understanding state changes.
6 Conclusion
We have presented a new neural architecture called
Procedural Reasoning Networks (PRN) for multi-
modal understanding of step-by-step instructions.
Our proposed model is based on the successful
BiDAF framework but also equipped with an ex-
plicit memory unit that provides an implicit mecha-
Step 1: This is a cheap and easy method of an ancientcooking technique known as clay pot cookingusing a common terra cotta flowerpot and saucer.You can spend over $100 on a clay cooker at agourmet kitchen gadget store, or about $20 at agarden supply. You choose. Some of you mayalready have the pot lying in your yard, garage orshed. Once you try this you will probably becooking all kinds of things in it! onions (Flowerpot Chicken)Step 3: Prepare Vegetables.Chop your vegetables while the pot is soaking.You can use whatever you like for this, rootvegetables mixed with onions are always a nicebase. This time I used leeks, bell peppers, garlicand red onions.:onions (Flowerpot Chicken)::Step 1: This is a cheap and easy method of an ancientcooking technique known as clay pot cookingusing a common terra cotta flowerpot and saucer.You can spend over $100 on a clay cooker at agourmet kitchen gadget store, or about $20 at agarden supply. You choose. Some of you mayalready have the pot lying in your yard, garage orshed. Once you try this you will probably becooking all kinds of things in it! tomatoes (Flowerpot Chicken)?:Step 1: Prepping the Vegetables.The first step is to have all the Vegetables prepped and ready to go in thepan, so finely dice the Garlic, onions and Peppers. Don't worry about mixingthem up in the bowl, all of these items are going to be sauteed in a smallamount of oil at the next stage. Picture 1. Finely dice up the Garlic, you wantit to be almost puree consistency. Picture 2. Finely dice up the Onions, thisdoesn't need to be as fine as the garlic but you should ensure that they areall roughly the same size. Picture 3. Lastly dice up the bell pepper, I showyou how i cut this in the video, but i will go over it quickly. Firstly i take off thefour walls of the pepper, flatten them then cut them in to strips, then simplycut the other way so i have them diced.tomatoes (Chilli Con Carne)Step 1: Ingredients...pepperoni (I used what was left in a package which was enough for onelayer) 1/2 onion 2 roma tomatoes dried rosemary shredded mozarella andparmesan fresh savory, basil, tarragon, and thyme 2 or 3 cloves of garlic salt (sea or kosher salt are best) and pepper Slice the tomatoes and onion as thin as is reasonable, slice the garlic as thinas possible. Thoroughly wash the fresh herbs and pull the leaves from thestems. Discard the stems.tomatoes (Seven Layer Seven Grain Bread)Step 1: Gather Your Ingredients......1 teaspoon dried oregano, 1/8 teaspoon red pepper flakes (see step five fora bit of humor on this note), 3/4 to 1 cup wine - Honestly, folks, don't be tooparticular about the wine. Red or white is fine. (you may substitute chickenbroth, or even add broth in addition to the wine. Be creative!)(you maysubstitute chicken broth, or even add broth in addition to the wine. Becreative!) 1 - 28 ounce can diced tomatoes (save the juice!)1/2 teaspoon dried Porcino mushrooms (Optional, see step #2)tomatoes (How to Make Chicken Cacciatore)Step 1: This is absolutely mind-blowingly good. Goatbasically tastes like lamb, but is far leaner. (Lambis the fattiest of the red meats.) It's very popular ina variety of different countries' cuisines, but forsome reason has yet to gain a real following in theUS. This recipe is inspired by the curried goat rotifrom Penny's Caribbean Cafe. While Pennydoesn't share her secrets, this tastes awfullysimilar. Go get yourself some goat (or lamb if youmust) and try it out!water (Caribbean Curried Goat)Step 4: Add Everything Else.Add the rest of the curry powder and stir thingsabout. When it starts to stick again add the waterand deglaze again. Pour in just enough water tocover the meat, and leave a cup full of water nearthe pot to refill as it boils off. You want the meat tostay wet during the entire cooking process. In the picture below I've dropped in anotherboullion cube because they didn't all make it inwith the onions. The details really don't matter toomuch in this dish - it cooks long enough thatyou've got LOTS of leeway to taste and modify..:water (Caribbean Curried Goat)::Step 1: All that sounded logic to me, and instead oflooking on the net how others did it I startedthinking how Bricobart would build such a device -I mean a bbq, not an anti-troll gun. And since Ididn't want to spend any money I decided to buildit from scratch.The project failed in the first trial,but ran like a small dog chased by a beeswarm inthe second. Enjoy my poor men's verticalbirdcage-based bbq!milk (Birdcage-BQ)?:Step 3: Cooking.Melt the butter and add 1/3 cup chopped onions. When the onions arecooked add the bacon bits. Now add the potatoes back to the pot and mashthe potato mixture. I use a potato masher or you can just use a fork. You stillwant it lumpy but the potatoes will help thicken the soup. Pour the milk andmix well. Add salt and pepper and heat until it is a slow boil. Remove fromthe stove and add the cheese and stir until melted. If you add the cheese tooearly it will go to the bottom and burnmilk (Potato Soup for One)Step 2: Meat SaucePreheat oven to 180 degrees celsius. Brown off the mince in a large pan,depending on the fat content of the meat, you may or may not need a littleoil. Drain the mince onto some paper towel to remove any oil and then placeback in the pan. Add 4 slices of chopped prosciutto (or bacon/pancetta) andfry for a few minutes. Add beef stock, tomato sauce, nutmeg, bayleaf andoregano. Simmer for at least 30 minutes.milk (Family Size Lasagne)Step 1: Potato Prep + SeasoningsMake sure all potatoes are peeled and cut into chunks.In a saucepan over medium heat, drop in the tablespoon of butter, the redpepper flakes and Italian seasoning. Let the butter melt and stir theseasonings around until they start smelling nice. :)milk (Potato Soup)nism to keep track of the changes in the states of
the entities over the course of the procedure. Our
experimental analysis on visual reasoning tasks in
the RecipeQA dataset shows that the model signifi-
cantly improves the results of the previous models,
indicating that it better understands the procedural
text and the accompanying images. Additionally,
we carefully analyze our results and find that our
approach learns meaningful dynamic representa-
tions of entities without any entity-level supervi-
sion. Although we achieve state-of-the-art results
on RecipeQA, clearly there is still room for im-
provement compared to human performance. We
also believe that the PRN architecture will be of
value to other visual and textual sequential reason-
ing tasks.
Acknowledgements
We thank the anonymous reviewers and area chairs
for their invaluable feedback. This work was sup-
ported by TUBA GEBIP fellowship awarded to E.
Erdem; and by the MMVC project via an Institu-
tional Links grant (Project No. 217E054) under the
Newton-Katip C¸ elebi Fund partnership funded by
the Scientific and Technological Research Council
of Turkey (TUBITAK) and the British Council. We
also thank NVIDIA Corporation for the donation
of GPUs used in this research.
References
Trapit Bansal, Arvind Neelakantan, and Andrew Mc-
Callum. 2017. RelNet: End-to-End Modeling of En-
In NeurIPS Workshop on Auto-
tities & Relations.
mated Knowledge Base Construction (AKBC).
in procedural text: a challenge dataset and models
for process paragraph comprehension. In Proceed-
ings of the Conference of the North American Chap-
ter of the Association for Computational Linguistics:
Human Language Technologies.
Rajarshi Das, Tsendsuren Munkhdalai, Xingdi Yuan,
Adam Trischler, and Andrew McCallum. 2019.
Building Dynamic Knowledge Graphs from Text us-
ing Machine Reading Comprehension. In Proceed-
ings of the International Conference on Learning
Representations (ICLR).
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai
Li, and Li Fei-Fei. 2009. ImageNet: A Large-Scale
Hierarchical Image Database. In Proceedings of the
IEEE Conference on Computer Vision and Pattern
Recognition (CVPR), pages 248 -- 255.
Bhuwan Dhingra, Qiao Jin, Zhilin Yang, William W
Cohen, and Ruslan Salakhutdinov. 2018. Neural
Models for Reasoning over Multiple Mentions using
In Proceedings of the Conference of
Coreference.
the North American Chapter of the Association for
Computational Linguistics: Human Language Tech-
nologies (NAACL-HLT).
Xinya Du, Bhavana Dalvi Mishra, Niket Tandon, An-
toine Bosselut, Wen-tau Yih, Peter Clark, and Claire
Cardie. 2019. Be consistent! improving procedural
text comprehension using label consistency. In Pro-
ceedings of the Conference of the North American
Chapter of the Association for Computational Lin-
guistics: Human Language Technologies (NAACL-
HLT).
Matt Gardner, Joel Grus, Mark Neumann, Oyvind
Tafjord, Pradeep Dasigi, Nelson F. Liu, Matthew Pe-
ters, Michael Schmitz, and Luke Zettlemoyer. 2018.
AllenNLP: A deep semantic natural language pro-
In Proceedings of Workshop for
cessing platform.
NLP Open Source Software (NLP-OSS), pages 1 --
6, Melbourne, Australia. Association for Computa-
tional Linguistics.
Antoine Bosselut, Corin Ennis, Omer Levy, Ari Holtz-
man, Dieter Fox, and Yejin Choi. 2018. Simulat-
ing Action Dynamics with Neural Process Networks.
In Proceedings of the International Conference on
Learning Representations (ICLR).
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian
Sun. 2016. Deep Residual Rearning for Image
In Proceedings of the IEEE Confer-
Recognition.
ence on Computer Vision and Pattern Recognition,
pages 770 -- 778.
Danqi Chen, Jason Bolton, and Christopher D Man-
ning. 2016.
A Thorough examination of the
CNN/Daily Mail Reading Comprehension Task. In
Proceedings of the Annual Meeting of the Associ-
ation for Computational Linguistics (ACL), pages
2358 -- 2367.
Ronan Collobert, Jason Weston, L´eon Bottou, Michael
Karlen, Koray Kavukcuoglu, and Pavel Kuksa.
2011. Natural Language Processing (Almost) from
Journal of Machine Learning Research,
Scratch.
12:2493 -- 2537.
Mikael Henaff, Jason Weston, Arthur Szlam, Antoine
Bordes, and Yann LeCun. 2017. Tracking The
World State with Recurrent Entity Networks. In Pro-
ceedings of the International Conference on Learn-
ing Representations (ICLR).
Karl Moritz Hermann, Tomas Kocisky, Edward Grefen-
stette, Lasse Espeholt, Will Kay, Mustafa Suleyman,
and Phil Blunsom. 2015. Teaching Machines to
In Proceedings of the Ad-
Read and Comprehend.
vances in Neural Information Processing Systems
(NeurIPS), pages 1693 -- 1701.
Bhavana Dalvi, Lifu Huang, Niket Tandon, Wen-tau
Yih, and Peter Clark. 2018. Tracking state changes
Schmidhuber J. Hochreiter, S. 1997. Long Short-Term
Memory. Neural computation, 9(8):1735 -- 1780.
Mohit Iyyer, Varun Manjunatha, Anupam Guha, Yoga-
rshi Vyas, Jordan Boyd-Graber, Hal Daum´e III, and
Larry Davis. 2017. The amazing mysteries of the
gutter: Drawing inferences between panels in comic
book narratives. In Proceedings of the IEEE Confer-
ence on Computer Vision and Pattern Recognition
(CVPR).
Yangfeng Ji, Chenhao Tan, Sebastian Martschat, Yejin
Choi, and Noah A Smith. 2017. Dynamic Entity
Representations in Neural Language Models.
In
Proceedings of the Conference on Empirical Meth-
ods in Natural Language Processing (EMNLP).
Robin Jia and Percy Liang. 2017. Adversarial Ex-
amples for Evaluating Reading Comprehension Sys-
In Proceedings of the Conference on Em-
tems.
pirical Methods in Natural Language Processing
(EMNLP).
Samira Ebrahimi Kahou, Adam Atkinson, Vincent
Michalski, Akos Kadar, Adam Trischler, and Yoshua
FigureQA: An Annotated Figure
Bengio. 2017.
In Proceedings of
Dataset for Visual Reasoning.
the International Conference on Learning Represen-
tations Workshop (ICLR Workshop).
Aniruddha Kembhavi, Minjoon Seo, Dustin Schwenk,
Jonghyun Choi, Ali Farhadi, and Hannaneh Ha-
jishirzi. 2017. Are You Smarter Than A Sixth
Grader? Textbook Question Answering for Multi-
modal Machine Comprehension. In Proceedings of
the IEEE Conference on Computer Vision and Pat-
tern Recognition (CVPR).
Yoon Kim. 2014. Convolutional Neural Networks for
Sentence Classification. In Proceedings of the Con-
ference on Empirical Methods in Natural Language
Processing (EMNLP).
Javier Marin, Aritro Biswas, Ferda Ofli, Nicholas
Hynes, Amaia Salvador, Yusuf Aytar, Ingmar We-
ber, and Antonio Torralba. 2018. Recipe1M: A
Dataset for Learning Cross-Modal Embeddings for
Cooking Recipes and Food Images. arXiv preprint
arXiv:1810.06553.
Bryan McCann, Nitish Shirish Keskar, Caiming Xiong,
and Richard Socher. 2018. The natural language de-
cathlon: Multitask learning as question answering.
arXiv preprint arXiv:1806.08730.
Adam Paszke, Sam Gross, Soumith Chintala, Gregory
Chanan, Edward Yang, Zachary DeVito, Zeming
Lin, Alban Desmaison, Luca Antiga, and Adam
Lerer. 2017. Automatic Differentiation in pytorch.
In NIPS-W.
Jeffrey Pennington, Richard Socher, and Christopher
Manning. 2014. Glove: Global Vectors for Word
In Proceedings of the Conference
Representation.
on Empirical Methods in Natural Language Process-
ing (EMNLP), pages 1532 -- 1543.
Julien Perez and Fei Liu. 2017. Dialog state tracking,
a machine reading approach using memory network.
In Proceedings of the 15th Conference of the Euro-
pean Chapter of the Association for Computational
Linguistics: Volume 1, Long Papers, pages 305 -- 314.
Matthew Peters, Mark Neumann, Mohit Iyyer, Matt
Gardner, Christopher Clark, Kenton Lee, and Luke
Zettlemoyer. 2018. Deep contextualized word rep-
In Proceedings of the Conference of
resentations.
the North American Chapter of the Association for
Computational Linguistics: Human Language Tech-
nologies (NAACL-HLT), pages 2227 -- 2237.
Adam Santoro, Ryan Faulkner, David Raposo, Jack
Rae, Mike Chrzanowski, Theophane Weber, Daan
Wierstra, Oriol Vinyals, Razvan Pascanu, and Tim-
othy Lillicrap. 2018. Relational Recurrent Neural
Networks. In Proceedings of the Advances in Neural
Information Processing Systems (NeurIPS), pages
7299 -- 7310.
M. Schuster and K. K. Paliwal. 1997. Bidirectional re-
current neural networks. IEEE Transactions on Sig-
nal Processing, 45(11):2673 -- 2681.
Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and
Hannaneh Hajishirzi. 2017a. Bidirectional Atten-
tion Flow for Machine Comprehension. In Proceed-
ings of the International Conference on Learning
Representations (ICLR).
Minjoon Seo, Sewon Min, Ali Farhadi, and Hannaneh
Hajishirzi. 2017b. Query-Reduction Networks for
In Proceedings of the Inter-
Question Answering.
national Conference on Learning Representations
(ICLR).
R. K. Srivastava, K. Greff, and J. Schmidhuber. 2015.
Highway networks. In Proceedings of the Interna-
tional Conference on Machine Learning (ICML).
Sainbayar Sukhbaatar, Jason Weston, Rob Fergus, et al.
2015. End-To-End Memory Networks. In Proceed-
ings of the Advances in Neural Information Process-
ing Systems (NeurIPS), pages 2440 -- 2448.
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe,
Jon Shlens, and Zbigniew Wojna. 2016. Rethink-
ing the Inception Architecture for Computer Vision.
In Proceedings of the IEEE Conference on Com-
puter Vision and Pattern Recognition (CVPR), pages
2818 -- 2826.
Juan Pavez, Hector Allende, and Hector Allende-Cid.
2018. Working memory networks: Augmenting
memory networks with a relational reasoning mod-
In Proceedings of the Annual Meeting of the
ule.
Association for Computational Linguistics (ACL),
pages 1000 -- 1009.
Niket Tandon, Bhavana Dalvi, Joel Grus, Wen-tau Yih,
Antoine Bosselut, and Peter Clark. 2018. Reasoning
about actions and state changes by injecting com-
In Proceedings of the Con-
monsense knowledge.
ference on Empirical Methods in Natural Language
Processing (EMNLP).
Makarand Tapaswi, Yukun Zhu, Rainer Stiefelhagen,
Antonio Torralba, Raquel Urtasun, and Sanja Fidler.
2016. MovieQA: Understanding Stories in Movies
In Proceedings of
Through Question-Answering.
the IEEE Conference on Computer Vision and Pat-
tern Recognition (CVPR), pages 4631 -- 4640.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob
Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukasz
Kaiser, and Illia Polosukhin. 2017. Attention is all
you need. In Proceedings of the Advances in Neural
Information Processing Systems (NeurIPS), pages
5998 -- 6008.
Hai Wang, Takeshi Onishi, Kevin Gimpel, and David
McAllester. 2017. Emergent predication structure
in hidden state vectors of neural readers. In Proceed-
ings of the 2nd Workshop on Representation Learn-
ing for NLP, pages 26 -- 36, Vancouver, Canada. As-
sociation for Computational Linguistics.
Jason Weston, Antoine Bordes, Sumit Chopra, Alexan-
der M Rush, Bart van Merrienboer, Armand Joulin,
and Tomas Mikolov. 2016. Towards AI-Complete
Question Answering: A Set of Prerequisite Toy
Tasks. In Proceedings of the International Confer-
ence on Learning Representations (ICLR).
Jason Weston, Sumit Chopra, and Antoine Bordes.
In Proceedings of the
2015. Memory Networks.
International Conference on Learning Representa-
tions (ICLR).
Semih Yagcioglu, Aykut Erdem, Erkut Erdem, and Na-
zli Ikizler-Cinbis. 2018. RecipeQA: A Challenge
Dataset for Multimodal Comprehension of Cook-
In Proceedings of the Conference on
ing Recipes.
Empirical Methods in Natural Language Processing
(EMNLP).
Yummly. 2015. Kaggle Whats Cooking?
https:
//www.kaggle.com/c/whats-cooking/data.
[Accessed: 2018-05-31].
|
1906.03293 | 1 | 1906 | 2019-06-07T18:45:51 | Assessing incrementality in sequence-to-sequence models | [
"cs.CL",
"cs.LG"
] | Since their inception, encoder-decoder models have successfully been applied to a wide array of problems in computational linguistics. The most recent successes are predominantly due to the use of different variations of attention mechanisms, but their cognitive plausibility is questionable. In particular, because past representations can be revisited at any point in time, attention-centric methods seem to lack an incentive to build up incrementally more informative representations of incoming sentences. This way of processing stands in stark contrast with the way in which humans are believed to process language: continuously and rapidly integrating new information as it is encountered. In this work, we propose three novel metrics to assess the behavior of RNNs with and without an attention mechanism and identify key differences in the way the different model types process sentences. | cs.CL | cs | Assessing incrementality in sequence-to-sequence models
Dennis Ulmer
University of Amsterdam
Dieuwke Hupkes
ILLC, University of Amsterdam
Elia Bruni
Universitat Pompeu Fabra
[email protected]
[email protected]
[email protected]
9
1
0
2
n
u
J
7
]
L
C
.
s
c
[
1
v
3
9
2
3
0
.
6
0
9
1
:
v
i
X
r
a
Abstract
Since their inception, encoder-decoder models
have successfully been applied to a wide array
of problems in computational linguistics. The
most recent successes are predominantly due
to the use of different variations of attention
mechanisms, but their cognitive plausibility is
questionable. In particular, because past repre-
sentations can be revisited at any point in time,
attention-centric methods seem to lack an in-
centive to build up incrementally more infor-
mative representations of incoming sentences.
This way of processing stands in stark contrast
with the way in which humans are believed to
process language: continuously and rapidly in-
tegrating new information as it is encountered.
In this work, we propose three novel metrics to
assess the behavior of RNNs with and without
an attention mechanism and identify key dif-
ferences in the way the different model types
process sentences.
Introduction
1
Incrementality -- that is, building up representa-
tions "as rapidly as possible as the input is encoun-
tered" (Christiansen and Chater, 2016) -- is con-
sidered one of the key ingredients for humans to
process language efficiently and effectively.
Christiansen and Chater (2016) conjecture how
this trait is realized in human cognition by iden-
tifying several components which either make up
or are implications of their hypothesized Now-
or-Never bottleneck, a set of fundamental con-
straints on human language processing, which in-
clude a limited amount of available memory and
time pressure. First of all, one of the implications
of the now-or-never bottleneck is anticipation, im-
plemented by a mechanism called predictive pro-
cessing. As humans have to process sequences of
inputs fast, they already try to anticipate the next
element before it is being uttered. This is hypoth-
esized to be the reason why people struggle with
so-called garden path sentences like "The horse
race past the barn fell", where the last word en-
countered, "fell", goes against the representation
of the sentence built up until this point. Secondly,
another strategy being employed by humans in
processing language seems to be eager process-
ing: the cognitive system encodes new input into
"rich" representations as fast as possible. These
are build up in chunks and then processed into
more and more abstract representations, an oper-
ation Christiansen and Chater (2016) call Chunk-
and-pass processing.
In this paper, we aim to gain a better insight
into the inner workings of recurrent models with
respect to incrementality while taking inspiration
from and drawing parallels to this psycholinguis-
tic perspective. To ensure a successful processing
of language, the human brain seems to be forced
to employ an encoding scheme that seems highly
reminiscent of the encoder in today's encoder-
decoder architectures. Here, we look at differ-
ences between a recurrent-based encoder-decoder
model with and without attention. We analyze the
two model variants when tasked with a navigation
instruction dataset designed to assess the compo-
sitional abilities of sequence-to-sequence models
(Lake and Baroni, 2018).
The key contributions of this work can be sum-
marized as follows:
• We introduce three new metrics for incre-
mentality that help to understand the way that
recurrent-based encoder-decoder models en-
code information;
• We conduct an in-depth analysis of how in-
crementally recurrent-based encoder-decoder
models with and without attention encode se-
quential information;
• We
confirm existing
intuitions
about
attention-based recurrent models but also
highlight some new aspects that explain their
superiority over most attention-less recurrent
models.
2 Related Work
Sequence-to-Sequence models that rely partly or
fully on attention have gained much popularity
in recent years (Bahdanau et al. (2015), Vaswani
et al. (2017)). Although this concept can be re-
lated to the prioritisation of information in the hu-
man visual cortex (Hassabis et al., 2017), it seems
contrary to the incremental processing of informa-
tion in a language context, as for instance recently
shown empirically for the understanding of con-
junctive generic sentences (Tessler et al., 2019).
In machine learning, the idea of incremental-
ity has already played a role in several problem
statements, such as inferring the tree structure of
a sentence (Jacob et al., 2018), parsing (Kohn and
Menzel, 2014), or in other problems that are nat-
urally equipped with time constraints like real-
time neural machine translation (Neubig et al.,
2017; Dalvi et al., 2018a), and speech recogni-
tion (Baumann et al., 2009; Jaitly et al., 2016;
Graves, 2012). Other approaches try to encourage
incremental behavior implictly by modifying the
model architecture or the training objective: Guan
et al. (2018) introduce an encoder with an incre-
mental self-attention scheme for story generation.
Wang (2019) try to encourage a more incremental
attention behaviour through masking for text-to-
speech, while Hupkes et al. (2019) guide attention
by penalizing deviation from a target pattern.
The significance of the encoding process in
sequence-to-sequence models has also been stud-
ied extensively by Conneau et al. (2018). Pro-
posals exploring how to improve the resulting
approaches include adding additional loss terms
(Serdyuk et al., 2018) or a second decoder (Jiang
and Bansal, 2018; Korrel et al., 2019).
3 Metrics
In this section, we present
three novel met-
rics called Diagnostic Classifier Accuracy (Sec-
tion 3.1), Integration Ratio (Section 3.2) and Rep-
resentational Similarity (Section 3.3) to assess the
ability of models to process information incremen-
tally. These metrics are later evaluated themselves
in Section 5.2 and differ from traditional ones used
to assess the incrementality of models, e.g. as the
ones summarized by Kohn and Menzel (2014), as
they focus on the role of the encoder in sequence-
to-sequence models.
It further should be noted
that the "optimal" score of these measures with re-
spect to downstream applications cannot defined
explicity; they rather serve as a mean to uncover
insights about the ways that attention changes a
model's behavior, which might aid the develop-
ment of new architectures.
3.1 Diagnostic Classifier Accuracy
Several works have utilized linear classifiers to
predict the existence of certain features in the hid-
den activations1 of deep neural networks (Hupkes
et al., 2018; Dalvi et al., 2018b; Conneau et al.,
2018). Here we follow the nomenclature of Hup-
kes et al. (2018) and call these models Diagnostic
Classifiers (DCs).
in(cid:80)T
We hypothesize that the hidden activations of
an incremental model contain more information
about previous tokens inside the sequence. This
is based on the assumption that attention-based
models have no incentive to encode inputs re-
currently, as previous representations can always
be revisited. To test this assumption, we train
a DC on every time step t > 1 in a sequence
t ∈ [1, . . . T ] to predict the k most frequently oc-
curing input tokens for all time steps t(cid:48) < t (see
Figure 1). For a sentence of length T , this results
t(cid:48)=t−1 k trained DCs. To then gener-
ate the corresponding training set for one of these
classifiers, all activations from the network on a
test set are extracted and the corresponding tokens
recorded. Next, all activations from time step t
are used as the training samples and all tokens to
generate binary labels based on whether the target
token xk occured on target time step t(cid:48). As these
data sets are highly unbalanced, class weights are
also computed and used during training.
(cid:80)t
t=2
Applying this metric to a model, the accuracies
of all classifiers after training are averaged on a
given test set, which we call Diagnostic Classi-
fier Accuracy (DC Accuracy). We can test this
way how much information about specific inputs
is lost and whether that even matters for success-
ful model performance, should it employ an en-
coding procedure of increasing abstraction like in
Chunk-and-pass processing. On the other hand,
one might assume that a more powerful model
1In this work, the terms hidden representation and hidden
activations are used synonymously.
In a more realistic setting, we can exploit this
thought experiment to quantify the amount of new
information that is integrated into the current hid-
den representation by subtracting this hypothetical
value from the actual value at timestep t:
∆xt = ht − fθ(xt,(cid:126)0)2,
(1)
where . . .2 denotes the l2-norm. Conversely,
we can quantify the amount of information that
was lost from previous hidden states with:
∆ht = ht − fθ((cid:126)0, ht−1)2.
(2)
In the case of the extreme attention-based model,
we would expect ∆xt = 0, as no information from
ht−1 has been used in the transformation of xt by
fθ. Likewise, the "ignorant" model would produce
a value of ∆ht = 0, as any new hidden represen-
tation completely originates from a transformation
of the previous one.
Using these two quanitities, we can formulate a
metric expressing the average ratio between them
throughout a sequence which we call Integration
Ratio:
φint =
1
T − 1
∆xt
∆ht
(3)
This metric provides an intuitive insight into the
(average) model behavior during the encoding
process: For φint < 1 it holds that ∆xt < ∆ht,
signifying that the model prefers to integrate new
information into the hidden state. Vice versa,
φint > 1 and therefore ∆xt > ∆ht implies a pref-
erence to maintain a representation of preceding
inputs, possibly at the cost of encoding the current
token xt in an incomplete manner.
To account for the fact that integrating new in-
formation is more important at the beginning of
a sequence -- as no inputs have been processed
yet -- and maintaining a representation of the sen-
tence is more plausile towards the end of a sen-
tence, we introduce two linear weighing terms
with α∆xt = T−t
T for ∆xt and
∆ht, respectively, which simplify to a single term
αt:
and α∆ht = t
T
T(cid:88)
t=2
T(cid:88)
T − t
∆xt
∆ht
,
(4)
∆xt
∆ht
=
1
Z
t
t=2
φint =
T(cid:88)
such that Z =(cid:80)T
1
Z
αt
t=2
where Z corresponds to a new normalizing factor
. It should be noted that
T−t
t
t=2
Figure 1: For the Diagnostic Classifier Accuracy, DCs
are trained on the hidden activations to predict previ-
ously occuring tokens. The accuracies are averaged and
potentially weighed by the distance between the hidden
activations used for training the occurrence of the token
to predict.
Figure 2: Illustration of a thought experiment about
(Left) The
two types of extreme recurrent models.
model completely ignores the current token and bases
its new hidden state entirely on the previous one.
(Right) The model forgets the whole history and just
encodes the current input.
might require to retain information about an input
even if the same occured several time steps ago.
To account for this fact, we introduce a modified
version of this metric called Weighed Diagnos-
tic Classifier Accuracy (Weighed DC Accuracy),
where we weigh the accuracy of a classifier based
on the distance t − t(cid:48).
Integration Ratio
3.2
Imagine an extreme attention-based model that
does not encode information recurrently but whose
hidden state ht is solely based on the current token
xt (see right half of Figure 2). If we formalize an
LSTM as a recurrent function fθ : Rn, Rm (cid:55)→ Rm
parameterized by weights θ that maps two con-
tinuous vector representations, in our case the n-
dimensional representation of the current token
xt ∈ Rn and the m-dimensional previous hidden
state representation ht−1 ∈ Rm to a new hidden
state ht ∈ Rm, we can formalize the mentioned
scenario as a recurrent function that completely ig-
nores the pevious hidden state, which we can de-
note using a zero-vector (cid:126)0 ∈ Rm: ht = fθ(xt,(cid:126)0).
the ideal score for this metric is unknown. The
motivation for this score merely lies in gaining in-
side into a model's behaviour, showing us whether
it engages in a similar kind of eager processing
while having to handle memory constraints (in this
case realized in the constant dimensionality of hid-
den representations) like in human cognition.
3.3 Representational Similarity
The sentences "I saw a cat" and "I saw a feline"
only differ in terms of word choice, but essen-
tially encode the same information. An incremen-
tal model, based on the Chunk-and-Pass process-
ing described by Christiansen and Chater (2016),
should arrive at the same or at least a similar, ab-
stract encoding of these phrases.2 While the exact
wording might be lost in the process, the infor-
mation encoded should still describe an encounter
with a feline creature. We therefore hypothesize
that an incremental model should map the hid-
den activations of similar sequences of tokens into
similar regions of the hidden activation space. To
test this assumption, we compare the representa-
tions produced by a model after encoding the same
sequence of tokens - or history - using their aver-
age pairwise distance based on a distance measure
like the l2 norm or cosine similarity. We call the
length of the history the order of the Representa-
tional Similarity.
To avoid models to score high on this model
metric by substituting most or all of a hidden rep-
resentation with an encoding of the current token,3
we only gather the hidden states for comparison
after encoding another, arbitrary token (see Fig-
ure 3). We can therefore interpret the score as the
ability to "remember" the same sequence of tokens
in the past through the encoding.
The procedure is repeated for the n most com-
mon histories of a specified order occuring in the
test corpus over all time steps and, to obtain the
final score, results are averaged.
4 Setup
We test our metric on two different architectures,
trained on the SCAN dataset proposed by Lake
and Baroni (2018). We explain both below.
2In fact, given that humans built up sentence representa-
tions in a compositional manner, the same should hold for
sentence pairs like "I saw a cat" and "A feline was observed
by me", which is beyond the limits of the metric proposed
here.
3∆xt = 0 in the framework introduced in the previous
Section 3.2.
Figure 3: Representational Similarity measures the av-
erage pair-wise distance of hidden representations after
encoding the same subsquence of tokens (in this case
the history is only of first order, i.e. x2) as well as one
arbitrary token x3.
It
(2018):
4.1 Data
We use the SCAN data set proposed by Lake
and Baroni
is a simplified ver-
sion of the CommAI Navigation task, where
the objective is to translate an order in natu-
ral language into a sequence of machine-readable
commands, e.g.
"jump thrice and look" into
I_JUMP I_JUMP I_JUMP I_LOOK. We fo-
cus on the add_prim_jump_split (Loula
et al., 2018), where the model has to learn to
generalize from seeing a command like jump
only in primitive forms (i.e. by itself) to see-
ing it in composite forms during test time (e.g.
jump twice), where the remainder of the com-
posite forms has been encountered in the context
of other primitive commands during training.
The SCAN dataset has been proposed to assess
the compositional abilities of a model, which we
believe to be deeply related with the concept of
incrementality, which is the target of our research.
4.2 Models
two seasoned architectures used in
We test
sequence processing,
namely a Long-Short
Term Memory (LSTM) network (Hochreiter and
Schmidhuber, 1997) and an LSTM network with
attention (Bahdanau et al., 2015). The attention
mechanism creates a time-dependent context
vector ci for every decoder time step i that is used
together with the previous decoder hidden state.
This vector is a weighted average of the output
of the encoder, where the weights are calculated
based on some sort of similarity measure. More
specifically, we first calculate the energy eit
between the last decoder hidden state si−1 and
any encoder hidden state ht using some function
a(·)
eit = a(si−1, ht)
(5)
We then normalize the energies using the softmax
function and use the normalised attention weights
αit to create the context vector ct:
T(cid:88)
ci =
αitht
(6)
t=1
In this work, we use a simple attention function,
namely a dot product adot:
adot(si−1, ht) = sT
i−1ht,
(7)
matching the setup originally introduced by Bah-
danau et al. (2015).
4.3 Training
For both architectures, we train 15 single-layer
uni-directional models, with an embedding and
hidden layer size of 128. We use the same hyper-
parameters for both architectures, to ensure com-
patibility. More specifically, both models were
trained for 50 epochs using the Adam optimizer
(Kingma and Ba, 2015) with the AMSgrad cor-
rection (Reddi et al., 2018) and a learning rate of
0.001 and a batch size of 128.
5 Results
We compute metric values for all 30 models (15
per architecture) that resulted from the training
procedure described above.4 We plot the metric
values, averaged over all runs for both models, in
Figure 4. For the representational similarity score,
we use all instances of the n = 5 most frequently
occuring histories of length 2 at all available time
steps. The unweighted DC accuracies are not de-
picted, as they do not differ substantially from
their weighted counter part, for which we also try
to detect the k = 5 most frequently occuring in-
puts at every time step.
5.1 Metric scores
As expected, the standard attention model signif-
icantly outperforms the vanilla model in terms of
4The code used in this work is available online un-
https://github.com/i-machine-think/
der
incremental_encoding.
Figure 4: Results on SCAN add prim left with
n = 15. Abbreviations stand for sequence accuracy,
weighed diagnostic classifier accuracy, integration ratio
and representational similarity, respectively. All differ-
ences are statistically significant (using a Student's t-
test with p = 0.05).
sequence accuracy. Surprisingly, both models per-
form very similarly in terms of weighed DC accu-
racy. While one possible conclusion is that both
models display a similar ability to store informa-
tion about past tokens, we instead hypothesize that
this can be explained by the fact that all sequences
in our test set are fairly short (6.8 tokens on aver-
age). Therefore, it is easy for both models to store
information about tokens over the entire length
of the input even under the constrained capacity
of the hidden representations. Bigger differences
might be observed on corpora that contain longer
sequences.
From the integration ratio scores (last column
in Figure 4), it seems that, while both models pre-
fer to maintain a history of previous tokens, the
attention-based model contains a certain bias to
add new information about the current input to-
ken. This supports our suspicion that this model
is less incentivized to build up expressive repre-
sentations over entire sequences, as the encoder
representation can always be revisited later via
the attention mechanism. Counterintuitively and
perhaps surprisingly, it appears that the attention
model produces representations that are more sim-
ilar than the vanilla model, judging from the rep-
resentational similarity score. To decode success-
fully, the vanilla model has to include information
about the entire input sequence in the last encoder
hidden state, making the encodings of similar sub-
sequences more distinct because of their different
prefixes.5 In contrast, the representations of the at-
5Remember that to obtain these scores, identical subse-
quences of only length 2 were considered.
vious tokens and the weighed DC accuracy suf-
fers. Therefore, as the attention model performs
better in terms of sequence accuracy, a negative
correlation score is observed. The same trend can
be observed for the sequence accuracy - integra-
tion ratio pair, where the better performance of the
attention model creates a significant negative cor-
relation.
The last noteworthy observation can be found
looking at the high positive correlation between
the weighed DC accuracy and representational
similarity, which follows from the line of thought
in Section 5.1: As the vanilla model has to squeeze
information about the whole history into the hid-
den representation at every time step, encodings
for a shorter subsequence become more distinct,
while the attention model only encodes the few
most recent inputs and are therefore able to pro-
duce more homogenous representations.
5.3 Qualitative Analysis
We scrutinize the models' behavior when process-
ing the same sequence by recording the integration
ratio per time step and contrasting them in plots,
which are shown in Figure 6. Figure 6a and 6b
are thereby indicative of a trend which further
reinforces our hypothesis about the behavior of
attention-based models: As the orange curve lies
below the vanilla model's blue curve in the major-
ity of cases, we can even infer on a case by case ba-
sis that these models tend to integrate more infor-
mation at every time step than a vanilla LSTM. In-
terestingly, these distinct behaviors when process-
ing information do not always lead to the models
finding different solutions. In Figure 6 however,
we present three error cases in which the models'
results do diverge.
In Figure 6a, we can see that the vanilla model
decodes a second and redundant TURN-LEFT in
the beginning of the sequence. Although this hap-
pens right at the start, the corresponding part in
the input sequence is actually encountered right
at the end of the encoding process in the form of
"turn left", where "after" in front of it constitutes
an inversion of the sequence of operations. There-
fore, when the vanilla model starts decoding based
on the last encoder hidden state, "left" is actually
the most recently encoded token. We might as-
sume that, due to this reason, the vanilla model
might contain some sort of recency bias, which
seems to corrupt some count information and leads
Figure 5: Correlations between metrics as heatmap of
Pearson's rho values. 1 indicates a strong positive cor-
relation, −1 a negative one. Abbreviations correspond
to the same metrics as in Figure 4. Best viewed in color.
tention model is able to only contain information
about the most recent tokens, exclusively encoding
the current input at a given time step in the extreme
case, as the attention mechanism can select the re-
quired representations on demand. These results
will be revisited in more detail in section 5.3.
5.2 Metrics Comparison
To further understand the salience of our new met-
rics, we use Pearson's correlation coefficient to
show their correlation with each other and with se-
quence accuracy. A heat map showing Pearson's
ρ values between all metric pairs is given in Fig-
ure 5.
We can observe that representational similar-
ity and weighed DC accuracy display a substan-
tial negative correlation with sequence accuracy.
In the first case, this implies that the more simi-
lar representations of the same subsequences pro-
duced by the model's encoder are, the better the
model itself performs later.6 Surprisingly, we can
infer from the latter case that storing more infor-
mation about the previous inputs does not lead to
better performance. At this point we should dis-
entangle correlation from causation, as it is to be
assumed that our hypothesis about the attention
mechanism applies here as well: The attention is
always able to revisit the encodings later during
the decoding process, thus a hidden representation
does not need to contain information about all pre-
6The representational similarity score actually expresses
a degree of dissimilarity, i.e. a lower score results from more
similar representations, therefore we identify a negative cor-
relation here.
to a duplicate in the output sequence. The atten-
tion model seems to be able to avoid this issue
by erasing a lot of its prior encoded information
when processing "after", as signified by the drop
in the graph. Afterwards, only very little informa-
tion seems to be integrated by the model.
The vanilla model commits a slightly different
error in Figure 6b: After both models decode three
TURN-LEFT correctly, it choses to decode "oppo-
site" as TURN-LEFT TURN-RIGHT in contrast to
the corect TURN-RIGHT TURN-RIGHT supplied
by the attention model. It is to be assumed here
that the last half of the input, "turn left thrice" had
the vanilla model overwrite some critical informa-
tion about the initial command. Again, the atten-
tion model is able to evade this problem by eras-
ing a lot of its representation when encoding "af-
ter" and can achieve a correct decoding this critical
part by attending to the representation produced at
"right" later. "turn left thrice" can followingly be
encoded without having to loose any past informa-
tion.
Lastly, we want to shed some light on one of
the rare failure cases of the attention model, as
given in Figure 6c. Both models display very sim-
ilar behavior when encoding this trivial sequence,
yet only the vanilla model is able to decode it cor-
rectly. A possible reason for this could be found
in the model's energy function: When deciding
which encoded input to attend to for the next de-
coding step, the model scores potential candidates
based on the last decoder hidden state (see eq. 7),
which was decoded as TURN-LEFT. Therefore
the most similar inputs token might appear to be
TURN-LEFT as well. Notwithstanding this expla-
nation, it falls short of giving a conclusive reason
why the model does not err in similar ways in other
examples.
Looking at all three examples, it should further-
more be noted that the encoder of the attention
model seems to anticipate the mechanism's behav-
ior and learns to erase much of its representation
after encoding one contiguous chunk of informa-
tion, as exemplified by the low integration ratio
after finishing the first block of commands in an
input sequence. This freedom seems to enable the
encoder to come up with more homogenous rep-
resentations, i.e.
that no information has to be
overwritten and possibly being corrupted to pro-
cess later, less related inputs, which also explains
the lower representational similarity score in 5.1.
(a) The vanilla model adds a redundant TURN-LEFT in the
beginning.
(b) The vanilla model confuses left and right when decoding
opposite.
(c) The attention model fails on a trivial sequence.
Figure 6: Qualitative analysis about the models' en-
coding behavior. Bounds show the standard deviation
of integration ratio scores per time step. Decoded sen-
tences are produced by having each model decode the
sequence individually and then consolidating the solu-
tion via a majority vote. Resulting sequences have been
slightly simplified for readability. Best viewed in color.
6 Conclusion
In this work, we introduced three novel metrics
that try to shine a light on the incremental abilities
of the encoder in a sequence-to-sequence model
and tested them on a LSTM-RNN with and with-
out an attention mechanism. We showed how
these metrics relate to each other and how they
can be employed to better understand the encod-
ing behavior of models and how these difference
lead to performance improvements in the case of
the attention-based model.
We confirm the general intuition that using an
attention mechanism, due to its ability to oper-
ate on the whole encoded input sequence, prefers
to integrate new information about the current to-
ken and is less pressured to maintain a represen-
tation for the whole input sequence, which seems
to lead to some corruptions of the encoded infor-
mation in case of the vanilla model. Moreover,
our qualitative analysis suggests that the encoder
of the attention model learns to chunk parts of the
input sequence into salient blocks, a behavior that
is reminiscent of the Chunk-and-Pass processing
described by Christiansen and Chater (2016) and
one component that is hypothesized to enable in-
cremental processing in humans. In this way, the
attention model most surprisingly seems to dis-
play a more incremental way of processing than
the vanilla model.
These results open up several lines of future re-
search: Although we tried to assess incremental-
ity in sequence-to-sequence models in a quantita-
tive manner, the notion of incremental processing
lacks a formal definition within this framework.
Thus, such definition could help to confirm our
findings and aid in developing more incremental
architectures. It furthermore appears consequen-
tial to extend this methodology to deeper models
and other RNN-variants as well as other data sets
in order to confirm this work's findings.
Although we were possibly able to identify one
of the components that build the foundation of
human language processing (as defined by Chris-
tiansen and Chater, 2016) in attention models,
more work needs to be done to understand how
these dynamics play out in models that solely rely
on attention like the Transformer (Vaswani et al.,
2017) and how the remaining components could
be realized in future models.
Based on these reflections, future work should
attack this problem from a solid foundation: A
formalization of incrementality in the context of
sequence-to-sequence modelling could help to de-
velop more expressive metrics. These metrics in
turn could then be used to assess possible incre-
mental models in a more unbiased way. Further
thought should also be given to a fairer compari-
son of candidate models to existing baselines: The
attention mechanism by Bahdanau et al. (2015)
and models like the Transformer operate without
the temporal and memory pressure that is claimed
to fundamentally shape human cognition Chris-
tiansen and Chater (2016). Controlling for this
factor, it can be better judged whether incremental
processing has a positive impact on the model's
performance. We hope that these steps will lead
to encoders that create richer representations that
can followingly be used back in regular sequence-
to-sequence modelling tasks.
Acknowledgements
DH is funded by the Netherlands Organization
for Scientific Research (NWO), through a Gravi-
tation Grant 024.001.006 to the Language in In-
teraction Consortium. EB is funded by the Euro-
pean Union's Horizon 2020 research and innova-
tion program under the Marie Sklodowska-Curie
grant agreement No 790369 (MAGIC).
References
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben-
gio. 2015. Neural machine translation by jointly
In 3rd Inter-
learning to align and translate.
national Conference on Learning Representations,
ICLR 2015, San Diego, CA, USA, May 7-9, 2015,
Conference Track Proceedings.
Timo Baumann, Michaela Atterer,
and David
Schlangen. 2009. Assessing and improving the
performance of speech recognition for incremental
In Proceedings of Human Language
systems.
Technologies: The 2009 Annual Conference of
the North American Chapter of
the Association
for Computational Linguistics, pages 380 -- 388.
Association for Computational Linguistics.
Morten H Christiansen and Nick Chater. 2016. The
now-or-never bottleneck: A fundamental constraint
on language. Behavioral and Brain Sciences, 39.
Alexis Conneau, Germ´an Kruszewski, Guillaume
Lample, Loıc Barrault, and Marco Baroni. 2018.
What you can cram into a single \$&!#* vector:
Probing sentence embeddings for linguistic proper-
ties. In Proceedings of the 56th Annual Meeting of
the Association for Computational Linguistics, ACL
2018, Melbourne, Australia, July 15-20, 2018, Vol-
ume 1: Long Papers, pages 2126 -- 2136.
Fahim Dalvi, Nadir Durrani, Hassan Sajjad, and
Stephan Vogel. 2018a.
Incremental decoding and
training methods for simultaneous translation in
In Proceedings of the
neural machine translation.
2018 Conference of the North American Chapter of
the Association for Computational Linguistics: Hu-
man Language Technologies, NAACL-HLT, New Or-
leans, Louisiana, USA, June 1-6, 2018, Volume 2
(Short Papers), pages 493 -- 499.
Fahim Dalvi, Nadir Durrani, Hassan Sajjad, and
Stephan Vogel. 2018b.
Incremental decoding and
training methods for simultaneous translation in
In Proceedings of the
neural machine translation.
2018 Conference of the North American Chapter of
the Association for Computational Linguistics: Hu-
man Language Technologies, NAACL-HLT, New Or-
leans, Louisiana, USA, June 1-6, 2018, Volume 2
(Short Papers), pages 493 -- 499.
Alex Graves. 2012. Sequence transduction with recur-
rent neural networks. CoRR, abs/1211.3711.
Jian Guan, Yansen Wang, and Minlie Huang. 2018.
Story ending generation with incremental en-
CoRR,
coding and commonsense knowledge.
abs/1808.10113.
Demis Hassabis, Dharshan Kumaran, Christopher
Summerfield,
and Matthew Botvinick. 2017.
Neuroscience-inspired artificial intelligence. Neu-
ron, 95(2):245 -- 258.
Sepp Hochreiter and Jurgen Schmidhuber. 1997.
Neural computation,
Long short-term memory.
9(8):1735 -- 1780.
Dieuwke Hupkes, Anand Singh, Kris Korrel, Germ´an
Kruszewski, and Elia Bruni. 2019. Learning com-
In CI-
positionally through attentive guidance.
CLing: International Conference on Computational
Linguistics and Intelligent Text Processing.
Dieuwke Hupkes, Sara Veldhoen,
and Willem
Zuidema. 2018. Visualisation and'diagnostic classi-
fiers' reveal how recurrent and recursive neural net-
works process hierarchical structure. Journal of Ar-
tificial Intelligence Research, 61:907 -- 926.
Athul Paul Jacob, Zhouhan Lin, Alessandro Sordoni,
and Yoshua Bengio. 2018.
Learning hierarchi-
cal structures on-the-fly with a recurrent-recursive
model for sequences. In Proceedings of The Third
Workshop on Representation Learning for NLP,
pages 154 -- 158.
Navdeep Jaitly, Quoc V Le, Oriol Vinyals,
Ilya
Sutskever, David Sussillo, and Samy Bengio. 2016.
An online sequence-to-sequence model using partial
In Advances in Neural Information
conditioning.
Processing Systems, pages 5067 -- 5075.
Yichen Jiang and Mohit Bansal. 2018. Closed-book
training to improve summarization encoder mem-
ory. In Proceedings of the 2018 Conference on Em-
pirical Methods in Natural Language Processing,
Brussels, Belgium, October 31 - November 4, 2018,
pages 4067 -- 4077.
Diederik P. Kingma and Jimmy Ba. 2015. Adam: A
In 3rd Inter-
method for stochastic optimization.
national Conference on Learning Representations,
ICLR 2015, San Diego, CA, USA, May 7-9, 2015,
Conference Track Proceedings.
Arne Kohn and Wolfgang Menzel. 2014.
Incremen-
tal predictive parsing with turboparser. In Proceed-
ings of the 52nd Annual Meeting of the Association
for Computational Linguistics (Volume 2: Short Pa-
pers), volume 2, pages 803 -- 808.
Kris Korrel, Dieuwke Hupkes, Verna Dankers, and
Elia Bruni. 2019. Transcoding compositionally: us-
ing attention to find more generalizable solutions.
BlackboxNLP 2019, ACL.
Brenden Lake and Marco Baroni. 2018. Generalization
without systematicity: On the compositional skills
of sequence-to-sequence recurrent networks. In In-
ternational Conference on Machine Learning, pages
2879 -- 2888.
Joao Loula, Marco Baroni, and Brenden M Lake.
2018. Rearranging the familiar: Testing composi-
tional generalization in recurrent networks. arXiv
preprint arXiv:1807.07545.
Graham Neubig, Kyunghyun Cho, Jiatao Gu, and Vic-
tor O. K. Li. 2017. Learning to translate in real-
In Proceed-
time with neural machine translation.
ings of the 15th Conference of the European Chap-
ter of the Association for Computational Linguistics,
EACL 2017, Valencia, Spain, April 3-7, 2017, Vol-
ume 1: Long Papers, pages 1053 -- 1062.
Sashank J Reddi, Satyen Kale, and Sanjiv Kumar.
2018. On the convergence of adam and beyond.
Dmitriy Serdyuk, Nan Rosemary Ke, Alessandro Sor-
doni, Adam Trischler, Chris Pal, and Yoshua Ben-
gio. 2018. Twin networks: Matching the future for
In 6th International Confer-
sequence generation.
ence on Learning Representations, ICLR 2018, Van-
couver, BC, Canada, April 30 - May 3, 2018, Con-
ference Track Proceedings.
Michael Henry Tessler, Karen Gu, and Roger Philip
Levy. 2019. Incremental understanding of conjunc-
tive generic sentences.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob
Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz
Kaiser, and Illia Polosukhin. 2017. Attention is all
you need. In Advances in Neural Information Pro-
cessing Systems, pages 5998 -- 6008.
Gary Wang. 2019. Deep text-to-speech system with
seq2seq model. CoRR, abs/1903.07398.
|
1912.01111 | 1 | 1912 | 2019-11-22T16:07:02 | Use of Artificial Intelligence to Analyse Risk in Legal Documents for a Better Decision Support | [
"cs.CL",
"cs.AI",
"cs.IR",
"cs.LG",
"cs.NE"
] | Assessing risk for voluminous legal documents such as request for proposal; contracts is tedious and error prone. We have developed "risk-o-meter", a framework, based on machine learning and natural language processing to review and assess risks of any legal document. Our framework uses Paragraph Vector, an unsupervised model to generate vector representation of text. This enables the framework to learn contextual relations of legal terms and generate sensible context aware embedding. The framework then feeds the vector space into a supervised classification algorithm to predict whether a paragraph belongs to a per-defined risk category or not. The framework thus extracts risk prone paragraphs. This technique efficiently overcomes the limitations of keyword-based search. We have achieved an accuracy of 91% for the risk category having the largest training dataset. This framework will help organizations optimize effort to identify risk from large document base with minimal human intervention and thus will help to have risk mitigated sustainable growth. Its machine learning capability makes it scalable to uncover relevant information from any type of document apart from legal documents, provided the library is per-populated and rich. | cs.CL | cs | Use of Artificial Intelligence to Analyse Risk in Legal
Documents for a Better Decision Support
Dipankar Chakrabarti
Senior Member, IEEE
PricewaterhouseCoopers Pvt Ltd.
Kolkata, India
[email protected]
Indranil Mitra
PricewaterhouseCoopers Pvt Ltd.
Kolkata, India
[email protected]
Nandini Roy
PricewaterhouseCoopers Pvt Ltd.
Kolkata, India
[email protected]
Neelam Patodia
PricewaterhouseCoopers Pvt Ltd.
Kolkata, India
[email protected]
Satyaki Roy
PricewaterhouseCoopers Pvt Ltd.
Kolkata, India
[email protected]
Prasun Nandy
PricewaterhouseCoopers Pvt Ltd.
Kolkata, India
[email protected]
Udayan Bhattacharya
PricewaterhouseCoopers Pvt Ltd.
Kolkata, India
[email protected]
Jayanta Mandi
PricewaterhouseCoopers Pvt Ltd.
Kolkata, India
[email protected]
Abstract -- Assessing risk for voluminous legal documents such
as request for proposal, contracts is tedious and error prone. We
have developed "risk-o-meter", a framework, based on machine
learning and natural language processing to review and assess
risks of any legal document. Our framework uses Paragraph
Vector, an unsupervised model to generate vector representation
of text. This enables the framework to learn contextual relations of
legal terms and generate sensible context aware embedding. The
framework then feeds the vector space into a supervised
classification algorithm to predict whether a paragraph belongs to
a pre-defined risk category or not. The framework thus extracts
risk prone paragraphs. This technique efficiently overcomes the
limitations of keyword based search. We have achieved an
accuracy of 91% for the risk category having the largest training
dataset. This framework will help organizations optimize effort to
identify risk from large document base with minimal human
intervention and thus will help to have risk mitigated sustainable
growth. Its machine learning capability makes it scalable to
uncover relevant information from any type of document apart
from legal documents, provided the library is pre-populated and
rich.
Keywords -- Machine Learning, Natural Language Processing,
Text Representation, Paragraph Vectors, Text Classification,
Support Vector Machines, Naïve Bayes, Contextual Relation,
Contract Analysis, Risk-o-Meter
I. INTRODUCTION
A contract between two parties defines the scope of work and
commercial business terms for performing such activities. It is
very important for any business organization to review the
contract and analyze risks, such as liability, indemnity, risk
purchase and other such commercial risks. Early identification
of risks help either to mitigate the risks or to take a decision of
entering
ratio.
Organizations traditionally rely upon manual reading by legal
professionals to assess risks emanating out of the documents.
The continued influx of legal paperwork demands more of the
into contract understanding
risk-reward
lawyer's time and knowledge/experience for review. This time
consuming, cost intensive and person dependent activity is
riddled with inefficiencies. Even after investing 11.2 hours per
week [1] in document creation and management, chances of
error still persist because of unidentified or misinterpreted risk
aspects, which could
interfere with an organization's
performance while increasing financial risk.
Thus there is an increased demand for intelligently
automating analysis of contracts and other legal documents and
to provide correct interpretation with minimum intervention of
human beings. This is far beyond a "contract management
system" which files and indexes electronic contracts/legal
documents. The focus of this paper is to propose a contract
analysis system efficient at identifying and highlighting
embedded risks in contracts or other legal documents.
Traditional keyword driven approach for contract risk
analysis does not capture the contextual understanding of
different clauses which limits its performance in the following
two ways: (1) identifying paragraphs which contain any of the
library keywords as risk prone, thus raising false alarms, (2)
understanding the risk significance of a keyword in context of
another keyword.
We have developed an effective and intelligent framework
named "risk-o-meter" based on machine learning (ML) and
natural language processing (NLP). Our framework dramatically
changes the way contractual risks are assessed by identifying
risk prone paragraphs and associating them to their predefined
risk categories like liability, indemnity, confidentiality and other
such commercial risks. It reduces manual effort and operational
time; increases consistency of outcomes; enhances precision in
risk identification and reduces chances of overlooking critical
information through manual fatigue or inexperience of reviewer.
It would thus help in creating a risk-aware environment for
sustainable growth of organizations.
Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference (Jeju, Korea, 28-31 October 2018)0683978-1-5386-5457-6/18/$31.00 ©2018 IEEEThe paper is organized as follows: work done in the field of
word embeddings is given in Section II. We then present the
building blocks of our "risk-o-meter" in Section III, and
particularly focus on the algorithms used for risk identification
in Section IV. Following that we present an experimental
comparison to assess most effective model for our task in
Section V. We provide future possibilities in Section VI and
conclusion in Section VII.
II. RELATED WORK
Vector space models have been used in distributional
semantics for quite some time. The term word embeddings was
coined by Bengio et al. [17]. Colbert and Weston et al. [16]
showed the utility of word embeddings and their usefulness for
downstream tasks such as parsing, tagging, named entity
recognition etc. Socher et.al [18] focused on distributed
representation of phrases and sentences by implementing
parsing techniques. Their method was supervised and required
labelled data.
The unsupervised word vector model proposed by Mikolov
et.al, 2013 [20] is an efficient method for learning high-quality
distributed vector representations that capture a large number of
precise syntactic and semantic word relationships. This model
was extended beyond word-level to achieve paragraph-level
representation. The framework proposed by Quoc Le and Tomas
Mikolov, 2014 [2] for text representation applies () in learning
vector representations from variable length pieces of text.
III. BUILDING BLOCKS OF RISK-O-METER
The objective of our framework "risk-o-meter" is to identify
risk prone paragraphs from legal documents that belong to a
predefined risk category. Risk categories are defined as liability,
confidentiality,
termination and others. The
categories can be modified/updated/added as needed. The
framework consists of four key blocks: (1) Training Data, (2)
Text Representation, (3) Text Classification, (4) Continuous
Learning (see Figure. 1).
indemnity,
A. Training Data
The training dataset is created by tagging such paragraphs
collated from contractual/legal documents to their respective risk
categories. The categories are generated by human annotators.
In case a paragraph belonged to more than one category, it is
recorded separately for all these categories. In our training
dataset, we consider all the risk prone paragraphs and their
associated categories uniformly. The quality and quantity of the
training data collated, has a significant
impact on the
performance of our framework. The specifics of this impact is
described in detail in Section V.
B. Text Representation
Text representation is used to convert text into a machine
readable format. In order to represent risk prone paragraphs, it is
essential to understand and capture the context in which the legal
terms are used i.e. their meaning. E.g. "The agency shall
indemnify the department against all third-party claims of
infringement of copyright, patent, trademark or industrial design
rights arising from use of the Goods or any part thereof in India".
In this example, indemnify used in the context of agency,
department, third party and infringement essentially qualifies as
risk.
The commonly used bag-of-words (BoW) model [2] and its
extension, term frequency-inverse document frequency model
(TF-IDF) [15], though quite simple and efficient cannot be used
in our case. It suffers from two main disadvantages: (1) it loses
the ordering of the words, as a result sentences having the same
words are represented in an identical manner, (2) it also ignores
the semantics of the words, meaning it does not take into
consideration the distance between words.
In our framework, we use Paragraph vectors proposed in [2]
for
learning high quality, continuous distributed vector
representations that capture a large number of precise syntactic
and semantic relationship between words and the topic of the
paragraph. This n-dimensional vector space is created for each
paragraph in the training dataset. After the training converges,
these feature vectors are used for calculating paragraph vectors
for the unseen documents. The specifics of this model is
described in detail in Section IV-A.
C. Text Classification
Vector representations from text representation module are
then fed to the text classification module to predict whether a
paragraph belongs to a particular risk category or not. While
cosine similarity measures are helpful in predicting the
categories; in this paper, we implement supervised learning
techniques, namely: Support Vector Machines and Naïve Bayes,
to further train the system to predict better. The probability
values generated post classification for unseen documents depict
the likelihood of the paragraph being associated with the
concerned risk category. Both these models are effective in
handling high dimensional vector spaces and have been detailed
in Section IV-B.
Fig.1. Process flow diagram for our AI enabled framework, "risk-o-meter"
D. Continuous Learning
Our framework has an integrated feedback loop which
records review responses in the form of acceptance or rejection
for all the identified paragraphs for a given risk category and
appends them to the training data. Unidentified clauses can be
manually added to the training data. This updated training data
is later used to retrain the models. This way the machine learns
continuously and performs better.
IV. SPECIFICATIONS OF RISK IDENTIFICATION
In this section we will detail the algorithm behind Paragraph
Vectors and classification techniques: Support Vector Machines
Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference (Jeju, Korea, 28-31 October 2018)0684and Naïve Bayes, as well as define their corresponding
performance metrics.
A. Paragraph Vectors
Paragraph vector, an unsupervised neural network model
generates sensible context aware word embedding for input
sentences of variable length [2]. It has only one hidden layer. It
does not rely upon parse trees. It is an extension of the word
vector model [20].
In the word vector model, only words are considered as input
nodes. However, in Paragraph vector, each paragraph id also acts
as an input node and is mapped to a unique vector. We have
assigned a unique label or paragraph id for each paragraph as the
meaning of the paragraphs vary even if they belong to the same
category. The paragraph vector (D) along with word vector (W)
is considered as a member of the context set. The context is
sampled from a sliding window of fixed length over the
paragraph. The context window considers words to the left and
right of the target word. While the paragraph vector is shared
only across the context from the same paragraph, the word
vectors are universally shared across all paragraphs [2]. The
concatenation or sum of the vectors (W and D) is then used to
predict the next word in the context.
task
learning
1) Hyperparameter selection: Building this network for a
given
involves selecting optimal hyper-
parameters. Hyper-parameter choice is also crucial for an
improved performance (both accuracy and speed). These are as
follows:
a) Choosing between the two neural networks based
models: Distributed memory (PV-DM) and Distributed bag of
words (PV-DBOW). Given a window of words {(cid:1875)(cid:2869), (cid:1875)(cid:2870), (cid:1875)(cid:2871),
(cid:1875)(cid:2872), (cid:1875)(cid:2873)}, the DM model predicts (cid:1875)(cid:2871) given the rest, while the
DBOW model predicts (cid:1875)(cid:2869), (cid:1875)(cid:2870), (cid:1875)(cid:2872), (cid:1875)(cid:2873) given (cid:1875)(cid:2871).
b) Choosing the algorithm for training the selected
model: hierarchical softmax (HS) and negative sampling
(NEG).
c) Dimensionality of the feature vectors.
d) Window size which determines the maximum distance
between the current and predicted word within a paragraph.
e) Minimum frequency so that all words lower than this
threshold is ignored.
f) Concatenation vs sum/average of context vectors.
g) Sample threshold so that high frequency words are
randomly down-sampled.
2) Training Procedure: The first task in building paragraph
vectors is determining the efficacy of the base architecture
against the training algorithms for the given dataset. We
evaluated the performance of both the models: PV-DM and PV-
DBOW as shown in Table 1. DM trained using negative
sampling outperforms the other combinations DBOW-HS,
DBOW-NEG and DM-HS at the task of identifying the risk
prone paragraphs. We thus opted for the DM model using
negative sampling to generate vector representations.
Risk
Method
Category
Termination DM-NEG
DM-HS
DBOW-
HS
DBOW-
NEG
Accuracy
Precision
Recall
74%
86%
96%
96%
84%
43%
59%
59%
F1-
score
79%
58%
73%
73%
87%
81%
87%
87%
TABLE I. END-TO-END PERFORMANCE COMPARISON AMONGST TRAINING
ARCHITECTURE AND ALGORITHM TO PREDICT THE RISK CATEGORY
(TERMINATION-HAVING MAXIMUM EXAMPLES IN THE TRAINING DATA).
INITIAL MODEL PARAMETERS: NEGATIVE SAMPLE (K) OF 5, SUBSAMPLING (T)
OF 10-6, CONTEXT WINDOW=5, VECTOR SIZE=300, SUPPORT VECTOR
MACHINES (SVM) LINEAR CLASSIFIER WITH C VALUE OF 1
average log probability, given by:
V ( T ⊂ V) whose size is V.
The objective of the PV-DM model is to maximize the
1(cid:1846)(cid:3533)log(cid:1868)((cid:1875)(cid:3047)(cid:1875)(cid:3047)(cid:2879)(cid:3041),…,(cid:1875)(cid:3047)(cid:2878)(cid:3041)
(cid:3021)(cid:2879)(cid:3041)
(cid:3047)(cid:2880)(cid:3041)
) (1)
where, (cid:1875)(cid:3047) represents the target word and (cid:1875)(cid:3047)(cid:2879)(cid:3041) to (cid:1875)(cid:3047)(cid:2878)(cid:3041)
represents the input context words ((cid:1875)(cid:3016)) with a window of n
words at each time step t. T represents the sequence of words (cid:1875)(cid:2869),
(cid:1875)(cid:2870),…, (cid:1875)(cid:3021) in the given training set that belong to a vocabulary
(cid:1868)((cid:1875)(cid:3010)(cid:1875)(cid:3016))=
(2)
where, (cid:1874)(cid:3050) and (cid:1874)(cid:4593)(cid:3050) are the input and output vector
representations of word w; (cid:1875)(cid:3010) represents the ith target word.
between (cid:1874)(cid:3050) and the output embedding (cid:1874)(cid:4593)(cid:3050) of every word (cid:1875)(cid:3036) in
(cid:1857)(cid:1876)(cid:1868)(cid:3435)(cid:1874)(cid:4593)(cid:3050)(cid:3258)(cid:3021)(cid:1874)(cid:3050)(cid:3264)(cid:3439)
(cid:1857)(cid:1876)(cid:1868)(cid:3435)(cid:1874)(cid:4593)(cid:3050)(cid:3284)(cid:3021)(cid:1874)(cid:3050)(cid:3264)(cid:3439)
(cid:3023)(cid:3050)(cid:3284)(cid:2880)(cid:2869)
Computing the softmax is expensive as the inner product
The softmax layer calculates this probability as:
the vocabulary V needs to be computed as part of the sum in the
denominator in order to obtain the normalized probability of the
target word given its context.
∑
(K) of
them and
Negative sampling on the other hand, is similar to stochastic
gradient descent: instead of changing all of the weights each time
with taking into account all of the thousands of observations,
we're using only sample
increasing
computational efficiency dramatically too [6]. The objective of
negative sampling for one observation is as follows:
(cid:1864)(cid:1867)(cid:1859)(cid:1868)((cid:1875)(cid:3010)(cid:1875)(cid:3016))=(cid:1864)(cid:1867)(cid:1859)(cid:2026)((cid:1874)(cid:4593)(cid:3050)(cid:3258)(cid:3021)(cid:1874)(cid:3050)(cid:3264))
+(cid:3533)(cid:1831)(cid:3050)(cid:3284)~(cid:3017)(cid:3289)((cid:3050)) [
(cid:1864)(cid:1867)(cid:1859) (cid:2026)(−(cid:1874)(cid:4593)(cid:3050)(cid:3284)(cid:3021)(cid:1874)(cid:3050)(cid:3264))] (3)
(cid:3012)
(cid:3036)(cid:2880)(cid:2869)
The noise distribution (cid:1842)(cid:3041)(w) is defined as the Unigram
(cid:1858)((cid:1875)(cid:3036))(cid:2871)(cid:2872)
(cid:1842)((cid:1875)(cid:3036))=
(4)
∑
(cid:3436)(cid:1858)((cid:1875)(cid:3036))(cid:2871)(cid:2872)(cid:3440)
(cid:3041)(cid:3037)(cid:2880)(cid:2868)
distribution raised to the power of ¾.
Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference (Jeju, Korea, 28-31 October 2018)0685TABLE IV. END-TO-END PERFORMANCE COMPARISON OF PREDICTING THE
RISK CATEGORY (TERMINATION) FOR VARYING CONTEXT WINDOW SIZE. THE
ADDITIONAL MODEL PARAMETERS: K=10, T=10-6, VECTOR SIZE=300, SVM
LINEAR CLASSIFIER C-VALUE=1
Risk Category
and Method
Window
Size
Accuracy Precision Recall
Termination
with DM-NEG
5
8
10
88%
88%
90%
76%
77%
82%
86%
84%
84%
F1-
score
81%
80%
83%
TABLE V. END-TO-END PERFORMANCE COMPARISON OF PREDICTING THE
RISK CATEGORY (TERMINATION) FOR VARYING VECTOR SIZE. THE
ADDITIONAL MODEL PARAMETERS: K=10, T=10-6, CONTEXT SIZE=10, SVM
LINEAR CLASSIFIER C-VALUE=1
Vector Size
Accuracy Precision Recall
F1-
score
Risk
Category
and
Method
Termination
with DM-
NEG
100
200
300
92%
91%
90%
90%
89%
82%
82%
77%
84%
86%
83%
83%
This neural network based vector model is trained using
stochastic gradient descent where the gradient is obtained via
backpropagation.
TABLE VI. 5 MOST SIMILAR WORDS ASSOCIATED WITH THE TARGET WORD
where, 3/4 is the empirical value suggested in [2]; f(w) is the
frequency of the word in the corpus.
TABLE II. END-TO-END PERFORMANCE COMPARISON OF PREDICTING THE
RISK CATEGORY (TERMINATION) FOR VARYING VALUES OF K. THE
ADDITIONAL MODEL PARAMETERS: SUBSAMPLING OF 10-6, CONTEXT
WINDOW=5, VECTOR SIZE=300, SVM LINEAR CLASSIFIER WITH C VALUE OF 1
Accuracy
Precision Recall
Risk Category
and Method
Termination
with DM-NEG
No. of
samples
K
5
10
15
20
87%
88%
86%
85%
74%
76%
72%
70%
84%
86%
86%
86%
F1-
score
79%
81%
78%
78%
Our experimental results (Table II) indicate that while
Negative Sampling achieves a respectable accuracy even with
K = 5, using K = 10 achieves considerably better performance
with an accuracy of 88% and F1-score of 81%.
TABLE III. END-TO-END PERFORMANCE COMPARISON OF PREDICTING THE
RISK CATEGORY (TERMINATION) FOR VARYING SUBSAMPLING THRESHOLDS.
THE ADDITIONAL MODEL PARAMETERS: CONTEXT WINDOW=5, VECTOR
SIZE=300, SVM LINEAR CLASSIFIER WITH C VALUE OF 1
Risk
Category
and
Method
Termination
with DM-
NEG
(k=10)
Subsampling
Threshold
(T)
0
10-5
10-6
Accuracy
Precision Recall
F1-
score
71%
89%
88%
-
86%
76%
0%
73%
-
79%
86%
81%
Subsampling has also been used to counter the balance
between rare and frequent words. Words like "is", "an", "the"
and such similar stop words occur innumerable times in the
dataset and do not provide valuable information as compared to
the rare words. The vector representations of frequent words
remain almost constant after training on several examples. E.g.
Co-occurrences of "Limitation" and "Liability" hold much
more significance than "The" and "Liability", as mostly all
words in a paragraph co-occur with such words. Thus words
whose frequency, (cid:1858)((cid:1875)(cid:3036)) is greater than the threshold, T, is
(cid:1842)((cid:1875)(cid:3036))=1−(cid:3496) (cid:1846)(cid:1858)((cid:1875)(cid:3036)) (5)
subsampled using the given equation:
As depicted in Table III, subsampling significantly improves
the performance of our framework and a threshold value of
10-6 is optimal for our case. It also improves the training speed
by nearly 8 times (for our training dataset).
The context window and vector size also play a significant
role in the model's performance. Context window of 10 (Table
IV) and vector size of 100 (Table V) are optimal for our case.
We ignored all words from the corpus which had a frequency
lesser than 5. In our paper, we have used concatenation to
combine the two vectors as it keeps the ordering information
intact.
Target Word
Lower Case
Termination
Indemnity
Insurance
notice
contract
order
date
than
infringements
damages
alleged
losses
claims
agrees
secure
contribution
employee's
place
Without Case
Conversions
contract
prejudice
written
notice
whole
Trademark
alleged
attorney's
nature
suits
coverage
taken
commencing
policies
place
Once the optimal hyper-parameters are selected, we also
qualitatively evaluate these word embeddings by inspecting
manually the five most similar words (by cosine similarity) [19]
to a given set of target words. We compare the results across two
cases: converting all words to lower cases and without making
any case conversions. It is evident from Table VI that PV-DM
model finds words that associate with the target word (domain
aspect). It also depicts that paragraph vector model draws out
almost similar logical associations for the both the cases. We
also compared their end to end results and found that they were
similar to Table V for vector size 100. We prefer to adopt the
lower case model as it is more robust.
3) Inference: After the training converges, these feature
vectors are used for calculating paragraph vectors for the unseen
documents, where-in all weights are fixed. We retrain the model
with words present in the unseen documents, but it does not
impact the members in the context set.
Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference (Jeju, Korea, 28-31 October 2018)0686B. Classification techniques
We opted for implementing both Support Vector Machines
(SVM) and Naïve Bayes (NB) to classify the vector space based
on their risk categories. As discussed earlier, these two
techniques are chosen as they are efficient in handling high
dimensions. We built individual classifiers for each of the
predefined risk categories and compared their performance
across both the classifier algorithms. The feature vectors are
normalized before implementing classification algorithms to
enable better projection. We built four types of classifier
models: (1) SVM with Linear kernel, (2) SVM with Radial
Basis Function (RBF) kernel, (3) Gaussian NB, (4) Bernoulli
NB. Our results show that Support Vector Machines with linear
kernel outperformed all other classifier models across all
parameters (Table VII). The details of both the algorithms are
as follows (for further details, refer [9, 13]):
TABLE VII. COMPARING THE PERFORMANCE OF VARIOUS CLASSIFIERS TO
PREDICT THE RISK CATEGORY (TERMINATION) WHOSE VECTOR SPACE IS BUILT
USING DM-NEG WITH K=10, T=10-6, CONTEXT WINDOW=10 AND VECTOR
SIZE=100
Classifier
Method
SVM-Linear
SVM-Radial
Basis Function
NB-Gaussian
NB-Bernoulli
AUC Accuracy Precision Recall
0.96
0.96
0.75
0.94
92%
71%
75%
89%
-
90%
65%
83%
82%
0%
34%
80%
F1-
score
86%
-
45%
81%
1) Support Vector Machines: SVM are based on the
concept of decision planes that define decision boundaries. In the
case of n dimensional space of input variables, a hyperplane
splits positive and negative sets of examples, with maximal
margin. C-value, a regularization parameter affects the number
of instances that fall within the margin and influences the
number of support vectors used by the model [9]. A large value
of C permits more violations of the hyper plane and results in
lesser sensitivity and higher bias. We cross-validated our model
at different C-values as depicted in Table VIII.
Category
Termination
TABLE VIII. COMPARING THE PERFORMANCE OF SVM-LINEAR CLASSIFIER
TO PREDICT THE RISK CATEGORIES BY ADJUSTING DIFFERENT C VALUES
F1-
score
Precision Recall
AUC Accuracy
Risk
C
value
0.1
1
10
100
0.1
1
10
100
0.1
1
10
100
Indemnity
0.96
0.96
0.96
0.96
0.93
0.93
0.95
0.96
0.91
0.89
0.9
0.91
31%
86%
83%
82%
-
69%
68%
67%
-
-
-
-
** The classifier for the risk category "Insurance", could not be optimized due to
insufficient data.
100%
90%
82%
78%
-
91%
61%
56%
-
-
-
-
76%
92%
90%
89%
88%
94%
91%
90%
90%
90%
90%
90%
18%
82%
84%
86%
0%
56%
78%
83%
0%
0%
0%
0%
Insurance**
2) Naïve Bayes : NB Classifier is a linear classifier built on
the Bayesian theorem. It is based on the assumption that features
in a dataset are mutually independent and are identically
distributed. An additional assumption
the conditional
independence of features.
is
The classifier's performance is evaluated in terms of area
under the curve (AUC), accuracy, precision, recall and F1-score.
A random classifier has an AUC of 0.5 while a perfect classifier
has an AUC of 1.
TABLE IX. TEST RESULTS FOR THE FINAL MODEL PARAMETERS: DM-NEG,
K=10, T=10-6, CONTEXT WINDOW=10, VECTOR SIZE=100, SVM LINEAR
CLASSIFIERS WITH OPTIMAL C VALUES
Risk
Category
Termination
Indemnity
Accuracy
Precision
Recall
F-score
91%
93%
89%
83%
77%
56%
83%
67%
V. RESULTS
The dataset on which this experimentation was performed
consisted of three sets: 1,382 paragraphs for training, 151
paragraphs for validation and 75 paragraphs for test. These
paragraphs were collated from request for proposal (RFP)
documents of various risk categories. The risk categories with
maximum number of paragraphs in the training dataset are:
"Termination" with 499, "Indemnity" with 117 and "Insurance"
with 89. In the validation dataset, Termination accounted for 44
paragraphs, Indemnity accounted for 18 paragraphs and
Insurance accounted for 15 paragraphs. In the test dataset the
count of paragraphs was 22, 9 and 7 for Termination, Indemnity
and Insurance respectively. The hyper-parameter choice for
paragraph vectors and classifier models are cross validated by
comparing end to end performance of predicting the categories.
Vector
representation built using Distributed memory
architecture; trained using negative sampling (Table I) with
number of samples to be updated (K)=10 (Table II), subsampling
threshold=10-6 (Table III), context window=10 (Table IV),
vector size=100 (Table V); and classified using linear SVM
(Table VII) outperforms all other combinations. All words are
converted to lower case. We have a vocabulary of 1,442 words.
Special characters are treated as normal words.
The performance of individual risk category classifier model
is further tuned by updating the C-values. C value of 1 works
best for both Indemnity and Termination (Table VIII). Thus by
parameter tuning, the performance of the overall model has
increased by 5% points (Table I, Table VIII) in terms of
accuracy, for the risk category "Termination". The higher values
of precision, recall and F1-score for "Termination" and
"Indemnity" as compared to "Insurance" (Table VIII) are driven
by a larger training data. The poor performance of the risk
category, "Insurance" (trained on <100 paragraphs) suggests
training on a larger dataset to produce reliable results. Also
contextualization of "Insurance" with associated words to assess
risk was not clear, as we found out by manual review of
dictionary and training set. Thus performance of this framework
is largely dependent on the size of the training data and propriety
of pre-defined risk category and association. Using these
selections, the test results for Indemnity and Termination are
displayed in Table IX.
Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference (Jeju, Korea, 28-31 October 2018)0687The varied functionalities of our framework is detailed in
Table X with a sample screen-shot in Figure 2.
TABLE X. FRAMEWORK FUNCTIONALITY DESCRIPTION
Framework
Functionalities
1
2
3
4
5
6
7
8
9
Description
Document Upload
Document Repository
Selection of Risk Tokens
Extracted risk prone paragraphs for the risk category
selected
Probability Values
Reviewing and Commenting
Feedback to decline an identified paragraph
Original legal document
Export reports
Fig.2."Risk-o-Meter" framework: Document Upload and Document Repository
VI. FUTURE WORK
The current framework considers all risk prone paragraphs
and their associated categories with equal importance. E.g.
Statement 1 for Indemnity: "The Consultant shall at all times
indemnify and keep indemnified the Company against all
claims/damages etc. for any infringement of any Intellectual
Property Rights (IPR) while providing its services under the
Project." Statement 2 for Termination: "If the firm stands
dissolved /reconstituted and the name/ style of the firm is
changed." The current framework would identify both the
paragraphs as risky but would not differentiate between their
severities. To further aid legal professionals in the task of
analyzing risk reward ratio, we propose to incorporate a module
which considers the severity and impact of different risk
paragraphs; and superimpose with risk emanating from
associated categories. We will also ascertain the distance of
association to weight the risk quotient as necessary. Thus they
could be classified as High, Medium or Low; or their impact
rated on a scale of 1-5, with 5 being the highest. Based on the
severity and impact of the identified risk category, the
framework could also be trained for suggesting probable
mitigation options.
VII. CONCLUSION
The time and cost involved in manual assessment of legal
documents clearly indicate the need for developing an AI-based
system that makes risk analysis of contracts fast, error free and
person independent; so that the decision to accept/reject/mitigate
to tolerable limit is made easy. In this paper, we presented our
framework, "risk-o-meter" which has reduced the average time
taken by our legal professionals in reviewing and assessing the
Documents", 2014
[3] Back
to
Basic:
Contract
Automation
101,
https://www.ontask.io/resources/back-basics-contract-automation-101/
Shperber,
"A
gentle
introduction
to Doc2vec",
[4] Gidi
https://medium.com/scaleabout/a-gentle-introduction-to-doc2vec-
db3e8c0cce5e, July 26, 2017
[5] "Uncover
relevant
information
from
contracts with Kira",
https://www.kirasystems.com/how-it-works/contract-analysis/
[6] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, Jeffrey Dean.
their
"Distributed Representations of Words and Phrases and
Compositionality"
[7] Mingyong Liu and Jiangang Yang. "An improvement of TFIDF weighting
in text categorization. International Conference on Computer Technology
and Science", 2012
[8] A. Ben-Hur and J. Weston, "A User's Guide to Support Vector Machine".
[9]
Jason Brownlee,"Support Vector Machines for Machine Learning",
https://machinelearningmastery.com/support-vector-machines-for-
machine-learning/, April 20, 2016
[10] Savan Patel,"Chapter 2: SVM (Support Vector Machine)-Theory",
https://medium.com/machine-learning-101/chapter-2-svm-support-
vector-machine-theory-f0812effc72, May 3, 2017
[11] "Naïve Bayes and Text Classification-Introduction and Theory",
http://sebastianraschka.com/Articles/2014_naive_bayes_1.html
[12] "NLP 05: From Word2vec to Doce2vec: a simple example with Gensim",
risk in legal documents. It thus fosters a risk-aware environment
for sustainable growth and knowledgeable decision making for
the organization.
The framework can be tailored for uncovering relevant
information from multiple kinds of documents by optimizing the
hyper-parameters based on the quality and quantity of the
available data. Another potential application of the framework
could be for processing claims documents wherein accident
descriptions could be used for better understanding of the
accident scenario and accordingly predicting the accident types
such as bodily damage, property damage and others. Our
framework, thus provides a scalable, efficient and reliable
solution for reviewing and assessing all kinds of documents.
REFERENCES
[1] "Lawyers Waste As Much As Six Hours a Week on Document
Issues", http://metajure.com/lawyers-waste-six-hours-a-
Management
week-on-document-management-issues-2/, January 28,2016
[2] Quoc Le, Tomas Mikolov. "Distributed Representations of Sentences and
https://ireneli.eu/2016/07/27/nlp-05-from-word2vec-to-doc2vec-a-
simple-example-with-gensim/
[13] Chai, K.; H. T. Hn, H. L. Chieu; "Bayesian Online Classifiers for Text
Classification and Filtering", Proceedings of the 25th annual international
ACM SIGIR conference on Research and Development in Information
Retrieval, August 2002, pp 97-104
[14] Data Mining Concepts and Techniques, Jiawei Han, Micheline Kamber
Morgan Kaufman Publishers, 2003
[15] Julia Silge and David Robinson, "Term Frequency and Inverse Document
Frequency
(tf-idf) using Tidy Data Principles", https://cran.r-
project.org/web/packages/tidytext/vignettes/tf_idf.html, March 21, 2018
[16] Collobert, Ronan andWeston, Jason. "A unified architecture for natural
language processing: Deep neural networks with multitask learning" In
Proceedings of the 25th International Conference on Machine Learning,
pp. 160 -- 167. ACM, 2008.
[17] Bengio, Yoshua, Schwenk, Holger, Senecal, Jean-Sebastien, Morin,
Frederic, and Gauvain, Jean-Luc; "Neural probabilistic language models.
In Innovations in Machine Learning", pp. 137 -- 186. Springer, 2006.
[18] Socher, Richard, Huang, Eric H., Pennington, Jeffrey, Manning, Chris D.,
and Ng, Andrew Y. Dynamic pooling and unfolding recursive
autoencoders for paraphrase detection. In Advances in Neural Information
Processing Systems, 2011a.
[19] Omer Levy and Yoav Goldberg, "Dependency-Based Word Embeddings"
[20] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean, "Efficient
estimation of word representations in vector space" arXiv preprint
arXiv:1301.3781, 2013a.
Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference (Jeju, Korea, 28-31 October 2018)0688 |
1808.02171 | 1 | 1808 | 2018-08-07T01:04:39 | Dialog-context aware end-to-end speech recognition | [
"cs.CL"
] | Existing speech recognition systems are typically built at the sentence level, although it is known that dialog context, e.g. higher-level knowledge that spans across sentences or speakers, can help the processing of long conversations. The recent progress in end-to-end speech recognition systems promises to integrate all available information (e.g. acoustic, language resources) into a single model, which is then jointly optimized. It seems natural that such dialog context information should thus also be integrated into the end-to-end models to improve further recognition accuracy. In this work, we present a dialog-context aware speech recognition model, which explicitly uses context information beyond sentence-level information, in an end-to-end fashion. Our dialog-context model captures a history of sentence-level context so that the whole system can be trained with dialog-context information in an end-to-end manner. We evaluate our proposed approach on the Switchboard conversational speech corpus and show that our system outperforms a comparable sentence-level end-to-end speech recognition system. | cs.CL | cs | DIALOG-CONTEXT AWARE END-TO-END SPEECH RECOGNITION
Suyoun Kim1 and Florian Metze2
1Electrical & Computer Engineering
2Language Technologies Institute, School of Computer Science
Carnegie Mellon University
{suyoung1fmetze}@andrew.cmu.edu
8
1
0
2
g
u
A
7
]
L
C
.
s
c
[
1
v
1
7
1
2
0
.
8
0
8
1
:
v
i
X
r
a
ABSTRACT
Existing speech recognition systems are typically built at
the sentence level, although it is known that dialog context,
e.g. higher-level knowledge that spans across sentences or
speakers, can help the processing of long conversations. The
recent progress in end-to-end speech recognition systems
promises to integrate all available information (e.g. acous-
tic, language resources) into a single model, which is then
jointly optimized. It seems natural that such dialog context
information should thus also be integrated into the end-to-
end models to improve further recognition accuracy. In this
work, we present a dialog-context aware speech recognition
model, which explicitly uses context information beyond
sentence-level information, in an end-to-end fashion. Our
dialog-context model captures a history of sentence-level
contexts, so that the whole system can be trained with dialog-
context information in an end-to-end manner. We evaluate our
proposed approach on the Switchboard conversational speech
corpus, and show that our system outperforms a comparable
sentence-level end-to-end speech recognition system.
Index Terms -- end-to-end speech recognition
1. INTRODUCTION
As voice-driven interfaces to devices become mainstream,
spoken dialog systems that can recognize and understand
long dialogs are becoming increasingly important. Dialog
context, dynamic contextual flow across multiple sentences,
provides important
information that can improve speech
recognition. To build speech recognition models, the long
dialogs typically split into short utterance-level audio clips
to make training the speech recognition models computation-
ally feasible. Thus, such speech recognition models built on
sentence-level speech data may lose important dialog-context
information.
In language model trained only on text data, several recent
studies have attempted to use document-level or dialog-level
context information to improve language model performance.
Recurrent neural network (RNN) based language models [1]
have shown success in outperforming conventional n-gram
based models due to their ability to capture long-term in-
formation. Based on the success of RNN based language
models, recent research has developed a variety of ways to
incorporate document-level or dialog-level context informa-
tion [2 -- 5]. Mikolov et al. proposed a context-dependent RNN
language model [2] using a context vector which is produced
by applying latent Dirichelt allocation [6] on the preceding
text. Wang et al. proposed using a bag-of-words to repre-
sent the context vector [3], and Ji et al. proposed using the
last RNN hidden states from the previous sentence to rep-
resent the context vector [4]. Liu et al. proposed using an
external RNN to model dialog context between speakers [5].
All of these models have been developed and optimized on
text data, and therefore must still be combined with conven-
tional acoustic models, which are optimized separately with-
out any context information beyond sentence-level. The re-
cent study [7] attempted to integrated such dialog session-
aware language model with acoustic models, however, it re-
quires disjoint training procedure.
There have been no studies of speech recognition mod-
els that incorporate dialog-context information in end-to-end
training approach on both speech and text data. The recently
proposed end-to-end speech recognition models, a neural net-
work is trained to convert a sequence of acoustic feature vec-
tors into a sequence of graphemes (characters) rather than
senones. Unlike sequences of senone predictions, which need
to be decoded using a pronunciation lexicon and a language
model, the grapheme sequences can be directly converted to
word sequences without any additional models. The end-to-
end models proposed in the literature to use a Connection-
ist Temporal Classification framework [8 -- 12], an attention-
based encoder-decoder framework [13 -- 16], or both [17, 18].
Our goal is to build speech recognition model that explic-
itly use a dialog-level context information beyond sentence-
level information especially in an end-to-end manner so that
the whole system can be trained with the long context infor-
mation. In this paper, we present a dialog-context aware end-
to-end speech recognition model that can capture a history of
sentence-level contexts within an end-to-end speech recogni-
tion models. We also present a method to serialize datasets for
Fig. 1: The architecture of our dialog-context end-to-end speech recognition model. The red curved line represents the context
information flow.
LAttention (cid:44) −(cid:88)
ln p(y∗
ux, y∗
1:u−1)
(3)
u
where π is the label sequence allowing the presence of the
blank symbol, Φ is the set of all possible π given u-length y,
and y∗
1:u−1 is all the previous labels.
In this section, we present our DialogAttentionDecoder sub-
network. We extend the AttentionDecoder which is a subnet-
work of standard end-to-end models in order to employ con-
text information. The core modeling idea of this work is to
integrate the context information from the previous sentence
into that of the current sentence.
Let we have a dataset consists of N-number of dialogs,
D = {d1,··· , dN} and each dialog di = (s1,··· , sK) has
K utterances. k-th utterance sk is represented as a sequence
of U-length output characters (y) and T -length input acoustic
features (x). Given the high-level representation (h) of input
acoustic features (x) generated from Encoder, both the stan-
dard AttentionDecoder and our proposed DialogAttentionDe-
coder generates the probability distribution over characters
( yu), conditioned on (h), and all the characters seen previ-
ously (y1:u−1). Our proposed DialogAttentionDecoder ad-
ditionally conditioning on dialog context vector (ck), which
represents the information of the preceding utterance in the
same dialog as:
h = Encoder(x)
standard decoder network:
yu ∼
AttentionDecoder(h, y1:u−1)
proposed decoder network:
DialogAttentionDecoder(h, y1:u−1, ck)
(4)
(5)
(6)
2. DIALOG-CONTEXT END-TO-END ASR
2.2. Dialog-context models
training and decoding based on their onset times to learn dia-
log flow. We evaluate our proposed approach on the Switch-
board conversational speech corpus [19, 20], and show that
our model outperforms the sentence-level end-to-end speech
recognition model.
2.1. End-to-end models
We perform end-to-end speech recognition using a joint
CTC/Attention-based approach with graphemes as the output
symbols [17,18]. The key advantage of the joint CTC/Attention
framework is that it can address the weaknesses of the two
main end-to-end models, Connectionist Temporal Classifi-
cation (CTC) [8] and attention-based encoder-decoder (At-
tention) [21], by combining the strengths of the two. With
CTC, the neural network is trained according to a maximum-
likelihood training criterion computed over all possible seg-
mentations of the utterance's sequence of feature vectors to its
sequence of labels while preserving left-right order between
input and output. With attention-based encoder-decoder mod-
els, the decoder network can learn the language model jointly
without relying on the conditional independent assumption.
Given a sequence of acoustic feature vectors, x, and
the corresponding graphemic label sequence, y, the joint
CTC/Attention objective is represented as follows by combin-
ing two objectives with a tunable parameter λ : 0 ≤ λ ≤ 1:
(1)
L = λLCTC + (1 − λ)LAttention.
Each loss to be minimized is defined as the negative log likeli-
hood of the ground truth character sequence y∗, is computed
from:
LCTC (cid:44) − ln
p(πx)
(2)
(cid:88)
π∈Φ(y)
tion error:
dk ∼DialogContextGenerator(y∗)
LDialog (cid:44) − ln p(d∗
(8)
(9)
The additional loss LDialog is added to the L in Eq. (1) so that
the whole model is optimized jointly. Once the context vector
of previous sentence is generated by either proposed method
(a) or (b), it is stored for the next sentence prediction.
ky∗)
(a)
(b)
Fig. 2: Two different types of our dialog-context Attention-
Decoder network. At each output step (u), the character dis-
tribution (yu), is generated conditioning on 1) the dialog con-
text vector (ck) from the previous sentence, in addition to 2)
the attended inputs (Hu) from Encoder network, 3) the de-
coder state (su−1), and 4) the history of character yu−1. The
red curved line represents the context information flow.
We represent the context vector, ck, in two different ways
as illustrated in Figure 2. In method (a), the last decoder state
of the previous sentence represents the context vector, ck. The
context vector ck is propagated to the initial decoder state of
current sentence. In method (b), every output information is
integrated with additional attention mechanism and represents
the context vector, ck, then is propagated to every decoder
state for each output time step of current sentence. Motivated
by prior work [4], we produce the context vector for the (a)-
type of our decoder from the final hidden representation of
the previous sentence sk−1:
ck = ssk−1
U
.
(7)
For the (b)-type of our decoder, we embed a subnetwork (Di-
alogContextGenerator) with an additional attention mecha-
nism to incorporate every previous context into a single con-
text vector ck. We use the character distributions of previous
sentence (y ∗1 ··· y∗U ) as input to generate (ck). This subnet-
work is optimized towards minimizing the dialog classifica-
The following equation represents how to update the hid-
den states of DialogAttentionDecoder with high-level input
features (hu) generated from Encoder, 2) the previous char-
acter (yu−1), and 3) the context vector (ck) from previous sen-
tence:
su−1 = f (su−1, ck)
(10)
(11)
(12)
where f (·) is a function that combines the two inputs, su−1,
and ck:
su = RN N (su−1, hu, yu−1))
yu ∼ softmax(su)
f (su−1, ck) = tanh(W su−1 + V ck + b)
(13)
where W, V, b are trainable parameters. In this work, we use
tanh for the non-linear activation function.
2.3. Dataset serialization
In order to learn and use the dialog context during training
and decoding, we serialized the sentences based on their onset
times and their dialogs rather than random shuffling of data.
We first grouped the sentences based on their dialogs, then
ordered the sentences according to their onset times. Instead
of generating a minibatch set in a typical way that randomly
chooses sentences, we created a minibatch to contain the sen-
tences from each one of different dialogs. For example, a
size-30 minibatch had 30 sentences from d1 d30. We did not
shuffle the minibatch sets for training or decoding, so that the
context information generated from the previous minibatch
that contains preceding sentences can propagate to the next
minibatch.
Since the number of sentences varies across the dialogs,
some dialogs may not have enough sentences to construct the
minibatches. In this case, we included dummy input/output
data for the dialogs that have fewer sentences to maintain the
minibatch size and not to lose context information of the other
dialogs that have more sentences. We then masked out the
loss from the dummy data for the objective function. Once
every sentence in d1 d30 was processed, then the sentences
from the other dialogs d31 − d60 would be processed.
Figure 3 illustrates the example minibatches that are se-
rialized according to their onset times and their dialogs. The
size of minibatch is 3 and the sentences are from dialogs, dA,
dB, and dC. In second and third minibatches, the dummy in-
put/output data is included in the position for the dB and dC,
which have fewer sentences.
persand, noise, vocalized-noise, laughter, unknown, space,
start-of-speech/end-of-speech, and blank tokens.
Note that no pronunciation lexicon was used in any of the
experiments.
3.2. Training and decoding
We used joint CTC/Attention end-to-end speech recognition
architecture [17, 18] with ESPnet toolkit [24]. We used a
CNN-BLSTM encoder as suggested in [25, 26]. We followed
the same six-layer CNN architecture as the prior study, ex-
cept we used one input channel instead of three, since we
did not use delta or delta delta features.
Input speech fea-
tures were downsampled to (1/4 x 1/4) along with the time-
frequency axis. Then, the 4-layer BLSTM with 320 cells
was followed by the CNN. We used a location-based atten-
tion mechanism [15], where 10 centered convolution filters of
width 100 were used to extract the convolutional features.
The decoder network of both our proposed models and
the baseline models was a one-layer LSTM with 300 cells.
Our dialog-context aware models additionally requires one-
layer with 300 hidden units for incorporating the context
vector with decoder states, and attention network with 2402-
dimensional output layer to generate the context vector. We
also built a character-level RNNLM (Char-RNNLM) on the
the same Switchboard text dataset. The Char-RNNLM net-
work was a two-layer LSTM with 650 cells, trained sepa-
rately only on the training transcription. This network was
used only for decoding. Note that we did not use any extra
text data other than the training transcription.
The AdaDelta algorithm [27] with gradient clipping [28]
was used for optimization. We used λ = 0.5 for joint
CTC/Attention training. We bootstrap the training our pro-
posed dialog-context aware end-to-end models from the base-
line end-to-end models. For decoding of the models, we used
joint decoder which combines the output label scores from
the AttentionDecoder, CTC, and Char-RNNLM [26] . The
scaling factor of CTC, and RNNLM scores were α = 0.3,
and β = 0.3, respectively. We used a beam search algorithm
similar to [29] with the beam size 20 to reduce the computa-
tion cost. We adjusted the score by adding a length penalty,
since the model has a small bias for shorter utterances. The
final score s(yx) is normalized with a length penalty 0.1.
The models were implemented by using the Chainer deep
learning library [30], and ESPnet toolkit [17, 18, 24].
4. RESULTS
We evaluated both the end-to-end speech recognition model
which was built on sentence-level data (sentence-level end2end)
and our proposed dialog-context aware end-to-end speech
recognition model which leveraged dialog-context informa-
tion within and beyond the sentence (dialog-context aware
Fig. 3: A method to make the minibatch set for training and
evaluating our models. The example minibatches are serial-
ized according to their onset times and their dialogs. The size
of example minibatch is 3 and the sentences are from three
dialogs, dA, dB, and dC. In second and third minibatches, the
dummy input/output data is included in the position for the
dB and dC, which have fewer sentences.
Table 1: Experimental dataset description. We used the
Switchboard dataset which has a 300 hours training set. Note
that any pronunciation lexicon or external text data was not
used.
# dialog
# sentences
Train nodup Train dev
34
4,000
2,402
192,656
CH SWB
20
20
1,831
2,627
3. EXPERIMENTS
3.1. Experimental corpora
We investigated the performance of the proposed dialog-
context aware model on the Switchboard LDC corpus (97S62)
which has a 300 hours training set. Note that we did not use
the Fisher dataset. We split the Switchboard data into two
groups, then used 285 hours of data (192 thousand sentences)
for model training and 5 hours of data (4 thousand sen-
tences) for hyper-parameter tuning. Evaluation was carried
out on the HUB5 Eval 2000LDC corpora (LDC2002S09,
LDC2002T43), which have 3.8 hours of data (4.4 thousand
sentences), and we show separate results for the Callhome
English (CH) and Switchboard (SWB) evaluation sets. We
denote train nodup, train dev, SWB, and CH as our training,
development, and two evaluation datasets for CH and SWB,
respectively. Table 1 shows the number of dialogs per each
dataset.
We sampled all audio data at 16kHz, and extracted 80-
dimensional log-mel filterbank coefficients with 3-dimensional
pitch features, from 25 ms frames with a 10ms frame shift.
We used 83-dimensional feature vectors to input to the net-
work in total. We used 49 distinct labels: 26 characters,
10 digits, apostrophe, period, dash, underscore, slash, am-
Table 2: Comparison of hypothesis between baseline and our proposed model. Three examples of two consecutive sentences
are manually chosen from evaluation dataset. They show that our model correctly predicted the word bolded in current sentence,
while the baseline incorrectly predicted it. The preceding sentence includes the context information related to the word, and
our model seems to be benefit this information.
model
previous sentence
REF well claire's kindergarten but she is already past the
Baseline well clears in the garden but she is already past
Ours well clears kindergarten but she is already past the
REF
Baseline
Ours
REF
Baseline
Ours
yes it is so hot in the building have you ever been in it
yeah if when he said that is like just so hot in the belly have ever been but
yeah if when he is in this like it is so hot in the belief I have never been but
if we go we like check into a to a to a hotel but
if we go we like check until the law that you know to do
if we go we like check into a law if it does a job hotel
current sentence
kindergarten i mean
in a garden i mean
kindergarten i mean
it is like a sauna
it is like i saw
it is like a sauna
i know but it is much more comfortable
i know that is much more comes of one
i know that is much more comfortable
Table 3: Word Error Rate (WER) on the Switchboard dataset.
None of our experiments used any lexicon information or ex-
ternal text data other than the training transcription. The mod-
els were trained on 300 hours of Switchboard data only.
Train (∼ 300hrs)
CH SWB
Models WER WER
sentence-level end2end
Seq2Seq A2C [22]
CTC A2C [10]
CTC A2C [12]
CTC A2W(Phone/external-LM init.) [23]
sentence-level end2end
Our baseline (CTC/Seq2Seq)
dialog-context aware end2end
Our proposed model(a)
Our proposed model(b)
40.6
31.8
32.1
23.6
34.4
34.1
33.2
28.1
20.0
19.8
14.6
19.0
18.2
18.6
end2end).
Table 3 shows the WER of our baseline, proposed models,
and several other published results those were only trained
on 300 hours Switchboard training data. Note that CTC
A2W(Phone/external-LM init.) [23] was initialized from
Phone CTC model and use external word embeddings. As
shown in Table 3, we obtained a performance gain over our
baseline sentence-level end2end by using the dialog-context
information. Our proposed model (a) performed best on SWB
evaluation set showing 4.2% relative improvement over our
baseline. Our proposed model (b) performed best on CH
evaluation set showing 3.4% relative improvement over our
baseline.
Table 4 shows the insertion, deletion, and substitution
rates. We observed that the largest factor of WER improve-
ment was from the substitution rates rather than deletion
or insertion. Table 2 shows three example utterances with
each previous sentence to show that our context information
beyond the sentence-level improves word accuracy.
Table 4: Substitution rate (Sub), Deletion rate (Del), and In-
sertion rate (Ins) for the baseline and our proposed model.
Model
Baseline
Proposed model(a)
Proposed model(b)
Baseline
Proposed model(a)
Proposed model(b)
Test
CH 23.9
CH 23.9
CH 22.8
SWB 13.1
SWB 12.5
SWB 12.6
Sub Del
5.8
5.9
6.3
3.4
3.4
3.6
Ins WER
34.4
4.7
4.3
34.1
33.2
4.1
19.0
2.5
18.2
2.2
2.4
18.6
5. CONCLUSION
We proposed a dialog-context aware end-to-end speech
recognition model which explicitly uses context informa-
tion beyond sentence-level information. A key aspect of this
model is that the whole system can be trained with dialog-
level context information in an end-to-end manner. Our
model was shown to outperform previous end-to-end models
trained on sentence-level data. Moving forward, we plan
to explore additional methods to represent the context in-
formation and evaluate performance improvements that can
be obtained by addressing overfitting and data sparsity us-
ing larger conversational datasets, e.g., 2,000 hours of fisher
dataset.
6. ACKNOWLEDGEMENTS
We gratefully acknowledge the support of NVIDIA Corpora-
tion with the donation of the Titan X Pascal GPU used for
this research. This research was supported by a fellowship
from the Center for Machine Learning and Health (CMLH)
at Carnegie Mellon University.
7. REFERENCES
[1] Tom´as Mikolov, Martin Karafi´at, Luk´as Burget, Jan
Cernock`y, and Sanjeev Khudanpur, "Recurrent neural
network based language model," in Eleventh Annual
Conference of the International Speech Communication
Association, 2010.
[2] Tomas Mikolov and Geoffrey Zweig, "Context depen-
dent recurrent neural network language model.," SLT,
vol. 12, pp. 234 -- 239, 2012.
[3] Tian Wang and Kyunghyun Cho, "Larger-context lan-
guage modelling," arXiv preprint arXiv:1511.03729,
2015.
[4] Yangfeng Ji, Trevor Cohn, Lingpeng Kong, Chris Dyer,
"Document context language
and Jacob Eisenstein,
models," arXiv preprint arXiv:1511.03962, 2015.
[5] Bing Liu and Ian Lane, "Dialog context language mod-
in Acoustics,
eling with recurrent neural networks,"
Speech and Signal Processing (ICASSP), 2017 IEEE In-
ternational Conference on. IEEE, 2017, pp. 5715 -- 5719.
[6] David M Blei, Andrew Y Ng, and Michael I Jordan,
"Latent dirichlet allocation," Journal of machine Learn-
ing research, vol. 3, no. Jan, pp. 993 -- 1022, 2003.
[7] Wayne Xiong, Jasha Droppo, Xuedong Huang, Frank
Seide, Mike Seltzer, Andreas Stolcke, Dong Yu, and
Geoffrey Zweig, "The microsoft 2016 conversational
speech recognition system," in Acoustics, Speech and
Signal Processing (ICASSP), 2017 IEEE International
Conference on. IEEE, 2017, pp. 5255 -- 5259.
[8] Alex Graves, Santiago Fern´andez, Faustino Gomez, and
Jurgen Schmidhuber, "Connectionist temporal classifi-
cation: labelling unsegmented sequence data with recur-
rent neural networks," in Proceedings of the 23rd inter-
national conference on Machine learning. ACM, 2006,
pp. 369 -- 376.
[9] Alex Graves and Navdeep Jaitly, "Towards end-to-end
speech recognition with recurrent neural networks," in
Proceedings of the 31st International Conference on
Machine Learning (ICML-14), 2014, pp. 1764 -- 1772.
[10] Awni Hannun, Carl Case, Jared Casper, Bryan Catan-
zaro, Greg Diamos, Erich Elsen, Ryan Prenger, San-
jeev Satheesh, Shubho Sengupta, Adam Coates, et al.,
"Deep speech: Scaling up end-to-end speech recogni-
tion," arXiv preprint arXiv:1412.5567, 2014.
[11] Yajie Miao, Mohammad Gowayyed, and Florian Metze,
"EESEN: End-to-end speech recognition using deep
in 2015
RNN models and WFST-based decoding,"
IEEE Workshop on Automatic Speech Recognition and
Understanding (ASRU). IEEE, 2015, pp. 167 -- 174.
[12] Geoffrey Zweig, Chengzhu Yu, Jasha Droppo, and An-
dreas Stolcke, "Advances in all-neural speech recog-
in Acoustics, Speech and Signal Process-
nition,"
ing (ICASSP), 2017 IEEE International Conference on.
IEEE, 2017, pp. 4805 -- 4809.
[13] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben-
gio, "Neural machine translation by jointly learning to
align and translate," arXiv preprint arXiv:1409.0473,
2014.
[14] Jan Chorowski, Dzmitry Bahdanau, Kyunghyun Cho,
and Yoshua Bengio,
"End-to-end continuous speech
recognition using attention-based recurrent NN: First re-
sults," arXiv preprint arXiv:1412.1602, 2014.
[15] Jan K Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk,
Kyunghyun Cho, and Yoshua Bengio, "Attention-based
models for speech recognition," in Advances in Neural
Information Processing Systems, 2015, pp. 577 -- 585.
[16] William Chan, Navdeep Jaitly, Quoc V Le, and Oriol
arXiv preprint
"Listen, attend and spell,"
Vinyals,
arXiv:1508.01211, 2015.
[17] Suyoun Kim, Takaaki Hori, and Shinji Watanabe, "Joint
ctc-attention based end-to-end speech recognition using
multi-task learning," in Acoustics, Speech and Signal
Processing (ICASSP), 2017 IEEE International Confer-
ence on. IEEE, 2017, pp. 4835 -- 4839.
[18] Shinji Watanabe, Takaaki Hori, Suyoun Kim, John R
Hershey, and Tomoki Hayashi, "Hybrid ctc/attention
architecture for end-to-end speech recognition," IEEE
Journal of Selected Topics in Signal Processing, vol. 11,
no. 8, pp. 1240 -- 1253, 2017.
[19] John J Godfrey, Edward C Holliman, and Jane Mc-
Daniel, "Switchboard: Telephone speech corpus for re-
search and development," Acoustics, Speech, and Sig-
nal Processing, 1992. ICASSP-92., 1992 IEEE Interna-
tional Conference on, 1992.
[20] John J Godfrey, Edward C Holliman, and Jane Mc-
Daniel,
"Switchboard: Telephone speech corpus for
research and development," in Acoustics, Speech, and
Signal Processing, 1992. ICASSP-92., 1992 IEEE Inter-
national Conference on. IEEE, 1992, vol. 1, pp. 517 --
520.
[21] Dzmitry Bahdanau, Jan Chorowski, Dmitriy Serdyuk,
Philemon Brakel, and Yoshua Bengio,
"End-to-end
attention-based large vocabulary speech recognition,"
arXiv preprint arXiv:1508.04395, 2015.
[22] Thomas Zenkel, Ramon Sanabria, Florian Metze, Jan
Niehues, Matthias Sperber, Sebastian Stuker, and Alex
Waibel,
"Comparison of decoding strategies for ctc
acoustic models,"
2017.
arXiv preprint arXiv:1708.04469,
[23] Kartik Audhkhasi, Brian Kingsbury, Bhuvana Ramab-
hadran, George Saon, and Michael Picheny,
"Build-
ing competitive direct acoustics-to-word models for en-
glish conversational speech recognition," arXiv preprint
arXiv:1712.03133, 2017.
[24] Shinji Watanabe, Takaaki Hori, Shigeki Karita, Tomoki
Hayashi, Jiro Nishitoba, Yuya Unno, Nelson En-
rique Yalta Soplin, Jahn Heymann, Matthew Wiesner,
Nanxin Chen, et al.,
"Espnet: End-to-end speech
processing toolkit," arXiv preprint arXiv:1804.00015,
2018.
[25] Yu Zhang, William Chan, and Navdeep Jaitly, "Very
deep convolutional networks for end-to-end speech
recognition," in Acoustics, Speech and Signal Process-
ing (ICASSP), 2017 IEEE International Conference on.
IEEE, 2017, pp. 4845 -- 4849.
[26] Takaaki Hori, Shinji Watanabe, Yu Zhang, and William
Chan, "Advances in joint ctc-attention based end-to-end
speech recognition with a deep cnn encoder and rnn-
lm," arXiv preprint arXiv:1706.02737, 2017.
[27] Matthew D Zeiler, "Adadelta: an adaptive learning rate
method," arXiv preprint arXiv:1212.5701, 2012.
[28] Razvan Pascanu, Tomas Mikolov, and Yoshua Ben-
gio, "On the difficulty of training recurrent neural net-
works," in International Conference on Machine Learn-
ing, 2013, pp. 1310 -- 1318.
[29] Ilya Sutskever, Oriol Vinyals, and Quoc VV Le, "Se-
quence to sequence learning with neural networks,"
in Advances in neural information processing systems,
2014, pp. 3104 -- 3112.
[30] Seiya Tokui, Kenta Oono, Shohei Hido, and Justin Clay-
ton, "Chainer: a next-generation open source frame-
work for deep learning," in Proceedings of Workshop
on Machine Learning Systems (LearningSys) in The
Twenty-ninth Annual Conference on Neural Information
Processing Systems (NIPS), 2015.
|
1711.05680 | 2 | 1711 | 2017-11-20T14:40:29 | An Unsupervised Approach for Mapping between Vector Spaces | [
"cs.CL"
] | We present a language independent, unsupervised approach for transforming word embeddings from source language to target language using a transformation matrix. Our model handles the problem of data scarcity which is faced by many languages in the world and yields improved word embeddings for words in the target language by relying on transformed embeddings of words of the source language. We initially evaluate our approach via word similarity tasks on a similar language pair - Hindi as source and Urdu as the target language, while we also evaluate our method on French and German as target languages and English as source language. Our approach improves the current state of the art results - by 13% for French and 19% for German. For Urdu, we saw an increment of 16% over our initial baseline score. We further explore the prospects of our approach by applying it on multiple models of the same language and transferring words between the two models, thus solving the problem of missing words in a model. We evaluate this on word similarity and word analogy tasks. | cs.CL | cs | An Unsupervised Approach for Mapping between
Vector Spaces
Syed Sarfaraz Akhtar*
Arjit Srivastava
Avijit Vajpayee*
Manish Shrivastava
{syed.akhtar, arihant.gupta, arjit.srivastava, madangopal.jhanwar}@research.iiit.ac.in,
Arihant Gupta*
Madan Gopal Jhanwar
[email protected],
[email protected]
7
1
0
2
v
o
N
0
2
]
L
C
.
s
c
[
2
v
0
8
6
5
0
.
1
1
7
1
:
v
i
X
r
a
Language Technologies Research Center(LTRC)
Kohli Center On Intelligent Systems (KCIS)
International Institute of Information Technology Hyderabad (IIITH), 500032
Abstract. We present a language independent, unsupervised approach for trans-
forming word embeddings from source language to target language using a trans-
formation matrix. Our model handles the problem of data scarcity which is faced
by many languages in the world and yields improved word embeddings for words
in the target language by relying on transformed embeddings of words of the
source language. We initially evaluate our approach via word similarity tasks on a
similar language pair - Hindi as source and Urdu as the target language, while we
also evaluate our method on French and German as target languages and English
as source language. Our approach improves the current state of the art results -
by 13% for French and 19% for German. For Urdu, we saw an increment of 16%
over our initial baseline score. We further explore the prospects of our approach
by applying it on multiple models of the same language and transferring words
between the two models, thus solving the problem of missing words in a model.
We evaluate this on word similarity and word analogy tasks.
1
Introduction
Word representations are being widely used to solve problems of various areas of natu-
ral language processing. These include but are not limited to dependency parsing [11],
named entity recognition [18] and parsing [16].
In this paper, we try to exploit similarities in linguistically similar languages by
transforming word embeddings of source language - which is highly resource rich and
hence well trained, to a corresponding model of target language - which is relatively
resource deficient. This technique is similar to that used by Mikolov et. al. [21] for
machine translation. We further extend our approach by applying it to different models
trained for one particular language. This enables us to incorporate the best of various
models.
* These authors contributed equally to this work.
2
Akhtar et al.
Given a source of structured connections between words, Faruqui et.al [9] proposed
a technique to combine embeddings learned from distributional semantics of unstruc-
tured text, known as "retrofitting". Speer and Chin [17] extended this technique to pro-
duce state of the art word embeddings for English. The method proposed by them re-
sulted in a 16% increase on the Stanford English Rare-Word (RW) dataset [10].
In this paper, we propose a method to transform words from one vector space to
another. We use this technique to transform word embeddings between languages and
also within the same language. Some languages are richer in resources than others.
For example, Hindi is richer in resources than Urdu. We also evaluate our approach
on dissimilar language pairs like English - French and English - German. Our aim is
to use resource rich techniques like ConceptNet Ensemble [17] for languages poor in
resources, for which we need to learn a mapping between their vector spaces.
Using this technique, we are also able to get embeddings of words which are un-
known for one embedding space by importing the transformed embedding of the same
word from another model of the same language. This method proved to be faster than
training a combined embedding space from scratch, while giving high quality word
embeddings.
The basis of our approach lies in having a sufficient number of frequent word pairs
in both source and target languages to successfully train our transformation matrix.
Each word pair is of form <word from source language, translated word of target
language>. In this paper, we present a method for transforming word representations
which, for training, take word representations of these word pairs to create a single
transformation matrix, which when applied on any word representation of source word,
will give us word representation of corresponding word in target language. We em-
phasize on highly frequent words, because we believe that highly frequent words have
better trained word embeddings and thus result in better results for our approach.
We rely on a bi-lingual dictionary of the language pair for training and evaluating
our transformation matrix. For training our matrix, we generate a bi-lingual dictionary
from parallel corpus of source and target language in an unsupervised way. But for
evaluation, the bi-lingual dictionary was missing most of the word pairs present in our
test dataset because the parallel corpus for all the language pairs that we worked on in
this paper were not large enough. Hence, only for evaluating our transformation matrix,
we manually created a bilingual dictionary from the test sets - which was not used for
training our transformation matrix because transformation matrix tends to completely
remember the word representations it was generated from.
We show that our method performs well on both French and German with state of
the art results on both languages. Since there is no prior work done on Urdu, we test
our approach against baseline scores of SkipGram embeddings. Our approach showed
improvement of 16% over baseline scores. We further test our approach on multiple
models of English. Our evaluations show that this is a fast and efficient approach to
transform word embeddings from one vector space to another.
An Unsupervised Approach for Mapping between Vector Spaces
3
2 Datasets
For some experiments, we are using word embeddings trained on Google News cor-
pus [21]. For all the models trained in this paper, we have used the Skip-gram [20]
algorithm. The dimensionality has been fixed at 300 with a minimum count of 5 along
with negative sampling.
As training set for English, we use the Wikipedia data [5] (SG/en-SG). Soricut and
Och [15] and Luong et. al. [10] had used the same training corpus for their models. The
corpus contains about 1 billion tokens. For German and French, we use News Crawl
(Articles from 2010) released as a part of ACL 2014 Ninth Workshop on Statistical
Machine Translation (de-SG and fr-SG respectively). For Urdu, we use the untagged
corpus released by Jawaid et. al. [1]. For Hindi, we use a monolingual corpus containing
31 million tokens, for training.
As a parallel corpus for Urdu, we use the Hindi-Urdu parallel corpus released by
Durrani et. al. [12]. We have used the Europarl parallel corpus version 7 [14] for parallel
sentences of English-French and English-German.
We use standard word-similarity datasets for testing. For English, we use Stanford
English Rare-Word (RW) dataset [10] and the RG65 dataset [7]. The Stanford Rare-
Word dataset contains comparatively more rare words and morphological complexity
than other datasets and is central to our experiments. For German, we use the German
RG65 [23] dataset. For French we use the French RG65 [4] dataset. In case of Urdu,
we are using the word similarity dataset WS-UR-100 [19].
For testing analogical regularities, we have used the MSR word analogy dataset [22].
It contains 8000 analogy question. This dataset has been used by us for testing our
model. The relations portrayed by these questions are morpho-syntactic, and can be
categorized according to parts of speech - adjectives, nouns and verbs. Adjective rela-
tions include comparative and superlative (good is to best as smart is to smartest). Noun
relations include singular and plural, possessive and non-possessive (dog is to dog's as
cat is to cat's). Verb relations are tense modifications (work is to worked as accept is to
accepted).
For rest of the paper, we have calculated the Spearman ρ (multiplied by 100) be-
tween human assigned similarity and cosine similarity of our word embeddings for the
word-pairs.
All the thresholds mentioned have been decided after empirical fine tuning. Even
though our experiments were computationally optimized, time and space complexities
also played a part in deciding our thresholds.
In order to learn initial representations of the words, we train word embeddings
(word2vec) using the parameters described above on the training set. This model is
referred to as SG (Skip-gram).
3 Cross-Lingual Transformation Matrix
Since we are generating our transformation matrix from parallel word pairs of two
different languages, we first need a list of highly frequent word pairs. For generating
this list, we have parallel corpus of two different languages - in our case, Hindi and
4
Akhtar et al.
Urdu, and English and French/German. This parallel corpus contains aligned sentences,
from which we generate a one-to-one mapping between words.
First we obtain word alignments using fast align [3] which gives us many to many
word mapping, which we further use to construct our confidence matrix. This confi-
dence matrix is generated using the frequency count of each individual mapping. For
each word of the source language in the confidence matrix, we find out the word in the
target language that it has been matched with most frequently and its fraction among all
matches. After this, we proceed in decreasing order of count of matches while building
a one-to-one matching above a threshold of match count and fraction of matches (25
and 0.5 respectively).
For this word pair list, we have a frequency threshold, which decides the word pairs
that will be chosen for generating our transformation matrix (see Table 1). For our
experiments, this threshold has been set at 500 (to ensure that they are well trained).
Fig. 1. Generating Cross-Lingual Word Pairs
Figure 1 gives a high level overview of how we generate highly frequent word pairs
from parallel corpus of source and target language in an unsupervised way.
Suppose we get "N" highly frequent word pairs. Dimensions of word embedding of
a word in our model is "D". Using first word of our "N" chosen word pairs, we create
a matrix "A" of dimensions N*D, where each row is vector representation of the first
An Unsupervised Approach for Mapping between Vector Spaces
5
Table 1. Example of word pairs for training transformation matrix of English-French from the
confidence matrix. "E. Word" is the word in English, "F. Word" is the word in French, Count is
the number of times "E. Word" was aligned with "F. Word" and Fraction is the fraction of the
count over all the times "E. Word" was aligned with any word.
E. Word F. Word Count Fraction
and
of
that
we
not
We
Mr
-
1.1M 0.87
0.51
1M
0.51
422K
0.65
319K
229K
0.55
0.63
108K
Monsieur 99K
0.5
0.79
98K
et
de
que
nous
pas
Nous
-
Fig. 2. Computing similarity scores via transformation matrix.
word. Similarly, we create another matrix B, of similar dimensions as A, using second
word of our chosen word pairs.
We now propose that a matrix "X" (our transformation matrix) will exist such that
A*X = B, i.e. X = A−1*B. Our matrix "X" will be of dimensions "D*D" and when
applied to a word embedding (matrix of dimensions 1*D, it gives a matrix of dimensions
1*D as output), it results in the word embedding of the transformed form of the word.
Due to inverse property of a matrix, it accurately remembers the word pairs used for
computing it. The matrix also appears to align itself with the word embedding of other
6
Akhtar et al.
words (not used for its training) to transform them according to the patterns that the
matrix follows.
3.1 Transformation between Similar Language Pairs
We tried our approach on a very similar language pair - "Hindi-Urdu" with Hindi as the
source language and Urdu as the target language. Durrnai et. al. [12] observed that 62%
of the Hindi vocabulary are also a part of the Urdu vocabulary after transliteration. The
approach smoothly maps embeddings between pairs of linguistically similar or deriva-
tive languages, as well as between languages of diverse linguistic properties. Similarity
between languages further improves the performance as is evident from results shown
in table 2.
Table 2. WS-UR-100 is the Urdu version of en-RG-65 and en-WS353 test sets. Note that hi-
SG-T denotes the scores of transformed word embeddings of hi-SG. We see that there is a large
increase in the scores of the transformed embeddings of hi-SG-T, considerably greater than en-
SG-T or de-SG-T over en-SG .
System WS-UR-100 Vocab
ur-SG
130K
hi-SG-T
34.50
50.08
-
3.2 Transformation between Diverse Language Pairs
Table 3. This table denotes the results of various systems on en-RG-65 test set. SO denotes
the scores of Soricut and Och [15]. ConceptNet denotes the results of ensemble approach by
Speer and Chin [17] and en-SG denotes the scores of the model trained by us. This table is
for comparison between en-SG and ConceptNet and how this difference is reflected when these
models are transformed to other languages.
System
SO [15]
SO w/ Morph [15]
en-SG
ConceptNet
en-RG-65 Vocab
1.2M
1.2M
2.4M
0.4M
75.1
75.1
74.12
90.16
We have used English RG-65 test set as a translation table for French RG-65 and
German RG-65 with minor corrections. It is to be noted that the French and German
versions of RG-65 were constructed by translating and re-annotating English RG-65.
We use word similarity task as our evaluation criteria. Given a word pair (French
or German), we find its translation in English using English RG-65 test as a translation
An Unsupervised Approach for Mapping between Vector Spaces
7
Table 4.
fr-RG-65 is the French version of en-RG-65 test set. Note that en-SG-T and
ConceptNet-T denote the scores of transformed word embeddings of en-SG and ConceptNet.
We can see that en-SG gave a score of 74.12 on en-RG-65 and 68.62 on fr-RG-65 after transfor-
mation, whereas for ConceptNet, the scores are 90.16 and 80.13 respectively.
System
SO [15]
SO w/ Morph [15]
fr-SG
en-SG-T
ConceptNet-T
fr-RG-65 Vocab
1.2M
1.2M
0.5M
63.6
67.3
62.48
68.62
80.13
-
-
table. We then find the corresponding word embedding of the word (English) in Con-
ceptNet/SG, and apply our transformation matrix on the word embedding, to generate
word embedding for the word in the vector space of target language (French or German)
which is further used to generate word similarity score. The scores are shown in Tables
3, 4 and 5.
Table 5. de-RG-65 is the German version of en-RG-65 test set. Note that en-SG-T and
ConceptNet-T denote the scores of transformed word embeddings of en-SG and ConceptNet. We
see that there is a proportional increase in the scores of the transformed embeddings of en-SG-T
and ConceptNet-T (as we saw in case of French).
System
SO [15]
SO w/ Morph [15]
de-SG
en-SG-T
ConceptNet-T
de-RG-65 Vocab
2.9M
2.9M
1.8M
62.4
64.1
64.96
67.3
83.17
-
-
We see that the approach performs better in the case of Hindi-Urdu as compared to
English-German and English-French, owing to similarity between the two languages.
Please note that the comparison is not made between ConceptNet-T and hi-SG-T but
between en-SG-T (of both French and German) and hi-SG-T because anything of sim-
ilar nature to ConceptNet does not exist for Hindi.
4 Transformation between Different Models of Same Language
While evaluating and testing our approach, we realized that it might be possible to port
and use multiple models as and when needed, for a single language. We often encounter
models trained for different types of data, for different purposes, but for the same lan-
guage. Our approach enables us to generate word embeddings for words that are miss-
ing in one model but are present in another model. This enables us to reduce number
8
Akhtar et al.
Table 6. Scores on Stanford Rare word test set. GN denotes the scores of embeddings trained in
Google-News word embeddings. SG denotes the scores of the embeddings trained by us. GN+SG
denotes the system in which we import the embeddings of any word missing in GN from SG.
System RW Unseen Words
GN
45.27
SG
40.08
GN+SG 48.56
173
88
58
Table 7. This table denotes the scores on MSR word analogy test set. GN denotes the word
embeddings trained on Google-News corpus. SG denotes the embeddings trained by us. GN+SG
denotes the system in which we import the embeddings of the words missing in GN from SG.
CosSum and CosMul denotes two different techniques for solving word analogy [13]. Unseen
words is the number of words missing from the model out of 16000.
System CosSum CosMul Unseen Words
0.646
GN
SG
0.484
GN+SG 0.674
0.67
0.533
0.701
2000
0
0
of unseen words encountered, and after careful evaluation, we found that this approach
indeed helps us. We tested this approach using word similarity and word analogy tasks
and it showed significant improvement in results.
For creating transformation matrix for two different models of same language, we
initially require two different models trained on two different datasets - so that there
are certain set of words which are not present in both the models. Then we take a small
corpus, for determining the frequent words of the language (above a frequency threshold
of 500 and also present in both the models). Using these frequent words, we create our
transformation matrix, procedure for which is similar to what we did earlier in section
3.
After creating this matrix, now whenever we encounter a word which is not present
in our first model, we look for the word in our second model, and if found, we apply
our transformation matrix to its embedding in our second model. This results in a rep-
resentation of the word, which proved to be good enough, when we ran word similarity
and word analogy tasks on it. Figure 3 gives a high level overview of how we try to in-
corporate different models of the same language via transformation matrix. The scores
are shown in tables 6 and 7.
5 Results and Analysis
The method seems to perform well not only for the same language but also for cross
lingual vector space transformation. Cross-lingual vector space transformation results
in state of the art results on word similarity test sets of French and German - an increase
of 13% in case of French and 19% for German (See tables 4 and 5).
An Unsupervised Approach for Mapping between Vector Spaces
9
Fig. 3. Porting multiple models of same language.
We see in table 8 that for the language pair Hindi-Urdu, there was considerably
greater increase than en-SG-T for both English-French and English-German. This may
be because Hindi-Urdu are very much more similar than either English-French and
English-German.
For transformation within the same language we saw a significant improvement on
both word similarity and word analogy test sets for English (See tables 6 and 7).
ConceptNet proved to be state of the art model for English, with significant improve-
ment in quality of word embeddings. However, its not possible to apply techniques like
ConceptNet on other languages because of their relative data scarcity. Our approach
allows us to overcome this hurdle with encouraging results for languages that are lin-
guistically similar to English.
6 Future Work
While we were able to significantly improve on baseline scores of Urdu and beat previ-
ous state of the art systems for German and French, and also improve scores by porting
two models to generate word embeddings for missing words, we could further extend
this approach by creating transformation matrix for not only two, but for all possible
10
Akhtar et al.
Table 8. Inter-Language comparison of results. "Increase on SG" denotes the difference between
the mentioned systems and the scores of SkipGram embeddings trained on the target languages -
fr-SG, de-SG and ur-SG respectively. We are not using ConceptNet-T for this comparison because
any equivalent embedding is not available for Hindi.
System Language Pair Increase on SG
hi-SG-T
en-SG-T English-French
en-SG-T English-German
15.58
6.14
2.34
Hindi-Urdu
combinations of models available. This way, when ever a particular model is being
used for a particular task, we can look for a missing word in other models and use its
transformed representation accordingly. Significant improvement in training word em-
beddings by mapping from a source language to a linguistically similar target language,
gives us the hypothesis that similar improvement can be achieved for training between
different dialects of the same language and we would like to test the approach further
on such pairs.
What we could also do is choosing best available word representation of a word in
two or more models. For example, even though we have a word present in our model,
but its representation is not reliable because of its low frequency in the corpus it was
trained on or we are able to detect somehow that it is not well trained. We could then
use a more reliable word embedding from other models, transform it for our model, and
then use it. We would still need to run various evaluation tasks on this approach to see
its impact and usage in future. We will also try to see if it can be modified to retain its
character in one model, and import characteristics from its other word representations
in other models, which are relatively more reliable. We could define a heuristic for the
same, and evaluate on various different values of parameters in the heuristics.
References
1. Bushra Jawaid, Amir Kamran, and Ondrej Bojar.: A Tagged Corpus and a Tagger for Urdu.
LREC 2014.
2. Camacho-Collados, Jos, Mohammad Taher Pilehvar, and Roberto Navigli.: A Framework for
the Construction of Monolingual and Cross-lingual Word Similarity Datasets. In ACL (2) (pp.
1-7).
3. Chris Dyer, Victor Chahuneau, and Noah A. Smith.: A Simple, Fast, and Effective Reparam-
eterization of IBM Model 2. In proceedings of NAACL.
4. Colette Joubarne and Diana Inkpen.: A Comparison of semantic similarity for different lan-
guages using the Google n-gram corpus and second-order co-occurrence measures. In Ad-
vances in Artificial Intelligence - 24th Canadian Conference on Artificial Intelligence, pages
216-221.
5. Cyrus Shaoul and Chris Westbury.: The Westbury lab Wikipedia corpus. In Edmonton, AB:
University of Alberta.
6. David Jurgens, Mohammad Taher Pilehvar, and Roberto Navigli.: Semeval-2014 task 3:
Cross-level semantic similarity. Proceedings of the 8th International Workshop on Semantic
Evaluation (SemEval 2014) in conjunction with COLING. 2014.
An Unsupervised Approach for Mapping between Vector Spaces
11
7. Herbert Rubenstein and John B. Goodenough.: Contextual correlates of synonym. Communi-
cations of the ACM, volume 8, number 10, pages 627-633.
8. Lev Finkelstein, Evgeniy Gabrilovich, Yossi Matias, Ehud Rivlin, Zach Solan, Gadi Wolfman
and Eytan Ruppin.: Placing search in context. Proceedings of the 10th international conference
on World Wide Web, pages 406-414.
9. Manaal Faruqui, Jesse Dodge, Sujay K. Jauhar, Chris Dyer, Eduard Hovy.: Retrofitting word
vectors to semantic lexicons. In proceedings of NAACL.
10. Minh-Thang Luong, Richard Socher and Christopher D. Manning.: Minh-Thang Luong,
Richard Socher and Christopher D. Manning. In CoNLL. Pages 104-113.
11. Mohit Bansal, Kevin Gimpel, and Karen Livescu. :Tailoring continuous word representations
for dependency parsing. In Proceedings of the 52nd Annual Meeting of the Association for
Computational Linguistics, ACL 2014, June 22-27, Baltimore, MD, USA, Volume 2: Short
Papers, pages 809-815.
12. Nadir Durrani, Hassan Sajjad, Alexander Fraser, and Helmut Schmid. 2010. Hindi-to-Urdu
machine translation through transliteration.
in Proceedings of the 48th Annual meeting of
the Association for Computational Linguistics, pp. 465-474. Association for Computational
Linguistics, 2010.
13. Omer Levy, Yoav Goldberg, and Ido Dagan. 2002. Improving distributional similarity with
lessons learned from word embeddings. Transactions of the Association for Computational
Linguistics 3 (2015): 211-225
14. Philipp Koehn. 2002. Europarl: A multilingual corpus for evaluation of machine transla-
tion. Proceedings of the 43rd Annual Meeting on Association for Computational Linguistics.
Association for Computational Linguistics, 2005.
15. Radu Soricut and Franz Och. 2015. Unsupervised Morphology Induction using Word Em-
beddings. In Proceedings of NAACL.
16. Richard Socher, John Bauer, Christopher D. Manning, and Andrew Y. Ng. 2013. Parsing
With Compositional Vector Grammars. In ACL, pages 455-465.
17. Robert Speer 2016. Ensemble Method to Produce High-Quality Word Embeddings. arXiv
preprint arXiv:1604.01692 (2016).
18. Scott Miller, Jethran Guinness, and Alex Zamanian. 2004. Name tagging with word clusters
and discriminative training. In Proceedings of HLT-NAACL, volume 4, pages 337-342.
19. Syed Sarfaraz Akhtar, Arihant Gupta, Avijit Vajpayee, Arjit Srivastava, Manish Shrivastava
2017. Word Similarity Datasets for Indian Languages: Annotation and Baseline Systems.
Proceedings of the 11th Linguistic Annotation Workshop, pages 91-94.
20. Tomas Mikolov, Kai Chen, Greg Corrado, and Jeff Dean. 2013. Efficient estimation of word
representations in vector space. In In arXiv preprint arXiv:1301.3781
21. Tomas Mikolov, Quoc V. Le, and Ilya Sutskever. 2013. Exploiting similarities among lan-
guages for machine translation. arXiv preprint arXiv:1309.4168 (2013).
22. Tomas Mikolov, Wen-tau Yih, and Geoffrey Zweig. 2013. Linguistic regularities in continu-
ous space word representations. In Proceedings of HLT-NAACL, volume 13, pages 746-751.
23. Torsten Zesch and Iryna Gurevych. 2006. Automatically creating datasets for measures of
semantic relatedness. In Proceedings of the Workshop on Linguistic Distances, pages 16-24.
|
1904.09537 | 1 | 1904 | 2019-04-21T03:49:09 | PullNet: Open Domain Question Answering with Iterative Retrieval on Knowledge Bases and Text | [
"cs.CL",
"cs.LG"
] | We consider open-domain queston answering (QA) where answers are drawn from either a corpus, a knowledge base (KB), or a combination of both of these. We focus on a setting in which a corpus is supplemented with a large but incomplete KB, and on questions that require non-trivial (e.g., ``multi-hop'') reasoning. We describe PullNet, an integrated framework for (1) learning what to retrieve (from the KB and/or corpus) and (2) reasoning with this heterogeneous information to find the best answer. PullNet uses an {iterative} process to construct a question-specific subgraph that contains information relevant to the question. In each iteration, a graph convolutional network (graph CNN) is used to identify subgraph nodes that should be expanded using retrieval (or ``pull'') operations on the corpus and/or KB. After the subgraph is complete, a similar graph CNN is used to extract the answer from the subgraph. This retrieve-and-reason process allows us to answer multi-hop questions using large KBs and corpora. PullNet is weakly supervised, requiring question-answer pairs but not gold inference paths. Experimentally PullNet improves over the prior state-of-the art, and in the setting where a corpus is used with incomplete KB these improvements are often dramatic. PullNet is also often superior to prior systems in a KB-only setting or a text-only setting. | cs.CL | cs | PullNet: Open Domain Question Answering with
Iterative Retrieval on Knowledge Bases and Text
Haitian Sun Tania Bedrax-Weiss William W. Cohen
{haitiansun,tbedrax,wcohen}@google.com
Google AI Language
9
1
0
2
r
p
A
1
2
]
L
C
.
s
c
[
1
v
7
3
5
9
0
.
4
0
9
1
:
v
i
X
r
a
Abstract
We consider open-domain queston answering
(QA) where answers are drawn from either a
corpus, a knowledge base (KB), or a combi-
nation of both of these. We focus on a set-
ting in which a corpus is supplemented with
a large but incomplete KB, and on questions
that require non-trivial (e.g., "multi-hop") rea-
soning. We describe PullNet, an integrated
framework for (1) learning what to retrieve
(from the KB and/or corpus) and (2) reasoning
with this heterogeneous information to find the
best answer. PullNet uses an iterative process
to construct a question-specific subgraph that
contains information relevant to the question.
In each iteration, a graph convolutional net-
work (graph CNN) is used to identify subgraph
nodes that should be expanded using retrieval
(or "pull") operations on the corpus and/or
KB. After the subgraph is complete, a simi-
lar graph CNN is used to extract the answer
from the subgraph. This retrieve-and-reason
process allows us to answer multi-hop ques-
tions using large KBs and corpora. PullNet is
weakly supervised, requiring question-answer
pairs but not gold inference paths. Experimen-
tally PullNet improves over the prior state-of-
the art, and in the setting where a corpus is
used with incomplete KB these improvements
are often dramatic. PullNet is also often supe-
rior to prior systems in a KB-only setting or a
text-only setting.
Introduction
1
Open domain Question Answering (QA) is the
task of finding answers to questions posed in nat-
ural language, usually using text from a corpus
(Dhingra et al., 2017; Joshi et al., 2017; Dunn
et al., 2017), or triples from a knowledge base
(KB) (Zelle and Mooney, 1996; Zettlemoyer and
Collins, 2005; Yih et al., 2015). Both of these ap-
proaches have limitations. Even the largest KBs
are incomplete (Min et al., 2013), which limits
recall of a KB-based QA system. On the other
hand, while a large corpus may contain more an-
swers than a KB, the diversity of natural language
makes corpus-based QA difficult (Chen et al.,
2017; Welbl et al., 2018; Kwiatkowski et al., 2019;
Yang et al., 2018).
In this paper we follow previous research
(Sawant et al., 2019; Sun et al., 2018) in deriving
answers using both a corpus and a KB. We focus
on tasks in which questions require compositional
(sometimes called "multi-hop") reasoning, and a
setting in which the KB is incomplete, and hence
must be supplemented with information extracted
from text. We also restrict ourselves in this paper
to answers which correspond to KB entities. For
this setting, we propose an integrated framework
for (1) learning what to retrieve, from either a cor-
pus, a KB, or a combination, and (2) combining
this heterogeneous information into a single data
structure that allows the system to reason and find
the best answer. In prior work, this approach was
termed an early fusion approach, and shown to im-
prove over late fusion methods, in which two QA
systems, one corpus-based and one KB-based, are
combined in an ensemble.
The system we describe, PullNet, builds on the
GRAFT-Net1 early fusion system. GRAFT-Net
uses heuristics to build a question-specific sub-
graph which contains sentences from the corpus,
entities from the KB, and facts from the KB. A
graph CNN (Kipf and Welling, 2016; Li et al.,
2016; Schlichtkrull et al., 2017) variant is then
used to reason over this graph and select an an-
swer. However, as we will show experimentally,
GRAFT-Net's heuristics often produce subgraphs
that far from optimal:
they are generally much
larger than necessary, and often do not contain the
answer at all.
1Graphs of Relations Among Facts and Text Networks.
PullNet also uses a reasoning process based on
a graph CNN to find answers. However, PullNet
learns how to construct the subgraph, rather than
using an ad hoc subgraph-building strategy. More
specifically, PullNet relies on a small set of re-
trieval operations, each of which takes a node in
an existing subgraph, and then expand the node by
retrieving new information from the KB or the cor-
pus. PullNet learns when and where to apply these
"pull" operations with another graph CNN classi-
fier. The "pull" classifier is weakly supervised ,
using question-answer pairs for supervision.
The end result is a learned iterative process for
subgraph construction, which begins with a small
subgraph containing only the question text and the
entities which it contains, and gradually expands
the subgraph to contain information from the KB
and corpus that are likely to be useful. The in-
cremental question-guided subgraph construction
process results in high-recall subgraphs that are
much smaller than the ones created heuristically,
making the final answer extraction process easier.
The process is especially effective for multi-hop
questions, which naively would require expand-
ing the subgraph to include all corpus and KB ele-
ments that are k hops away from the question.
PullNet
improves over the current state-of-
the-art for KB-only QA on several benchmark
datasets, and is superior to, or competitive with,
corpus-only QA on several others. For multi-hop
questions, this improvement is often dramatic: for
instance, MetaQA (Zhang et al., 2018) contains
multi-hop questions based on a small movie KB,
originally associated with the WikiMovies dataset
(Miller et al., 2016). In a KB-only setting, Pull-
Net improves hits-at-one performance for 3-hop
MetaQA questions from 62.5% to 91.4%. Perhaps
more interestingly, PullNet obtains performance
of 85.2% hits-at-one with a KB from which half
of the triples have been removed, if that KB is
supplemented with a corpus. We note that this re-
sult improves by 7% (absolute improvement) over
a pure corpus-based QA system, and by more than
25% over a pure KB-based QA system. In a simi-
lar incomplete-KB setting, PullNet improves over
GRAFTNet by 6.8% on the ComplexWebQues-
tions dataset (Talmor and Berant, 2018).
2 Related Work
This paper has focused on QA for multi-hop ques-
tions using large KBs and text corpora as the
information sources from which answers can be
drawn. The main technical contribution is an it-
erative question-guided retrieval mechanism that
retrieves information from KBs, corpora, or com-
binations of both. The iterative retrieval makes
it possible to follow long paths of reasoning on
large KBs, and as we show below, this leads to
new state-of-the art results on two datasets of this
sort. The hybrid KB/text retrieval, and the ability
to reason over combinations of text and KBs, lets
us extend these results to settings where only text
is available, and to settings where text and an in-
complete KB is available. These contributions are
based on much prior work.
A long line of QA models have been developed
which answer questions based on a single passage
of text (Dhingra et al., 2016; Yu et al., 2018; Seo
et al., 2016; Gao et al., 2018; Liu et al., 2017; De-
vlin et al., 2018). Generally, these "reading com-
prehension" systems operate by encoding the pas-
sage and question into an embedding space, and
due to memory limitations cannot be applied to a
large corpus instead of a short passage. To address
this limitation a number of systems have been de-
signed which use a "retrieve and read" pipeline
(Chen et al., 2017; Dhingra et al., 2017; Joshi
et al., 2017; Dunn et al., 2017; Wang et al., 2018,
2017), in which a retrieval system with high re-
call is piped into a reading comprehension system
that can find the answer. An alternative approach
is "phrase-indexed" QA (Seo et al., 2018), where
embedded phrases in a document are indexed and
searched over. Such systems differ from PullNet
in that only a single round of retrieval is used;
however, for questions that requires multi-hop rea-
soning, we believe is difficult for a single retrieval
step to find the relevant information. These sys-
tems are also not able to use both KB and text for
QA.
SplitQA (Talmor and Berant, 2018) is a text-
based QA system that cam decompose complex
questions (e.g.
conjunction, composition) into
simple subquestions, and perform retrieval on
them sequentially. Although it uses iterative re-
trieval for multi-hop questions, unlike PullNet,
SplitQA does not also use a KB as an information
source. Also, since SplitQA has been applied only
to the Complex WebQuestions dataset, it is unclear
how general its question decomposition methods
are.
There has also been much work on QA from
KBs alone, often using methods based on mem-
ory networks (Sukhbaatar et al., 2015), seman-
tic parsing (Zelle and Mooney, 1996; Zettlemoyer
and Collins, 2005) or reinforcement learning Das
et al. (2017a). Extending such KB-based work
to also use text, however, is non-trivial. In (Das
et al., 2017b) one approach for a hybrid text-based
and KB-based QA system is described, where key-
value memory networks are used to store text as
well as KB facts encoded with a universal schema
representation (Riedel et al., 2013). We use a
similar method as one of our baselines, follow-
ing (Sun et al., 2018). Another line of QA work
from text and KBs is exemplified by AQQU (Bast
and Haussmann, 2015) and its successors (Sawant
et al., 2019). These systems focus on questions
that, like the questions in the SimpleWebQues-
tions dataset, can be interpreted as identifying an
entity based on a relationship and related entity,
plus (potentially) additional restrictions described
in text, and it is unclear how to extend such ap-
proaches to multi-hop questions.
GRAFT-Net (Sun et al., 2018) supports multi-
hop reasoning on both KBs and text by introduc-
ing a question subgraph built with facts and text,
and uses a learned graph representation (Kipf and
Welling, 2016; Li et al., 2016; Schlichtkrull et al.,
2017; Scarselli et al., 2009) to perform the "rea-
soning" required to select the answer. We use
the same representation and reasoning scheme as
GRAFT-Net, but do not require that the entire
graph be retrieved in a single step. In our experi-
mental comparisons, this gives significant perfor-
mance gains for multi-hop reasoning tasks.
Combinations of KBs and text have also been
used for relation extraction and Knowledge Base
Completion (KBC) (Lao et al., 2012; Toutanova
et al., 2015; Das et al., 2017a). The QA task dif-
fers from KBC in that in QA, the inference process
must be conditioned on a natural-language ques-
tion, which leads to different constraints on which
methods can be used.
3 The PullNet Model
PullNet retrieves from two "knowledge sources",
a text corpus and a KB. Given a question, PullNet
will use these to construct a question subgraph that
can be used to answer the question. The question
subgraph is constructed iteratively.
Initially the
subgraph depends only on the question. PullNet
then iteratively expands the subgraph by choos-
ing nodes from which to "pull" information about,
from the KB or corpus as appropriate. The ques-
tion subgraph is heterogeneous, and contains both
entities, KB triples, and entity-linked text.
In this section, we will first introduce notation
defining the heterogeneous graph structure we use.
Then we will introduce the general iterative re-
trieval process. Finally, we will discuss the re-
trieval operations used on the corpus and KB, and
the classification operations on the graph which
determine where to perform the retrievals.
3.1 The Question Subgraph
A question subgraph for question q, denoted Gq =
{V,E}, is a hetogeneous graph that contains infor-
mation from both the text corpus and the KB rele-
vant to q. Let V denote the set of vertices, which
we also call nodes. Following GRAFT-Net (Sun
et al., 2018), there are three types of nodes: entity
nodes Ve, text nodes Vd, and fact nodes Vf , with
V = Ve∪Vd∪Vf . A entity node ve ∈ Ve represents
an entity from the knowledge base. A text node
vd ∈ Vd represents a document from the corpus,
with a sequence of tokens denoted (w1, . . . , wd).
In this paper, a document is always a single sen-
tence, to which an entity linker (Ji et al., 2014) has
been applied to detect and ground entity mentions.
A fact node vf ∈ Vf represents a triplet (vs, r, vo)
from the KB, with subject and objects vs, vo ∈ Ve
and relation r. We let E denote the set of edges
between nodes. An edge connects a fact node vf
and an entity node ve exists iff fact vf has ve as its
subject or object. An edge connects a text node vd
with entity node ve iff the entity is mentioned in
the text.
3.2
Iterative subgraph expansion and
classification
3.2.1 Overview
We start with a question subgraph G0
q = {V 0,E 0}
where V 0 = {eqi} is the list of entities mentioned
in the question and E 0 is an empty set. We iter-
atively expand the question subgraph G0
q until it
contains the information required to answer the
question.
The algorithm is shown in Alg 1. Briefly, we
expand the graph in T iterations. In each iteration,
we choose k entities to expand, and then for each
selected entity, we retrieve a set of related docu-
ments, and also a set of related facts. The new doc-
uments are then passed through an entity-linking
system to identify entities that occur in them, and
the head and tail entities of each fact will also be
extracted. The last stage in the iteration is to up-
date the question graph by adding all these new
edges. After the t-th iteration of expansion, an ad-
ditional classification step is applied to the final
question subgraph which predicts the answer en-
tity.
Algorithm 1 PullNet
1: Initialize question graph G0
2: for t = 1,··· , T do
3:
entities, with V 0 = {eqi} and E 0 = ∅.
q with question q and question
Classify and select the entity nodes in the graph with
probability larger than
{vei} = classify pullnodes(Gt
q, k)
for all ve in {vei} do
Perform pull operation on selected entity nodes
{vdi} = pull docs(ve, q)
{vfi} = pull facts(ve, q)
for all vd in {vdi} do
Extracted entities in new document nodes
{ve(d)i} = pull entities(vd)
for all vf in {vfi} do
Extract head and tail of new fact nodes
{ve(f )i} = pull headtail(vf )
Add new nodes and edges to question graph
4:
5:
6:
7:
8:
9:
10:
Gt+1
q = update(Gt
q)
11: Select entity node in final graph that is the best answer
vans = classify answer(GT
q )
We will now describe the operations used in Alg
1.
3.2.2 Pull Operations
Pull operations either retrieve information from a
knowledge source, or extract entities from a fact
or document.
The two extraction operations are relatively
simple. The pull entities(vd) operation in-
puts a document node vd, calls an entity linker
and returns all entities mentioned in vd. The
pull headtail(vf ) operation inputs a fact
node vf and returns the subject and object entity
of fact vf .
The retrieval operations are more complex. The
pull docs(ve, q)) operation retrieves relevant
documents from the corpus. We use an IDF-based
retrieval system, Lucene (McCandless et al., 2010)
and assume that all sentences have been entity-
linked prior to being indexed. The retrieved docu-
ments are constrained to link to entity ve, and are
ranked by their IDF similarity to the question q.
Only the top Nd documents in this ranking are re-
turned.
The pull facts(ve, q) operation retrieves
the top Nf facts from the KB about entity ve. The
retrieved facts are constrained to have ve as their
subject or object, and are ranked based on the sim-
ilarity S(r, q) between the fact's relation r and the
question q. Since it is not obvious how to as-
sess relevance of a fact to a question q, we learn a
S(r, q) as follows. Let hr be an embedding of re-
lation r, which is looked up from an embedding ta-
ble, and let q = (w1, . . . , wq) be the sequence of
words for question q. Similarity is defined as the
dot-product of the last-state LSTM representation
for q with the embedding for r. This dot-product is
then passed through a sigmoid function to bring it
into a range of [0, 1]: as we explain below, we will
train this similarity function as a classifier which
predicts which retrieved facts are relevant to the
question q. The final ranking method for facts is
thus
hq = LSTM(w1, . . . , wq) ∈ Rn
S(r, q) = sigmoid(hT
r hq)
During
subgraph
3.2.3 Classify Operations
Two types of classify operations are applied to
q. These operations are
the nodes in a subgraph Gt
applied only to the entity nodes in the graph, but
they are based on node representations computed
by the graph CNN, so the non-entity nodes and
edges also affect the classification results.
construction,
q) operation
the
re-
classify pullnodes(Gt
turns a probability an entity node ve should be
expanded in the next iteration. In subgraph con-
struction, we choose the k nodes with the highest
probability in each iteration. After the subgraph
is
q)
operation predicts whether an entity node answers
the question. The highest-scoring entity node is
returned as the final answer.
the classify answer(Gt
complete,
We use the same CNN architecture used by
GRAFT-Net (Sun et al., 2018) for classification.
GRAFT-Net's source is open-domain and it sup-
ports node classification on heterogeneous graphs
containing facts, entities, and documents. Graft-
Net differs from other graph CNN implementa-
tions, in using special mechanisms to distribute
representations across different types of nodes and
edges: notably, document nodes are represented
with LSTM encodings, extended by mechanisms
that allow the representations for entity nodes ve to
be passed into a document vd that mentions ve, and
mechanisms that allow the LSTM hidden states as-
sociated with an entity mention to be passed out of
vd to the associated entity node ve.
3.2.4 The Update Operation
The update operation takes the question sub-
graph Gt−1
from the previous iteration and up-
dates it by adding the newly retrieved entity nodes
{ve(f )i} ∪ {ve(d)i}, the text nodes {vdi}, and the
fact nodes {vfi}. It also updates the set of edges E
based on the definitions of Section 3.1. Note that
some new edges are derived when pull operations
are performed on text nodes and fact node, but
other new edges may connect newly-added nodes
with nodes that already exist in the previous sub-
graph.
q
3.3 Training
To train PullNet, we assume that we only observe
question and answer pairs, i.e., the actual infer-
ence chain required to answer the question is la-
tent. We thus need to use weak supervision to
train the classifiers and similarity scores described
above.
To train these models, we form an approxima-
tion of the ideal question subgraph for question q
as follows. Note that in training, the answer enti-
ties are available. We use these to find all shortest
paths in the KB between the question entities and
answer entities. Each entity e that appears in such
a shortest path will be marked as a candidate inter-
mediate entities. For each candidate intermediate
entity e we record its minimal distance te from the
question nodes.
When we train the classify pullnodes
classifier in iteration t, we treat as positive ex-
amples only those entities e(cid:48) that are connected
to a candidate intermediate entity e with distance
et = t+1. Likewise in training the similarity func-
tion S(hr, q) we treat as positive relations lead-
ing to candidate intermediate entities e at distance
et = t + 1. This encourages the retrieval to focus
on nodes that lie on shortest paths to an answer.
In training we use a variant of teacher forcing.
When training, we pull from all entity nodes with
a predicted score larger than some threshold ,
rather than only the top k nodes. If, during train-
ing, a candidate intermediate entity is not retrieved
in iteration te, we add it to the graph anyway. The
values T and are hyperparameters, but here we
always pick for T , the number of retrieval steps,
maximum length of the inference chain needed to
ensure full coverage of the answers.
We use the same classifier on the graph in the
retrieval step as in answer selection, except that
we change last fully-connected layer. The classi-
fiers used for retrieval in the different iterations are
identical.
The learned parts of the model are implemented
in PyTorch, using an ADAM optimizer (Kingma
and Ba, 2014), and the full retrieval process of Alg
1 is performed on each minibatch.
4 Experiments and Results
4.1 Datasets
MetaQA (Zhang et al., 2018) consists of more
than 400k single and multi-hop (up to 3-hop) ques-
tions in the domain of movies. The questions were
constructed using the knowledge base provided by
the WikiMovies (Miller et al., 2016) dataset. We
use the "vanilla" version of the queries: for this
version, the 1-hop questions in MetaQA are ex-
actly the same as WikiMovies. We use the KB and
text corpus that are supplied with the WikiMovies
dataset (Miller et al., 2016), and run use a sim-
ple exact match on surface forms to perform entity
linking. The KB used here is relatively small, with
about 43k entities and 135k triples.
WebQuestionsSP (Yih et al., 2015) contains 4737
natural language questions that are answerable us-
ing Freebase2. The questions require up to 2-hop
reasoning from knowledge base, and 1-hop rea-
soning using the corpus. We use Freebase as our
knowledge base but for ease of experimentation
restrict it to a subset of Freebase which contains
all facts that are within 2-hops of any entity men-
tioned in the questions of WebQuestionsSP. This
smaller KB contains 164.6 million facts and 24.9
million entities. We use Wikipedia as our text
corpus and again use a simple entity-linker: we
link entities by exact matching to any surface form
annotated in FACC1 project (Gabrilovich et al.,
2013).3
Complex WebQuestions 1.1 (Complex WebQ)
(Talmor and Berant, 2018) is generated from Web-
QuestionsSP by extending the question entities or
adding constraints to answers, in order to construct
2We use the same train/dev/test splits as GRAFT-Net (Sun
3If two overlapping spans are possible matches, we match
et al., 2018).
only the longer of them.
more complex multi-hop questions4. There are
four types of question: composition (45%), con-
junction (45%), comparative (5%), and superlative
(5%). The questions require up to 4-hops of rea-
soning on knowledge base and 2-hops on the cor-
pus. We use the same KB and corpus as used for
WebQuestionsSP.
MetaQA 1-hop
MetaQA 2-hop
MetaQA 3-hop
WebQuestionsSP
Complex WebQ
Train
96,106
118,980
114,196
2,848
27,623
Dev
9,992
14,872
14,274
250
3,518
Test
9,947
14,872
14,274
1,639
3,531
Table 1: Statistics of all datasets.
4.2 Tasks
We explored several different QA settings: KB
only (complete), corpus only, incomplete KB only,
and incomplete KB paired with the corpus.
In the KB only complete setting, the answer al-
ways exists in knowledge base: for all of these
datasets, this is true because the questions were
crowd-sourced to enforce this conditions. This is
the easiest setting for QA, but arguably unrealistic,
since with a more natural distribution of questions,
a KB is likely to be incomplete. Note that PullNet
can be used in this setting by simply removing the
pull docs operation.
In the text only setting we use only the corpus.
Again, PullNet can operate in this setting by re-
moving the pull facts operation.
In the incomplete KB setting, we simulate KB-
based QA on anincomplete KB by randomly dis-
carding some of the triples in the KB: specifically,
we randomly drop a fact from the knowledge base
with probability p = 50%.
In the incomplete KB plus text setting, we pair
the same incomplete knowledge base with the cor-
pus.
In principle this allows a learned QA sys-
tem to adopt many different hybrid strategies. For
simple 1-hop queries, a model might use the KB
when the required fact exists, and "back off" to
text when the KB is missing information. In mul-
tihop or conjunctive queries, the reasoning done
in answering the question might involve combin-
ing inferences done with text and inferences done
with KB triples.
4We use Complex WebQuestions v1.1, where the author
re-partition the train/dev/test data to prevent the leakage of
information.
Comment. One point to note is that our train-
ing procedure is based on finding shortest paths in
a complete KB, and we use this same procedure on
the incomplete KB setting as well. Thus the weak
training that we use should, in the incomplete-
KB settings, be viewed as a form of weak su-
pervision, with labels that are intermediate in in-
formativeness between pure distant training (with
only question-answer pairs) and gold inference
paths (a setting that has been extensively investi-
gated on some of these datasets, in particular Web-
QuestionsSP).
4.3 Baselines
We choose Key-Value Memory Network (Miller
et al., 2016) and GRAFT-Net (Sun et al., 2018) as
our baseline models: to the best of our knowledge,
these are the only ones that can use both text and
KBs for question answering. However, both mod-
els are limited in the number of facts and text that
can fit into memory. Thus, we create a separate re-
trieval process as a pre-processing step, which will
be discussed below.
Key-Value Memory Network (KVMem)
(Miller et al., 2016) maintains a memory table
which stores KB facts and text encoded into
key-value pairs. The encoding of KB facts is the
same as is presented in Miller et al. (2016). For
text, we use an bi-directional LSTM to encode the
text for the key and take the entities mentioned
in the text as values. Our implementation shows
comparable performance on the WikiMovies
(MetaQA 1-hop) datasets as reported previously,
as shown in Table 2.
For GRAFT-Net (Sun et al., 2018), we use the
implementation published by the author5; how-
ever, we run it on somewhat different data as de-
scribed in Section 4.4.
4.4 Subgraph Retrieval for Baseline Models
Text was retrieved (non-iteratively) using the IDF-
based similarity to the question.
It is less obvi-
ous how to perform KB retrieval: we would like
to retrieve as many facts as possible to maximize
the recall of answers, but it is infeasible to take
all facts that are within k-hop away from question
entities since the number grows exponentially, and
there is no widely-used heuristic, corresponding to
IDF-based text retrieval, for extracting subsets of
5https://github.com/OceanskySun/
GraftNet
50%
KB
63.6
64
65.1
MetaQA (1-hop) / wikimovies
50% KB
KB
+ Text
75.7
96.2
91.5
97.0
92.4
97.0
--
93.9
92.6
96.8
97.5
--
Text
75.4
82.5
84.4
76.2
86.6
--
--
68.0
--
KB
82.7
94.8
99.9
--
--
89.9
KV-Mem*
GraftNet*
PullNet (Ours)
KV-Mem
GraftNet
VRN
50%
KB
41.8
52.6
52.1
MetaQA (2-hop)
Text
7.0
36.2
81.0
--
--
--
--
--
--
50%KB
+ Text
48.4
69.5
90.4
--
--
--
MetaQA (3-hop)
Text
19.5
40.2
78.2
--
--
--
50%
KB
37.6
59.2
59.7
--
--
--
50% KB
+ Text
35.2
66.4
85.2
--
--
--
KB
48.9
77.7
91.4
--
--
62.5
Table 2: Hits@1 on MetaQA compared to baseline models. Number below the double line are from original
papers: KV-Mem (KB) (Miller et al., 2016), KV-Mem (Text) (Watanabe et al., 2017), GraftNet (Sun et al., 2018),
and VRN (Zhang et al., 2018). * Reimplemented or different data.
a KB. We elected to first run the PageRank-Nibble
algorithm (Andersen et al., 2006) with = 1e−6
and pick the top m entities. PageRank-Nibble ef-
ficiently approximates a personalized PageRank
(aka random walk with reset) seeded from the
questions (not the answers, which are of course
not available at test time). We then find all entities
from these top m entities that are within k-hops of
the question entities. Finally, we collect all facts
from the knowledge base that connect any pair of
the retrieved entities. This allows us to easily vary
the number of KB facts that are retrieved.
The retrieval results are shown in Table 3 and
4. For the smaller MetaQA KB, the proposed re-
trieval method finds high-coverage graphs. For
ComplexWebQuestions, the recall is only 64%,
even with a graph with nearly 2000 nodes: this is
expected, since retrieving the relevant entities for
a multi-hop question from a KB with millions of
entities is a difficult task.
wikimovies-KB wikimovies-KB (50%)
1-hop
2-hop
3-hop
0.995 / 9.17
0.983 / 47.3
0.923 / 459.2
0.544 / 4.58
0.344 / 28.6
0.522 / 316.6
Table 3: Retrieval performance for baseline retrieval
model on MetaQA with 500 PageRank-Nibble entities
(recall / # entities in graph)
WebQuestionsSP
Complex WebQ
Freebase
0.927 / 1876.9
0.644 / 1948.7
Freebase (50%)
0.485 / 1212.5
0.542 / 1849.2
Table 4: Retrieval performance for baseline retrieval
model on WebQuestionsSP and Complex WebQues-
tions with 2000 PageRank-Nibble entities (recall / #
entities in graph)
4.5 Main Results
4.5.1 MetaQA
The experimental results for MetaQA are shown in
Table 2. For 1-hop questions in MetaQA (which is
identical to WikiMovies), our model is compara-
ble to the state-of-the-art6. For the other three set-
tings, the performance of our re-implementation is
slightly worse than the results reported in by orig-
inal GRAFT-Net paper (Sun et al., 2018); this is
likely because we use a simpler retrieval module.
In the KB-only setting, PullNet shows a large
improvement over the baseline models on 2-hop
and 3-hop questions. For the text only setting,
PullNet also improves on the baselines, and other
prior models, by a large margin. Finally, PullNet
also shows significant improvements over base-
lines in the text and incomplete-KB-plus-text set-
tings. We also see that PullNet is able to effec-
tively combine KB and text information, as this
setting also greatly outperforms the incomplete
KB alone or the text alone.7
4.5.2 WebQuestionsSP
Table 5 presents the results on the WebQuestion-
sSP dataset. PullNet is comparable with GRAFT-
Net on the complete KB only setting and slightly
worse on the text only setting, but is consis-
tently better than GRAFT-Net on the incomplete
KB setting or the incomplete KB plus text set-
ting.
It is also significantly better than the re-
implemented GRAFT-Net, which uses the less
highly-engineered retrieval module.
4.5.3 Complex WebQuestions
Complex WebQuestions contains multi-hop ques-
tions against FreeBase: intuitively, one would ex-
pect that single-shot retrieval of facts and text
would not be able to always find efficient infor-
mation to answer such questions. Table 6 shows
66.7% questions in Wikimovies are ambiguous, e.g. ques-
tions about movies with remakes without specifying years.
7Another way to perform QA in the incomplete KB plus
text setting would be to ensemble two QA systems, one which
uses the incomplete KB, and one which uses the text. Al-
though we do not make that comparison here, prior work
(Sun et al., 2018) did show that GRAFT-Net outperforms
such "late fusion" approaches.
WebQuestionsSP
KV-Mem*
GraftNet*
PullNet (Ours)
GraftNet
NSM
KB
46.7
66.4
68.1
67.8
69.0 (F1)
Text
23.2
24.9
24.8
25.3
--
50%
KB
32.7
48.2
50.3
47.7
--
50% KB
+ Text
31.6
49.7
51.9
49.9
--
Table 5: Hits@1 on WebQuestionsSP compared to
baseline models. Number below the double line are
from original papers: GraftNet (Sun et al., 2018), and
NSM (Liang et al., 2017) (which only reports F1 in
their paper). * Reimplemented or different data.
our results for Complex WebQuestions on the de-
velopment set. An expected, PullNet shows sig-
nificant improvement over GRAFT-Net and KV-
Mem on all four settings. Once again we see some
improvement when pairing the incomplete knowl-
edge base with text, compared to using the incom-
plete knowledge base only or the text only.
Complex WebQuestions (dev)
50% KB
KB
+ Text
15.2
21.1
32.8
26.9
33.7
47.2
50%
KB
14.8
26.1
31.5
Text
7.4
10.6
13.1
KV-Mem*
GraftNet*
PullNet (Ours)
Table 6: Hits@1 on Complex WebQuestions (dev)
compared to baseline models. * Reimplemented or dif-
ferent data.
Complex WebQuestions (test)
GoogleSnippet Wikipedia
Freebase
SplitQA
PullNet
34.2
29.7
--
13.8
--
45.9
Table 7: Hits@1 on Complex WebQuestions (test).
Researchers are only allowed limited submis-
sions on the Complex WebQuestions test set, how-
ever, some results for the test set are shown in Ta-
ble 7. Results with the text-only (Wikipedia) set-
ting are comparable to the dev set results (13.8%
instead of 13.1%) as are results with the KB-only
setting (45.9% instead of 47.2%).
For completeness, we also compare to SplitQA
(Talmor and Berant, 2018). SplitQA takes a multi-
hop question and decomposes it into several sim-
ple sub-questions, and sends each of these to sub-
questions to the Google search engine. After
that, it applies a reading comprehension model to
gather information from the web snippets returned
by Google to find answers. Using this same collec-
tion of Google snippets as the corpus, our model
has 4.5% lower hists-at-one than SplitQA. How-
ever, the snippet corpus is arguably biased toward
the SplitQA model, since it was collected specif-
ically to support it. We also note unlike SplitQA,
PullNet relies only on open-source components
and corpora.
4.6 Further Results
4.6.1 Retrieval Performance of PullNet
We compare the retrieval performance of PullNet
and PageRank-Nibble on multi-hop questions with
a complete KB, varying the number of entities re-
trieved by PageRank-Nibble. The results in Figure
1 show that PullNet retrieves far fewer entities but
obtains higher recall.
Figure 1: Recall of graphs retrieved by PageRank-
Nibble compared with PullNet. Left: MetaQA (3-hop).
Right: Complex WebQuestions.
We also further explored the effectiveness of it-
erative retrieval for multi-hop questions on a text
corpus. The results are shown in Figure 2. Again,
PullNet with multiple iterations of retrieval, ob-
tains higher recall than a single iteration of IDF-
based retrieval on both the MetaQA (3-hop) and
the Complex WebQuestions dataset.
Figure 2: Recall of a single round of retrieval with
Apache Lucene compared with PullNet. Left: MetaQA
(3-hop). Right: Complex WebQuestions.
Figure 3 shows the recall of question subgraphs
on MetaQA (3-hop) questions as training pro-
ceeds. Performance of the retrieval components
of PullNet converges relatively quickly, with re-
call saturating after 10-20,000 examples (about
10-20% of a single epoch).
about 3 epochs for PullNet.
Figure 3: Recall of question subgraph on MetaQA 3-
hop questions.
4.6.2 Training Efficiency
We also analyze the training efficiency of PullNet.
PullNet's algorithm is quite different from prior
systems, since learning and retrieval are inter-
leaved: in most prior systems, including GRAFT-
Net, retrieval is performed only once, before learn-
ing. Intuitively, interleaving learning with the rel-
atively slow operation of retrieval is potentially
slower; on the other hand, PullNet's final ques-
tion subgraph is smaller than GRAFT-Net, which
makes learning potentially faster.
To study these issues, we plot the Hits@1 per-
formance of learned model versus wall clock time
in Figure 4. This experiment is run on Complex
WebQuestions in the KB-only setting, using one
high-end GPU. To be fair to GRAFT-Net, we used
a fast in-memory implementation of PageRank-
Nibble (based on SciPy sparse matrices), which
takes about 40 minutes to complete. GRAFT-Net
takes an average of 31.9 minutes per epoch, while
PullNet is around four times slower, taking an av-
erage of 114 minutes per epoch.
As the graph shows, initially PullNet's perfor-
mance is better, since GRAFT-Net cannot start
learning until the preprocessing finishes. GRAFT-
Net's faster learning speed then allows it to domi-
nates for some time. GRAFT-Net reaches its peak
performance in about 3.6 hours. PullNet passes
GRAFT-Net in hits-at-one after around 6 hours, or
Figure 4: Performance of PullNet and GRAFT-Net un-
der wall clock training time.
5 Conclusions
PullNet is a novel integrated QA framework for (1)
learning what to retrieve from a KB and/or corpus
and (2) reasoning with this heterogeneous to find
the best answer. Unlike prior work, PullNet uses
an iterative process to construct a question-specific
subgraph that contains information relevant to the
question. In each iteration, a graph-CNN is used to
identify subgraph nodes that should be expanded
using retrieval (or "pull") operations on the corpus
and/or KB. This iterative process makes it possible
to retrieve a small graph that contains just the in-
formation relevant to a multi-hop question -- a task
that is in general difficult.
Experimentally PullNet improves over the prior
state-of-the art for the setting in which questions
are answered with a corpus plus an incomplete
KB, or in settings in which questions need com-
plex "multi-hop" reasoning. Sometimes the per-
formance improvements are dramatic: e.g., an im-
provement from 62.5% hits-at-one to 91.4% hits-
at-one for 3-hop MetaQa with a KB, or improve-
ments from 32.8% to 47.2% for Complex Web-
Questions with a KB.
References
Reid Andersen, Fan Chung, and Kevin Lang. 2006.
Local graph partitioning using pagerank vectors. In
2006 47th Annual IEEE Symposium on Foundations
of Computer Science (FOCS'06), pages 475 -- 486.
IEEE.
Hannah Bast and Elmar Haussmann. 2015. More ac-
curate question answering on freebase. In Proceed-
ings of the 24th ACM International on Conference
on Information and Knowledge Management, pages
1431 -- 1440. ACM.
Danqi Chen, Adam Fisch, Jason Weston, and Antoine
Bordes. 2017. Reading Wikipedia to answer open-
In Association for Computa-
domain questions.
tional Linguistics (ACL).
Rajarshi Das, Shehzaad Dhuliawala, Manzil Za-
heer, Luke Vilnis, Ishan Durugkar, Akshay Kr-
ishnamurthy, Alex Smola, and Andrew McCal-
lum. 2017a. Go for a walk and arrive at the an-
swer: Reasoning over paths in knowledge bases
arXiv preprint
using reinforcement
arXiv:1711.05851.
learning.
Rajarshi Das, Manzil Zaheer, Siva Reddy, and An-
drew McCallum. 2017b. Question answering on
knowledge bases and text using universal schema
and memory networks. CoRR, abs/1704.08384.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and
Kristina Toutanova. 2018. Bert: Pre-training of deep
bidirectional transformers for language understand-
ing. arXiv preprint arXiv:1810.04805.
Bhuwan Dhingra, Hanxiao Liu, Zhilin Yang,
William W Cohen, and Ruslan Salakhutdinov.
2016. Gated-attention readers for text comprehen-
sion. arXiv preprint arXiv:1606.01549.
Bhuwan Dhingra, Kathryn Mazaitis, and William W
Cohen. 2017. Quasar: Datasets for question an-
arXiv preprint
swering by search and reading.
arXiv:1707.03904.
Matthew Dunn, Levent Sagun, Mike Higgins, V Ugur
Guney, Volkan Cirik, and Kyunghyun Cho. 2017.
Searchqa: A new q&a dataset augmented with
arXiv preprint
context from a search engine.
arXiv:1704.05179.
Evgeniy Gabrilovich, Michael Ringgaard, and Amar-
nag Subramanya. 2013. Facc1: Freebase annotation
of clueweb corpora, version 1 (release date 2013-06-
26, format version 1, correction level 0).
Mingfei Gao, Ruichi Yu, Ang Li, Vlad I Morariu, and
Larry S Davis. 2018. Dynamic zoom-in network for
In Proceed-
fast object detection in large images.
ings of the IEEE Conference on Computer Vision
and Pattern Recognition, pages 6926 -- 6935.
Heng Ji, Joel Nothman, Ben Hachey, et al. 2014.
Overview of tac-kbp2014 entity discovery and link-
In Proc. Text Analysis Conference
ing tasks.
(TAC2014), pages 1333 -- 1339.
Diederik P Kingma and Jimmy Ba. 2014. Adam: A
method for stochastic optimization. arXiv preprint
arXiv:1412.6980.
Thomas N Kipf and Max Welling. 2016.
Semi-
supervised classification with graph convolutional
networks. arXiv preprint arXiv:1609.02907.
Tom Kwiatkowski, Jennimaria Palomaki, Olivia Red-
field, Michael Collins, Ankur Parikh, Chris Alberti,
Danielle Epstein, Illia Polosukhin, Matthew Kelcey,
Jacob Devlin, Kenton Lee, Kristina N. Toutanova,
Llion Jones, Ming-Wei Chang, Andrew Dai, Jakob
Uszkoreit, Quoc Le, and Slav Petrov. 2019. Natu-
ral questions: a benchmark for question answering
research. Transactions of the Association of Com-
putational Linguistics.
Ni Lao, Amarnag Subramanya, Fernando Pereira, and
William W Cohen. 2012. Reading the web with
learned syntactic-semantic inference rules. In Pro-
ceedings of the 2012 Joint Conference on Empiri-
cal Methods in Natural Language Processing and
Computational Natural Language Learning, pages
1017 -- 1026. Association for Computational Linguis-
tics.
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and
Richard Zemel. 2016. Gated graph sequence neu-
ral networks. ICLR.
Chen Liang, Jonathan Berant, Quoc Le, Kenneth D
Forbus, and Ni Lao. 2017. Neural symbolic ma-
chines: Learning semantic parsers on freebase with
weak supervision. ACL.
Rui Liu, Wei Wei, Weiguang Mao, and Maria Chik-
ina. 2017. Phase conductor on multi-layered atten-
tions for machine comprehension. arXiv preprint
arXiv:1710.10504.
Michael McCandless, Erik Hatcher, and Otis Gospod-
Lucene in action: covers Apache
netic. 2010.
Lucene 3.0. Manning Publications Co.
Alexander Miller, Adam Fisch, Jesse Dodge, Amir-
Hossein Karimi, Antoine Bordes, and Jason We-
ston. 2016. Key-value memory networks for directly
reading documents. EMNLP.
Bonan Min, Ralph Grishman, Li Wan, Chang Wang,
and David Gondek. 2013. Distant supervision for
relation extraction with an incomplete knowledge
In NAACL HLT 2013 - 2013 Conference
base.
of the North American Chapter of the Association
for Computational Linguistics: Human Language
Technologies, Proceedings of the Main Conference,
pages 777 -- 782. Association for Computational Lin-
guistics (ACL).
Mandar Joshi, Eunsol Choi, Daniel S. Weld, and Luke
Zettlemoyer. 2017. Triviaqa: A large scale distantly
supervised challenge dataset for reading comprehen-
sion. In Proceedings of the 55th Annual Meeting of
the Association for Computational Linguistics, Van-
couver, Canada. Association for Computational Lin-
guistics.
Sebastian Riedel, Limin Yao, Andrew McCallum, and
Benjamin M Marlin. 2013. Relation extraction with
matrix factorization and universal schemas. In Pro-
ceedings of the 2013 Conference of the North Amer-
ican Chapter of the Association for Computational
Linguistics: Human Language Technologies, pages
74 -- 84.
Uma Sawant, Saurabh Garg, Soumen Chakrabarti, and
Ganesh Ramakrishnan. 2019. Neural architecture
for question answering using a knowledge graph and
Information Retrieval Journal, pages
web corpus.
1 -- 26.
Johannes Welbl, Pontus Stenetorp, and Sebastian
Riedel. 2018. Constructing datasets for multi-hop
reading comprehension across documents. Transac-
tions of the Association of Computational Linguis-
tics, 6:287 -- 302.
Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Ben-
gio, William Cohen, Ruslan Salakhutdinov, and
Christopher D Manning. 2018. Hotpotqa: A dataset
for diverse, explainable multi-hop question answer-
ing. In Proceedings of the 2018 Conference on Em-
pirical Methods in Natural Language Processing,
pages 2369 -- 2380.
Wen-tau Yih, Ming-Wei Chang, Xiaodong He, and
Jianfeng Gao. 2015. Semantic parsing via staged
query graph generation: Question answering with
knowledge base. In Proceedings of the 53rd Annual
Meeting of the Association for Computational Lin-
guistics and the 7th International Joint Conference
on Natural Language Processing (Volume 1: Long
Papers), pages 1321 -- 1331, Beijing, China. Associ-
ation for Computational Linguistics.
Adams Wei Yu, David Dohan, Minh-Thang Luong, Rui
Zhao, Kai Chen, Mohammad Norouzi, and Quoc V
Le. 2018. Qanet: Combining local convolution
with global self-attention for reading comprehen-
sion. arXiv preprint arXiv:1804.09541.
John M Zelle and Raymond J Mooney. 1996. Learn-
ing to parse database queries using inductive logic
programming. In Proceedings of the Thirteenth Na-
tional conference on Artificial intelligence-Volume
2, pages 1050 -- 1055. AAAI Press.
Luke S Zettlemoyer and Michael Collins. 2005. Learn-
ing to map sentences to logical form: structured
classification with probabilistic categorial gram-
In Proceedings of the Twenty-First Confer-
mars.
ence on Uncertainty in Artificial Intelligence, pages
658 -- 666. AUAI Press.
Yuyu Zhang, Hanjun Dai, Zornitsa Kozareva, Alexan-
der J Smola, and Le Song. 2018. Variational reason-
ing for question answering with knowledge graph.
In AAAI.
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus
Hagenbuchner, and Gabriele Monfardini. 2009. The
graph neural network model. IEEE Transactions on
Neural Networks, 20(1):61 -- 80.
Michael Schlichtkrull, Thomas N Kipf, Peter Bloem,
Rianne van den Berg, Ivan Titov, and Max Welling.
2017. Modeling relational data with graph convolu-
tional networks. arXiv preprint arXiv:1703.06103.
Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and
Hannaneh Hajishirzi. 2016. Bidirectional attention
flow for machine comprehension. arXiv preprint
arXiv:1611.01603.
Minjoon Seo, Tom Kwiatkowski, Ankur Parikh, Ali
Farhadi, and Hannaneh Hajishirzi. 2018. Phrase-
indexed question answering: A new challenge for
scalable document comprehension. In Proceedings
of the 2018 Conference on Empirical Methods in
Natural Language Processing, pages 559 -- 564.
Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston,
and Rob Fergus. 2015. End-to-end memory net-
works. In NIPS.
Haitian Sun, Bhuwan Dhingra, Manzil Zaheer, Kathryn
Mazaitis, Ruslan Salakhutdinov, and William W Co-
hen. 2018. Open domain question answering using
early fusion of knowledge bases and text. EMNLP.
A. Talmor and J. Berant. 2018.
The web as a
knowledge-base for answering complex questions.
In North American Association for Computational
Linguistics (NAACL).
Kristina Toutanova, Danqi Chen, Patrick Pantel, Hoi-
fung Poon, Pallavi Choudhury, and Michael Gamon.
2015. Representing text for joint embedding of text
In Proceedings of the 2015
and knowledge bases.
Conference on Empirical Methods in Natural Lan-
guage Processing, pages 1499 -- 1509.
Shuohang Wang, Mo Yu, Xiaoxiao Guo, Zhiguo Wang,
Tim Klinger, Wei Zhang, Shiyu Chang, Gerry
Tesauro, Bowen Zhou, and Jing Jiang. 2018. R 3:
Reinforced ranker-reader for open-domain question
In Thirty-Second AAAI Conference on
answering.
Artificial Intelligence.
Shuohang Wang, Mo Yu, Jing Jiang, Wei Zhang,
Xiaoxiao Guo, Shiyu Chang, Zhiguo Wang, Tim
Klinger, Gerald Tesauro, and Murray Campbell.
2017.
re-
ranking in open-domain question answering. CoRR,
abs/1711.05116.
Evidence aggregation for answer
Yusuke Watanabe, Bhuwan Dhingra, and Ruslan
Salakhutdinov. 2017. Question answering from
unstructured text by retrieval and comprehension.
arXiv preprint arXiv:1703.08885.
|
1910.11491 | 1 | 1910 | 2019-10-25T02:14:17 | Attention Optimization for Abstractive Document Summarization | [
"cs.CL"
] | Attention plays a key role in the improvement of sequence-to-sequence-based document summarization models. To obtain a powerful attention helping with reproducing the most salient information and avoiding repetitions, we augment the vanilla attention model from both local and global aspects. We propose an attention refinement unit paired with local variance loss to impose supervision on the attention model at each decoding step, and a global variance loss to optimize the attention distributions of all decoding steps from the global perspective. The performances on the CNN/Daily Mail dataset verify the effectiveness of our methods. | cs.CL | cs | Attention Optimization for Abstractive Document Summarization
Min Gui1, Junfeng Tian1, Rui Wang1, Zhenglu Yang2
1 Alibaba Group, China
2 School of Computer Science, Nankai University, China
{guimin.gm, tjf141457, masi.wr}@alibaba-inc.com
9
1
0
2
t
c
O
5
2
]
L
C
.
s
c
[
1
v
1
9
4
1
1
.
0
1
9
1
:
v
i
X
r
a
[email protected]
Abstract
Attention plays a key role in the improve-
ment of sequence-to-sequence-based docu-
ment summarization models. To obtain a pow-
erful attention helping with reproducing the
most salient information and avoiding repeti-
tions, we augment the vanilla attention model
from both local and global aspects. We pro-
pose an attention refinement unit paired with
local variance loss to impose supervision on
the attention model at each decoding step, and
a global variance loss to optimize the atten-
tion distributions of all decoding steps from
the global perspective. The performances on
the CNN/Daily Mail dataset verify the effec-
tiveness of our methods.
Introduction
1
Abstractive document summarization (Rush et al.,
2015; Nallapati et al., 2016; Tan et al., 2017; Chen
and Bansal, 2018; Celikyilmaz et al., 2018) at-
tempts to produce a condensed representation of
the most salient information of the document, as-
pects of which may not appear as parts of the
original input text. One popular framework used
in abstractive summarization is the sequence-to-
sequence model introduced by Sutskever et al.
The attention mechanism (Bahdanau
(2014).
et al., 2014) is proposed to enhance the sequence-
to-sequence model by allowing salient features to
dynamically come to the forefront as needed to
make up for the incapability of memorizing the
long input source.
However, when it comes to longer documents,
basic attention mechanism may lead to distraction
and fail to attend to the relatively salient parts.
Therefore, some works focus on designing vari-
ous attentions to tackle this issue (Tan et al., 2017;
Gehrmann et al., 2018). We follow this line of re-
search and propose an effective attention refine-
ment unit (ARU). Consider the following case.
Even with a preliminary idea of which parts of
source document should be focused on (attention),
sometimes people may still have trouble in decid-
ing which exact part should be emphasized for the
next word (the output of the decoder). To make
a more correct decision on what to write next,
people always adjust the concentrated content by
reconsidering the current state of what has been
summarized already. Thus, ARU is designed as
an update unit based on current decoding state,
aiming to retain the attention on salient parts but
weaken the attention on irrelevant parts of input.
The de facto standard attention mechanism is
a soft attention that assigns attention weights to
all input encoder states, while according to previ-
ous work (Xu et al., 2015; Shankar et al., 2018), a
well-trained hard attention on exact one input state
is conducive to more accurate results compared to
the soft attention. To maintain good performance
of hard attention as well as the advantage of end-
to-end trainability of soft attention, we introduce
a local variance loss to encourage the model to
put most of the attention on just a few parts of
input states at each decoding step. Additionally,
we propose a global variance loss to directly opti-
mize the attention from the global perspective by
preventing assigning high weights to the same lo-
cations multiple times. The global variance loss
is somewhat similar with the coverage mechanism
(Tu et al., 2016; See et al., 2017), which is also
designed for solving the repetition problem. The
coverage mechanism introduces a coverage vec-
tor to keep track of previous decisions at each
decoding step and adds it into the attention cal-
culation. However, when the high attention on
certain position is wrongly assigned during pre-
vious timesteps, the coverage mechanism hinders
the correct assignment of attention in later steps.
We conduct our experiments on the CNN/Daily
Mail dataset and achieve comparable results on
ROUGE (Lin, 2004) and METEOR (Denkowski
and Lavie, 2014) with the state-of-the-art models.
Our model surpasses the strong pointer-generator
baseline (w/o coverage) (See et al., 2017) on all
ROUGE metrics by a large margin. As far as
we know, we are the first to introduce explicit
loss functions to optimize the attention. More
importantly, the idea behind our model is simple
but effective. Our proposal could be applied to
improve other attention-based models, which we
leave these explorations for the future work.
2 Proposed model
2.1 Model Architecture
We adopt the Pointer-Generator Network (PGN)
(See et al., 2017) as our baseline model, which
augments the standard attention-based seq2seq
model with a hybrid pointer network (Vinyals
et al., 2015). An input document is firstly fed
into a Bi-LSTM encoder, then an uni-directional
LSTM is used as the decoder to generate the sum-
mary word by word. At each decoding step, the
attention distribution at and the context vector ct
are calculated as follows:
Figure 1: The process of attention optimization (better
view in color). The original attention distribution (red
bar on the left) is updated by the refinement gate rt and
attention on some irrelevant parts are lowered. Then the
updated attention distribution (blue bar in the middle)
is further supervised by a local variance loss and get a
final distribution (green bar on the right).
be updated. Small value of rti indicates that the
content of i-th position is not much relevant to cur-
rent decoding state st, and the attention on i-th po-
sition should be weakened to avoid confusing the
model. The attention distribution is updated as fol-
lows (the symbol (cid:12) means element-wise product):
t = rt (cid:12) at
ar
(5)
eti = vT tanh(Whhi + Wsst + battn)
at = softmax(et)
(cid:88)
ct =
atihi
(1)
(2)
(3)
i=1
where hi and st are the hidden states of the en-
coder and decoder, respectively. Then, the token-
generation softmax layer reads the context vector
ct and current hidden state st as inputs to compute
the vocabulary distribution. To handle OOVs, we
inherit the pointer mechanism to copy rare or un-
seen words from the input document (refer to See
et al. (2017) for more details).
To augment the vanilla attention model, we pro-
pose the Attention Refinement Unit (ARU) mod-
ule to retain the attention on the salient parts while
weakening the attention on the irrelevant parts of
input. As illustrated in Figure 1, the attention
weight distribution at at timestep t (the first red
histogram) is fed through the ARU module. In the
ARU module, current decoding state st and atten-
tion distribution at are combined to calculate a re-
finement gate rt:
2.2 Local Variance Loss
As discussed in section 1, the attention model
putting most of attention weight on just a few
parts of the input tends to achieve good perfor-
mance. Mathematically, when only a small num-
ber of values are large, the shape of the distribu-
tion is sharp and the variance of the attention dis-
tribution is large. Drawing on the concept of vari-
ance in mathematics, local variance loss is defined
as the reciprocal of its variance expecting the at-
tention model to be able to focus on more salient
parts. The standard variance calculation is based
on the mean of the distribution. However, as pre-
vious work (Huang et al., 1979; Jung et al., 2018)
mentioned that the median value is more robust to
outliers than the mean value, we use the median
value to calculate the variance of the attention dis-
tribution. Thus, local variance loss can be calcu-
lated as:
var(ar
t ) =
ti − ar
t )2
(ar
D(cid:88)
T(cid:88)
i=1
1
D
(6)
(7)
rt = σ(W r
s st + W r
a at + br)
(4)
LL =
1
T
1
var(ar
t ) +
t
where σ is the sigmoid activation function, W r
s ,
a and br are learnable parameters. rt represents
W r
how much degree of the current attention should
where · is a median operator and is utilized to
avoid zero in the denominator.
2.3 Global Variance Loss
To avoid the model attending to the same parts
of the input states repeatedly, we propose another
variance loss to adjust the attention distribution
globally.
Ideally, the same locations should be
assigned a relatively high attention weight once
at most. Different from the coverage mechanism
(See et al., 2017; Tu et al., 2016) tracking attention
distributions of previous timesteps, we maintain
the sum of attention distributions over all decoder
timesteps, denoted as A. The i-th value of A repre-
sents the accumulated attention that the input state
at i-th position has received throughout the whole
decoding process. Without repeated high atten-
tion being paid to the same location, the difference
between the sum of attention weight and maxi-
mum attention weight of i-th input state among all
timesteps should be small. Moreover, the whole
distribution of the difference over all input posi-
tions should have a flat shape. Similar to the def-
inition of local variance loss, the global variance
loss is formulated as:
(cid:88)
t
1
D
gi =
LG =
(ar
ti)
t
ti) − max
(ar
D(cid:88)
(gi − g)2
i=1
(8)
(9)
where gi represents the difference between the ac-
cumulated attention weight and maximum atten-
tion weight at i-th position.
2.4 Model Training
The model is firstly pre-trained to minimize the
maximum-likelihood loss, which is widely used
in sequence generation tasks. We define y∗ =
{y∗
T} as the ground-truth output sequence
for a given input sequence x, then the loss function
is formulated as:
1,··· , y∗
LM LE = − 1
T
log(p(y∗
t x)
(10)
After converging, the model is further optimized
with local variance loss and global variance loss.
The mix of loss functions is:
L = LM LE + λ1LL + λ2LG
(11)
where λ1 and λ2 are hyper-parameters.
T(cid:88)
t=1
3 Experiments
3.1 Preliminaries
Dataset and Metrics. We conduct our model on
the large-scale dataset CNN/Daily Mail (Hermann
et al., 2015; Nallapati et al., 2016), which is widely
used in the task of abstractive document summa-
rization with multi-sentences summaries. We use
the scripts provided by See et al. (2017) to obtain
the non-anonymized version of the dataset with-
out preprocessing to replace named entities. The
dataset contains 287,226 training pairs, 13,368
validation pairs and 11,490 test pairs in total. We
use the full-length ROUGE F11 and METEOR2 as
our main evaluation metrics.
Implementation Details. The data preprocess-
ing is the same as PGN (See et al., 2017), and
we randomly initialize the word embeddings. The
hidden states of the encoder and the decoder are
both 256-dimensional and the embedding size is
also 256. Adagrad with learning rate 0.15 and an
accumulator with initial value 0.1 are used to train
the model. We conduct experiments on a single
Tesla P100 GPU with a batch size of 64 and it
takes about 50000 iterations for pre-training and
10000 iterations for fine-tuning. Beam search size
is set to 4 and trigram avoidance (Paulus et al.,
2018) is used to avoid trigram-level repetition.
Tuned on validation set, λ1 and λ2 in the loss func-
tion (Equation. 11) is set to 0.3 and 0.1, respec-
tively.
3.2 Automatic Evaluation Result
As shown in Table 1 (the performance of other
models is collected from their papers), our model
exceeds the PGN baseline by 3.85, 2.1 and 3.37
in terms of R-1, R-2 and R-L respectively and
receives over 3.23 point boost on METEOR.
FastAbs (Chen and Bansal, 2018) regards ROUGE
scores as reward signals with reinforcement learn-
ing, which brings a great performance gain. DCA
(Celikyilmaz et al., 2018) proposes deep com-
municating agents with reinforcement setting and
achieves the best results on CNN/Daily Mail. Al-
though our experimental results have not outper-
formed the state-of-the-art models, our model has
a much simpler structure with fewer parameters.
Besides, these simple methods do yield a boost
1We use the official package pyrouge https://pypi.
org/project/pyrouge/
2http://www.cs.cmu.edu/alavie/METEOR/
Models
ROUGE-1 ROUGE-2 ROUGE-L METEOR
PREVIOUS WORKS
PGN (See et al., 2017)
PGN+Coverage (See et al., 2017)
Intra-att.+RL (Paulus et al., 2018)
FastAbs+RL (Chen and Bansal, 2018)
DCA+RL (Shi et al., 2018)
36.44
39.53
39.87
40.88
41.69
PGN (ours)
PGN+Coverage (ours)
PGN+ARU
+Local variance loss
+Global variance loss
OUR MODELS
36.72
39.75
37.41
39.45
40.29
15.66
17.28
15.82
17.80
19.47
15.76
17.42
16.01
17.26
17.76
33.41
36.38
36.90
38.54
37.92
33.40
36.36
34.05
35.99
36.78
16.65
18.72
-
20.38
-
17.19
19.73
18.03
19.02
19.88
Table 1: Performance on CNN/Daily Mail test dataset.
in performance compared with PGN baseline and
may be applied on other models with attention
mechanism.
We further evaluate how these optimization ap-
proaches work. The results at the bottom of Ta-
ble 1 verify the effectiveness of our proposed
methods. The ARU module has achieved a gain
of 0.97 ROUGE-1, 0.35 ROUGE-2, and 0.64
ROUGE-L points; the local variance loss boosts
the model by 3.01 ROUGE-1, 1.6 ROUGE-2, and
2.58 ROUGE-L. As shown in Figure 2, the global
variance loss helps with eliminating n-gram repe-
titions, which verifies its effectiveness.
3.3 Human Evaluation and Case Study
We also conduct human evaluation on the gen-
erated summaries. Similar to the previous work
(Chen and Bansal, 2018; Nallapati et al., 2017),
we randomly select 100 samples from the test
set of CNN/Daily Mail dataset and ask 3 human
testers to measure relevance and readability of
each summary. Relevance is based on how much
salient information does the summary contain, and
readability is based on how fluent and grammat-
ical the summary is. Given an article, different
people may have different understandings of the
main content of the article, the ideal situation is
that more than one reference is paired with the ar-
ticles. However, most of summarization datasets
contain the pairs of article with a single refer-
ence summary due to the cost of annotating multi-
references. Since we use the reference summaries
as target sequences to train the model and assume
that they are the gold standard, we give both arti-
cles and reference summaries to the annotator to
score the generated summaries.
In other words,
Models
Reference
PGN
PGN+Coverage
Our model
Relevance Readability
5.00
2.27
2.46
2.74
5.00
4.30
4.88
4.92
Table 2: Human Evaluation: pairwise comparison be-
tween our final model and PGN model.
we compare the generated summaries against the
reference ones and the original article to obtain the
(relative) scores in Table 3. Each perspective is as-
sessed with a score from 1 (worst) to 5 (best). The
result in Table 2 demonstrate that our model per-
forms better under both criteria w.r.t. See et al.
(2017). Additionally, we show the example of
summaries generated by our model and baseline
model in Table 3. As can be seen from the table,
PGN suffers from repetition and fails to obtain the
salient information. Though with coverage mech-
anism solving saliency and repetition problem, it
generates many trivial facts. With ARU, the model
successfully concentrates on the salient informa-
tion, however, it also suffers from serious repeti-
tion problem. Further optimized by the variance
loss, our model can avoid repetition and gener-
ate summary with salient information. Besides,
our generated summary contains fewer trivial facts
compared to the PGN+Coverage model.
4 Related Work
The exploration on document summarization can
be broadly divided into extractive and abstractive
summarization. The extractive methods (Nalla-
pati et al., 2017; Jadhav and Rajan, 2018; Shi
Article: poundland has been been forced to pull decorative plastic easter eggs from their shelves over fears children may
choke - because they look like cadbury mini eggs . trading standards officials in buckinghamshire and surrey raised
the alarm over the chinese made decorations , as they were ' likely to contravene food imitation safety rules ' . the eggs
have now been withdrawn nationwide ahead of the easter break . scroll down for video . poundland has been been forced to
pull decorative plastic easter eggs from their shelves over fears they may choke - because they look like cadbury mini eggs
-lrb- pictured is the poundland version -rrb- . the eggs bear a striking similarity to the sugar-coated chocolate treats
with a brown ' speckle ' designed to make it look like a quail 's egg -lrb- cadbury mini eggs are pictured -rrb- . . . . ' parents
should also be wary of similar products being offered for sale over the easter period at other stores or online . '
Reference Summary: Trading standards officials in buckinghamshire and surrey raised alarm. Officers said they were
'likely to contravene food imitation safety rules'. The eggs bear a striking similarity to the sugar-coated chocolate treats.
PGN: Poundland has been forced to pull decorative plastic easter eggs from their shelves over fears children may choke -
because they look like cadbury mini eggs. The eggs have now been withdrawn nationwide ahead of the easter break. The
eggs have now been withdrawn nationwide ahead of the easter break.
PGN+Coverage: Trading standards officials in buckinghamshire and surrey raised the alarm over the chinese made
decorations , as they were ' likely to contravene food imitation safety rules ' the eggs have now been withdrawn nation-
wide ahead of the easter break . the eggs bear a striking similarity to the sugar-coated chocolate treats with a brown '
speckle ' designed to make it look like a quail 's egg .
+ ARU: Eggs bear a striking similarity to the sugar-coated chocolate treats with a brown 'speckle' designed to make
it look like a quail's egg. The eggs bear a striking similarity to the sugar-coated chocolate treats with a brown 'speckle'
designed to make it look like a quail's egg.
+ Variance loss: Trading standards officials in buckinghamshire and surrey raised the alarm over the chinese made
decorations, as they were 'likely to contravene food imitation safety rules'. The eggs have now been withdrawn nation-
wide ahead of the easter break. The eggs bear a striking similarity to the sugar-coated chocolate treats with a brown
'speckle'.
Table 3: The bold words in article are salient parts contained in reference summary. The blue words in generated
summaries are salient information and the red words are repetition.
formation, Chen et al. (2016) proposes a new at-
tention mechanism to distract them in the decod-
ing step to better grasp the overall meaning of in-
put documents. We optimize attention using an
attention refinement unit under the novel variance
loss supervision. As far as we know, we are the
first to propose explicit losses to refine the atten-
tion model in abstractive document summarization
tasks. Recently many models (Paulus et al., 2018;
Celikyilmaz et al., 2018; Chen and Bansal, 2018;
Zhou et al., 2018; Jiang and Bansal, 2018) have
emerged taking advantage of reinforcement learn-
ing (RL) to solve the discrepancy issue in seq2seq
model and have yielded the state-of-the-art perfor-
mance.
5 Conclusion
In this paper, we propose simple but effective
methods to optimize the vanilla attention mecha-
nism in abstarctive document summarization. The
results on CNN/Daily Mail dataset demonstrate
the effectiveness of our methods. We argue that
these simple methods are also adaptable to other
summarization models with attention. Further ex-
ploration on this and combination with other ap-
proaches like RL remains as our future explo-
ration. Besides, we will also conduct experiments
on several other current summarization datasets
like New York Times (NYT) (Paulus et al., 2018)
and Newsroom (Grusky et al., 2018).
Figure 2: With global variance loss, our model (green
bar) can avoid repetitions and achieve comparable per-
centage of duplicates with reference summaries.
et al., 2018) select salient sentences from origi-
nal document as a summary. In contrast, abstrac-
tive summarization (Rush et al., 2015; Nallapati
et al., 2016; See et al., 2017; Chen and Bansal,
2018) generates summaries word-by-word after
digesting the main content of the document. Out-
of-vocabulary(OOV), repetition, and saliency are
three conspicuous problems need to be well solved
in abstractive document summarization. Some
works (Nallapati et al., 2016; See et al., 2017;
Paulus et al., 2018) handle the OOV problem by
introducing the pointer network. See et al. (2017)
introduces a coverage mechanism, which is a vari-
ant of the coverage vector (Tu et al., 2016) from
Neural Machine Translation, to eliminate repeti-
tions. However, there are just a few studies on
saliency problem (Tan et al., 2017; Shi et al., 2018;
Gehrmann et al., 2018). To obtain more salient in-
References
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua
Neural machine translation by
CoRR,
Bengio. 2014.
jointly learning to align and translate.
abs/1409.0473.
Asli Celikyilmaz, Antoine Bosselut, Xiaodong He, and
Yejin Choi. 2018. Deep communicating agents for
In Proceedings of the
abstractive summarization.
2018 Conference of the North American Chapter of
the Association for Computational Linguistics: Hu-
man Language Technologies, Volume 1 (Long Pa-
pers), pages 1662 -- 1675. Association for Computa-
tional Linguistics.
Qian Chen, Xiaodan Zhu, Zhenhua Ling, Si Wei, and
Hui Jiang. 2016. Distraction-based neural networks
In Proceedings of the
for modeling documents.
Twenty-Fifth International Joint Conference on Ar-
tificial Intelligence, IJCAI'16, pages 2754 -- 2760.
AAAI Press.
Yen-Chun Chen and Mohit Bansal. 2018. Fast abstrac-
tive summarization with reinforce-selected sentence
rewriting. In Proceedings of the 56th Annual Meet-
ing of the Association for Computational Linguistics
(Volume 1: Long Papers), pages 675 -- 686. Associa-
tion for Computational Linguistics.
Michael Denkowski and Alon Lavie. 2014. Meteor
universal: Language specific translation evaluation
for any target language. In Proceedings of the Ninth
Workshop on Statistical Machine Translation, pages
376 -- 380. Association for Computational Linguis-
tics.
Sebastian Gehrmann, Yuntian Deng, and Alexander
Rush. 2018. Bottom-up abstractive summarization.
In Proceedings of the 2018 Conference on Empiri-
cal Methods in Natural Language Processing, pages
4098 -- 4109. Association for Computational Linguis-
tics.
Max Grusky, Mor Naaman, and Yoav Artzi. 2018.
Newsroom: A dataset of 1.3 million summaries with
diverse extractive strategies. In Proceedings of the
2018 Conference of the North American Chapter
of the Association for Computational Linguistics:
Human Language Technologies, NAACL-HLT 2018,
New Orleans, Louisiana, USA, June 1-6, 2018, Vol-
ume 1 (Long Papers), pages 708 -- 719.
Karl Moritz Hermann, Tom´as Kocisk´y, Edward
Grefenstette, Lasse Espeholt, Will Kay, Mustafa Su-
leyman, and Phil Blunsom. 2015. Teaching ma-
In Advances in
chines to read and comprehend.
Neural Information Processing Systems 28: Annual
Conference on Neural Information Processing Sys-
tems 2015, December 7-12, 2015, Montreal, Que-
bec, Canada, pages 1693 -- 1701.
T. Huang, G. Yang, and G. Tang. 1979. A fast
two-dimensional median filtering algorithm. IEEE
Transactions on Acoustics, Speech, and Signal Pro-
cessing, 27(1):13 -- 18.
Aishwarya Jadhav and Vaibhav Rajan. 2018. Extrac-
tive summarization with swap-net: Sentences and
In Pro-
words from alternating pointer networks.
ceedings of the 56th Annual Meeting of the Associa-
tion for Computational Linguistics (Volume 1: Long
Papers), pages 142 -- 151. Association for Computa-
tional Linguistics.
Yichen Jiang and Mohit Bansal. 2018. Closed-book
training to improve summarization encoder mem-
ory. In Proceedings of the 2018 Conference on Em-
pirical Methods in Natural Language Processing,
Brussels, Belgium, October 31 - November 4, 2018,
pages 4067 -- 4077.
Yunjae Jung, Donghyeon Cho, Dahun Kim, Sanghyun
Woo, and In So Kweon. 2018. Discriminative fea-
ture learning for unsupervised video summarization.
CoRR, abs/1811.09791.
Chin-Yew Lin. 2004. Rouge: A package for automatic
In Text Summarization
evaluation of summaries.
Branches Out.
Ramesh Nallapati, Feifei Zhai, and Bowen Zhou. 2017.
Summarunner: A recurrent neural network based se-
quence model for extractive summarization of doc-
In Proceedings of the Thirty-First AAAI
uments.
Conference on Artificial Intelligence, February 4-9,
2017, San Francisco, California, USA., pages 3075 --
3081.
Ramesh Nallapati, Bowen Zhou, Cicero dos Santos,
Caglar Gulcehre, and Bing Xiang. 2016. Ab-
stractive text summarization using sequence-to-
sequence rnns and beyond. In Proceedings of The
20th SIGNLL Conference on Computational Natural
Language Learning, pages 280 -- 290. Association for
Computational Linguistics.
Romain Paulus, Caiming Xiong, and Richard Socher.
2018. A deep reinforced model for abstractive sum-
marization. In International Conference on Learn-
ing Representations.
Alexander M. Rush, Sumit Chopra, and Jason Weston.
2015. A neural attention model for abstractive sen-
In Proceedings of the 2015
tence summarization.
Conference on Empirical Methods in Natural Lan-
guage Processing, pages 379 -- 389. Association for
Computational Linguistics.
Abigail See, Peter J. Liu, and Christopher D. Manning.
2017. Get to the point: Summarization with pointer-
generator networks. In Proceedings of the 55th An-
nual Meeting of the Association for Computational
Linguistics (Volume 1: Long Papers), pages 1073 --
1083. Association for Computational Linguistics.
Shiv Shankar, Siddhant Garg, and Sunita Sarawagi.
2018. Surprisingly easy hard-attention for sequence
In Proceedings of the 2018
to sequence learning.
Conference on Empirical Methods in Natural Lan-
guage Processing, Brussels, Belgium, October 31 -
November 4, 2018, pages 640 -- 645.
Jiaxin Shi, Chen Liang, Lei Hou, Juanzi Li, Zhiyuan
Liu, and Hanwang Zhang. 2018.
Deepchan-
nel: Salience estimation by contrastive learning
for extractive document summarization. CoRR,
abs/1811.02394.
Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. 2014.
Sequence to sequence learning with neural net-
In Proceedings of the 27th International
works.
Conference on Neural Information Processing Sys-
tems - Volume 2, NIPS'14, pages 3104 -- 3112, Cam-
bridge, MA, USA. MIT Press.
Jiwei Tan, Xiaojun Wan, and Jianguo Xiao. 2017.
Abstractive document summarization with a graph-
In Proceedings of
based attentional neural model.
the 55th Annual Meeting of the Association for Com-
putational Linguistics (Volume 1: Long Papers),
pages 1171 -- 1181. Association for Computational
Linguistics.
Zhaopeng Tu, Zhengdong Lu, Yang Liu, Xiaohua Liu,
and Hang Li. 2016. Modeling coverage for neural
machine translation. In Proceedings of the 54th An-
nual Meeting of the Association for Computational
Linguistics, ACL 2016, August 7-12, 2016, Berlin,
Germany, Volume 1: Long Papers.
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly.
In Advances in Neural
2015. Pointer networks.
Information Processing Systems 28: Annual Con-
ference on Neural Information Processing Systems
2015, December 7-12, 2015, Montreal, Quebec,
Canada, pages 2692 -- 2700.
Kelvin Xu,
Jimmy Ba, Ryan Kiros, Kyunghyun
Cho, Aaron C. Courville, Ruslan Salakhutdinov,
Richard S. Zemel, and Yoshua Bengio. 2015. Show,
attend and tell: Neural image caption generation
with visual attention. In Proceedings of the 32nd In-
ternational Conference on Machine Learning, ICML
2015, Lille, France, 6-11 July 2015, pages 2048 --
2057.
Qingyu Zhou, Nan Yang, Furu Wei, Shaohan Huang,
Ming Zhou, and Tiejun Zhao. 2018. Neural docu-
ment summarization by jointly learning to score and
select sentences. In Proceedings of the 56th Annual
Meeting of the Association for Computational Lin-
guistics (Volume 1: Long Papers), pages 654 -- 663.
Association for Computational Linguistics.
|
1907.01968 | 1 | 1907 | 2019-07-03T14:31:45 | Depth Growing for Neural Machine Translation | [
"cs.CL"
] | While very deep neural networks have shown effectiveness for computer vision and text classification applications, how to increase the network depth of neural machine translation (NMT) models for better translation quality remains a challenging problem. Directly stacking more blocks to the NMT model results in no improvement and even reduces performance. In this work, we propose an effective two-stage approach with three specially designed components to construct deeper NMT models, which result in significant improvements over the strong Transformer baselines on WMT$14$ English$\to$German and English$\to$French translation tasks\footnote{Our code is available at \url{https://github.com/apeterswu/Depth_Growing_NMT}}. | cs.CL | cs | Depth Growing for Neural Machine Translation
Lijun Wu1,∗, Yiren Wang2,∗, Yingce Xia3,†, Fei Tian3, Fei Gao3,
Tao Qin3, Jianhuang Lai1, Tie-Yan Liu3
1School of Data and Computer Science, Sun Yat-sen University;
2 University of Illinois at Urbana-Champaign; 3 Microsoft Research Asia;
1{wulijun3, stsljh}@mail2.sysu.edu.cn, [email protected],
3{Yingce.Xia, fetia, feiga, taoqin, tyliu}@microsoft.com
Abstract
While very deep neural networks have shown
effectiveness for computer vision and text
classification applications, how to increase the
network depth of neural machine translation
(NMT) models for better translation quality re-
mains a challenging problem. Directly stack-
ing more blocks to the NMT model results
in no improvement and even reduces perfor-
mance.
In this work, we propose an effec-
tive two-stage approach with three specially
designed components to construct deeper
NMT models, which results in significant
improvements over the strong Transformer
baselines on WMT14 English→German and
English→French translation tasks1.
1
Introduction
Neural machine translation (briefly, NMT), which
is built upon deep neural networks, has gained
rapid progress in recent years (Bahdanau et al.,
2015; Sutskever et al., 2014; Sennrich et al.,
2016b; He et al., 2016a; Sennrich et al., 2016a; Xia
et al., 2017; Wang et al., 2019) and achieved sig-
nificant improvement in translation quality (Has-
san et al., 2018). Variants of network structures
have been applied in NMT such as LSTM (Wu
et al., 2016), CNN (Gehring et al., 2017) and
Transformer (Vaswani et al., 2017).
9
1
0
2
l
u
J
3
]
L
C
.
s
c
[
1
v
8
6
9
1
0
.
7
0
9
1
:
v
i
X
r
a
Training deep networks has always been a chal-
lenging problem, mainly due to the difficulties in
optimization for deep architecture. Breakthroughs
have been made in computer vision to enable
deeper model construction via advanced initializa-
tion schemes (He et al., 2015), multi-stage train-
ing strategy (Simonyan and Zisserman, 2015), and
∗The first two authors contributed equally to this work.
†Corresponding author.
1Our code is available at https://github.com/
This work is conducted at Microsoft Research Asia.
apeterswu/Depth_Growing_NMT
Figure 1: Performances of Transformer models with
different number of encoder/decoder blocks (recorded
on x-axis) on WMT14 En→De translation task. † de-
notes the result reported in (Vaswani et al., 2017).
novel model architectures (Srivastava et al., 2015;
He et al., 2016b). While constructing very deep
neural networks with tens and even more than a
hundred blocks have shown effectiveness in im-
age recognition (He et al., 2016b), question an-
swering and text classification (Devlin et al., 2018;
Radford et al., 2019), scaling up model capac-
ity with very deep network remains challenging
for NMT. The NMT models are generally con-
structed with up to 6 encoder and decoder blocks
in both state-of-the-art research work and cham-
pion systems of machine translation competition.
For example, the LSTM-based models are usually
stacked for 4 (Stahlberg et al., 2018) or 6 (Chen
et al., 2018) blocks, and the state-of-the-art Trans-
former models are equipped with a 6-block en-
coder and decoder (Vaswani et al., 2017; Junczys-
Dowmunt, 2018; Edunov et al., 2018). Increasing
the NMT model depth by directly stacking more
blocks results in no improvement or performance
drop (Figure 1), and even leads to optimization
failure (Bapna et al., 2018).
There have been a few attempts in previous
works on constructing deeper NMT models. Zhou
et al. (2016) and Wang et al. (2017) propose in-
creasing the depth of LSTM-based models by
introducing linear units between internal hidden
states to eliminate the problem of gradient van-
ishing. However, their methods are specially de-
signed for the recurrent architecture which has
been significantly outperformed by the state-of-
the-art transformer model. Bapna et al. (2018)
propose an enhancement to the attention mech-
anism to ease the optimization of models with
deeper encoders. While gains have been re-
ported over different model architectures includ-
ing LSTM and Transformer, their improvements
are not made over the best performed baseline
model configuration. How to construct and train
deep NMT models to push forward the state-of-
the-art translation performance with larger model
capacity remains a challenging and open problem.
In this work, we explore the potential of lever-
aging deep neural networks for NMT and propose
a new approach to construct and train deeper NMT
models. As aforementioned, constructing deeper
models is not as straightforward as directly stack-
ing more blocks, but requires new mechanisms to
boost the training and utilize the larger capacity
with minimal increase in complexity. Our solu-
tion is a new two-stage training strategy, which
"grows" a well-trained NMT model into a deeper
network with three components specially designed
to overcome the optimization difficulty and best
leverage the capability of both shallow and deep
architecture. Our approach can effectively con-
struct a deeper model with significantly better
performance, and is generally applicable to any
model architecture.
We evaluate our approach on two large-scale
benchmark datasets, WMT14 English→German
and English→French translations. Empirical stud-
ies show that our approach can significantly im-
prove in translation quality with an increased
model depth. Specifically, we achieve 1.0 and
0.6 BLEU score improvement over the strong
Transformer baseline in English→German and
English→French translations.
2 Approach
We introduce the details of our proposed approach
in this section. The overall framework is illus-
trated in Figure 2.
Figure 2: The overall framework of our proposed deep
model architecture. N and M are the numbers of
blocks in the bottom module (i.e., grey parts) and top
module (i.e., blue and green parts). Parameters of
the bottom module are fixed during the top module
training. The dashed parts denote the original train-
ing/decoding of the bottom module. The weights of
the two linear operators before softmax are shared.
Our model consists of a bottom module with
N blocks of encoder and decoder (the grey com-
ponents in Figure 2), and a top module with M
blocks (the blue and green components). We de-
note the encoder and decoder of the bottom mod-
ule as enc1 and dec1, and the corresponding two
parts of the top module as enc2 and dec2. An
encoder-decoder attention mechanism is used in
the decoder blocks of the NMT models, and here
we use attn1 and attn2 to represent such atten-
tion in the bottom and top modules respectively.
The model is constructed via a two-stage train-
ing strategy: in Stage 1, the bottom module (i.e.,
enc1 and dec1) is trained and subsequently holds
constant; in Stage 2, only the top module (i.e.,
enc2 and dec2) is optimized.
Let x and y denote the embedding of source
and target sequence. Let ly denote the number of
words in y, and y<t denote the elements before
time step t. Our proposed model works in the fol-
lowing way:
h1 = enc1(x); h2 = enc2(x + h1);
s1,t = dec1(y<t, attn1(h1)), ∀t ∈ [ly];
s2,t = dec2(y<t + s1,<t, attn2(h2)),
(1)
(2)
(3)
which contains three key components specially de-
signed for deeper model construction, including:
Input EmbeddingInputsN×Output EmbeddingOutputs×NLinearSoftmaxOutputProbabilityPositional EncodingPositional EncodingEncoderBlockDecoderBlockLinearSoftmaxOutputProbability×MM×EncoderBlockDecoderBlock(1) Cross-module residual connections: As
shown in Eqn.(1), the encoder enc1 of the bot-
tom module encodes the input x to a hidden repre-
sentation h1, then a cross-module residual connec-
tion is introduced to the top module and the repre-
sentation h2 is eventually produced. The decoders
work in a similar way as shown in Eqn.(2) and (3).
This enables the top module to have direct access
to both the low-level input signals from the word
embedding and high-level information generated
by the bottom module. Similar principles can be
found in Wang et al. (2017); Wu et al. (2018).
(2) Hierarchical encoder-decoder attention: We
introduce a hierarchical encoder-decoder attention
calculated with different contextual representa-
tions as shown in Eqn.(2) and (3), where h1 is used
as key and value for attn1 in the bottom module,
and h2 for attn2 in the top module. Hidden states
from the corresponding previous decoder block
are used as queries for both attn1 and attn2
(omitted for readability). In this way, the strong
capability of the well trained bottom module can
be best preserved regardless of the influence from
top module, while the newly stacked top module
can leverage the higher-level contextual represen-
tations. More details can be found from source
code in the supplementary materials.
(3) Deep-shallow decoding: At
the decoding
phase, enc1 and dec1 work together accord-
ing to Eqn.(1) and Eqn.(2) as a shallow net-
work netS, integrate both bottom and top mod-
ule works as a deep network netD according to
Eqn.(1)∼Eqn.(3). netS and netD generate the
final translation results through reranking.
Discussion
• Training complexity: As aforementioned, the
bottom module is trained in Stage 1 and only pa-
rameters of the top module are optimized in Stage
2. This significantly eases optimization difficulty
and reduces training complexity. Jointly training
the two modules with minimal training complex-
ity is left for future work.
• Ensemble learning: What we propose in this pa-
per is a single deeper model with hierarchical con-
textual information, although the deep-shallow de-
coding is similar to the ensemble methods in terms
of inference complexity (Zhou, 2012). While
training multiple diverse models for good ensem-
ble performance introduces high additional com-
plexity, our approach, as discussed above, "grows"
a well-trained model into a deeper one with mini-
mal increase in training complexity. Detailed em-
pirical analysis is presented in Section 3.3.
3 Experiments
We evaluate our proposed approach on two large-
scale benchmark datasets. We compare our ap-
proach with multiple baseline models, and analyze
the effectiveness of our deep training strategy.
3.1 Experiment Design
Datasets We conduct experiments to evaluate
the effectiveness of our proposed method on two
widely adopted benchmark datasets: the WMT142
English→German translation (En→De) and the
WMT14 English→French translation (En→Fr).
We use 4.5M parallel sentence pairs for En→De
and 36M pairs for En→Fr as our training data3.
We use the concatenation of Newstest2012 and
Newstest2013 as the validation set, and New-
stest2014 as the test set. All words are seg-
mented into sub-word units using byte pair encod-
ing (BPE)4 (Sennrich et al., 2016b), forming a vo-
cabulary shared by the source and target languages
with 32k and 45k tokens for En→De and En→Fr
respectively.
Architecture The basic encoder-decoder frame-
work we use is the strong Transformer model. We
adopt the big transformer configuration follow-
ing Vaswani et al. (2017), with the dimension of
word embeddings, hidden states and non-linear
layer set as 1024, 1024 and 4096 respectively. The
dropout rate is 0.3 for En→De and 0.1 for En→Fr.
We set the number of encoder/decoder blocks for
the bottom module as N = 6 following the com-
mon practice, and set the number of additionally
stacked blocks of the top module as M = 2. Our
models are implemented based on the PyTorch im-
plementation of Transformer5 and the code can be
found in the supplementary materials.
Training We use Adam (Kingma and Ba, 2015)
optimizer following the optimization settings and
default learning rate schedule in Vaswani et al.
(2017) for model training. All models are trained
on 8 M40 GPUs.
2http://www.statmt.org/wmt14/
translation-task.html
3Training data are constructed with filtration rules fol-
lowing https://github.com/pytorch/fairseq/
tree/master/examples/translation
4https://github.com/rsennrich/
subword-nmt
5https://github.com/pytorch/fairseq
Table 1: The test set performances of WMT14 En→De
and En→Fr translation tasks. '†' denotes the perfor-
mance figures reported in the previous works.
Model
Transformer (6B)†
Transformer (6B)
Transformer (8B)
Transformer (10B)
Transparent Attn (16B)†
Ours (8B)
En→De En→Fr
41.80
28.40
42.69
28.91
42.63
28.75
28.63
42.73
−
28.04
43.27
29.92
Evaluation We evaluate the model perfor-
mances with tokenized case-sensitive BLEU6
score (Papineni et al., 2002) for the two transla-
tion tasks. We use beam search with a beam size
of 5 and with no length penalty.
3.2 Overall Results
We compare our method (Ours) with the Trans-
former baselines of 6 blocks (6B) and 8 blocks
(8B), and a 16-block Transformer with transparent
attention (Transparent Attn (16B))7 (Bapna et al.,
2018). We also reproduce a 6-block Transformer
baseline, which has better performance than what
is reported in (Vaswani et al., 2017) and we use it
to initialize the bottom module in our model.
From the results in Table 1, we see that our
proposed approach enables effective training for
deeper network and achieves significantly better
performances compared to baselines. With our
method, the performance of a well-optimized 6-
block model can be further boosted by adding two
additional blocks, while simply using Transformer
(8B) will lead to a performance drop. Specifi-
cally, we achieve a 29.92 BLEU score on En→De
translation with 1.0 BLEU improvement over the
strong baselines, and achieve a 0.6 BLEU im-
provement for En→Fr. The improvements are sta-
tistically significant with p < 0.01 in paired boot-
strap sampling (Koehn, 2004).
We further make an attempt to train a deeper
model with additional M = 4 blocks, which has
10 blocks in total for En→De translation. The bot-
6https://github.com/moses-smt/
mosesdecoder/blob/master/scripts/
generic/multi-bleu.perl
7We directly use the performance figure from (Bapna
et al., 2018), which uses the base Transformer configura-
tion. We run the method of our own implementation with
the widely adopted and state-of-the-art big setting, but no
improvement has been observed.
Figure 3: The test performances of WMT14 En→De
translation task.
tom module is also initialized from our reproduced
6-block transformer baseline. This model achieves
a 30.07 BLEU score on En→De translation and it
surpasses the performance of our 8-block model,
which further demonstrates that our approach is
effective for training deeper NMT models.
3.3 Analysis
To further study the effectiveness of our proposed
framework, we present additional comparisons in
En→De translation with two groups of baseline
approaches in Figure 3:
(1) Direct stacking (DS): we extend the 6-block
baseline to 8-block by directly stacking 2 addi-
tional blocks. We can see that both training from
scratch (DS scratch) and "growing" from a well-
trained 6-block model (DS grow) fails to improve
performance in spite of larger model capacity. The
comparison with this group of models shows that
directly stacking more blocks is not a good strat-
egy for increasing network depth, and demon-
strates the effectiveness and necessity of our pro-
posed mechanisms for training deep networks.
(2) Ensemble learning (Ensemble): we present the
two-model ensemble results for fair comparison
with our approach that involves a two-pass deep-
shallow decoding. Specifically, we present the en-
semble performances of two independently trained
6-block models (Ensemble 6B/6B), and ensemble
of one 6-block and one 8-block model indepen-
dently trained from scratch (Ensemble 6B/8B). As
expected, the ensemble method improves transla-
tion quality over the single model baselines by a
large margin (over 0.8 BLEU improvement). Re-
garding training complexity, it takes 40 GPU days
(5 days on 8 GPU) to train a single 6-block model
Baseline(6B)DS (8B)scratchDS (8B)growEnsemble(6B/6B)Ensemble(6B/8B)Ours(8B)28.628.829.029.229.429.629.830.030.2BLEU Score28.9128.7528.8129.629.5729.92BaselineDirect StackingEnsembleOursfrom scratch, 48 GPU days for a 8-block model ,
and 8 GPU days to "grow" a 6-block model into
8-block with our approach. Therefore, our model
is better than the two-model ensemble in terms of
both translation quality (more than 0.3 BLEU im-
provement over the ensemble baseline) and train-
ing complexity.
4 Conclusion
In this paper, we proposed a new training strategy
with three specially designed components, includ-
ing cross-module residual connection, hierarchical
encoder-decoder attention and deep-shallow de-
coding, to construct and train deep NMT mod-
els. We showed that our approach can effec-
tively construct deeper model with significantly
better performance over the state-of-the-art trans-
former baseline. Although only empirical studies
on the transformer are presented in this paper, our
proposed strategy is a general approach that can
be universally applicable to other model architec-
tures, including LSTM and CNN. In future work,
we will further explore efficient strategies that can
jointly train all modules of the deep model with
minimal increase in training complexity.
References
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben-
gio. 2015. Neural machine translation by jointly
In Third Interna-
learning to align and translate.
tional Conference on Learning Representations.
Ankur Bapna, Mia Chen, Orhan Firat, Yuan Cao, and
Yonghui Wu. 2018. Training deeper neural ma-
chine translation models with transparent attention.
In Proceedings of the 2018 Conference on Empiri-
cal Methods in Natural Language Processing, pages
3028 -- 3033.
Mia Xu Chen, Orhan Firat, Ankur Bapna, Melvin
Johnson, Wolfgang Macherey, George Foster, Llion
Jones, Mike Schuster, Noam Shazeer, Niki Parmar,
et al. 2018. The best of both worlds: Combining
recent advances in neural machine translation.
In
Proceedings of the 56th Annual Meeting of the As-
sociation for Computational Linguistics (Volume 1:
Long Papers), pages 76 -- 86.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and
Kristina Toutanova. 2018. Bert: Pre-training of deep
bidirectional transformers for language understand-
ing. arXiv preprint arXiv:1810.04805.
Sergey Edunov, Myle Ott, Michael Auli, and David
Grangier. 2018. Understanding back-translation at
In Proceedings of the 2018 Conference on
scale.
Empirical Methods in Natural Language Process-
ing, pages 489 -- 500.
Jonas Gehring, Michael Auli, David Grangier, Denis
Yarats, and Yann N Dauphin. 2017. Convolutional
In Proceedings
sequence to sequence learning.
of the 34th International Conference on Machine
Learning-Volume 70, pages 1243 -- 1252. JMLR. org.
Hany Hassan, Anthony Aue, Chang Chen, Vishal
Jonathan Clark, Christian Feder-
Chowdhary,
mann, Xuedong Huang, Marcin Junczys-Dowmunt,
William Lewis, Mu Li, et al. 2018. Achieving hu-
man parity on automatic chinese to english news
translation. arXiv preprint arXiv:1803.05567.
Di He, Yingce Xia, Tao Qin, Liwei Wang, Nenghai Yu,
Tie-Yan Liu, and Wei-Ying Ma. 2016a. Dual learn-
ing for machine translation. In Advances in Neural
Information Processing Systems, pages 820 -- 828.
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian
Sun. 2015. Delving deep into rectifiers: Surpass-
ing human-level performance on imagenet classifi-
In Proceedings of the IEEE international
cation.
conference on computer vision, pages 1026 -- 1034.
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian
Sun. 2016b. Deep residual learning for image recog-
In Proceedings of the IEEE conference on
nition.
computer vision and pattern recognition, pages 770 --
778.
Marcin Junczys-Dowmunt. 2018. Microsoft's submis-
sion to the wmt2018 news translation task: How i
learned to stop worrying and love the data. In Pro-
ceedings of the Third Conference on Machine Trans-
lation: Shared Task Papers, pages 425 -- 430.
Diederik P Kingma and Jimmy Ba. 2015. Adam: A
method for stochastic optimization. In Third Inter-
national Conference on Learning Representations.
Philipp Koehn. 2004. Statistical significance tests for
In Proceedings of
machine translation evaluation.
the 2004 conference on empirical methods in natural
language processing.
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-
Jing Zhu. 2002. Bleu: a method for automatic eval-
In Proceedings of
uation of machine translation.
the 40th annual meeting on association for compu-
tational linguistics, pages 311 -- 318. Association for
Computational Linguistics.
Alec Radford, Jeff Wu, Rewon Child, David Luan,
Dario Amodei, and Ilya Sutskever. 2019. Language
models are unsupervised multitask learners.
Rico Sennrich, Barry Haddow, and Alexandra Birch.
2016a. Improving neural machine translation mod-
In Proceedings of the
els with monolingual data.
54th Annual Meeting of the Association for Compu-
tational Linguistics (Volume 1: Long Papers), vol-
ume 1, pages 86 -- 96.
Jie Zhou, Ying Cao, Xuguang Wang, Peng Li, and Wei
Xu. 2016. Deep recurrent models with fast-forward
connections for neural machine translation. Trans-
actions of the Association for Computational Lin-
guistics, 4:371 -- 383.
Zhi-Hua Zhou. 2012. Ensemble methods: foundations
and algorithms. Chapman and Hall/CRC.
Rico Sennrich, Barry Haddow, and Alexandra Birch.
2016b. Neural machine translation of rare words
with subword units. In Proceedings of the 54th An-
nual Meeting of the Association for Computational
Linguistics (Volume 1: Long Papers), volume 1,
pages 1715 -- 1725.
Karen Simonyan and Andrew Zisserman. 2015. Very
deep convolutional networks for large-scale image
In Third International Conference on
recognition.
Learning Representations.
Rupesh Kumar Srivastava, Klaus Greff, and Jurgen
arXiv
Schmidhuber. 2015. Highway networks.
preprint arXiv:1505.00387.
Felix Stahlberg, Adri`a de Gispert, and Bill Byrne.
2018. The university of cambridges machine trans-
In Proceedings of the
lation systems for wmt18.
Third Conference on Machine Translation: Shared
Task Papers, pages 504 -- 512.
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. 2014.
Sequence to sequence learning with neural net-
works. In Advances in neural information process-
ing systems, pages 3104 -- 3112.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob
Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz
Kaiser, and Illia Polosukhin. 2017. Attention is all
you need. In Advances in Neural Information Pro-
cessing Systems, pages 5998 -- 6008.
Mingxuan Wang, Zhengdong Lu, Jie Zhou, and Qun
Liu. 2017. Deep neural machine translation with lin-
ear associative unit. In Proceedings of the 55th An-
nual Meeting of the Association for Computational
Linguistics (Volume 1: Long Papers), volume 1,
pages 136 -- 145.
Yiren Wang, Yingce Xia, Tianyu He, Fei Tian, Tao Qin,
ChengXiang Zhai, and Tie-Yan Liu. 2019. Multi-
agent dual learning. In Seventh International Con-
ference on Learning Representations.
Lijun Wu, Fei Tian, Li Zhao, Jianhuang Lai, and Tie-
Yan Liu. 2018. Word attention for sequence to se-
quence text understanding. In Thirty-Second AAAI
Conference on Artificial Intelligence.
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V
Le, Mohammad Norouzi, Wolfgang Macherey,
Maxim Krikun, Yuan Cao, Qin Gao, Klaus
Macherey, et al. 2016.
Google's neural ma-
chine translation system: Bridging the gap between
arXiv preprint
human and machine translation.
arXiv:1609.08144.
Yingce Xia, Fei Tian, Lijun Wu, Jianxin Lin, Tao Qin,
Nenghai Yu, and Tie-Yan Liu. 2017. Deliberation
networks: Sequence generation beyond one-pass de-
coding. In Advances in Neural Information Process-
ing Systems, pages 1784 -- 1794.
|
1808.04943 | 1 | 1808 | 2018-08-15T01:50:56 | Folksonomication: Predicting Tags for Movies from Plot Synopses Using Emotion Flow Encoded Neural Network | [
"cs.CL"
] | Folksonomy of movies covers a wide range of heterogeneous information about movies, like the genre, plot structure, visual experiences, soundtracks, metadata, and emotional experiences from watching a movie. Being able to automatically generate or predict tags for movies can help recommendation engines improve retrieval of similar movies, and help viewers know what to expect from a movie in advance. In this work, we explore the problem of creating tags for movies from plot synopses. We propose a novel neural network model that merges information from synopses and emotion flows throughout the plots to predict a set of tags for movies. We compare our system with multiple baselines and found that the addition of emotion flows boosts the performance of the network by learning ~18\% more tags than a traditional machine learning system. | cs.CL | cs | Folksonomication: Predicting Tags for Movies from Plot Synopses Using
Emotion Flow Encoded Neural Network
Sudipta Kar
Suraj Maharjan
Thamar Solorio
Department of Computer Science
University of Houston
Houston, TX 77204-3010
{skar3, smaharjan2, tsolorio}@uh.edu
8
1
0
2
g
u
A
5
1
]
L
C
.
s
c
[
1
v
3
4
9
4
0
.
8
0
8
1
:
v
i
X
r
a
Abstract
Folksonomy of movies covers a wide range of heterogeneous information about movies, like
the genre, plot structure, visual experiences, soundtracks, metadata, and emotional experiences
from watching a movie. Being able to automatically generate or predict tags for movies can
help recommendation engines improve retrieval of similar movies, and help viewers know what
to expect from a movie in advance. In this work, we explore the problem of creating tags for
movies from plot synopses. We propose a novel neural network model that merges information
from synopses and emotion flows throughout the plots to predict a set of tags for movies. We
compare our system with multiple baselines and found that the addition of emotion flows boosts
the performance of the network by learning ≈18% more tags than a traditional machine learning
system.
Introduction
1
User generated tags for online items are beneficial for both of the users and content providers in modern
web technologies. For instance, the capability of tags in providing a quick glimpse of items can assist
users to pick items precisely based on their taste and mood. On the other hand, such strength of tags
enables them to act as strong search keywords and efficient features for recommendation engines (Lam-
biotte and Ausloos, 2006; Szomszor et al., 2007; Li et al., 2008; Borne, 2013). As a result, websites
for different medias like photography1, literature2, film3, and music4 have adopted this system to make
information retrieval easier. Such systems are often referred as Folksonomy (Vander Wal, 2005), social
tagging, or collaborative tagging.
In movie review websites, it is very common that people assign tags to movies after watching them. Tags
for movies often represent summarized characteristics of the movies such as emotional experiences,
events, genre, character types, and psychological impacts. As a consequence, tags for movies became re-
markably convenient for recommending movies to potential viewers based on their personal preferences
and user profiles. However, this situation is not the same for all of the movies. Popular movies usually
have a lot of tags as they tend to reach a higher number of users in these sites. On the other hand, low
profile movies that fail to reach such an audience have very small or empty tagsets. In an investigation,
we found that ≈34% of the movies among the top ≈130K movies of 22 genres5 in IMDB do not have
any tag at all. It is very likely that lack of descriptive tags negatively affects chances of movies being
discovered.
An automatic process to create tags for movies by analyzing the written plot synopses or scripts could
help solve this problem. Such a process would reduce the dependency on humans to accumulate tags
This work is licensed under a Creative Commons Attribution 4.0 International License.
creativecommons.org/licenses/by/4.0/
1http://www.flickr.com
2http://www.goodreads.com
3http://www.imdb.com
4http://www.last.fm
5http://www.imdb.com/genre/
License details: http://
for movies. Additionally, learning the characteristics of a movie plot and possible emotional experiences
from the written synopsis is also an interesting problem by itself from the perspective of computational
linguistics. As the attributes of movies are multi-dimensional, a tag prediction system for movies has to
generate multiple tags for a movie. The application of predicting multiple tags from textual description
is not necessarily limited to the domain of movie recommendation but also appropriate in other domains,
such as video games and books, where storytelling is relevant. In this paper, we explore the problem of
analyzing plot synopses to generate multiple plot-related tags for movies. Our key contributions in this
paper are as follows:
• We create a neural system for predicting tags from narrative texts and provide a robust comparison
against traditional machine learning systems. Table 1 shows examples of predicted tags by our system
for four movies.
• We propose a neural network model that encodes flow of emotions in movie plot synopses. This emotion
• We release our source code and a live demo of the tag prediction system at
flow helps the model to learn more attributes of movie plots.
http://ritual.uh.edu/folksonomication-2018.
IMDB ID
tt0133093
tt0233298
tt0309820
tt0163651
Batman Beyond: Return of the Joker
Movie Title
The Matrix
Luther
American Pie
Predicted Tags
though-provoking, action, sci-fi, suspenseful, mystery
action, good versus evil, suspenseful, humor, thought-provoking
murder, melodrama, intrigue, historical fiction, christian film
adult comedy, cute, feel-good, prank, entertaining
Table 1: Example of predicted tags from the plot synopses of four movies. Blue and red labels indicate true positives and
false positives respectively.
2 Related Work
Automatic tag generation from content-based analysis has drawn attention in different domains like mu-
sic and images. For example, creating tags for music has been approached by utilizing lyrics (van Zaanen
and Kanters, 2010; Hu et al., 2009), acoustic features from the tracks (Eck et al., 2008; Dieleman and
Schrauwen, 2013), categorical emotion models (Kim et al., 2011), and deep neural models (Choi et al.,
2017).
AutoTag (Mishne, 2006) and TagAssist (Sood et al., 2007), which utilize the text content to generate
tags, aggregate information from similar blog posts to compile a list of ranked tags to present to the
authors of new blog posts. Similar works (Katakis et al., 2008; Lipczak, 2008; Tatu et al., 2008) focused
on recommending tags to users of BibSonomy6 upon posting a new web page or publication as proposed
systems in the ECML PKDD Discovery Challenge 2008 (Hotho et al., 2008) shared task. These systems
made use of some kind of out of content resources like user metadata, and tags assigned to similar re-
sources to generate tags.
Computational narrative studies deal with representing natural language stories by computational mod-
els that can be useful to understand, represent, and generate stories computationally. Current works
attempt to model narratives using the character's personas and roles (Valls-Vargas et al., 2014; Bamman
et al., 2013), interaction information between the characters (Iyyer et al., 2016; Chaturvedi et al., 2016;
Chaturvedi et al., 2017) and events taking place throughout the stories (Goyal et al., 2010; Finlayson,
2012; McIntyre and Lapata, 2010). Other works try to build social networks of the characters (Agar-
wal et al., 2013a; Agarwal et al., 2013b; Agarwal et al., 2014; Krishnan and Eisenstein, 2015). Only a
few works explored the possible type of impressions narrative texts can create on their consumers. For
instance, different types of linguistic features have been used for success prediction for books (Ganji-
gunte Ashok et al., 2013; Maharjan et al., 2017) and tag prediction of movies from plot synopses (Kar et
al., 2018). The tag prediction system predicts a fixed number of tags for each movie. But the tag space
created by the system for the test data covers only 73% tags of the actual tagset as the system could
capture a small portion of the multi-dimensional attributes of movie plots.
6https://www.bibsonomy.org
3 Dataset
We conduct our experiments on the Movie Plot Synopses with Tags (MPST) corpus (Kar et al., 2018),
which is a collection of plot synopses for 14,828 movies collected from IMDb and Wikipedia. Most im-
portantly, the corpus provides one or more fine-grained tags for each movie. The reason behind selecting
this particular dataset is two-fold. First, the tagset is comprised of manually curated tags. These tags
express only plot-related attributes of movies (e.g. suspenseful, violence, and melodrama) and are free
of any tags foreign to the plots, such as metadata. Furthermore, grouping semantically similar tags and
representing them by generalized tags helped to reduce the noise created by redundancy in tag space.
Second, the corpus provides adequate amount of texts in the plot synopses as all the synopses have at
least ten sentences. We follow the same split provided with the corpus, using 80% for training and 20%
for test set. Table 2 gives statistics of the dataset.
Split
Train
Test
#Plot Synopses
#Tags
#Tags per Movie
#Sentence per Synopsis
#Words per Synopsis
11862
2966
71
71
2.97
3.04
42.36
42.61
893.39
907.96
Table 2: Statistics of the MPST corpus.
4 Encoding Emotion Flow with a Neural Network
Our proposed model simultaneously takes the emotion flow throughout the storyline and the text-based
representation of the synopsis to retrieve relevant tags for a movie. Figure 1 shows the proposed ar-
chitecture. The proposed neural architecture has three modules. The first module uses a convolutional
neural network (CNN) to learn plot representations from synopses. The second module models the flow
of emotions via a bidirectional long short-term memory (Bi-LSTM) network. And the last module con-
tains hidden dense layers that operate on the combined representations generated by the first and second
modules to predict the most likely tags for movies.
(a) Convolutional Neural Network (CNN): Recent successes in different text classification problems
motivated us to extract important word level features using convolutional neural networks (CNNs) (dos
Santos and Gatti, 2014; Kim, 2014; Zhang et al., 2015; Kar et al., 2017; Shrestha et al., 2017). We design
a model that takes word sequences as input, where each word is represented by a 300-dimensional word
embedding vector. We use randomly initialized word embeddings but also experiment with the FastText7
word embeddings trained on Wikipedia using subword information. We stack 4 sets of one-dimensional
convolution modules with 1024 filters each for filter sizes 2, 3, 4, and 5 to extract word-level n-gram
features (Kim, 2014; Zhang et al., 2015). Each filter of size c is applied from window t to window
t + c − 1 on a word sequence x1, x2, . . . , xn. Convolution units of filter size c calculate a convolution
output using a weight map Wc, bias bc, and the ReLU activation function (Nair and Hinton, 2010). The
output of this operation is defined by:
The ReLU activation function is defined by:
hc,t = ReLU (Wcxt:t+c−1 + bc)
ReLU (x) = max(0, x)
(1)
(2)
Finally, each convolution unit produces a high-level feature map hc.
hc = [hc,1, hc,2, ..., hc,T−c+1, ]
(3)
On those feature maps, we apply max-over-time pooling operation and take the maximum value as the
feature produced a particular filter. We concatenate the outputs of the pooling operation for four filter
sets that represent the feature representations for each plot synopsis.
(b) CNN with Flow of Emotions (CNN-FE): Stories can be described in terms of emotional
shapes (Vonnegut, 1981), and it has been shown that the emotional arcs of stories are dominated by six
7https://fasttext.cc/docs/en/english-vectors.html
Figure 1: Convolutional Neural Network with Emotion Flow. The entire model is a combination of three modules. Module (a)
learns feature representations from synopses using convolutional neural network. Module (b) incorporates emotion flows with
module (a) to generate a combined representation of synopses. Module (c) uses these representations to predict the likelihood
of each tag.
different shapes (Reagan et al., 2016). We believe that capturing the emotional ups and downs through-
out the plots can help better understand how the story unfolds. This will enable us to predict relevant
tags more accurately. So we design a neural network architecture that tries to learn representations of
plots using the vector space model of words combined with the emotional ups and downs of plots.
Human emotion is a complex phenomenon to define computationally. The Hourglass of Emotions model
(Cambria et al., 2012) categorized human emotions into four affective dimensions (attention, sensitivity,
aptitude, and pleasantness), which started from the study of human emotions by Plutchik (2001). Each
of these affective dimensions is represented by six different activation levels that make up to 24 distinct
labels called 'elementary emotions' that represent the total emotional state of the human mind. NRC8
emotion lexicons (Mohammad and Turney, 2013) is a list of 14,182 words9 and their binary associations
with eight types of elementary emotions from the Hourglass of Emotions model (anger, anticipation,
joy, trust, disgust, sadness, surprise, and fear) with polarity. These lexicons have been used effectively
in tracking the emotions in literary texts (Mohammad, 2011) and predicting success of books (Maharjan
et al., 2018).
To model the flow of emotions throughout the plots, we divide each synopsis into N equally-sized
segments based on words. For each segment, we compute the percentage of words corresponding to
each emotion and polarity type (positive and negative) using the NRC emotion lexicons. More precisely,
for a synopsis xX, where X denotes the entire collection of plot synopses, we create N sequences of
emotion vectors using the NRC emotion lexicons as shown below:
x → s1:N = [s1, s2, ..., sN ]
(4)
8National Research Council Canada
9Version 0.92
where si is the emotion vector for segment i. We experiment with different values of N, and N = 20
works better on the validation data.
As recurrent neural networks are good at encoding sequential data, we feed the sequence of emotion
vectors into a bidirectional LSTM (Hochreiter and Schmidhuber, 1997) with 16 units as shown in Figure
1. This bidirectional LSTM layer tries to summarize the contextual flow of emotions from both directions
of the plots. The forward LSTMs read the sequence from s1 to sN , while the backward LSTMs read the
−→
sequence in reverse from sN to s1. These operations will compute the forward hidden states (
←−
hN )
and backward hidden states (
hN ). For input sequence s, the hidden states ht are computed using
the following intermediate calculations:
−→
h1, . . . ,
←−
h1, . . . ,
it = σ(Wsist + Whiht−1 + Wcict−1 + bi)
ft = σ(Wsf st + Whf ht−1 + Wcf ct−1 + bf )
ct = ftct−1 + it tanh(Wscst + Whcht−1 + bc)
ot = σ(Wscst + Whcht−1 + bc)
ht = ot tanh(ct)
←−
hi, i.e. hi=[
where, W and b denote the weight matrices and bias, respectively. σ is the sigmoid activation function,
and i, f, o, and c are input gate, forget gate, output gate, and cell activation vectors, respectively. The
−→
annotation for each segment si is obtained by concatenating its forward hidden states
hi and backward
←−
hidden states
hi ]. We then apply attention mechanism on this representation to get a
unified representation of the emotion flow.
Attention models have been used effectively in many problems related to computer vision (Mnih et
al., 2014; Ba et al., 2014) and have been successfully adopted in problems related to natural language
processing (Bahdanau et al., 2014; Seo et al., 2016). An attention layer applied on top of a feature map
hi computes the weighted sum r as follows:
−→
hi ;
(cid:88)
i
r =
αihi
and the weight αi is defined as
where, score(.) is computed as follows:
αi =
(cid:80)
exp(score(hi))
i(cid:48) exp(score(hi(cid:48)))
,
(5)
(6)
score(hi) = vT tanh(Wahi + ba)
(7)
where, W , b, v, and u are model parameters. Finally, we concatenate the representation of the emotion
flow produced by the attention operation and the output vector with the vector representation generated
from the CNN module.
The concatenated vector is then fed into two hidden dense layers with 500 and 200 neurons. To improve
generalization of the model, we use dropout with a rate of 0.4 after each hidden layer. Finally, we add
the output layer y with 71 neurons to compute predictions for 71 tags. To overcome the imbalance of the
tags, we weight the posterior probabilities for each tag using different weight values. Weight value CWt
for tag tT is defined by,
(8)
where, D is the size of the training set, T is the number of classes, and Mt is the number of movies
having tag t in the training set. We normalize the output layer by applying a softmax function defined
by,
T × Mt
CWt =
D
sof tmax(y) =
(cid:80)70
exp(y)
k=0 exp( yk)
(9)
Based on the ranking for each tag, we then select top N (3/5/10) tags for a movie.
5 Experimental Setup
Data Processing and Training: As a preprocessing step, we lowercase the synopses, remove stop-words
and also limit the vocabulary to top 5K words to reduce noise and data sparsity. Then we convert each
synopsis into a sequence of 1500 integers where each integer represents the index of the corresponding
word in the vocabulary. For the sequences longer than 1500 words, we truncate them from the left based
on experiments on the development set. Shorter sequences are left padded with zeros.
During training, we use 20% of the training data as validation data. We tune various deep model pa-
rameters (dropouts, learning rate, weight initialization schemes, and batch size) using early stopping
technique on the validation data. We use the Kullback-Leibler (KL) divergence (Kullback and Leibler,
1951) to compute the loss between the true and predicted tag distributions and train the network using
the RMSprop optimization algorithm (Tieleman and Hinton, 2012) with a learning rate of 0.0001. We
implemented our neural network using the PyTorch deep learning framework10.
Baselines: We compare the model performance against three baselines: majority baseline, random base-
line, and traditional machine learning system. The majority baseline method assigns the most frequent
three or five or ten tags in the training set to all the movies. Similarly, the random baseline assigns ran-
domly selected three or five or ten tags to each movie. Finally, we compare our results with the bench-
mark system reported in Kar et al. (2018). This benchmark system used different types of hand-crafted
lexical, semantic, and sentiment features to train a OneVsRest approach model with logistic regression
as the base classifier.
Evaluation Measures: We try to follow the same evaluation methodology as described in Kar et al.
(2018). We create two sets of tags for each movie by choosing the most likely three and five tags by the
system. Additionally, we report our results on a wider range of tags, where we select top ten predictions.
We evaluate the performance using the number of unique tags learned by the system (TL), micro aver-
aged F1, and tag recall (TL). Tags learned (TL) computes how many unique tags are being predicted by
the system for the test data (size of the tag space created by the model for test data). Tag recall represents
the average recall per tag and it is defined by the following equation:
(cid:80)T
i=1 Ri
T
T R =
Here, T is the total number of tags in the corpus, and Ri is the recall for the ith tag.
(10)
6 Results and Discussions
Methods
Baseline: Most Frequent
Baseline: Random
Baseline: Kar et al. (2018)
CNN without class weights
CNN with class weights
CNN-FE
CNN-FE + FastText
TL
3
71
47
24
49
58
53
Top 3
F1
29.7
4.2
37.3
36.8
34.9
36.9
37.3
TR TL
5
4.23
71
4.21
10.52
52
7.99
26
55
9.85
65
9.40
10.00
59
Top 5
F1
28.4
6.4
37.3
36.7
35.7
36.7
36.8
TR TL
10
14.08
15.04
71
16.77 --
12.62
27
67
14.94
70
14.11
15.47
63
Top 10
F1
28.4
6.6
--
31.3
30.8
31.1
30.6
TR
13.73
14.36
--
24.52
26.86
24.76
26.45
Table 3: Performance of tag prediction systems on the test data. We report results of two setups using three matrices (TL:
Tags learned, F1: Micro f1, TR: Tag recall).
Table 3 shows our results for Top 3, Top 5, and Top 10 settings. We will mainly discuss the results
achieved by selecting top five tags as it allows us to compare with all the baseline systems and more tags
to discuss about. As the most frequent baseline system assigns a fixed set of tags to all the movies, it fails
to exhibit diversity in the created tag space. Still it manages to achieve a micro-F1 score around 28%. On
the other hand, the random baseline system creates the most diverse tag space by using all of the possible
tags. However its lower micro-F1 score of 6.30% makes it impractical to be used in real world scenario.
10https://pytorch.org
At this point, we find an interesting trade-off between accuracy and diversity. It is expected that a good
movie tagger will be able to capture the multi-dimensional attributes of the plots that allows to generalize
a diverse tag space. Tagging a large collection of movies with a very small and fixed set of tags (e.g.
majority baseline system) is not useful for either a recommendation system or users. Equally important
is the relevance between the movies and the tags created for those movies. The hand-crafted features
based approach (Kar et al., 2018) achieves a micro-F1 around 37%, which outperforms the majority and
random baselines. But the system was able to learn only 52 tags, which makes 73% of the total tags.
Our approach achieves a lower micro-F1 score than the traditional machine learning one, but it performs
better in terms of learning more tags. We observe that the micro-F1 of the CNN model with only word
sequences is very close (36.7%) to the hand-crafted features based system. However, it is able to learn
only around 37% of the tags. By utilizing class weights in this model (see Eq. 8), we improve the
learning for under-represented tags yielding an increase in tag recall (TR) and tags learned (TL). But
the micro-f1 drops to 35.7%. With the addition of emotion flows to CNN, the CNN-FE model learns
significantly more tags while micro-F1 and tag recall do not change much. Initializing the embedding
layer with pre-trained embeddings made a small improvement in micro-F1 but the model learns com-
paratively lesser tags. If we compare the CNN-FE model with the hand-crafted feature based system,
micro-F1 using CNN-FE is slightly lower (≈ 1%) than the feature based system. But it provides a strong
improvement in terms of the number of tags it learns (TL). CNN-FE learns around 91% tags of the tagset
compared to 73% with the feature based system. It is an interesting improvement, because model is
learning more tags and it is better at assigning relevant tags to movies. We observe similar pattern for
the rest of the two sets of tags where we select top three and ten tags. For all the sets, CNN-FE model
learns the highest number of tags compared to the other models. In terms of micro-F1 and tag recall, it
does not achieve the highest numbers but performs very closely.
Incompleteness in Tag Spaces: One of the limitations of folksonomies is the incompleteness in tag
spaces. The fact that users have not tagged an item with a specific label does not imply that that label
does not apply to the item. Incompleteness makes learning challenging for computational models as
the training and evaluation process penalizes the model for predicting a tag that is not present in the
ground truth tags, even though in some cases it may be a suitable tag. For example, ground truth tags
for the movie Luther (2003)11 are murder, romantic, and violence (Table 1). And the predicted tags from
our proposed model are murder, melodrama, intrigue, historical fiction, and christian film. The film is
indeed a Christian film12 portraying the biography of Martin Luther, who led the Christian reformation
during the 16th century. According to the Wikipedia, "Luther is a 2003 American-German epic historical
drama film loosely based on the life of Martin Luther"13. Similarly, Edtv14 (Table 6) has tags romantic
and satire in the dataset. Our system predicted adult comedy and this tag is appropriate for this movie.
In these two cases, the system will get lower micro-F1 since the relevant tags are not part of the ground
truth. Perhaps a different evaluation scheme could be better suited for this task. We plan to work on this
issue in our future work.
Significance of the Flow of Emotions: The results suggest that incorporating the flow of emotions helps
to achieve better results by learning more tags. Figure 2 shows some tags with significant improvements
in recall after incorporating the flow of emotions. We notice such improvements for around 30 tags. We
argue that for these tags (e.g. absurd, cruelty, thought-provoking, claustrophobic) the changes in specific
sentiments are adding new information helpful for identifying relevant tags. But we also notice negative
changes in recall for around 10 tags, which are mostly related to the theme of the story (e.g. blaxploita-
tion, alternate history, historical fiction, sci-fi). It will be an interesting direction of future work to add
a mechanism that can also learn to discern when emotion flow should contribute more to the prediction
task.
In Figure 3, we inspect how the flow of emotions looks like in different types of plots. Emotions like
joy and trust are continuously dominant over disgust and anger in the plot of Arthur (1981), which is
11http://www.imdb.com/title/tt0309820
12https://www.christianfilmdatabase.com/review/luther-2
13https://en.wikipedia.org/wiki/Luther (2003 film)
14http://www.imdb.com/title/tt0131369/
Figure 2: Tags with higher change of recall after adding the flow of emotions in CNN.
Figure 3: The flow of emotions in the plots of 2 different types of movies. Each synopsis was divided into 20 segments based
on the words, and percentage of the emotions for each segment was calculated using the NRC emotion lexicons. The y axis
represents the percentage of emotions in each segment; whereas, the x axis represents the segments.
a comedy film. We can observe sudden spikes in sadness and fear at segment 14, which is the possi-
ble reason for triggering the tag depressing. We observe a different pattern in the flow of emotions in
Messiah of Evil (1973), which is a horror film. Here the dominant emotions are sadness and fear. Such
characteristics of emotions are helpful to determine the type and possible experiences from a movie. Our
model seems to be able to leverage this information that is allowing it to learn more tags; specifically
tags that are related to feelings.
Learning or Copying? We found that only 11.8% of the 14,830 predicted tags for the ∼3K movies in
the test data were found in the synopses themselves. 12.7% of the total 9,022 ground truth tags appear
in the plot synopses. These numbers suggest that the model is not dependent on the occurrences of the
tags in the synopses to make predictions, rather it seems it is trying to understand the plots and assign
tags based on that. We also found that all the tags that were present in the synopses of the test data are
also present in the synopses of the training data. Then we investigate what type of tags appear in the
synopses and which ones do not. Tags present in the synopses are mostly genre or event related tags like
horror, violence, historical. On the other hand, most of the tags that do not appear in the synopses are the
tags that require a more sophisticated analysis of the plots synopses (e.g. thought-provoking, feel-good,
suspenseful). It is not necessarily bad to predict tags that are in the synopses, since they are still useful
for recommender systems. However, if this was the only ability of the proposed models, their value
would be limited. Luckily this analysis, and the results presented earlier show that the model is able to
infer relevant tags, even if they have not been observed in the synopses. This is a much more interesting
finding.
Learning Stories from Different Representations: Movie scripts represent the detailed story of a
movie, whereas the plot synopses are summaries of the movie. The problem with movie scripts is that
they are not as readily available as plot synopses. However, it is still interesting to evaluate our approach
to predict tags from movie scripts. For this purpose, we collected movie scripts from our test set. We
Top 3
TR TL
28
8.04
5.16
19
F1
29.3
29.8
F1
38.7
37.0
Plot Synopses
Scripts
Top 5
TR TL
35
26
15.70
9.27
Table 4: Evaluation of predictions using plot synopses and scripts
were able to find 80 movie scripts using the ScriptBase corpus (Gorinski and Lapata, 2015).
In table 4, we show the evaluation of tags generated using plot synopses and scripts. Despite having
similar micro-f1 scores, tag recall and tags learned are lower when we use the scripts. A possible expla-
nation for this is the train/test mismatch since the model was trained using summarized versions of the
movie, while the test data contained full movies scripts. Additional sources of error could come from the
external info included in scripts (such as descriptions of actions from the characters or settings).
Percentage of Match
>=80%
>=40% & <80%
>=20% & <40%
Percentage of Movies
40%
47.5%
11.25%
Table 5: Percentage of the match between the sets of top five tags generated from the scripts and plot synopses.
Table 5 shows that for most of the movies we generate very similar tags using the scripts and plot syn-
opses. For 40% movies, at least 80% tags are the same. While the predictions are not identical, these
results show a consistency in the learned tags from our system. An interesting direction for future work
would be to study what aspects in a full movie script are relevant to predict tags.
Title: A Nightmare on Elm Street 5: The Dream Child
Ground Truths: cult, good versus evil, insanity, murder, sadist, violence
Synopsis: cult, murder, paranormal, revenge, violence
Script: murder, violence, flashback, cult, suspenseful
Title: EDtv
Ground Truths: romantic, satire
Synopsis: adult comedy, comedy, entertaining, prank, satire
Script: comedy, satire, prank, entertaining, adult comedy
Title: Toy Story
Ground Truths: clever, comedy, cult, cute, entertaining, fantasy, humor, violence
Synopsis: comedy, cult, entertaining, humor, psychedelic
Script: psychedelic, comedy, entertaining, cult, absurd
Title: Margot at the Wedding
Ground Truths: romantic, storytelling, violence
Synopsis: depressing, dramatic, melodrama, queer, romantic
Script: psychological, murder, mystery, flashback, insanity
Table 6: Example of ground truth tags of movies from the test set and the generated tags for them using plot synopses and
scripts.
Challenging Tags: We found that these seven tags: stupid, grindhouse film, blaxploitation, magical re-
alism, brainwashing, plot twist, and allegory, were not assigned to any movies in the test set. One reason
might be that these are very infrequent (around 0.06% of movies have them assigned as their tags). This
will obviously make them difficult to learn. Again, these are subjective as well. We believe that tagging
a plot as stupid or brainwashing is complicated and depends on perspectives of a tagger. We plan to
investigate such type of tags in the future.
7 Conclusions and Future Work
In this paper we explore the problem of automatically creating tags for movies using plot synopses.
We propose a model that learns word level feature representations from the synopses using CNNs and
models sentiment flow throughout the plots using a bidirectional LSTM. We evaluated our model on a
corpus that contains plot synopses and tags of 14K movies. We compared our model against a majority
and random baselines, and a system that uses traditional hand-crafted linguistic features. We found that
incorporating emotion flows boosts prediction performance by improving the learning of tags related to
feelings as well as increasing the overall number of tags learned.
Predicting tags for movies is an interesting and complicated problem at the same time. To further improve
our results, we plan to investigate more sophisticated architectures and explore ways to tackle the problem
of incompleteness in the tag space. We also plan to evaluate the quality of predicted tags using a human
study evaluation and experiment on predicting tags in other storytelling related domains.
Acknowledgements
This work was partially supported by the National Science Foundation under grant number 1462141 and
by the U.S. Department of Defense under grant W911NF-16-1-0422.
References
[Agarwal et al.2013a] Apoorv Agarwal, Anup Kotalwar, and Owen Rambow. 2013a. Automatic extraction of
social networks from literary text: A case study on alice in wonderland. In Proceedings of the Sixth Interna-
tional Joint Conference on Natural Language Processing, pages 1202 -- 1208, Nagoya, Japan, October. Asian
Federation of Natural Language Processing.
[Agarwal et al.2013b] Apoorv Agarwal, Anup Kotalwar, Jiehan Zheng, and Owen Rambow. 2013b. Sinnet: Social
interaction network extractor from text. In The Companion Volume of the Proceedings of IJCNLP 2013: System
Demonstrations, pages 33 -- 36, Nagoya, Japan, October. Asian Federation of Natural Language Processing.
[Agarwal et al.2014] Apoorv Agarwal, Sriramkumar Balasubramanian, Anup Kotalwar, Jiehan Zheng, and Owen
Rambow. 2014. Frame semantic tree kernels for social network extraction from text. In Proceedings of the
14th Conference of the European Chapter of the Association for Computational Linguistics, pages 211 -- 219,
Gothenburg, Sweden, April. Association for Computational Linguistics.
[Ba et al.2014] Jimmy Ba, Volodymyr Mnih, and Koray Kavukcuoglu. 2014. Multiple object recognition with
visual attention. CoRR, abs/1412.7755.
[Bahdanau et al.2014] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2014. Neural machine translation
by jointly learning to align and translate. CoRR, abs/1409.0473.
[Bamman et al.2013] David Bamman, Brendan O'Connor, and Noah A. Smith. 2013. Learning latent personas of
film characters. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics
(Volume 1: Long Papers), pages 352 -- 361, Sofia, Bulgaria, August. Association for Computational Linguistics.
[Borne2013] Kirk Borne. 2013. Collaborative annotation for scientific data discovery and reuse. Bulletin of the
American Society for Information Science and Technology, 39(4):44 -- 45.
[Cambria et al.2012] Erik Cambria, Andrew Livingstone, and Amir Hussain. 2012. The hourglass of emotions.
In Proceedings of the 2011 International Conference on Cognitive Behavioural Systems, COST'11, pages 144 --
157, Berlin, Heidelberg. Springer-Verlag.
[Chaturvedi et al.2016] Snigdha Chaturvedi, Shashank Srivastava, Hal Daum´e III, and Chris Dyer. 2016. Modeling
In Dale Schuurmans and Michael P. Wellman,
evolving relationships between characters in literary novels.
editors, AAAI, pages 2704 -- 2710. AAAI Press.
[Chaturvedi et al.2017] Snigdha Chaturvedi, Mohit Iyyer, and Hal Daum´e III. 2017. Unsupervised learning of
evolving relationships between literary characters.
[Choi et al.2017] K. Choi, G. Fazekas, M. Sandler, and K. Cho. 2017. Convolutional recurrent neural networks
for music classification. In 2017 IEEE International Conference on Acoustics, Speech and Signal Processing
(ICASSP), pages 2392 -- 2396, March.
[Dieleman and Schrauwen2013] Sander Dieleman and Benjamin Schrauwen. 2013. Multiscale approaches to mu-
sic audio feature learning. In Proceedings of the 14th International Society for Music Information Retrieval
Conference, November 4-8. http://www.ppgia.pucpr.br/ismir2013/wp-content/uploads/
2013/09/69 Paper.pdf.
[dos Santos and Gatti2014] Cicero dos Santos and Maira Gatti. 2014. Deep convolutional neural networks for
In Proceedings of COLING 2014, the 25th International Conference on
sentiment analysis of short texts.
Computational Linguistics: Technical Papers, pages 69 -- 78, Dublin, Ireland, August. Dublin City University
and Association for Computational Linguistics.
[Eck et al.2008] Douglas Eck, Paul Lamere, Thierry Bertin-mahieux, and Stephen Green. 2008. Automatic gen-
eration of social tags for music recommendation. In J. C. Platt, D. Koller, Y. Singer, and S. T. Roweis, editors,
Advances in Neural Information Processing Systems 20, pages 385 -- 392. Curran Associates, Inc.
[Finlayson2012] Mark Alan Finlayson. 2012. Learning narrative structure from annotated folktales. Ph.D. thesis,
Massachusetts Institute of Technology.
[Ganjigunte Ashok et al.2013] Vikas Ganjigunte Ashok, Song Feng, and Yejin Choi. 2013. Success with style:
In Proceedings of the 2013 Conference on Empirical
Using writing style to predict the success of novels.
Methods in Natural Language Processing, pages 1753 -- 1764, Seattle, Washington, USA, October. Association
for Computational Linguistics.
[Gorinski and Lapata2015] Philip John Gorinski and Mirella Lapata. 2015. Movie script summarization as graph-
based scene extraction. In Proceedings of the 2015 Conference of the North American Chapter of the Asso-
ciation for Computational Linguistics: Human Language Technologies, pages 1066 -- 1076, Denver, Colorado,
May -- June. Association for Computational Linguistics.
[Goyal et al.2010] Amit Goyal, Ellen Riloff, and Hal Daum´e, III. 2010. Automatically producing plot unit repre-
sentations for narrative text. In Proceedings of the 2010 Conference on Empirical Methods in Natural Language
Processing, EMNLP '10, pages 77 -- 86, Stroudsburg, PA, USA. Association for Computational Linguistics.
[Hochreiter and Schmidhuber1997] Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long short-term memory.
Neural computation, 9(8):1735 -- 1780.
[Hotho et al.2008] Andreas Hotho, Dominik Benz, Robert J´aschke, and Beate Krause. 2008. Ecml pkdd discovery
In Workshop at 18th Europ. Conf. on Machine Learning (ECML'08)/11th Europ.
challenge 2008 (rsdc'08).
Conf. on Principles and Practice of Knowledge Discovery in Databases (PKDD'08), volume 32.
[Hu et al.2009] Xiao Hu, J. Stephen Downie, and Andreas F. Ehmann. 2009. Lyric text mining in music mood
classification. In Proceedings of the 10th International Society for Music Information Retrieval Conference,
ISMIR 2009, pages 411 -- 416.
[Iyyer et al.2016] Mohit Iyyer, Anupam Guha, Snigdha Chaturvedi, Jordan Boyd-Graber, and Hal Daum´e III. 2016.
Feuding families and former friends: Unsupervised learning for dynamic fictional relationships. In Proceed-
ings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics:
Human Language Technologies, pages 1534 -- 1544. Association for Computational Linguistics.
[Kar et al.2017] Sudipta Kar, Suraj Maharjan, and Thamar Solorio. 2017. RiTUAL-UH at semeval-2017 task 5:
Sentiment analysis on financial data using neural networks. In Proceedings of the 11th International Workshop
on Semantic Evaluation (SemEval-2017), pages 877 -- 882.
[Kar et al.2018] Sudipta Kar, Suraj Maharjan, A. Pastor L´opez-Monroy, and Thamar Solorio. 2018. MPST: A
In Proceedings of the Eleventh International Conference on Lan-
corpus of movie plot synopses with tags.
guage Resources and Evaluation (LREC 2018), Paris, France, May. European Language Resources Association
(ELRA).
[Katakis et al.2008] Ioannis Katakis, Grigorios Tsoumakas, and Ioannis Vlahavas. 2008. Multilabel text classifi-
cation for automated tag suggestion. In Proceedings of the ECML/PKDD 2008 Discovery Challenge.
[Kim et al.2011] JungHyun Kim, Seungjae Lee, SungMin Kim, and Won Young Yoo. 2011. Music mood classi-
fication model based on arousal-valence values. In Advanced Communication Technology (ICACT), 2011 13th
International Conference on, pages 292 -- 295. IEEE.
[Kim2014] Yoon Kim. 2014. Convolutional neural networks for sentence classification. In Proceedings of the
2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1746 -- 1751, Doha,
Qatar, October. Association for Computational Linguistics.
[Krishnan and Eisenstein2015] Vinodh Krishnan and Jacob Eisenstein. 2015. "You're Mr. Lebowski, I'm the
Dude": Inducing address term formality in signed social networks. In Proceedings of the 2015 Conference of
the North American Chapter of the Association for Computational Linguistics: Human Language Technologies,
pages 1616 -- 1626, Denver, Colorado, May -- June. Association for Computational Linguistics.
[Kullback and Leibler1951] S. Kullback and R. A. Leibler. 1951. On Information and Sufficiency. Ann. Math.
Statist., 22(1):79 -- 86, 03.
[Lambiotte and Ausloos2006] Renaud Lambiotte and Marcel Ausloos, 2006. Collaborative Tagging as a Tripartite
Network, pages 1114 -- 1117. Springer Berlin Heidelberg, Berlin, Heidelberg.
[Li et al.2008] Xin Li, Lei Guo, and Yihong Eric Zhao. 2008. Tag-based social interest discovery. In Proceedings
of the 17th International Conference on World Wide Web, WWW '08, pages 675 -- 684, New York, NY, USA.
ACM.
[Lipczak2008] Marek Lipczak. 2008. Tag recommendation for folksonomies oriented towards individual users. In
In: Proc. of the ECML PKDD Discovery Challenge.
[Maharjan et al.2017] Suraj Maharjan, John Arevalo, Manuel Montes, Fabio A Gonz´alez, and Thamar Solorio.
In Proceedings of the 15th Conference of the
2017. A multi-task approach to predict likability of books.
European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, volume 1, pages
1217 -- 1227.
[Maharjan et al.2018] Suraj Maharjan, Sudipta Kar, Manuel Montes, Fabio A. Gonzalez, and Thamar Solorio.
2018. Letting emotions flow: Success prediction by modeling the flow of emotions in books. In Proceedings of
the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human
Language Technologies, Volume 2 (Short Papers), pages 259 -- 265, New Orleans, Louisiana, June. Association
for Computational Linguistics.
[McIntyre and Lapata2010] Neil McIntyre and Mirella Lapata. 2010. Plot induction and evolutionary search for
story generation. In Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics,
pages 1562 -- 1572, Uppsala, Sweden, July. Association for Computational Linguistics.
[Mishne2006] Gilad Mishne. 2006. Autotag: A collaborative approach to automated tag assignment for weblog
posts. In Proceedings of the 15th International Conference on World Wide Web, WWW '06, pages 953 -- 954,
New York, NY, USA. ACM.
[Mnih et al.2014] Volodymyr Mnih, Nicolas Heess, Alex Graves, and Koray Kavukcuoglu. 2014. Recurrent mod-
els of visual attention. CoRR, abs/1406.6247.
[Mohammad and Turney2013] Saif M. Mohammad and Peter D. Turney. 2013. Crowdsourcing a word-emotion
association lexicon. 29(3):436 -- 465.
[Mohammad2011] Saif Mohammad. 2011. From once upon a time to happily ever after: Tracking emotions in
novels and fairy tales. In Proceedings of the 5th ACL-HLT Workshop on Language Technology for Cultural
Heritage, Social Sciences, and Humanities, LaTeCH '11, pages 105 -- 114, Stroudsburg, PA, USA. Association
for Computational Linguistics.
[Nair and Hinton2010] Vinod Nair and Geoffrey E. Hinton. 2010. Rectified linear units improve restricted boltz-
mann machines. In Proceedings of the 27th International Conference on International Conference on Machine
Learning, ICML'10, pages 807 -- 814, USA. Omnipress.
[Plutchik2001] Robert Plutchik. 2001. The nature of emotions human emotions have deep evolutionary roots, a fact
that may explain their complexity and provide tools for clinical practice. American scientist, 89(4):344 -- 350.
[Reagan et al.2016] Andrew J. Reagan, Lewis Mitchell, Dilan Kiley, Christopher M. Danforth, and Peter Sheridan
Dodds. 2016. The emotional arcs of stories are dominated by six basic shapes. CoRR, abs/1606.07772.
[Seo et al.2016] Paul Hongsuck Seo, Zhe Lin, Scott Cohen, Xiaohui Shen, and Bohyung Han. 2016. Hierarchical
attention networks. CoRR, abs/1606.02393.
[Shrestha et al.2017] Prasha Shrestha, Sebastian Sierra, Fabio Gonzalez, Manuel Montes, Paolo Rosso, and Thamar
Solorio. 2017. Convolutional neural networks for authorship attribution of short texts. In Proceedings of the
15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short
Papers, pages 669 -- 674, Valencia, Spain. Association for Computational Linguistics.
[Sood et al.2007] Sanjay C. Sood, Kristian J. Hammond, Sara H. Owsley, and Larry Birnbaum, 2007. TagAssist:
Automatic tag suggestion for blog posts.
[Szomszor et al.2007] Martin Szomszor, Ciro Cattuto, Harith Alani, Kieron O'Hara, Andrea Baldassarri, Vittorio
Loreto, and Vito D.P. Servedio. 2007. Folksonomies, the semantic web, and movie recommendation.
[Tatu et al.2008] M. Tatu, M. Srikanth, and T. D'Silva. 2008. RSDC'08: Tag Recommendations using Bookmark
Content. Workshop at 18th Europ. Conf. on Machine Learning (ECML'08) / 11th Europ. Conf. on Principles
and Practice of Knowledge Discovery in Databases (PKDD'08).
[Tieleman and Hinton2012] Tijmen Tieleman and Geoffrey Hinton. 2012. Lecture 6.5-rmsprop: Divide the gradi-
ent by a running average of its recent magnitude. COURSERA: Neural networks for machine learning, 4(2):26 --
31.
[Valls-Vargas et al.2014] Josep Valls-Vargas, Jichen Zhu, and Santiago Ontan´on. 2014. Toward automatic role
identification in unannotated folk tales. In Proceedings of the Tenth AAAI Conference on Artificial Intelligence
and Interactive Digital Entertainment, pages 188 -- 194. AAAI Press.
[van Zaanen and Kanters2010] Menno van Zaanen and Pieter Kanters. 2010. Automatic mood classification us-
ing tf*idf based on lyrics. In Proceedings of the 11th International Society for Music Information Retrieval
Conference, ISMIR 2010, Utrecht, Netherlands, August 9-13, 2010, pages 75 -- 80.
[Vander Wal2005] Thomas Vander Wal. 2005. Folksonomy definition and wikipedia. vanderwal. net.
[Vonnegut1981] Kurt Vonnegut. 1981. Palm sunday: An autobiographical collage.
[Zhang et al.2015] Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for
text classification. In Advances in Neural Information Processing Systems, pages 649 -- 657.
|
1308.2696 | 1 | 1308 | 2013-08-12T20:57:02 | B(eo)W(u)LF: Facilitating recurrence analysis on multi-level language | [
"cs.CL"
] | Discourse analysis may seek to characterize not only the overall composition of a given text but also the dynamic patterns within the data. This technical report introduces a data format intended to facilitate multi-level investigations, which we call the by-word long-form or B(eo)W(u)LF. Inspired by the long-form data format required for mixed-effects modeling, B(eo)W(u)LF structures linguistic data into an expanded matrix encoding any number of researchers-specified markers, making it ideal for recurrence-based analyses. While we do not necessarily claim to be the first to use methods along these lines, we have created a series of tools utilizing Python and MATLAB to enable such discourse analyses and demonstrate them using 319 lines of the Old English epic poem, Beowulf, translated into modern English. | cs.CL | cs | B(eo)W(u)LF:
Facilitating
Recurrence
Analysis
on
Multi-‐Level
Language
Alexandra
Paxton
and
Rick
Dale
Version
1.0
Released
August
12,
2013
Cognitive
and
Information
Sciences
University
of
California,
Merced
Merced,
CA
95340
[email protected],
http://www.alexandrapaxton.com
Discourse
analysis
may
seek
to
characterize
not
only
the
overall
composition
of
a
given
text
or
corpora
but
also
the
dynamic
patterns
within
the
data.
Patterns
of
interest
may
occur
at
multiple
levels,
from
character
to
sentence
to
corpus.
Researchers
may
be
interested
in
the
way
that
sentence
structures
recur
between
participants
or
how
affect
words
cluster
in
a
single
text.
Recurrence
analyses
are
an
ideal
tool
for
such
investigations,
but
linguistic
data
must
often
be
transformed
prior
to
being
analyzed.
This
technical
report
introduces
a
data
format
called
the
by-‐word
long-‐form
or
B(eo)W(u)LF.
Inspired
by
the
long-‐form
data
format
required
for
mixed-‐effects
modeling,
B(eo)W(u)LF
structures
linguistic
data
into
an
expanded
matrix
encoding
any
number
of
researchers-‐specified
markers.
While
we
do
not
necessarily
claim
to
be
the
first
to
use
methods
along
these
lines,
we
have
created
a
series
of
tools
utilizing
Python
and
MATLAB
to
enable
such
discourse
analyses.
We
demonstrate
this
analysis
on
319
lines
of
the
Old
English
epic
poem,
Beowulf,
translated
into
modern
English
(Appendix
1).
At
the
end
of
this
report,
we
provide
the
original
text,
scripts
adapted
to
the
text,
and
(for
brevity’s
sake)
a
portion
of
the
final
result.
The
sample
text
is
a
single
file,
but
if
a
corpus
is
saved
in
multiple
individual
files,
these
scripts
can
be
modified
with
“if”
statements
to
streamline
the
process.
Text
Preparation
These
scripts
require
that
text
data
be
stored
in
a
plain
text
file
(.txt
or
.csv).
If
the
corpus
comprises
separate
text
files,
it’s
highly
recommended
that
each
file
be
transcribed
or
formatted
identically.
The
data
will
be
run
through
with
a
series
of
regular
expressions
in
Python
to
quickly
and
automatically
reformat
the
text
(Appendix
2).
Therefore,
if
individual
files
are
formatted
differently,
the
cleanup
script
will
have
to
be
tweaked
for
each
format
type.
The
analyses
to
be
performed
will
dictate
the
cleanup
choices.
In
our
example,
we
remove
commas,
colons,
and
semicolons,
but
we
are
interested
in
keeping
the
end-‐
of-‐sentence
punctuations
(e.g.,
periods,
question
marks).
We
may
choose
to
do
some
analyses
on
the
separate
cantos
or
lines
of
the
poem,
so
we
created
indicators
of
each
that
will
be
utilized
in
the
MATLAB
script
in
the
next
section.
After
cleaning
up
the
original
text,
the
cleaned
file
is
saved
in
a
new
file.
The
cleaned
file
is
then
split
by
spaces,
saving
each
word
in
a
separate
cell,
and
saved
again.
We
format
the
data
into
a
CSV
format,
but
if
the
analyses
require
that
commas
remain
in
place,
we
recommend
changing
the
Python
script
to
save
the
output
in
a
tab-‐delimited
format.
This
file
will
then
be
read
into
the
MATLAB
script
in
the
next
phase.
Initial
Text
Analysis
The
next
phase
uses
MATLAB
to
automatically
calculate
a
number
of
target
variables
from
the
text
(Appendix
3).
These
variables
can
be
shaped
according
to
researcher
needs.
For
this
example,
we
have
chosen
to
create
variables
indicating
canto
number,
poem
line
number,
speech
events,
number
of
characters
per
word,
and
end-‐of-‐sentence
markers.
Of
course,
we
could
imagine
a
host
of
other
variables
that
could
also
be
chosen,
like
indicating
when
certain
word(s)
are
used
(e.g.,
name,
location,
experiment
materials),
exploring
types
of
sentences
(e.g.,
question
marks,
exclamation
points),
or
tracking
sentence
length.
The
code
reads
in
the
text
produced
by
Python
in
the
earlier
phase
and
tracks
canto
and
line
number
(using
the
indicators
created
earlier).
We
transform
these
indicators
into
separate
variables
and
remove
the
indicators
from
the
text.
Once
we
also
create
the
end-‐of-‐sentence,
character
number,
and
speech
event
variables,
we
save
the
data
into
a
matrix
(Appendix
4).
Each
line
reports
the
values
of
each
variable
for
a
single
word
in
the
original
text.
In
anticipation
of
further
linguistic
analysis,
we
also
save
the
text
data
in
a
.txt
format
with
one
word
per
line.
In
the
following
section,
we
model
how
to
use
the
BWLF
in
conjunction
with
LIWC
(Linguistic
Inquiry
and
Word
Count;
Pennebaker,
Booth,
&
Francis,
2007).
However,
these
methods
can
be
modified
for
other
forms
linguistic
analyses
as
desired.
Linguistic
Analysis
and
Integration
into
BWLF
Matrix
LIWC
is
a
highly
flexible
and
powerful
tool
that
has
been
fairly
widely
used
both
in
transcript-‐
and
text-‐based
linguistic
analyses
(e.g.,
Niederhoffer
&
Pennebaker,
2002).
In
addition
to
providing
pre-‐defined
linguistic
categories
of
both
content
and
structure,
LIWC
allows
researchers
to
specify
their
own
categories
of
interest
(e.g.,
a
set
of
proper
names).
The
text-‐only
file
that
was
produced
in
the
previous
section
can
be
uploaded
and
analyzed
by
the
LIWC
program,
using
1
newline
as
the
delimiting
option.
Once
the
LIWC
output
has
been
saved,
it
can
be
integrated
with
the
BLWF
matrix
we
created
earlier,
again
using
MATLAB
(Appendices
5-‐6).
Concluding
Remarks
B(eo)W(u)LF
provides
researchers
interested
in
language
with
a
data
format
that
is
well-‐suited
for
dynamic
language
analyses
(e.g.,
recurrence
analysis).
Again,
although
we
do
not
necessarily
claim
to
be
the
first
to
have
used
data
formats
like
this,
we
have
here
outlined
a
package
of
scripts
for
Python
and
MATLAB
that
can
be
easily
modified
to
fit
the
specific
needs
of
the
project
at
hand.
We
believe
that
B(eo)W(u)LF
provides
an
intuitively
simple
but
analytically
powerful
data
format
particularly
suited
to
analyzing
language
as
it
occurs
and
changes
over
a
number
of
time
scales.
References
Niederhoffer,
K.
G.,
&
Pennebaker,
J.
W.
(2002).
Linguistic
style
matching
in
social
interaction.
Journal
of
Language
and
Social
Psychology,
21(4),
337–360.
Pennebaker,
J.
W.,
Booth,
R.
J.,
&
Francis,
M.
E.
(2007).
Linguistic
Inquiry
and
Word
Count
(LIWC):
A
computerized
text
analysis
program.
Austin,
TX:
LIWC.net.
Modern
English
translation
of
Beowulf.
Taken
from
an
e-‐text
version
by
Robin
Appendix
1:
Katsuya-‐Corbet
(released
into
the
public
domain
July
1993).
Beowulf
Sample
Text
LO,
praise
of
the
prowess
of
people-‐kings
who
in
former
time
forth
had
sent
him
of
spear-‐armed
Danes,
in
days
long
sped,
sole
on
the
seas,
a
suckling
child.
we
have
heard,
and
what
honor
the
athelings
High
o'er
his
head
they
hoist
the
standard,
a
gold-‐wove
banner;
let
billows
take
him,
won!
Oft
Scyld
the
Scefing
from
squadroned
foes,
gave
him
to
ocean.
Grave
were
their
spirits,
from
many
a
tribe,
the
mead-‐bench
tore,
mournful
their
mood.
No
man
is
able
awing
the
earls.
Since
erst
he
lay
to
say
in
sooth,
no
son
of
the
halls,
no
hero
'neath
heaven,
-‐
who
harbored
that
friendless,
a
foundling,
fate
repaid
him:
for
he
waxed
under
welkin,
in
wealth
he
freight!
throve,
Now
Beowulf
bode
in
the
burg
of
the
till
before
him
the
folk,
both
far
and
near,
Scyldings,
leader
beloved,
and
long
he
ruled
who
house
by
the
whale-‐path,
heard
his
mandate,
in
fame
with
all
folk,
since
his
father
had
gone
gave
him
gifts:
a
good
king
he!
away
from
the
world,
till
awoke
an
heir,
To
him
an
heir
was
afterward
born,
haughty
Healfdene,
who
held
through
life,
sage
and
sturdy,
the
Scyldings
glad.
a
son
in
his
halls,
whom
heaven
sent
to
favor
the
folk,
feeling
their
woe
Then,
one
after
one,
there
woke
to
him,
that
erst
they
had
lacked
an
earl
for
leader
to
the
chieftain
of
clansmen,
children
four:
so
long
a
while;
the
Lord
endowed
him,
Heorogar,
then
Hrothgar,
then
Halga
brave;
the
Wielder
of
Wonder,
with
world's
renown.
and
I
heard
that
-‐
was
-‐'s
queen,
the
Heathoscylfing's
helpmate
dear.
Famed
was
this
Beowulf:
far
flew
the
boast
of
him,
To
Hrothgar
was
given
such
glory
of
war,
son
of
Scyld,
in
the
Scandian
lands.
such
honor
of
combat,
that
all
his
kin
So
becomes
it
a
youth
to
quit
him
well
obeyed
him
gladly
till
great
grew
his
band
of
youthful
comrades.
It
came
in
his
mind
with
his
father's
friends,
by
fee
and
gift,
that
to
aid
him,
aged,
in
after
days,
to
bid
his
henchmen
a
hall
uprear,
come
warriors
willing,
should
war
draw
nigh,
a
master
mead-‐house,
mightier
far
liegemen
loyal:
by
lauded
deeds
than
ever
was
seen
by
the
sons
of
earth,
and
within
it,
then,
to
old
and
young
shall
an
earl
have
honor
in
every
clan.
Forth
he
fared
at
the
fated
moment,
he
would
all
allot
that
the
Lord
had
sent
him,
sturdy
Scyld
to
the
shelter
of
God.
save
only
the
land
and
the
lives
of
his
men.
Then
they
bore
him
over
to
ocean's
billow,
Wide,
I
heard,
was
the
work
commanded,
for
many
a
tribe
this
mid-‐earth
round,
loving
clansmen,
as
late
he
charged
them,
while
wielded
words
the
winsome
Scyld,
to
fashion
the
folkstead.
It
fell,
as
he
ordered,
the
leader
beloved
who
long
had
ruled....
in
rapid
achievement
that
ready
it
stood
there,
In
the
roadstead
rocked
a
ring-‐dight
vessel,
of
halls
the
noblest:
Heorot
he
named
it
ice-‐flecked,
outbound,
atheling's
barge:
whose
message
had
might
in
many
a
land.
Not
reckless
of
promise,
the
rings
he
dealt,
there
laid
they
down
their
darling
lord
on
the
breast
of
the
boat,
the
breaker-‐of-‐rings,
treasure
at
banquet:
there
towered
the
hall,
by
the
mast
the
mighty
one.
Many
a
treasure
high,
gabled
wide,
the
hot
surge
waiting
fetched
from
far
was
freighted
with
him.
of
furious
flame.
Nor
far
was
that
day
when
father
and
son-‐in-‐law
stood
in
feud
No
ship
have
I
known
so
nobly
dight
with
weapons
of
war
and
weeds
of
battle,
for
warfare
and
hatred
that
woke
again.
with
breastplate
and
blade:
on
his
bosom
lay
With
envy
and
anger
an
evil
spirit
a
heaped
hoard
that
hence
should
go
endured
the
dole
in
his
dark
abode,
that
he
heard
each
day
the
din
of
revel
far
o'er
the
flood
with
him
floating
away.
No
less
these
loaded
the
lordly
gifts,
high
in
the
hall:
there
harps
rang
out,
thanes'
huge
treasure,
than
those
had
done
clear
song
of
the
singer.
He
sang
who
knew
tales
of
the
early
time
of
man,
how
the
Almighty
made
the
earth,
fairest
fields
enfolded
by
water,
set,
triumphant,
sun
and
moon
for
a
light
to
lighten
the
land-‐dwellers,
and
braided
bright
the
breast
of
earth
with
limbs
and
leaves,
made
life
for
all
of
mortal
beings
that
breathe
and
move.
So
lived
the
clansmen
in
cheer
and
revel
a
winsome
life,
till
one
began
to
fashion
evils,
that
field
of
hell.
Grendel
this
monster
grim
was
called,
march-‐riever
mighty,
in
moorland
living,
in
fen
and
fastness;
fief
of
the
giants
the
hapless
wight
a
while
had
kept
since
the
Creator
his
exile
doomed.
On
kin
of
Cain
was
the
killing
avenged
by
sovran
God
for
slaughtered
Abel.
Ill
fared
his
feud,
and
far
was
he
driven,
for
the
slaughter's
sake,
from
sight
of
men.
Of
Cain
awoke
all
that
woful
breed,
Etins
and
elves
and
evil-‐spirits,
as
well
as
the
giants
that
warred
with
God
weary
while:
but
their
wage
was
paid
them!
WENT
he
forth
to
find
at
fall
of
night
that
haughty
house,
and
heed
wherever
the
Ring-‐Danes,
outrevelled,
to
rest
had
gone.
Found
within
it
the
atheling
band
asleep
after
feasting
and
fearless
of
sorrow,
of
human
hardship.
Unhallowed
wight,
grim
and
greedy,
he
grasped
betimes,
wrathful,
reckless,
from
resting-‐places,
thirty
of
the
thanes,
and
thence
he
rushed
fain
of
his
fell
spoil,
faring
homeward,
laden
with
slaughter,
his
lair
to
seek.
Then
at
the
dawning,
as
day
was
breaking,
the
might
of
Grendel
to
men
was
known;
then
after
wassail
was
wail
uplifted,
loud
moan
in
the
morn.
The
mighty
chief,
atheling
excellent,
unblithe
sat,
labored
in
woe
for
the
loss
of
his
thanes,
when
once
had
been
traced
the
trail
of
the
fiend,
spirit
accurst:
too
cruel
that
sorrow,
too
long,
too
loathsome.
Not
late
the
respite;
with
night
returning,
anew
began
ruthless
murder;
he
recked
no
whit,
firm
in
his
guilt,
of
the
feud
and
crime.
They
were
easy
to
find
who
elsewhere
sought
in
room
remote
their
rest
at
night,
bed
in
the
bowers,
when
that
bale
was
shown,
was
seen
in
sooth,
with
surest
token,
-‐
the
hall-‐thane's
hate.
Such
held
themselves
far
and
fast
who
the
fiend
outran!
Thus
ruled
unrighteous
and
raged
his
fill
one
against
all;
until
empty
stood
that
lordly
building,
and
long
it
bode
so.
Twelve
years'
tide
the
trouble
he
bore,
sovran
of
Scyldings,
sorrows
in
plenty,
boundless
cares.
There
came
unhidden
tidings
true
to
the
tribes
of
men,
in
sorrowful
songs,
how
ceaselessly
Grendel
harassed
Hrothgar,
what
hate
he
bore
him,
what
murder
and
massacre,
many
a
year,
feud
unfading,
-‐
refused
consent
to
deal
with
any
of
Daneland's
earls,
make
pact
of
peace,
or
compound
for
gold:
still
less
did
the
wise
men
ween
to
get
great
fee
for
the
feud
from
his
fiendish
hands.
But
the
evil
one
ambushed
old
and
young
death-‐shadow
dark,
and
dogged
them
still,
lured,
or
lurked
in
the
livelong
night
of
misty
moorlands:
men
may
say
not
where
the
haunts
of
these
Hell-‐Runes
be.
Such
heaping
of
horrors
the
hater
of
men,
lonely
roamer,
wrought
unceasing,
harassings
heavy.
O'er
Heorot
he
lorded,
gold-‐bright
hall,
in
gloomy
nights;
and
ne'er
could
the
prince
approach
his
throne,
-‐
'twas
judgment
of
God,
-‐
or
have
joy
in
his
hall.
Sore
was
the
sorrow
to
Scyldings'-‐friend,
heart-‐rending
misery.
Many
nobles
sat
assembled,
and
searched
out
counsel
how
it
were
best
for
bold-‐hearted
men
against
harassing
terror
to
try
their
hand.
Whiles
they
vowed
in
their
heathen
fanes
altar-‐offerings,
asked
with
words
that
the
slayer-‐of-‐souls
would
succor
give
them
for
the
pain
of
their
people.
Their
practice
this,
their
heathen
hope;
'twas
Hell
they
thought
of
in
mood
of
their
mind.
Almighty
they
knew
not,
Doomsman
of
Deeds
and
dreadful
Lord,
nor
Heaven's-‐Helmet
heeded
they
ever,
Wielder-‐of-‐Wonder.
-‐
Woe
for
that
man
who
in
harm
and
hatred
hales
his
soul
to
fiery
embraces;
-‐
nor
favor
nor
change
awaits
he
ever.
But
well
for
him
that
after
death-‐day
may
draw
to
his
Lord,
and
friendship
find
in
the
Father's
arms!
THUS
seethed
unceasing
the
son
of
Healfdene
with
the
woe
of
these
days;
not
wisest
men
assuaged
his
sorrow;
too
sore
the
anguish,
loathly
and
long,
that
lay
on
his
folk,
most
baneful
of
burdens
and
bales
of
the
night.
This
heard
in
his
home
Hygelac's
thane,
great
among
Geats,
of
Grendel's
doings.
He
was
the
mightiest
man
of
valor
in
that
same
day
of
this
our
life,
stalwart
and
stately.
A
stout
wave-‐walker
he
bade
make
ready.
Yon
battle-‐king,
said
he,
far
o'er
the
swan-‐road
he
fain
would
seek,
the
noble
monarch
who
needed
men!
The
prince's
journey
by
prudent
folk
was
little
blamed,
though
they
loved
him
dear;
they
whetted
the
hero,
and
hailed
good
omens.
And
now
the
bold
one
from
bands
of
Geats
comrades
chose,
the
keenest
of
warriors
e'er
he
could
find;
with
fourteen
men
the
sea-‐wood
he
sought,
and,
sailor
proved,
led
them
on
to
the
land's
confines.
Time
had
now
flown;
afloat
was
the
ship,
boat
under
bluff.
On
board
they
climbed,
warriors
ready;
waves
were
churning
sea
with
sand;
the
sailors
bore
on
the
breast
of
the
bark
their
bright
array,
their
mail
and
weapons:
the
men
pushed
off,
on
its
willing
way,
the
well-‐braced
craft.
Then
moved
o'er
the
waters
by
might
of
the
wind
that
bark
like
a
bird
with
breast
of
foam,
till
in
season
due,
on
the
second
day,
the
curved
prow
such
course
had
run
that
sailors
now
could
see
the
land,
sea-‐cliffs
shining,
steep
high
hills,
headlands
broad.
Their
haven
was
found,
their
journey
ended.
Up
then
quickly
the
Weders'
clansmen
climbed
ashore,
anchored
their
sea-‐wood,
with
armor
clashing
and
gear
of
battle:
God
they
thanked
for
passing
in
peace
o'er
the
paths
of
the
sea.
Now
saw
from
the
cliff
a
Scylding
clansman,
a
warden
that
watched
the
water-‐side,
how
they
bore
o'er
the
gangway
glittering
shields,
war-‐gear
in
readiness;
wonder
seized
him
to
know
what
manner
of
men
they
were.
Straight
to
the
strand
his
steed
he
rode,
Hrothgar's
henchman;
with
hand
of
might
he
shook
his
spear,
and
spake
in
parley.
"Who
are
ye,
then,
ye
armed
men,
mailed
folk,
that
yon
mighty
vessel
have
urged
thus
over
the
ocean
ways,
here
o'er
the
waters?
A
warden
I,
sentinel
set
o'er
the
sea-‐march
here,
lest
any
foe
to
the
folk
of
Danes
with
harrying
fleet
should
harm
the
land.
No
aliens
ever
at
ease
thus
bore
them,
linden-‐wielders:
yet
word-‐of-‐leave
clearly
ye
lack
from
clansmen
here,
my
folk's
agreement.
-‐
A
greater
ne'er
saw
I
of
warriors
in
world
than
is
one
of
you,
-‐
yon
hero
in
harness!
No
henchman
he
worthied
by
weapons,
if
witness
his
features,
his
peerless
presence!
I
pray
you,
though,
tell
your
folk
and
home,
lest
hence
ye
fare
suspect
to
wander
your
way
as
spies
in
Danish
land.
Now,
dwellers
afar,
ocean-‐travellers,
take
from
me
simple
advice:
the
sooner
the
better
I
hear
of
the
country
whence
ye
came."
To
him
the
stateliest
spake
in
answer;
the
warriors'
leader
his
word-‐hoard
unlocked:-‐
"We
are
by
kin
of
the
clan
of
Geats,
and
Hygelac's
own
hearth-‐fellows
we.
To
folk
afar
was
my
father
known,
noble
atheling,
Ecgtheow
named.
Full
of
winters,
he
fared
away
aged
from
earth;
he
is
honored
still
through
width
of
the
world
by
wise
men
all.
To
thy
lord
and
liege
in
loyal
mood
we
hasten
hither,
to
Healfdene's
son,
people-‐protector:
be
pleased
to
advise
us!
To
that
mighty-‐one
come
we
on
mickle
errand,
to
the
lord
of
the
Danes;
nor
deem
I
right
that
aught
be
hidden.
We
hear
-‐
thou
knowest
if
sooth
it
is
-‐
the
saying
of
men,
that
amid
the
Scyldings
a
scathing
monster,
dark
ill-‐doer,
in
dusky
nights
shows
terrific
his
rage
unmatched,
hatred
and
murder.
To
Hrothgar
I
in
greatness
of
soul
would
succor
bring,
so
the
Wise-‐and-‐Brave
may
worst
his
foes,
-‐
if
ever
the
end
of
ills
is
fated,
of
cruel
contest,
if
cure
shall
follow,
and
the
boiling
care-‐waves
cooler
grow;
else
ever
afterward
anguish-‐days
he
shall
suffer
in
sorrow
while
stands
in
place
high
on
its
hill
that
house
unpeered!"
Astride
his
steed,
the
strand-‐ward
answered,
clansman
unquailing:
"The
keen-‐souled
thane
must
be
skilled
to
sever
and
sunder
duly
words
and
works,
if
he
well
intends.
I
gather,
this
band
is
graciously
bent
to
the
Scyldings'
master.
March,
then,
bearing
weapons
and
weeds
the
way
I
show
you.
I
will
bid
my
men
your
boat
meanwhile
to
guard
for
fear
lest
foemen
come,
-‐
your
new-‐tarred
ship
by
shore
of
ocean
faithfully
watching
till
once
again
it
waft
o'er
the
waters
those
well-‐loved
thanes,
-‐
winding-‐neck'd
wood,
-‐
to
Weders'
bounds,
heroes
such
as
the
hest
of
fate
shall
succor
and
save
from
the
shock
of
war."
They
bent
them
to
march,
-‐
the
boat
lay
still,
fettered
by
cable
and
fast
at
anchor,
broad-‐bosomed
ship.
-‐
Then
shone
the
boars
over
the
cheek-‐guard;
chased
with
gold,
keen
and
gleaming,
guard
it
kept
o'er
the
man
of
war,
as
marched
along
heroes
in
haste,
till
the
hall
they
saw,
broad
of
gable
and
bright
with
gold:
that
was
the
fairest,
'mid
folk
of
earth,
of
houses
'neath
heaven,
where
Hrothgar
lived,
and
the
gleam
of
it
lightened
o'er
lands
afar.
The
sturdy
shieldsman
showed
that
bright
burg-‐of-‐the-‐boldest;
bade
them
go
straightway
thither;
his
steed
then
turned,
hardy
hero,
and
hailed
them
thus:-‐
"Tis
time
that
I
fare
from
you.
Father
Almighty
in
grace
and
mercy
guard
you
well,
safe
in
your
seekings.
Seaward
I
go,
'gainst
hostile
warriors
hold
my
watch."
Python
Source
Code
for
Data
Preparation
This
code
is
also
available
for
upon
request.
Appendix
2:
###############
# B(eo)W(u)LF Code: By-Word Long-Form Data Preparation
# This code reads in a sample text file, reformats it, and exports it
# to a new file before further formatting and analysis.
# Written by: Alexandra Paxton, University of California, Merced
# Date last modified: June 16, 2013
###############
# coding:utf-8
import os,re,unicodedata,shlex,glob
# read in text file
os.chdir('~/bwlfTechReport/')
beowulfText = open('beowulfTextSnippet.txt','r') # open file
beowulf = beowulfText.read() # read in text
# start the cleanup (change according to text)
beowulf = re.sub('\r','\n',beowulf) # ensure all newlines are identical
beowulf = re.sub('(^\n)([A-Z]{2,}( ,))','\n\n[canto]\n\\2',beowulf) #
create canto indicator
beowulf = re.sub(':;(\-),',' ',beowulf) # remove non-target
punctuation
beowulf = re.sub('(\.){3,}','.',beowulf)
beowulf = re.sub(' {1,}',' ',beowulf) # remove redundant spaces
# convert all text to lower case
beowulf = beowulf.lower()
# split by spaces
beowulf = re.sub('\n(?=([A-Z][a-z]\"))',' [line] ',beowulf) # create
line indicator
beowulf = re.sub('\n',' ',beowulf) # convert newline to space
beowulf = re.split(' +',beowulf) # split file by space
beowulf = str(beowulf) # convert to a string
beowulf = re.sub('((\')("))\, ((\')("))',',',beowulf) # remove
extraneous quotations
beowulf = re.sub('\,{2}',',',beowulf) # remove empty cells
beowulf = re.sub('(\[\'(,)?)(\'\])','',beowulf) # remove extraneous
brackets
# close file and print new file
beowulfText.close()
cleaned = file('beowulfCleaned.csv','w')
cleaned.write(beowulf)
cleaned.close()
MATLAB
Source
Code
for
Initial
Text
Analysis
This
code
is
also
available
for
upon
request.
Appendix
3:
%% B(eo)W(u)LF Code: By-Word Long-Form Initial Text Analysis
% This code reads in the cleaned file produced by the Python script,
% computes a series of automatic variables from the texts, then outputs
% two files: a matrix with the automatic variables and a text file
% suitable for other linguistic analyses (e.g., LIWC).
% Written by: Alexandra Paxton, University of California, Merced
% Date last modified: June 17, 2013
%%
% preliminaries
clear
cd('./bwlfTechReport');
% read in cleaned text file
bText = fopen('beowulfCleaned.csv');
bRead = textscan(bText,'%s','EndOfLine','\n','delimiter',',');
bRead = bRead{1,1};
disp('Cleaned Text File Loaded.')
% separate and renumber cantos
canto = regexp(bRead,'\[canto\]');
cantoCount = 0;
trashLines = [];
for cantos = 1:length(bRead)
if cellfun(@isempty,canto(cantos))==0
cantoCount = cantoCount + 1;
trashLines = [trashLines cantos];
else
cantoTrack(cantos,1) = cantoCount;
end
end
disp('Cantos Numbered.')
% separate and renumber lines
pLine = regexp(bRead,'\[line\]');
pLineCount = 0;
for pLines = 1:length(bRead)
if cellfun(@isempty,pLine(pLines))==0
pLineCount = pLineCount + 1;
trashLines = [trashLines pLines];
else
pLineTrack(pLines,1) = pLineCount;
end
end
disp('Poem Lines Numbered.')
% remove indicator lines from text and indicator matrices
bRead(trashLines) = [];
cantoTrack(trashLines) = [];
pLineTrack(trashLines) = [];
% find end-of-sentence lines
ends = regexp(bRead,'.*[\.?\!]');
endsNone = cellfun(@isempty,ends);
disp('Sentences Isolated.')
% track speech lines
speech = regexp(bRead,'.*\"');
speechTrack = [];
tempStore = [];
speechEvent = 1;
for speaking = 1:length(bRead)
if cellfun(@isempty,speech(speaking))==0
tempStore = [tempStore speaking];
if length(tempStore)==2
speechTrack(speechEvent,1:2) = tempStore;
tempStore = [];
speechEvent = speechEvent + 1;
end
end
end
sTrack = 1;
for speechMark = 1:length(bRead)
if speechTrack(sTrack,1) <= speechMark && speechMark<=
speechTrack(sTrack,2)
speech{speechMark} = 1;
if speechMark == speechTrack(sTrack,2)
sTrack = sTrack + 1;
end
end
end
speechNone = cellfun(@isempty,speech);
disp('Speech Isolated.')
% create initial by-word long-form matrix
for i = 1:length(bRead)
% track sentence ends
if endsNone(i) == 0
eos = 1; % indicates end of sentence
charNum = length(char(bRead{i}))-1; % tracks current word
length, minus the punctuation
else
eos = 0; % indicates not end of sentence
charNum = length(char(bRead{i})); % tracks current word length,
minus the punctuation
end
% track speech events
if speechNone(i) == 0
sp = 1; % indicates speech event
if regexp(bRead{i},'.*\"')==1
charNum = charNum - 1; % subtrack quotation mark from
character count
end
else
sp = 0; % indicates no speech event
end
% store everything in matrix
beowulfMat(i,:) =
{int2str(cantoTrack(i)),int2str(pLineTrack(i)),bRead{i},int2str(charNum
),int2str(sp),int2str(eos)};
if mod(i,500)==0;
disp(['Line ' int2str(i) ' of ' int2str(length(bRead)) '
Recorded.'])
end
end
% save workspace
save beowulfBWLF.mat
disp('MATLAB Workspace Saved.')
% print transcript for LIWC
textFileName = ('bwlfTextAnalysisPrep.txt');
textLine = beowulfMat(:,3);
textFile = fopen(textFileName,'w');
for word = 1:length(textLine)
fprintf(textFile,'%s\n',textLine{word});
end
% print matrix
matrixFile = ('beowulfBWLFMatrix.csv');
matOut = fopen(matrixFile,'w');
header_names = {'canto';'line';'word';'charnum';'speech';'eos'};
fprintf(matOut,'%s,%s,%s,%s,%s,%s\n',header_names{:});
for beoLine = 1:size(beowulfMat,1)
fprintf(matOut,'%s,%s,%s,%s,%s,%s\n',beowulfMat{beoLine,:});
end
disp('Matrix Output Complete.')
save beowulfBLWF.mat
% close file
fclose(matOut);
disp('Processing Complete.')
canto
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
line
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
4
4
4
4
4
4
4
5
5
5
5
5
5
Appendix
4:
39
Lines
of
BWLF
Output
charnum
word
lo
2
6
praise
2
of
3
the
prowess
7
2
of
6
people
kings
5
2
of
5
spear
armed
5
5
danes
2
in
days
4
4
long
4
sped
we
2
4
have
5
heard
3
and
what
4
5
honor
3
the
athelings
9
3
won!
3
oft
scyld
5
3
the
7
scefing
from
4
10
squadroned
4
foes
4
from
many
4
1
a
5
tribe
the
3
4
mead
speech
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
eos
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
This
code
is
also
available
for
upon
request.
Appendix
5:
MATLAB
Source
Code
for
Data
Integration
%% B(eo)W(u)LF Code: By-Word Long-Form Data Integration
% This code combines the BWLF matrix created with the previous
% MATLAB script with LIWC output to create a single file.
% Written by: Alexandra Paxton, University of California, Merced
% Date last modified: June 17, 2013
%%
% preliminaries
clear
cd('./bwlfTechReport');
% import LIWC data
liwcData = importdata('beowulfLIWC.txt');
disp('LIWC Data Imported.')
% create variables named for each header
headers = liwcData.textdata(1,:);
Filename = liwcData.textdata(2:end,1);
for i = 2:(length(headers))
eval([headers{i} ' = liwcData.data(:,' int2str(i-1) ');']);
end
disp('LIWC Category Variable Headers Created.')
% import workspace
load beowulfBWLF.mat
% create output file for integrated matrx
matrixFile = ('beowulfBwlfLiwc.csv');
matOut = fopen(matrixFile,'w');
% print headers
fprintf(matOut,'%s,',header_names{:});
fprintf(matOut,'%s,',headers{1:length(headers)-1});
fprintf(matOut,'%s\n',headers{length(headers)});
% print to file
for thisLine = 1:length(bRead)
fprintf(matOut,'%s,',beowulfMat{thisLine,1:6});
fprintf(matOut,'%s,',Filename{thisLine});
fprintf(matOut,'%d,',liwcData.data(thisLine,1:(length(headers)-
2)));
fprintf(matOut,'%d\n',liwcData.data(thisLine,length(headers)-1));
if mod(thisLine,500)==0;
disp(['Line ' int2str(thisLine) ' Recorded.'])
end
end
fclose(matOut);
disp('Processing Complete.')
Appendix
6:
39
Lines
of
BWLF
Output
with
(Partial)
Integrated
LIWC
Analyses
charnum speech eos Seg WC WPS Sixltr Dic
canto line word
1
1
lo
2
0
0
1
1
1
0
0
100
0
1
1
2
0
0
6
praise
1
1
100
0
1
1
3
0
0
2
of
1
1
100
0
1
1
4
0
0
3
the
1
1
1
1
prowess
7
0
0
5
1
1
100
0
100
0
1
1
6
0
0
2
of
1
1
100
0
1
1
7
0
0
6
people
1
1
1
1
kings
5
0
0
8
1
1
0
100
100
0
1
1
9
0
0
2
of
2
1
0
0
1
1
10
0
0
5
spear
2
1
1
2
armed
5
0
0
11
1
1
0
0
0
0
1
1
12
0
0
5
danes
2
1
100
0
1
1
13
0
0
2
in
2
1
1
2
days
4
0
0
14
1
1
0
100
100
0
1
1
15
0
0
4
long
2
1
100
0
1
1
16
0
0
4
sped
2
1
100
0
1
1
17
0
0
2
we
3
1
1
3
have
4
0
0
18
1
1
0
100
100
0
1
1
19
0
0
5
heard
3
1
100
0
1
1
20
0
0
3
and
3
1
1
3
what
4
0
0
21
1
1
0
100
100
0
1
1
22
0
0
5
honor
3
1
100
0
1
1
23
0
0
3
the
3
1
1
3
athelings
9
0
0
24
1
1
100
0
100
0
1
1
25
1
0
3
won!
3
1
0
0
1
1
26
0
0
3
oft
4
1
1
4
scyld
5
0
0
27
1
1
0
0
100
0
1
1
28
0
0
3
the
4
1
0
100
1
1
29
0
0
7
scefing
4
1
1
4
from
4
0
0
30
1
1
0
100
0
100
1
1
31
0
0
squadroned 10
4
1
100
0
1
1
32
0
0
4
foes
4
1
100
0
1
1
33
0
0
4
from
5
1
1
5
many
4
0
0
34
1
1
0
100
100
0
1
1
35
0
0
1
a
5
1
0
0
1
1
36
0
0
5
tribe
5
1
1
5
the
3
0
0
37
1
1
0
100
1
0
0
1
1
38
0
0
4
mead
5
|
1911.12569 | 1 | 1911 | 2019-11-28T07:43:04 | Emotion helps Sentiment: A Multi-task Model for Sentiment and Emotion Analysis | [
"cs.CL"
] | In this paper, we propose a two-layered multi-task attention based neural network that performs sentiment analysis through emotion analysis. The proposed approach is based on Bidirectional Long Short-Term Memory and uses Distributional Thesaurus as a source of external knowledge to improve the sentiment and emotion prediction. The proposed system has two levels of attention to hierarchically build a meaningful representation. We evaluate our system on the benchmark dataset of SemEval 2016 Task 6 and also compare it with the state-of-the-art systems on Stance Sentiment Emotion Corpus. Experimental results show that the proposed system improves the performance of sentiment analysis by 3.2 F-score points on SemEval 2016 Task 6 dataset. Our network also boosts the performance of emotion analysis by 5 F-score points on Stance Sentiment Emotion Corpus. | cs.CL | cs |
Emotion helps Sentiment: A Multi-task Model for
Sentiment and Emotion Analysis
Abhishek Kumar
Asif Ekbal
Department of Computer Science and Engineering
Indian Institute of Technology Patna, India
Department of Computer Science and Engineering
Indian Institute of Technology Patna, India
[email protected]
[email protected]
Daisuke Kawahra
Sadao Kurohashi
Department of Intelligence Science and Technology
Department of Intelligence Science and Technology
Kyoto University, Japan
[email protected]
Kyoto University, Japan
[email protected]
Abstract -- In this paper, we propose a two-layered multi-task
attention based neural network that performs sentiment analysis
through emotion analysis. The proposed approach is based on
Bidirectional Long Short-Term Memory and uses Distributional
Thesaurus as a source of external knowledge to improve the
sentiment and emotion prediction. The proposed system has
two levels of attention to hierarchically build a meaningful
representation. We evaluate our system on the benchmark dataset
of SemEval 2016 Task 6 and also compare it with the state-of-the-
art systems on Stance Sentiment Emotion Corpus. Experimental
results show that the proposed system improves the performance
of sentiment analysis by 3.2 F-score points on SemEval 2016 Task
6 dataset. Our network also boosts the performance of emotion
analysis by 5 F-score points on Stance Sentiment Emotion
Corpus.
I. INTRODUCTION
The emergence of social media sites with limited character
constraint has ushered in a new style of communication. Twit-
ter users within 280 characters per tweet share meaningful and
informative messages. These short messages have a powerful
impact on how we perceive and interact with other human
beings. Their compact nature allows them to be transmitted
efficiently and assimilated easily. These short messages can
shape people's thought and opinion. This makes them an
interesting and important area of study. Tweets are not only
important for an individual but also for the companies, political
parties or any organization. Companies can use tweets to
gauge the performance of their products and predict market
trends [1]. The public opinion is particularly interesting for
political parties as it gives them an idea of voter's inclination
and their support. Sentiment and emotion analysis can help
to gauge product perception, predict stock prices and model
public opinions [2].
Sentiment analysis [3] is an important area of research in
natural language processing (NLP) where we automatically
determine the sentiments (positive, negative, neutral). Emotion
analysis focuses on the extraction of predefined emotion from
documents. Discrete emotions [4], [5] are often classified into
anger, anticipation, disgust, fear, joy, sadness, surprise and
trust. Sentiments and emotions are subjective and hence they
are understood similarly and often used interchangeably. This
is also mostly because both emotions and sentiments refer
to experiences that result from the combined influences of the
biological, the cognitive, and the social [6]. However, emotions
are brief episodes and are shorter in length [7], whereas senti-
ments are formed and retained for a longer period. Moreover,
emotions are not always target-centric whereas sentiments are
directed. Another difference between emotion and sentiment is
that a sentence or a document may contain multiple emotions
but a single overall sentiment.
Prior studies show that sentiment and emotion are generally
tackled as two separate problems. Although sentiment and
emotion are not exactly the same, they are closely related.
Emotions, like joy and trust, intrinsically have an association
with a positive sentiment. Similarly, anger, disgust, fear and
sadness have a negative tone. Moreover, sentiment analysis
alone is insufficient at times in imparting complete informa-
tion. A negative sentiment can arise due to anger, disgust,
fear, sadness or a combination of these. Information about
emotion along with sentiment helps to better understand the
state of the person or object. The close association of emotion
with sentiment motivates us to build a system for sentiment
analysis using the information obtained from emotion analysis.
In this paper, we put forward a robust two-layered multi-
task attention based neural network which performs sentiment
analysis and emotion analysis simultaneously. The model uses
two levels of attention - the first primary attention builds
the best representation for each word using Distributional
Thesaurus and the secondary attention mechanism creates
the final sentence level representation. The system builds the
representation hierarchically which gives it a good intuitive
working insight. We perform several experiments to evaluate
the usefulness of primary attention mechanism. Experimental
results show that the two-layered multi-task system for senti-
ment analysis which uses emotion analysis as an auxiliary task
improves over the existing state-of-the-art system of SemEval
2016 Task 6 [8].
The main contributions of the current work are two-fold:
a) We propose a novel two-layered multi-task attention based
system for joint sentiment and emotion analysis. This system
has two levels of attention which builds a hierarchical repre-
sentation. This provides an intuitive explanation of its working;
b) We empirically show that emotion analysis is relevant and
useful in sentiment analysis. The multi-task system utilizing
fine-grained information of emotion analysis performs better
than the single task system of sentiment analysis.
II. RELATED WORK
A survey of related literature reveals the use of both classical
and deep-learning approaches for sentiment and emotion anal-
ysis. The system proposed in [9] relied on supervised statistical
text classification which leveraged a variety of surface form,
semantic, and sentiment features for short informal texts. A
Support Vector Machine (SVM) based system for sentiment
analysis was used in [10], whereas an ensemble of four
different sub-systems for sentiment analysis was proposed
in [11]. It comprised of Long Short-Term Memory (LSTM)
[12], Gated Recurrent Unit (GRU) [13], Convolutional Neural
Network (CNN) [14] and Support Vector Regression (SVR)
[15]. [16] reported the results for emotion analysis using SVR,
LSTM, CNN and Bi-directional LSTM (Bi-LSTM) [17]. [18]
proposed a lexicon based feature extraction for emotion text
classification. A rule-based approach was adopted by [19]
to extract emotion-specific semantics. [20] used a high-order
Hidden Markov Model (HMM) for emotion detection. [21] ex-
plored deep learning techniques for end-to-end trainable emo-
tion recognition. [22] proposed a multi-task learning model for
fine-grained sentiment analysis. They used ternary sentiment
classification (negative, neutral, positive) as an auxiliary task
for fine-grained sentiment analysis (very-negative, negative,
neutral, positive, very-positive). A CNN based system was
proposed by [23] for three phase joint multi-task training. [24]
presented a multi-task learning based model for joint sentiment
analysis and semantic embedding learning tasks. [25] proposed
a multi-task setting for emotion analysis based on a vector-
valued Gaussian Process (GP) approach known as coregion-
alisation [26]. A hierarchical document classification system
based on sentence and document representation was proposed
by [27]. An attention framework for sentiment regression is
described in [28]. [29] proposed a DeepEmoji system based on
transfer learning for sentiment, emotion and sarcasm detection
through emoji prediction. However, the DeepEmoji system
treats these independently, one at a time.
Our proposed system differs from the above works in the
sense that none of these works addresses the problem of
sentiment and emotion analysis concurrently. Our empirical
analysis shows that performance of sentiment analysis is
boosted significantly when this is jointly performed with
emotion analysis. This may be because of the fine-grained
characteristics of emotion analysis that provides useful evi-
dences for sentiment analysis.
III. PROPOSED METHODOLOGY
We propose a novel two-layered multi-task attention based
neural network for sentiment analysis where emotion analysis
is utilized to improve its efficiency. Figure 1 illustrates the
overall architecture of the proposed multi-task system. The
proposed system consists of a Bi-directional Long Short-Term
Memory (BiLSTM) [17], a two-level attention mechanism
[30], [31] and a shared representation for emotion and sen-
timent analysis tasks. The BiLSTM encodes the word repre-
sentation of each word. This representation is shared between
the subsystems of sentiment and emotion analysis. Each of
the shared representations is then fed to the primary attention
mechanism of both the subsystems. The primary attention
mechanism finds the best representation for each word for each
task. The secondary attention mechanism acts on top of the
primary attention to extract the best sentence representation
by focusing on the suitable context for each task. Finally,
the representations of both the tasks are fed to two different
feed-forward neural networks to produce two outputs - one
for sentiment analysis and one for emotion analysis. Each
component is explained in the subsequent subsections.
A. Two-Layered Multi-Task Attention Model
1) BiLSTM based word encoder: Recurrent Neural Net-
works (RNN) are a class of networks which take sequential
input and computes a hidden state vector for each time step.
The current hidden state vector depends on the current input
and the previous hidden state vector. This makes them good
for handling sequential data. However, they suffer from a
vanishing or exploding gradient problem when presented with
long sequences. The gradient for back-propagating error either
reduces to a very small number or increases to a very high
value which hinders the learning process. Long Short Term
Memory (LSTM) [12], a variant of RNN solves this problem
by the gating mechanisms. The input, forget and output gates
control the information flow.
BiLSTM is a special
type of LSTM which takes into
account
the output of two LSTMs - one working in the
forward direction and one working in the backward direction.
The presence of contextual information for both past and
future helps the BiLSTM to make an informed decision. The
−→
←−
concatenation of a hidden state vectors
ht of the forward
ht of the backward LSTM at any time step t
LSTM and
provides the complete information. Therefore, the output of
←−
the BiLSTM at any time step t is ht = [
ht]. The output
of the BiLSTM is shared between the main task (Sentiment
Analysis) and the auxiliary task (Emotion Analysis).
−→
ht,
2) Word Attention: The word level attention (primary at-
tention) mechanism gives the model a flexibility to represent
each word for each task differently. This improves the word
representation as the model chooses the best representation
for each word for each task. A Distributional Thesaurus
(DT) identifies words that are semantically similar, based on
whether they tend to occur in a similar context. It provides
a word expansion list for words based on their contextual
Fig. 1. Two-layered multi-task attention based network
similarity. We use the top-4 words for each word as their
candidate terms. We only use the top-4 words for each word
as we observed that the expansion list with more words started
to contain the antonyms of the current word which empirically
reduced the system performance. Word embeddings of these
four candidate terms and the hidden state vector ht of the
input word are fed to the primary attention mechanism. The
primary attention mechanism finds the best attention coeffi-
cient for each candidate term. At each time step t we get
V(xt) candidate terms for each input xt with vi being the
embedding for each term (Distributional Thesaurus and word
embeddings are described in the next section). The primary
attention mechanism assigns an attention coefficient to each
of the candidate terms having the index i ∈ V(xt):
αti ∝ exp((hT
t Ww + bw)vi)
where Ww and bw are jointly learned parameters.
(cid:88)
mt =
αtivi
i∈V (xt)
(1)
(2)
Each embedding of the candidate term is weighted with the
attention score αti and then summed up. This produces mt,
the representation for the current input xt obtained from the
Distributional Thesaurus using the candidate terms.
(cid:98)ht = mt + ht
Finally, mt and ht are concatenated to get (cid:98)ht, the final output
(3)
of the primary attention mechanism.
3) Sentence Attention: The sentence attention (secondary
attention) part focuses on each word of the sentence and
assigns the attention coefficients. The attention coefficients
are assigned on the basis of words' importance and their
contextual relevance. This helps the model to build the over-
all sentence representation by capturing the context while
weighing different word representations individually. The final
sentence representation is obtained by multiplying each word
vector representation with their attention coefficient and sum-
ming them over. The attention coefficient αt for each word
vector representation and the sentence representation (cid:98)H are
calculated as:
where Ws and bs are parameters to be learned.
t Ws + bs))
αt ∝ exp(tanh((cid:99)hT
(cid:88)
αt(cid:98)ht
(cid:98)H =
(4)
(5)
t
(cid:98)H denotes the sentence representation for sentiment analy-
sis. Similarly, we calculate ¯H which represents the sentence
for emotion classification. The system has the flexibility to
compute different representations for sentiment and emotion
analysis both.
emotion analysis are computed by feeding (cid:98)H and ¯H to two
4) Final Output: The final outputs for both sentiment and
different one-layer feed forward neural networks. For our task,
the feed forward network for sentiment analysis has two output
units, whereas the feed forward network for emotion analysis
has eight output nodes performing multi-label classification.
B. Distributional Thesaurus
Distributional Thesaurus (DT) [32] ranks words according
to their semantic similarity. It is a resource which produces a
list of words in decreasing order of their similarity for each
word. We use the DT to expand each word of the sentence. The
top-4 words serve as the candidate terms for each word. For
example, the candidate terms for the word good are: great,
nice awesome and superb. DT offers the primary attention
mechanism external knowledge in the form of candidate terms.
It assists the system to perform better when presented with
unseen words during testing as the unseen words could have
been a part of the DT expansion list. For example, the system
may not come across the word superb during training but it
can appear in the test set. Since the system has already seen
the word superb in the DT expansion list of the word good,
it can handle this case efficiently. This fact is established by
our evaluation results as the model performs better when the
DT expansion and primary attentions are a part of the final
multi-task system.
C. Word Embeddings
Word embeddings represent words in a low-dimensional nu-
merical form. They are useful for solving many NLP problems.
We use the pre-trained 300 dimensional Google Word2Vec
[33] embeddings. The word embedding for each word in the
sentence is fed to the BiLSTM network to get the current
hidden state. Moreover, the primary attention mechanism is
also applied to the word embeddings of the candidate terms
for the current word.
IV. DATASETS, EXPERIMENTS AND ANALYSIS
In this section we present the details of the datasets used
for the experiments, results that we obtain and the necessary
analysis.
A. Datasets
We evaluate our proposed approach for joint sentiment and
emotion analysis on the benchmark dataset of SemEval 2016
Task 6 [8] and Stance Sentiment Emotion Corpus (SSEC) [16].
The SSEC corpus is an annotation of the SemEval 2016 Task 6
corpus with emotion labels. The re-annotation of the SemEval
2016 Task 6 corpus helps to bridge the gap between the
unavailability of a corpus with sentiment and emotion labels.
The SemEval 2016 corpus contains tweets which are classified
into positive, negative or other. It contains 2,914 training and
1,956 test instances. The SSEC corpus is annotated with anger,
anticipation, disgust, fear, joy, sadness, surprise and trust
labels. Each tweet could belong to one or more emotion classes
and one sentiment class. Table I shows the data statistics of
SemEval 2016 task 6 and SSEC which are used for sentiment
and emotion analysis, respectively.
B. Preprocessing
The SemEval 2016 task 6 corpus contains tweets from
Twitter. Since the tweets are derived from an environment
with the constraint on the number of characters, there is an
inherent problem of word concatenation, contractions and use
of hashtags. Example: #BeautifulDay, we've, etc. Usernames
and URLs do not impart any sentiment and emotion infor-
mation (e.g. @John). We use the Python package ekphrasis
[34] for handling these situations. Ekphrasis helps to split
the concatenated words into individual words and expand the
contractions. For example, #BeautifulDay to # Beautiful Day
and we've to we have. We replace usernames with <user>,
number with < number > and URLs with <url> token.
C. Implementation Details
We implement our model in Python using Tensorflow on
a single GPU. We experiment with six different BiLSTM
based architectures. The three architectures correspond to
BiLSTM based systems without primary attention i.e. only
with secondary attention for sentiment analysis (S1), emotion
analysis (E1) and the multi-task system (M1) for joint senti-
ment and emotion analysis. The remaining three architectures
correspond to the systems for sentiment analysis (S2), emotion
analysis (E2) and multi-task system (M2), with both primary
and secondary attention. The weight matrices were initialized
randomly using numbers form a truncated normal distribution.
The batch size was 64 and the dropout [35] was 0.6 with the
Adam optimizer [36]. The hidden state vectors of both the
forward and backward LSTM were 300-dimensional, whereas
the context vector was 150-dimensional. Relu [37] was used
as the activation for the hidden layers, whereas in the output
layer we used sigmoid as the activation function. Sigmoid
cross-entropy was used as the loss function. F1-score was
reported for the sentiment analysis [8] and precision, recall
and F1-score were used as the evaluation metric for emotion
analysis [16]. Therefore, we report the F1-score for sentiment
and precision, recall and F1-score for emotion analysis.
D. Results and Analysis
We compare the performance of our proposed system with
the state-of-the-art systems of SemEval 2016 Task 6 and the
systems of [16]. Experimental results show that the proposed
system improves the existing state-of-the-art systems for sen-
timent and emotion analysis. We summarize the results of
evaluation in Table II.
The primary attention mechanism plays a key role in the
overall system as it improves the score of both sentiment
and emotion analysis in both single task as well as multi-
task systems. The use of primary attention improves the
performance of single task systems for sentiment and emotion
analysis by 2.21 and 1.72 points, respectively.Similarly, when
sentiment and emotion analysis are jointly performed the
primary attention mechanism improves the score by 0.93
and 2.42 points for sentiment and emotion task, respectively.
To further measure the usefulness of the primary attention
mechanism and the Distributional Thesaurus, we remove it
from the systems S2, E2, and M2 to get the systems S1,
E1, and M1. In all the cases, with the removal of primary
attention mechanism, the performance drops. This is clearly
illustrated in Figure 2. These observations indicate that the
Data
Train
Test
Sentiment Dataset
(SemEval 2016 task 6)
other
pos
963
189
123
561
neg
1762
1272
anger
1657
1245
anticipation
1495
1205
Emotion Dataset
(Stance Sentiment Emotion Corpus)
disgust
1271
912
fear
1040
800
joy
1310
757
sadness
1583
1061
surprise
581
527
trust
1032
681
DATASET STATISTICS OF SEMEVAL 2016 TASK 6 AND SSEC USED FOR SENTIMENT AND EMOTION ANALYSIS, RESPECTIVELY.
TABLE I
Models
Sentiment
Emotion
only secondary attention
primary + secondary attention
Single task system for Sentiment Analysis
S1
S2
Single task system for Emotion Analysis
E1
E2
Multi-task system
M1
M2
only secondary attention
primary + secondary attention
only secondary attention
primary + secondary attention
TABLE II
75.37
77.58
-
-
81.17
82.10
-
-
64.94
66.66
63.02
65.44
F-SCORE OF VARIOUS MODELS ON SENTIMENT AND EMOTION TEST
DATASET.
Models
UWB [38]
INF-UFRGS-OPINION-MINING [39]
LitisMind
pkudblab [40]
SVM + n-grams + sentiment [8]
M2 (proposed)
Sentiment (F-score)
42.02
42.32
44.66
56.28
78.90
82.10
COMPARISON WITH THE STATE-OF-THE-ART SYSTEMS OF SEMEVAL 2016
TASK 6 ON SENTIMENT DATASET.
TABLE III
primary attention mechanism is an important component of the
two-layered multi-task attention based network for sentiment
analysis. We also perform t-test [41] for computing statistical
significance of the obtained results from the final two-layered
multi-task system M2 for sentiment analysis by calculating
the p-values and observe that the performance gain over M1
is significant with p-value = 0.001495. Similarly, we perform
the statistical significance test for each emotion class. The
p-values for anger, anticipation, fear, disgust, joy, sadness,
surprise and trust are 0.000002, 0.000143, 0.00403, 0.000015,
0.004607, 0.069, 0.000001 and 0.000001, respectively. These
results provide a good indication of statistical significance.
Table III shows the comparison of our proposed system with
the existing state-of-the-art system of SemEval 2016 Task 6 for
the sentiment dataset. [8] used feature-based SVM, [40] used
keyword rules, LitisMind relied on hashtag rules on external
data, [39] utilized a combination of sentiment classifiers and
rules, whereas [38] used a maximum entropy classifier with
domain-specific features. Our system comfortably surpasses
the existing best system at SemEval. Our system manages to
improve the existing best system of SemEval 2016 task 6 by
3.2 F-score points for sentiment analysis.
We also compare our system with the state-of-the-art sys-
tems proposed by [16] on the emotion dataset. The comparison
is demonstrated in Table IV. Maximum entropy, SVM, LSTM,
Bi-LSTM, and CNN were the five individual systems used by
[16]. Overall, our proposed system achieves an improvement
of 5 F-Score points over the existing state-of-the-art system for
emotion analysis. Individually, the proposed system improves
the existing F-scores for all the emotions except surprise. The
findings of [16] also support this behavior (i.e. worst result
for the surprise class). This could be attributed to the data
scarcity and a very low agreement between the annotators for
the emotion surprise.
Experimental results indicate that
the multi-task system
which uses fine-grained information of emotion analysis helps
to boost the performance of sentiment analysis. The system
M1 comprises of the system S1 performing the main task
(sentiment analysis) with E1 undertaking the auxiliary task
(emotion analysis). Similarly, the system M2 is made up of S2
and E2 where S2 performs the main task (sentiment analysis)
and E2 commits to the auxiliary task (emotion analysis).
We observe that in both the situations, the auxiliary task,
i.e. emotional information increases the performance of the
main task, i.e. sentiment analysis when these two are jointly
performed. Experimental results help us to establish the fact
that emotion analysis benefits sentiment analysis. The implicit
sentiment attached to the emotion words assists the multi-task
system. Emotion such as joy and trust are inherently associated
with a positive sentiment whereas, anger, disgust, fear and
sadness bear a negative sentiment. Figure 2 illustrates the
performance of various models for sentiment analysis.
Fig. 2. Comparison of various models (S1, S2, M1, M2) w.r.t different hidden
state vector sizes of BiLSTM for sentiment analysis. Y-axis denotes the F-
scores.
As a concrete example which justifies the utility of emotion
analysis in sentiment analysis is shown below.
@realMessi he is a real sportsman and deserves to be the
Models
Metric
Anger
Anticipation
MaxEnt
SVM
LSTM
BiLSTM
CNN
E2
(proposed)
P
R
F
P
R
F
P
R
F
P
R
F
P
R
F
P
R
F
76
72
74
76
69
72
76
77
76
77
77
77
77
77
77
81
83
82
72
61
66
70
60
64
68
68
67
70
66
68
68
60
64
74
62
68
Disgust
62
47
54
59
53
56
64
68
65
61
64
63
62
61
62
70
74
72
Fear
57
31
40
55
40
46
51
48
49
58
43
49
53
46
49
66
42
51
TABLE IV
Joy
55
50
52
52
52
52
56
41
46
54
59
56
54
56
55
64
59
62
Emotion
Sadness
Surprise
62
15
24
46
22
30
40
17
21
42
20
27
36
24
28
68
13
22
Trust Micro-Avg
62
38
47
57
45
50
57
49
51
59
44
50
53
49
50
68
49
57
66
52
58
63
53
58
62
60
61
64
60
62
62
59
60
71
63
67
65
65
65
64
60
62
60
77
67
62
72
67
63
72
67
67
81
73
COMPARISON WITH THE STATE-OF-THE-ART SYSTEMS PROPOSED BY [16] ON EMOTION DATASET. THE METRICS P, R AND F STAND FOR PRECISION,
RECALL AND F1-SCORE.
skipper.
The gold labels for the example are anticipation, joy and
trust emotion with a positive sentiment. Our system S2 (single
task system for sentiment analysis with primary and secondary
attention) had incorrectly labeled this example with a negative
sentiment and the E2 system (single task system with both
primary and secondary attention for emotion analysis) had
tagged it with anticipation and joy only. However, M2 i.e.
the multi-task system for joint sentiment and emotion analysis
had correctly classified the sentiment as positive and assigned
all the correct emotion tags. It predicted the trust emotion
tag, in addition to anticipation and joy (which were predicted
earlier by E2). This helped M2 to correctly identify the
positive sentiment of the example. The presence of emotional
information helped the system to alter its sentiment decision
(negative by S2) as it had better understanding of the text.
A sentiment directly does not invoke a particular emotion
always and a sentiment can be associated with more than one
emotion. However, emotions like joy and trust are associated
with positive sentiment mostly whereas, anger, disgust and
sadness are associated with negative sentiment particularly.
This might be the reason of the extra sentiment information
not helping the multi-task system for emotion analysis and
hence, a decreased performance for emotion analysis in the
multi-task setting.
E. Error Analysis
We perform quantitative error analysis for both sentiment
and emotion for the M2 model. Table V shows the confusion
matrix for sentiment analysis. Tables VI to XIII consist of the
confusion matrices for anger, anticipation, fear, disgust, joy,
sadness, surprise and trust. We observe from Table XII that the
system fails to label many instances with the emotion surprise.
This may be due to the reason that this particular class is the
most underrepresented in the training set. A similar trend can
also be observed for the emotion fear and trust in Table IX and
Table XIII, respectively. These three emotions have the least
share of training instances, making the system less confident
towards these emotions.
Moreover, we closely analyze the outputs to understand the
kind of errors that our proposed model faces. We observe that
the system faces difficulties at times and wrongly predicts the
sentiment class in the following scenarios:
• Often real-world phrases/sentences have emotions of con-
flicting nature. These conflicting nature of emotions are di-
rectly not evident from the surface form and are left unsaid as
these are implicitly understood by humans. The system gets
confused when presented with such instances.
Text: When you become a father you realize that you are not
the most important person in the room anymore... Your child
is!
Actual Sentiment: positive
Actual Emotion: anticipation, joy, surprise, trust
Predicted Sentiment: negative
Predicted Emotion: anger, anticipation, sadness
The realization of not being the most important person
in a room invokes anger, anticipation and sadness emotions,
and a negative sentiment. However, it is a natural feeling of
overwhelmingly positive sentiment when you understand that
your own child is the most significant part of your life.
• Occasionally, the system focuses on the less significant part
of the sentences. Due to this the system might miss crucial
information which can influence and even change the final
sentiment or emotion. This sometimes lead to the incorrect
Actual
negative
positive
Predicted
negative
positive
1184
236
TABLE V
88
325
CONFUSION MATRIX FOR sentiment analysis
Actual
NO
YES
Predicted
YES
NO
665
277
656
235
TABLE VIII
CONFUSION MATRIX FOR disgust
Actual
NO
YES
Predicted
NO
YES
405
413
191
824
TABLE XI
CONFUSION MATRIX FOR sadness
Actual
NO
YES
Predicted
YES
NO
242
388
201
1002
TABLE VI
CONFUSION MATRIX FOR anger
Actual
NO
YES
Predicted
YES
NO
911
160
317
445
TABLE IX
CONFUSION MATRIX FOR fear
Actual
NO
YES
Predicted
NO
1312
426
YES
30
65
TABLE XII
CONFUSION MATRIX FOR surprise
Actual
NO
YES
Predicted
YES
NO
249
445
433
706
TABLE VII
CONFUSION MATRIX FOR anticipation
Actual
NO
YES
Predicted
YES
NO
886
236
420
291
TABLE X
CONFUSION MATRIX FOR joy
Actual
NO
YES
Predicted
NO
1032
335
YES
150
316
TABLE XIII
CONFUSION MATRIX FOR trust
prediction of the overall sentiment and emotion.
Text: I've been called many things, quitter is not one of them...
Actual Sentiment: positive
Actual Emotion: anticipation, joy, trust
Predicted Sentiment: negative
Predicted Emotion: anticipation, sadness
Here, the system focuses on the first part of the sentence
where the speaker was called many things which denotes
a negative sentiment. Hence, the system predicts a negative
sentiment and, anticipation and sadness emotions. However,
the speaker in the second part uplifts the overall tone by
justifying that s/he has never been called a quitter. This
changes the negative sentiment to a positive sentiment and
the overall emotion.
V. CONCLUSION
In this paper, we have presented a novel two-layered multi-
task attention based neural network which performs senti-
ment analysis through emotion analysis. The primary attention
mechanism of the two-layered multi-task system relies on
Distributional Thesaurus which acts as a source of external
knowledge. The system hierarchically builds the final represen-
tation from the word level to the sentence level. This provides
a working insight to the system and its ability to handle the
unseen words. Evaluation on the benchmark dataset suggests
an improvement of 3.2 F-score point for sentiment analysis and
an overall performance boost of 5 F-score points for emotion
analysis over the existing state-of-the-art systems. The system
empirically establishes the fact that emotion analysis is both
useful and relevant to sentiment analysis. The proposed system
does not rely on any language dependent features or lexicons.
This makes it extensible to other languages as well. In future,
we would like to extend the two-layered multi-task attention
based neural network to other languages.
VI. ACKNOWLEDGEMENTS
Asif Ekbal acknowledges the Young Faculty Research Fel-
lowship (YFRF), supported by Visvesvaraya PhD scheme for
Electronics and IT, Ministry of Electronics and Information
Technology (MeitY), Government of India, being implemented
by Digital India Corporation (formerly Media Lab Asia).
REFERENCES
[1] R. Goonatilake and S. Herath, "The Volatility of the Stock Market
and News," International Research Journal of Finance and Economics,
vol. 3, no. 11, pp. 53 -- 65, 2007.
the 51st Annual Meeting of
[2] J. Si, A. Mukherjee, B. Liu, Q. Li, H. Li, and X. Deng, "Exploiting
topic based twitter sentiment for stock prediction," in Proceedings
of
the Association for Computational
Linguistics (Volume 2: Short Papers).
Sofia, Bulgaria: Association
for Computational Linguistics, August 2013, pp. 24 -- 29. [Online].
Available: http://www.aclweb.org/anthology/P13-2005
[3] B. Pang and L. Lee, "Opinion mining and sentiment analysis," Foun-
dations and trends in information retrieval, vol. 2, no. 1-2, pp. 1 -- 135,
2008.
[4] T. Dalgleish and M. Power, Handbook of cognition and emotion.
John
Wiley & Sons, 2000.
[5] R. Plutchik, "The nature of emotions: Human emotions have deep
evolutionary roots, a fact that may explain their complexity and provide
tools for clinical practice," American scientist, vol. 89, no. 4, pp. 344 --
350, 2001.
[6] J. D. DeLamater and A. Ward, Handbook of social psychology.
Springer, 2006.
[7] M. D. Munezero, C. S. Montero, E. Sutinen, and J. Pajunen, "Are they
different? affect, feeling, emotion, sentiment, and opinion detection in
text," IEEE transactions on affective computing, vol. 5, no. 2, pp. 101 --
111, 2014.
[8] S. M. Mohammad, P. Sobhani, and S. Kiritchenko, "Stance and sen-
timent in tweets," ACM Transactions on Internet Technology (TOIT),
vol. 17, no. 3, p. 26, 2017.
[9] S. Kiritchenko, X. Zhu, and S. M. Mohammad, "Sentiment analysis of
short informal texts," Journal of Artificial Intelligence Research, vol. 50,
pp. 723 -- 762, 2014.
[10] A. Kumar, A. Sethi, M. S. Akhtar, A. Ekbal, C. Biemann, and P. Bhat-
tacharyya, "IITPB at SemEval-2017 Task 5: Sentiment Prediction in
Financial Text," in Proceedings of the 11th International Workshop on
Semantic Evaluation (SemEval-2017), 2017, pp. 894 -- 898.
[11] M. S. Akhtar, A. Kumar, D. Ghosal, A. Ekbal, and P. Bhattacharyya,
"A Multilayer Perceptron based Ensemble Technique for Fine-grained
Financial Sentiment Analysis," in Proceedings of the 2017 Conference
on Empirical Methods in Natural Language Processing, 2017, pp. 551 --
557.
[12] S. Hochreiter and J. Schmidhuber, "Long short-term memory," Neural
Comput., vol. 9, no. 8, pp. 1735 -- 1780, Nov. 1997. [Online]. Available:
http://dx.doi.org/10.1162/neco.1997.9.8.1735
[31] M.-T. Luong, H. Pham,
ap-
proaches to attention-based neural machine translation," arXiv preprint
arXiv:1508.04025, 2015.
and C. D. Manning,
"Effective
[32] C. Biemann and M. Riedl, "Text: now in 2D! A framework
J. Language
[Online]. Available:
for
Modelling, vol. 1, no. 1, pp. 55 -- 95, 2013.
http://dx.doi.org/10.15398/jlm.v1i1.60
expansion with contextual
similarity,"
lexical
[33] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean,
"Distributed representations of words and phrases and their composi-
tionality," in Advances in neural information processing systems, Lake
Tahoe, NV, USA, 2013, pp. 3111 -- 3119.
[34] C. Baziotis, N. Pelekis, and C. Doulkeridis, "Datastories at semeval-2017
task 4: Deep lstm with attention for message-level and topic-based sen-
timent analysis," in Proceedings of the 11th International Workshop on
Semantic Evaluation (SemEval-2017). Vancouver, Canada: Association
for Computational Linguistics, August 2017, pp. 747 -- 754.
[35] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhut-
dinov, "Dropout: A simple way to prevent neural networks from overfit-
ting," Journal of Machine Learning Research, vol. 15, pp. 1929 -- 1958,
2014.
[36] D. P. Kingma and J. Ba, "Adam: A Method for Stochastic
Optimization," CoRR, vol. abs/1412.6980, 2014. [Online]. Available:
http://dblp.uni-trier.de/db/journals/corr/corr1412.html
[37] X. Glorot, A. Bordes, and Y. Bengio, "Deep Sparse Rectifier Neural
Networks," in Proceedings of the Fourteenth International Conference
on Artificial Intelligence and Statistics (AISTATS-11), G. J. Gordon and
D. B. Dunson, Eds., vol. 15.
Journal of Machine Learning Research -
Workshop and Conference Proceedings, 2011, pp. 315 -- 323.
[38] P. Krejzl and J. Steinberger, "Uwb at semeval-2016 task 6: stance detec-
tion," in Proceedings of the 10th International Workshop on Semantic
Evaluation (SemEval-2016), 2016, pp. 408 -- 412.
[39] M. Dias and K. Becker, "Inf-ufrgs-opinion-mining at semeval-2016 task
6: Automatic generation of a training corpus for unsupervised identi-
fication of stance in tweets," in Proceedings of the 10th International
Workshop on Semantic Evaluation (SemEval-2016), 2016, pp. 378 -- 383.
[40] W. Wei, X. Zhang, X. Liu, W. Chen, and T. Wang, "pkudblab at semeval-
2016 task 6: A specific convolutional neural network system for effective
stance detection," in Proceedings of the 10th International Workshop on
Semantic Evaluation (SemEval-2016), 2016, pp. 384 -- 388.
[41] K. Church, W. Gale, P. Hanks, and D. Hindle, "Using statistics in lexical
analysis," Lexical acquisition: exploiting on-line resources to build a
lexicon, vol. 115, p. 164, 1991.
[13] K. Cho, B. van Merrienboer, D. Bahdanau, and Y. Bengio, "On
the Properties of Neural Machine Translation: Encoder-Decoder
Approaches," CoRR, vol. abs/1409.1259, 2014. [Online]. Available:
http://arxiv.org/abs/1409.1259
[14] Y. Kim, "Convolutional Neural Networks for Sentence Classification,"
in Proceedings of the 2014 Conference on Empirical Methods in Natural
Language Processing, EMNLP 2014, October 25-29, 2014, Doha, Qatar,
A meeting of SIGDAT, a Special Interest Group of the ACL, 2014, pp.
1746 -- 1751.
[15] A. J. Smola and B. Scholkopf, "A Tutorial on Support Vector Regres-
sion," Statistics and Computing, vol. 14, no. 3, pp. 199 -- 222, Aug. 2004.
[16] H. Schuff, J. Barnes, J. Mohme, S. Pad´o, and R. Klinger, "Annotation,
modelling and analysis of fine-grained emotions on a stance and
sentiment detection corpus," in Proceedings of the 8th Workshop on
Computational Approaches to Subjectivity, Sentiment and Social Media
Analysis, 2017, pp. 13 -- 23.
[17] A. Graves, S. Fern´andez, and J. Schmidhuber, "Bidirectional
lstm
networks for improved phoneme classification and recognition," in
Proceedings of the 15th International Conference on Artificial Neural
Networks: Formal Models and Their Applications - Volume Part II, ser.
ICANN'05. Berlin, Heidelberg: Springer-Verlag, 2005, pp. 799 -- 804.
[Online]. Available: http://dl.acm.org/citation.cfm?id=1986079.1986220
[18] A. Bandhakavi, N. Wiratunga, D. Padmanabhan, and S. Massie, "Lex-
icon based feature extraction for emotion text classification," Pattern
recognition letters, vol. 93, pp. 133 -- 142, 2017.
[19] C.-H. Wu, Z.-J. Chuang, and Y.-C. Lin, "Emotion recognition
from text using semantic labels and separable mixture models,"
vol. 5, no. 2, pp. 165 -- 183,
[Online]. Available:
http://doi.acm.org/10.1145/1165255.1165259
Jun. 2006.
[20] D. T. Ho and T. H. Cao, "A high-order hidden markov model for emotion
detection from textual data," in Pacific Rim Knowledge Acquisition
Workshop. Springer, 2012, pp. 94 -- 105.
[21] S. E. Kahou, "Emotion recognition with deep neural networks," Ph.D.
dissertation, Ecole Polytechnique, Montreal (Canada), 2016.
[22] G. Balikas, S. Moura, and M.-R. Amini, "Multitask learning
in Proceedings of
for fine-grained twitter
the 40th International ACM SIGIR Conference on Research and
Development
New
York, NY, USA: ACM, 2017, pp. 1005 -- 1008. [Online]. Available:
http://doi.acm.org/10.1145/3077136.3080702
in Information Retrieval,
ser. SIGIR '17.
sentiment
analysis,"
[23] J. M. Deriu and M. Cieliebak, "Sentiment analysis using convolutional
neural networks with multi-task training and distant supervision on
italian tweets," in Fifth Evaluation Campaign of Natural Language
Processing and Speech Tools for Italian, Napoli, Italy, December 5-7,
2016.
Italian Journal of Computational Linguistics, 2016.
[24] Q. You, "Sentiment and emotion analysis for social multimedia:
the 2016
Methodologies
and applications,"
ACM on Multimedia Conference,
New York,
NY, USA: ACM, 2016, pp. 1445 -- 1449. [Online]. Available: http:
//doi.acm.org/10.1145/2964284.2971475
in Proceedings of
ser. MM '16.
[25] D. Beck, T. Cohn, and L. Specia, "Joint emotion analysis via multi-
task gaussian processes," in Proceedings of the 2014 Conference on
Empirical Methods in Natural Language Processing (EMNLP). ACL,
2014, pp. 1798 -- 1803.
[26] M. A. Alvarez, L. Rosasco, N. D. Lawrence et al., "Kernels for vector-
valued functions: A review," Foundations and Trends® in Machine
Learning, vol. 4, no. 3, pp. 195 -- 266, 2012.
[27] Z. Yang, D. Yang, C. Dyer, X. He, A. Smola, and E. Hovy, "Hierarchical
attention networks for document classification," in Proceedings of the
2016 Conference of the North American Chapter of the Association for
Computational Linguistics: Human Language Technologies, 2016, pp.
1480 -- 1489.
[28] A. Kumar, D. Kawahara, and S. Kurohashi, "Knowledge-Enriched Two-
Layered Attention Network for Sentiment Analysis," in Proceedings of
the 2018 Conference of the North American Chapter of the Association
for Computational Linguistics: Human Language Technologies, Volume
2 (Short Papers), vol. 2, 2018, pp. 253 -- 258.
[29] B. Felbo, A. Mislove, A. Søgaard, I. Rahwan, and S. Lehmann,
"Using millions of emoji occurrences to learn any-domain represen-
tations for detecting sentiment, emotion and sarcasm," arXiv preprint
arXiv:1708.00524, 2017.
[30] D. Bahdanau, K. Cho, and Y. Bengio, "Neural machine translation by
jointly learning to align and translate," arXiv preprint arXiv:1409.0473,
2014.
|
1605.04569 | 2 | 1605 | 2016-05-19T08:52:37 | Syntactically Guided Neural Machine Translation | [
"cs.CL"
] | We investigate the use of hierarchical phrase-based SMT lattices in end-to-end neural machine translation (NMT). Weight pushing transforms the Hiero scores for complete translation hypotheses, with the full translation grammar score and full n-gram language model score, into posteriors compatible with NMT predictive probabilities. With a slightly modified NMT beam-search decoder we find gains over both Hiero and NMT decoding alone, with practical advantages in extending NMT to very large input and output vocabularies. | cs.CL | cs | Syntactically Guided Neural Machine Translation
Felix Stahlberg† and Eva Hasler† and Aurelien Waite‡ and Bill Byrne‡†
†Department of Engineering, University of Cambridge, UK
‡SDL Research, Cambridge, UK
6
1
0
2
y
a
M
9
1
]
L
C
.
s
c
[
2
v
9
6
5
4
0
.
5
0
6
1
:
v
i
X
r
a
Abstract
We investigate the use of hierarchical
phrase-based SMT lattices in end-to-end
neural machine translation (NMT). Weight
pushing transforms the Hiero scores for
complete translation hypotheses, with the
full translation grammar score and full n-
gram language model score, into posteri-
ors compatible with NMT predictive prob-
abilities. With a slightly modified NMT
beam-search decoder we find gains over
both Hiero and NMT decoding alone, with
practical advantages in extending NMT to
very large input and output vocabularies.
Introduction
1
We report on investigations motivated by the idea
that the structured search spaces defined by syn-
tactic machine translation approaches such as Hi-
ero (Chiang, 2007) can be used to guide Neural
Machine Translation (NMT) (Kalchbrenner and
Blunsom, 2013; Sutskever et al., 2014; Cho et al.,
2014; Bahdanau et al., 2015). NMT and Hiero
have complementary strengths and weaknesses
and differ markedly in how they define probabil-
ity distributions over translations and what search
procedures they use.
The NMT encoder-decoder formalism provides
a probability distribution over translations y = yT
1
of a source sentence x as (Bahdanau et al., 2015)
P (yT
1 x) =
P (ytyt−1
1
, x) =
g(yt−1, st, ct)
(1)
where st = f (st−1, yt−1, ct) is a decoder state
variable and ct is a context vector depending on
the source sentence and the attention mechanism.
This posterior distribution is potentially very
powerful, however it does not easily lend itself
T(cid:89)
t=1
T(cid:89)
t=1
to sophisticated search procedures. Decoding is
done by 'beam search to find a translation that ap-
proximately maximizes the conditional probabil-
ity' (Bahdanau et al., 2015). Search looks only
one word ahead and no deeper than the beam.
Hiero defines a synchronous context-free gram-
mar (SCFG) with rules: X → (cid:104)α, γ(cid:105), where α
and γ are strings of terminals and non-terminals in
the source and target languages. A target language
sentence y can be a translation of a source lan-
guage sentence x if there is a derivation D in the
grammar which yields both y and x: y = y(D),
x = x(D). This defines a regular language Y
over strings in the target language via a projection
of the sentence to be translated: Y = {y(D) :
x(D) = x} (Iglesias et al., 2011; Allauzen et al.,
2014). Scores are defined over derivations via a
log-linear model with features {φi} and weights
λ. The decoder searches for the translation y(D)
in Y with the highest derivation score S(D) (Chi-
ang, 2007, Eq. 24) :
PG(D)PLM (y(D))λLM
(2)
(cid:125)
y = y
argmax
PG(D) ∝(cid:81)
D:x(D)=x
(cid:124)
(cid:123)(cid:122)
S(D)
(cid:81)
(X→(cid:104)γ,α(cid:105))∈D
Hiero decoders attempt
where PLM is an n-gram language model and
i φi(X → (cid:104)γ, α(cid:105))λi.
to avoid search er-
rors when combining the translation and lan-
guage model for the translation hypotheses (Chi-
ang, 2007; Iglesias et al., 2009). These procedures
search over a vast space of translations, much
larger than is considered by the NMT beam search.
However the Hiero context-free grammars that
make efficient search possible are weak models of
translation. The basic Hiero formalism can be ex-
tended through 'soft syntactic constraints' (Venu-
gopal et al., 2009; Marton and Resnik, 2008) or by
adding very high dimensional features (Chiang et
al., 2009), however the translation score assigned
by the grammar is still only the product of prob-
abilities of individual rules. From the modelling
perspective, this is an overly strong conditional in-
dependence assumption. NMT clearly has the po-
tential advantage in incorporating long-term con-
text into translation scores.
NMT and Hiero differ in how they 'consume'
source words. Hiero applies the translation rules to
the source sentence via the CYK algorithm, with
each derivation yielding a complete and unam-
biguous translation of the source words. The NMT
beam decoder does not have an explicit mecha-
nism for tracking source coverage, and there is ev-
idence that may lead to both 'over-translation' and
'under-translation' (Tu et al., 2016).
NMT and Hiero also differ in their internal rep-
resentations. The NMT continuous representa-
tion captures morphological, syntactic and seman-
tic similarity (Collobert and Weston, 2008) across
words and phrases. However, extending these rep-
resentations to the large vocabularies needed for
open-domain MT is an open area of research (Jean
et al., 2015a; Luong et al., 2015; Sennrich et al.,
2015; Chitnis and DeNero, 2015). By contrast,
Hiero (and other symbolic systems) can easily use
translation grammars and language models with
very large vocabularies (Heafield et al., 2013; Lin
and Dyer, 2010). Moreover, words and phrases
can be easily added to a fully-trained symbolic
MT system. This is an important consideration
for commercial MT, as customers often wish to
customise and personalise SMT systems for their
own application domain. Adding new words and
phrases to an NMT system is not as straightfor-
ward, and it is not clear that the advantages of the
continuous representation can be extended to the
new additions to the vocabularies.
NMT has the advantage of including long-range
context in modelling individual translation hy-
potheses. Hiero considers a much bigger search
space, and can incorporate n-gram language mod-
els, but a much weaker translation model. In this
paper we try to exploit the strengths of each ap-
proach. We propose to guide NMT decoding using
Hiero. We show that restricting the search space of
the NMT decoder to a subset of Y spanned by Hi-
ero effectively counteracts NMT modelling errors.
This can be implemented by generating translation
lattices with Hiero, which are then rescored by the
NMT decoder. Our approach addresses the lim-
ited vocabulary issue in NMT as we replace NMT
OOVs with lattice words from the much larger Hi-
ero vocabulary. We also find good gains from neu-
ral and Kneser-Ney n-gram language models.
2 Syntactically Guided NMT (SGNMT)
2.1 Hiero Predictive Posteriors
The Hiero decoder generates translation hypothe-
ses as weighted finite state acceptors (WFSAs), or
lattices, with weights in the tropical semiring. For
a translation hypothesis y(D) arising from the Hi-
ero derivation D, the path weight in the WFSA
is − log S(D), after Eq. 2. While this representa-
tion is correct with respect to the Hiero translation
grammar and language model scores, having Hi-
ero scores at the path level is not convenient for
working with the NMT system. What we need are
predictive probabilities in the form of Eq. 1.
The Hiero WFSAs are determinised and min-
imised with epsilon removal under the tropical
semiring, and weights are pushed towards the ini-
tial state under the log semiring (Mohri and Riley,
2001). The resulting transducer is stochastic in the
log semiring, i.e. the log sum of the arc log prob-
abilities leaving a state is 0 (= log 1).
In addi-
tion, because the WFSA is deterministic, there is
a unique path leading to every state, which corre-
sponds to a unique Hiero translation prefix. Sup-
pose a path to a state accepts the translation prefix
yt−1
. An outgoing arc from that state with symbol
1
y has a weight that corresponds to the (negative
log of the) conditional probability
PHiero(yt = yyt−1
, x).
(3)
1
This conditional probability is such that for a Hi-
ero translation yT
1 = y(D) accepted by the WFSA
T(cid:89)
PHiero(yT
1 ) =
PHiero(ytyt−1
1
, x) ∝ S(D).
t=1
(4)
The Hiero WFSAs have been transformed so that
their arc weights have the negative log of the con-
ditional probabilities defined in Eq. 3. All the
probability mass of this distribution is concen-
trated on the Hiero translation hypotheses. The
complete translation and language model scores
computed over the entire Hiero translations are
pushed as far forward in the WFSAs as possible.
This is commonly done for left-to-right decoding
in speech recognition (Mohri et al., 2002).
2.2 NMT–Hiero Decoding
As above, suppose a path to a state in the WFSA
accepts a Hiero translation prefix yt−1
, and let yt
be a symbol on an outgoing arc from that state. We
define the joint NMT+Hiero score as
1
log P (ytyt−1
, x) =
1
(cid:26)log PN M T (ytyt−1
λHiero log PHiero(ytyt−1
, x) +
1
yt ∈ ΣN M T
, x)
log PN M T (unkyt−1
, x) yt (cid:54)∈ ΣN M T
1
1
λN M T
(5)
Note that the NMT-HIERO decoder only con-
siders hypotheses in the Hiero lattice. As dis-
cussed earlier, the Hiero vocabulary can be much
larger than the NMT output vocabulary ΣN M T . If
a Hiero translation contains a word not in the NMT
vocabulary, the NMT model provides a score and
updates its decoder state as for an unknown word.
Our decoding algorithm is a natural extension of
beam search decoding for NMT. Due to the form
of Eq. 5 we can build up hypotheses from left-to-
right on the target side. Thus, we can represent
1, hs) by a transla-
a partial hypothesis h = (yt
1 and an accumulated score hs. At
tion prefix yt
each iteration we extend the current hypotheses by
one target token, until the best scoring hypothesis
reaches a final state of the Hiero lattice. We re-
fer to this step as node expansion, and in Sec. 3.1
we report the number of node expansions per sen-
tence, as an indication of computational cost.
We can think of the decoding algorithm as
breath-first search through the translation lattices
with a limited number of active hypotheses (a
beam). Rescoring is done on-the-fly: as the de-
coder traverses an edge in the WFSA, we update
its weight by Eq. 5. The output-synchronous char-
Train set
en
4.2M
de
Dev set
en
de
6k
Test set
en
de
2.7k
# sentences
# word tokens
# unique words
OOV (Hiero)
OOV (NMT)
59k
106M 102M 138k 138k
647k 1.5M 13k
13k
20k
0.0% 0.0% 0.8% 1.6% 1.0% 2.0%
1.6% 5.5% 2.5% 7.5% 3.1% 8.8%
fr
62k
9k
en
en
fr
fr
en
12.1M
# sentences
# word tokens
# unique words 1.6M 1.7M 14k
OOV (Hiero)
OOV (NMT)
81k
11k
0.0% 0.0% 0.6% 0.6% 0.4% 0.4%
3.5% 3.8% 4.5% 5.3% 5.0% 5.3%
305M 348M 138k 155k
17k
71k
10k
6k
3k
Table 1: Parallel texts and vocabulary coverage on
news-test2014.
acteristic of beam search enables us to compute
the NMT posteriors only once for each history
based on previous calculations.
Alternatively, we can think of the algorithm as
NMT decoding with revised posterior probabil-
ities:
instead of selecting the most likely sym-
bol yt according the NMT model, we adjust the
NMT posterior with the Hiero posterior scores and
delete NMT entries that are not allowed by the lat-
tice. This may result in NMT choosing a different
symbol, which is then fed back to the neural net-
work for the next decoding step.
3 Experimental Evaluation
We evaluate SGNMT on the WMT news-test2014
test sets (the filtered version) for English-German
(En-De) and English-French (En-Fr). We also re-
port results on WMT news-test2015 En-De.
The En-De training set includes Europarl v7,
Common Crawl, and News Commentary v10. Sen-
tence pairs with sentences longer than 80 words
or length ratios exceeding 2.4:1 were deleted, as
were Common Crawl sentences from other lan-
guages (Shuyo, 2010). The En-Fr NMT system
was trained on preprocessed data (Schwenk, 2014)
used by previous work (Sutskever et al., 2014;
Bahdanau et al., 2015; Jean et al., 2015a), but
with truecasing like our Hiero baseline. Follow-
ing (Jean et al., 2015a), we use news-test2012 and
news-test2013 as a development set. The NMT vo-
cabulary size is 50k for En-De and 30k for En-Fr,
taken as the most frequent words in training (Jean
et al., 2015a). Tab. 1 provides statistics and shows
the severity of the OOV problem for NMT.
The BASIC NMT system is built using the
Blocks framework (van Merrienboer et al., 2015)
based on the Theano library (Bastien et al., 2012)
with standard hyper-parameters (Bahdanau et al.,
2015): the encoder and decoder networks consist
of 1000 gated recurrent units (Cho et al., 2014).
The decoder uses a single maxout (Goodfellow et
al., 2013) output layer with the feed-forward at-
tention model (Bahdanau et al., 2015).
The En-De Hiero system uses rules which en-
courage verb movement (de Gispert et al., 2010).
The rules for En-Fr were extracted from the full
data set available at the WMT'15 website using a
shallow-1 grammar (de Gispert et al., 2010). 5-
gram Kneser-Ney language models (KN-LM) for
the Hiero systems were trained on WMT'15 par-
allel and monolingual data (Heafield et al., 2013).
SGNMT
(Jean et al., 2015a, Tab. 2)
Setup
BASIC NMT
NMT-LV
+ UNK Replace
–
+ Reshuffle
+ Ensemble
–
19.40
21.59
BLEU Setup
16.46
16.95 HIERO
18.89 NMT-HIERO
BASIC NMT
+ Tuning
+ Reshuffle
BLEU
16.31
19.44
20.69
21.43
21.87
SGNMT
(Jean et al., 2015a, Tab. 2)
Setup
BASIC NMT
NMT-LV
+ UNK Replace
–
+ Reshuffle
+ Ensemble
–
34.60
37.19
BLEU Setup
29.97
33.36 HIERO
34.11 NMT-HIERO
BASIC NMT
+ Tuning
+ Reshuffle
BLEU
30.42
32.86
35.37
36.29
36.61
(a) English-German
(b) English-French
Table 2: BLEU scores on news-test2014 calculated with multi-bleu.perl. NMT-LV refers to the
RNNSEARCH-LV model from (Jean et al., 2015a) for large output vocabularies.
Vocab.
NMT Grammar KN-LM NPLM
scores
scores
scores
scores
Search
space
Lattice
Lattice
(cid:88)
(cid:88)
(cid:88)
(cid:88)
1
2
3 Unrestricted
4
5
6
7
8
9
10
11
12
13
14
15
16 Neural MT – UMontreal-MILA (Jean et al., 2015b)
100-best
100-best
100-best
1000-best
1000-best
1000-best
Lattice
Lattice
Lattice
Lattice
Lattice
Lattice
Hiero
Hiero
NMT
Hiero
Hiero
Hiero
Hiero
Hiero
Hiero
NMT
Hiero
Hiero
Hiero
Hiero
Hiero
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
# of node exp-
ansions per sen.
–
–
254.8
2,233.6
(DFS: 832.1)
21,686.2
(DFS: 6,221.8)
243.3
243.3
243.3
240.5
243.9
244.3
(cid:88)
(cid:88)
(cid:88)
(cid:88)
BLEU
(single)
BLEU
(ensemble)
21.1 (Hiero)
21.7 (Hiero)
19.5
22.8
22.9
22.9
23.3
23.4
23.5
20.3
23.0
23.0
23.4
23.4
24.0
22.8
21.8
23.3
23.4
23.3
23.8
23.9
24.0
21.4
24.2
24.2
24.5
24.4
24.4
25.2
Table 3: BLEU English-German news-test2015 scores calculated with mteval-v13a.pl.
Our SGNMT system1 is built with the Pyfst inter-
face 2 to OpenFst (Allauzen et al., 2007).
3.1 SGNMT Performance
Tab. 2 compares our combined NMT+Hiero de-
coding with NMT results in the literature. We use
a beam size of 12. In En-De and in En-Fr, we find
that our BASIC NMT system performs similarly
(within 0.5 BLEU) to previously published results
(16.31 vs. 16.46 and 30.42 vs. 29.97).
In NMT-HIERO, decoding is as described in
Sec. 2.2, but with λHiero = 0. The decoder
searches through the Hiero lattice, ignoring the
Hiero scores, but using Hiero word hypotheses in
place of any UNKs that might have been produced
by NMT. The results show that NMT-HIERO is
much more effective in fixing NMT OOVs than
the 'UNK Replace' technique (Luong et al., 2015);
this holds in both En-De and En-Fr.
For the NMT-HIERO+TUNING systems, lattice
MERT (Macherey et al., 2008) is used to optimise
λHiero and λN M T on the tuning sets. This yields
further gains in both En-Fr and En-De, suggesting
1http://ucam-smt.github.io/sgnmt/html/
2https://pyfst.github.io/
that in addition to fixing UNKs, the Hiero predic-
tive posteriors can be used to improve the NMT
translation model scores.
Tab. 3 reports results of our En-De system with
reshuffling and tuning on news-test2015. BLEU
scores are directly comparable to WMT'15 re-
sults 3. By comparing row 3 to row 10, we see that
constraining NMT to the search space defined by
the Hiero lattices yields an improvement of +0.8
BLEU for single NMT. If we allow Hiero to fix
NMT UNKs, we see a further +2.7 BLEU gain
(row 11). The majority of gains come from fix-
ing UNKs, but there is still improvement from the
constrained search space for single NMT.
We next investigate the contribution of the Hi-
ero system scores. We see that, once lattices
are generated, the KN-LM contributes more to
rescoring than the Hiero grammar scores (rows 12-
14). Further gains can be achieved by adding a
feed-forward neural language model with NPLM
(Vaswani et al., 2013) (row 15). We observe that
n-best list rescoring with NMT (Neubig et al.,
2015) also outperforms both the Hiero and NMT
3http://matrix.statmt.org/matrix/systems list/1774
Figure 1: Performance with NPLM over beam size
on English-German news-test2015. A beam of 12
corresponds to row 15 in Tab. 3.
Determini- Minimi- Weight
pushing
sation
(cid:88)
(cid:88)
(cid:88)
sation
(cid:88)
(cid:88)
(cid:88)
Sentences
per second
2.51
1.57
1.47
Table 4: Time for lattice preprocessing operations
on English-German news-test2015.
baselines, although lattice rescoring gives the best
results (row 9 vs. row 15). Lattice rescoring with
SGNMT also uses far fewer node expansions per
sentence. We report n-best rescoring speeds for
rescoring each hypothesis separately, and a depth-
first (DFS) scheme that efficiently traverses the n-
best lists. Both these techniques are very slow
compared to lattice rescoring. Fig. 1 shows that
we can reduce the beam size from 12 to 5 with
only a minor drop in BLEU. This is nearly 100
times faster than DFS over the 1000-best list.
Cost of Lattice Preprocessing As described in
Sec. 2.1, we applied determinisation, minimisa-
tion, and weight pushing to the Hiero lattices in
order to work with probabilities. Tab. 4 shows that
those operations are generally fast4.
Lattice Size For previous experiments we set
the Hiero pruning parameters such that lattices had
8,510 nodes on average. Fig. 2 plots the BLEU
score over the lattice size. We find that SGNMT
works well on lattices of moderate or large size,
but pruning lattices too heavily has a negative ef-
fect as they are then too similar to Hiero first best
hypotheses. We note that lattice rescoring involves
nearly as many node expansions as unconstrained
NMT decoding. This confirms that the lattices at
8,510 nodes are already large enough for SGNMT.
4Testing environment: Ubuntu 14.04, Linux 3.13.0, single
Intel R(cid:13) Xeon R(cid:13) X5650 CPU at 2.67 GHz
Figure 2: SGNMT performance over lattice size
on English-German news-test2015. 8,510 nodes
per lattice corresponds to row 14 in Tab. 3.
Local Softmax
In SGNMT decoding we have
the option of normalising the NMT translation
probabilities over the words on outgoing words
from each state rather than over the full 50,000
words translation vocabulary. There are ∼4.5 arcs
per state in our En-De'14 lattices, and so avoiding
the full softmax could cause significant computa-
tional savings. We find this leads to only a modest
0.5 BLEU degradation: 21.45 BLEU in En-De'14,
compared to 21.87 BLEU using NMT probabili-
ties computed over the full vocabulary.
Modelling Errors vs. Search Errors
In our En-
De'14 experiments with λHiero = 0 we find
that constraining the NMT decoder to the Hiero
lattices yields translation hypotheses with much
lower NMT probabilities than unconstrained BA-
SIC NMT decoding: under the NMT model, NMT
hypotheses are 8,300 times more likely (median)
than NMT-HIERO hypotheses. We conclude (ten-
tatively) that BASIC NMT is not suffering only
from search errors, but rather that NMT-HIERO
discards some hypotheses ranked highly by the
NMT model but lower in the evaluation metric.
4 Conclusion
We have demonstrated a viable approach to Syn-
tactically Guided Neural Machine Translation for-
mulated to exploit the rich, structured search space
generated by Hiero and the long-context transla-
tion scores of NMT. SGNMT does not suffer from
the severe limitation in vocabulary size of basic
NMT and avoids any difficulty of extending dis-
tributed word representations to new vocabulary
items not seen in training data.
Acknowledgements
This work was supported in part by the U.K. En-
gineering and Physical Sciences Research Council
(EPSRC grant EP/L027623/1).
References
Cyril Allauzen, Michael Riley, Johan Schalkwyk, Wo-
jciech Skut, and Mehryar Mohri. 2007. OpenFst: A
general and efficient weighted finite-state transducer
In Implementation and Application of Au-
library.
tomata, pages 11–23. Springer.
Cyril Allauzen, Bill Byrne, de Adri`a Gispert, Gonzalo
Iglesias, and Michael Riley. 2014. Pushdown au-
tomata in statistical machine translation. Volume 40,
Issue 3 - September 2014, pages 687–723.
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben-
gio. 2015. Neural machine translation by jointly
learning to align and translate. In ICLR.
Fr´ed´eric Bastien, Pascal Lamblin, Razvan Pascanu,
James Bergstra, Ian Goodfellow, Arnaud Bergeron,
Nicolas Bouchard, David Warde-Farley, and Yoshua
Bengio. 2012. Theano: new features and speed im-
In Deep Learning and Unsupervised
provements.
Feature Learning NIPS 2012 Workshop.
David Chiang, Kevin Knight, and Wei Wang. 2009.
11,001 new features for statistical machine transla-
tion. In ACL, pages 218–226.
David Chiang. 2007. Hierarchical phrase-based trans-
lation. Computational Linguistics, 33(2):201–228.
Rohan Chitnis and John DeNero. 2015. Variable-
length word encodings for neural translation models.
In EMNLP, pages 2088–2093.
Kyunghyun Cho, Bart van Merrienboer, Caglar Gul-
cehre, Fethi Bougares, Holger Schwenk, and Yoshua
Bengio.
2014. Learning phrase representations
using RNN encoder-decoder for statistical machine
translation. In EMNLP.
Ronan Collobert and Jason Weston. 2008. A unified
architecture for natural language processing: Deep
In Pro-
neural networks with multitask learning.
ceedings of the 25th International Conference on
Machine Learning, pages 160–167. ACM.
Adri`a de Gispert, Gonzalo Iglesias, Graeme Black-
wood, Eduardo R Banga, and William Byrne. 2010.
Hierarchical phrase-based translation with weighted
finite-state transducers and shallow-n grammars.
Computational Linguistics, 36(3):505–533.
Ian Goodfellow, David Warde-farley, Mehdi Mirza,
Aaron Courville, and Yoshua Bengio. 2013. Max-
out networks. In ICML, pages 1319–1327.
Kenneth Heafield,
Ivan Pouzyrevsky, Jonathan H.
Clark, and Philipp Koehn. 2013. Scalable modified
In ACL,
Kneser-Ney language model estimation.
pages 690–696.
Gonzalo Iglesias, Adri`a de Gispert, Eduardo R Banga,
and William Byrne. 2009. Hierarchical phrase-
based translation with weighted finite state transduc-
ers. In NAACL-HLT, pages 433–441.
Gonzalo Iglesias, Cyril Allauzen, William Byrne,
Adri`a de Gispert, and Michael Riley. 2011. Hier-
archical phrase-based translation representations. In
EMNLP, pages 1373–1383.
S´ebastien Jean, Kyunghyun Cho, Roland Memisevic,
and Yoshua Bengio. 2015a. On using very large
target vocabulary for neural machine translation. In
ACL, pages 1–10.
S´ebastien Jean, Orhan Firat, Kyunghyun Cho, Roland
Memisevic, and Yoshua Bengio. 2015b. Montreal
neural machine translation systems for WMT15. In
Proceedings of the Tenth Workshop on Statistical
Machine Translation, pages 134–140.
Nal Kalchbrenner and Phil Blunsom. 2013. Recurrent
In EMNLP, page
continuous translation models.
413.
Jimmy Lin and Chris Dyer. 2010. Data-intensive text
processing with MapReduce. Morgan &Claypool.
Minh-Thang Luong, Ilya Sutskever, Quoc V Le, Oriol
Vinyals, and Wojciech Zaremba. 2015. Addressing
the rare word problem in neural machine translation.
In ACL.
Wolfgang Macherey, Franz Josef Och, Ignacio Thayer,
and Jakob Uszkoreit. 2008. Lattice-based minimum
error rate training for statistical machine translation.
In EMNLP, pages 725–734.
Yuval Marton and Philip Resnik. 2008. Soft syntac-
tic constraints for hierarchical phrased-based trans-
lation. In ACL, pages 1003–1011.
Mehryar Mohri and Michael Riley. 2001. A weight
large vocabulary speech
pushing algorithm for
recognition. In Interspeech, pages 1603–1606.
Mehryar Mohri, Fernando Pereira, and Michael Ri-
2002. Weighted finite-state transducers in
ley.
speech recognition. Computer Speech and Lan-
guage, 16(1).
Graham Neubig, Makoto Morishita, and Satoshi Naka-
mura. 2015. Neural reranking improves subjective
quality of machine translation: NAIST at WAT2015.
In Workshop on Asian Translation, pages 35–41.
Holger Schwenk.
2014.
Universit du Maine.
http://www-lium.univ-lemans.fr/
schwenk/nnmt-shared-task/.
accessed 1-March-2016].
[Online;
Rico Sennrich, Barry Haddow, and Alexandra Birch.
2015. Neural machine translation of rare words with
subword units. arXiv preprint arXiv:1508.07909.
2010.
Nakatani Shuyo.
Language detection li-
brary for Java. http://code.google.com/
p/language-detection/.
[Online; accessed
1-March-2016].
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. 2014.
Sequence to sequence learning with neural net-
works. In Advances in Neural Information Process-
ing Systems, pages 3104–3112.
Zhaopeng Tu, Zhengdong Lu, Yang Liu, Xiaohua Liu,
and Hang Li. 2016. Coverage-based neural machine
translation. arXiv preprint arXiv:1601.04811.
Bart van Merrienboer, Dzmitry Bahdanau, Vincent Du-
moulin, Dmitriy Serdyuk, David Warde-Farley, Jan
Chorowski, and Yoshua Bengio. 2015. Blocks and
fuel: Frameworks for deep learning. arXiv preprint
arXiv:1506.00619.
Ashish Vaswani, Yinggong Zhao, Victoria Fossum, and
David Chiang. 2013. Decoding with large-scale
neural language models improves translation.
In
EMNLP, pages 1387–1392.
Ashish Venugopal, Andreas Zollmann, Noah A. Smith,
and Stephan Vogel. 2009. Preference grammars:
Softening syntactic constraints to improve statistical
In NAACL-HLT, pages 236–
machine translation.
244.
|
1512.04419 | 2 | 1512 | 2018-10-09T10:49:35 | Sentence Entailment in Compositional Distributional Semantics | [
"cs.CL",
"cs.AI",
"math.CT"
] | Distributional semantic models provide vector representations for words by gathering co-occurrence frequencies from corpora of text. Compositional distributional models extend these from words to phrases and sentences. In categorical compositional distributional semantics, phrase and sentence representations are functions of their grammatical structure and representations of the words therein. In this setting, grammatical structures are formalised by morphisms of a compact closed category and meanings of words are formalised by objects of the same category. These can be instantiated in the form of vectors or density matrices. This paper concerns the applications of this model to phrase and sentence level entailment. We argue that entropy-based distances of vectors and density matrices provide a good candidate to measure word-level entailment, show the advantage of density matrices over vectors for word level entailments, and prove that these distances extend compositionally from words to phrases and sentences. We exemplify our theoretical constructions on real data and a toy entailment dataset and provide preliminary experimental evidence. | cs.CL | cs |
Sentence Entailment in
Compositional Distributional Semantics
Mehrnoosh Sadrzadeh, Dimitri Kartsaklis, Esma Balkır
{m.sadrzadeh,d.kartsaklis}@qmul.ac.uk, [email protected]
School of Electronic Engineering and Computer Science
Queen Mary University of London
Mile End Road, London E1 4NS, United Kingdom
Abstract. Distributional semantic models provide vector representations for words
by gathering co-occurrence frequencies from corpora of text. Compositional dis-
tributional models extend these from words to phrases and sentences. In categori-
cal compositional distributional semantics, phrase and sentence representations
are functions of their grammatical structure and representations of the words
therein. In this setting, grammatical structures are formalised by morphisms of
a compact closed category and meanings of words are formalised by objects of
the same category. These can be instantiated in the form of vectors or density ma-
trices. This paper concerns the applications of this model to phrase and sentence
level entailment. We argue that entropy-based distances of vectors and density
matrices provide a good candidate to measure word-level entailment, show the
advantage of density matrices over vectors for word level entailments, and prove
that these distances extend compositionally from words to phrases and sentences.
We exemplify our theoretical constructions on real data and a toy entailment
dataset and provide preliminary experimental evidence.
Distributional models of meaning, otherwise known as distributional semantics, are
based on the philosophy of Firth and Harris who argued that meanings of words can
be derived from their patterns of use and that words that have similar meanings often
occur in the same contexts [14,17]. For example, words like "butterfly" and "bee" have
similar meanings, since they often occur in the context of "flower", whereas "butter-
fly" and "door" do not have similar meanings, since one often occurs close to "flower"
and one does not. This hypothesis has been employed to develop semantic vector mod-
els where meanings of words are represented by vectors, built from the frequency of
co-occurrences of words with each other [40,42]. Compositional distributional models
extend these vector representations from words to phrases and sentences. They work
alongside a principle of compositionality, which states that the meaning of a phrase or
sentence is a function of the meanings of the words therein. Thus, the vector meaning
of "yellow butterfly was chased by our cat", is obtained by acting via a function, whose
form is yet to be decided, on the vector meanings of "yellow", "butterfly", "chase"
and "cat". Based on how this function is implemented, these models come in differ-
ent forms. There are the ones that use simple point wise vector operations [34]; these
just add or multiply vectors of the words. We have the ones that are based on tensors of
grammatical types with vectors of words [7]; these take the tensor product of the vectors
2
of the words with a vectorial representation of their grammatical types. There are ones
where tensors are used to represent meanings of functional words, such as adjectives
adverbs, and verbs. Here, the functional word gets a tensor meaning and composition
becomes tensor contraction [4,10]. Finally, we have the ones that use neural word em-
beddings, where the function is learnt from data [45,20].
The work of this paper is based on the categorical compositional distributional se-
mantics framework [10], from now on CCDS, where vectorial meanings of phrases and
sentences are built from the vectors and tensors of the words therein and the grammati-
cal structures of the phrases and sentences. These models are based on a general math-
ematical setting, where the meaning of any phrase or sentence, no matter how complex
and long they are, can in principle be assigned a vectorial representation. Fragments
of the model have been instantiated on concrete data and have been applied to word
and phrase/sentence disambiguation, classification, similarity, and paraphrasing tasks.
Some of the instantiations of CCDS in these tasks have outperformed other composi-
tional distributional models, where for instance, simple operations were used and the
grammar was not taken into account, see [15,25,23,33,16].
In distributional semantics, entailment is modelled via the distributional inclusion
hypothesis. This hypothesis says that word v entails word w when the contexts of v
are included in the contexts of w. This means that whenever word v is used, word w
can be used retaining a valid meaning. The hypothesis makes intuitive sense, it stands
a good chance for entailment, and indeed there has been an extensive amount of work
on it, e.g. see [12,47,27]. However, existing work is mostly done at the word level and
not much has been explored when it comes to phrases and sentences. The work on en-
tailment between quantified noun phrases [5] is an exception, but it does not take into
account composition and thus does not extend to sentences and longer phrases. Compo-
sition is what is needed for a modular approach to entailment and the challenges faced
based on it, e.g. see the work described in [11]. In this and other similar challenges,
categorised under the general heading of RTE (Recognising Textual Entailment), one
is to decide about the entailment between complex sentences of language, for example
"yellow butterfly was chased by our cat" and "someone's cat chased a butterfly". In
a compositional model of meaning, which is the one we work with, the goal is to try
and derive the entailment relation between the sentences from the entailment relations
between the words and the grammatical structures of the sentences.
Two points should be noted here. First is that entailment is a directional measure,
that is if v entails w, it is most of the time not the case that w entails v. This is in con-
trast to the notion of similarity, which is computed using symmetric distance measures
between vectors, e.g. cosine of the angle, and is the most common operation in distri-
butional semantics and its applications, for example see the tasks described in [43,46].
The second point is that, although the distributional inclusion hypothesis can be read
in a binary fashion and indeed the notion of entailment in classical logics has a binary
truth value semantics (i.e. either it holds or not), in a distributional setting it would make
more sense to work with degrees of entailment. Conceptually, this is because we are in
a quantitative setting that represents meanings of words by vectors of numbers rather
than in the qualitative setting of classical logic, designed to reason about truth valued
predicates. Concretely and when it comes to working with data, it is rarely the case that
3
one gets 0's in the coordinates of vectors. Some coordinates might have low numbers;
these should be used in a lesser extent in the entailment decision. Some coordinates
have large numbers; these should affect the entailment decision to a larger extent. In
summary, in order to model entailment in a distributional semantics one is after an op-
eration between the vectors that is asymmetric (similar to the logical entailment) and
has degrees (contrary to the logical entailment). This is exactly what previous work on
word-level entailment [12,47,27] has done and what we are going to do in this paper for
phrase/sentence-level entailment.
In this paper we show how CCDS can be used to reason about entailment in a com-
positional fashion. In particular, we prove how the general compositional procedures
of this model give rise to an entailment relation at the word level which is extendible
to the phrase and sentence level. At the word level, we work with the distributional
inclusion hypothesis. Previous work on word level entailment in these models shows
that entropy-based notions such as KL-divergence provide a good notion of degrees of
entailment based on the distributional inclusion hypothesis [12,19,39]. In this paper,
we prove that in CCDS this notion extends from word vectors to phrase and sentence
vectors and thus also provides a good notion of phrase/sentence entailment: one that is
similar to that of Natural Logic [31]. We also show that in the presence of correlations
between contexts, the notion of KL-divergence naturally lifts from vectors to density
matrices via von Neumann's entropy, and that this notion of entropy also lifts compo-
sitionally from words to phrases and sentences, in the same way as KL-divergence did
for vectors.
The density matrix results of this paper build on the developments of [1,2] and
are related to [36,35,22], where the use of density matrices in CCDS were initiated.
More recently, the work of [3] focuses on the density matrices of CCDS to develop a
theoretical notion for a graded entailment operator. Prior to that, density matrices were
used in [6] to assist in parsing. In contrast to these works, here (and in the conference
version of this paper [13]), we do not start right away with density matrices, neither do
we treat density matrices as our only or first-class citizens. The main contribution of our
work is that we develop a more general notion of entailment that is applicable to both
vectors and density matrices. This notion is compositional and extends modularly from
words to phrases and sentences. The reason for the fact that our results hold for both
vectors and density matrices is that they are both instances of the same higher order
categorical structure: the category of vector spaces and linear maps and the category of
density matrices and completely positive maps are both compact closed.
The outline of our contribution is as follows. We start with vectors and vector-
based notions of entropy, pointing out a shortcoming of vector-level entropy when it
comes to measuring a certain form of entailment, motivate how this problem can be
solved using density matrices, and then move on to show how one can incorporate
in the CCDS setting an entailment based on density matrices. In short, we develop a
distributional notion of entailment that extends compositionally from words to phrase
and sentences and which works for both vectors and density matrices. We argue, in
theoretical, in concrete, and in experimental terms, that the notion of relative entropy
on density matrices gives rise to a richer notion of word and sentence level entailment
than the notion of KL-divergence on vectors.
4
On the concrete side, we provide two small scale experiments on data collected from
a text corpus, build vectors and density matrices, and apply the results to a toy word
level entailment task and a short phrase and sentence entailment task. This involves
implementing a concrete way of building vectors and density matrices for words and
composing them to obtain vectors and density matrices for our short sentences. We
elaborate on all of these in the corresponding sections of the paper. As will be pointed
out below, some of the concrete constructions we present are novel.
This paper is the journal version of the work presented in the 14th International
Symposium in Artificial Intelligence and Mathematics [13]. The novel contributions of
the current paper, in relation to its conference version, are as follows:
1. We prove a more general version of the main result of the previous paper, i.e. The-
orem 1. In the new version, this theorem is not restricted to sentences that satisfy
Lambek's switching lemma, which says that the grammatical structures of sen-
tences are only epsilon maps (i.e. applications of functions) and identities. Here, we
show that the grammatical structures of phrases/sentences can be any morphism of
a base category of finite dimensional vector spaces (for the vectorial entailments)
and a base category of density matrices and completely positive maps (for the den-
sity matrix entailments).
2. We develop and implement a new way of building concrete density matrices for
words, thus work with two different concrete implementations, as opposed to the
only one presented in the conference version. In the previous method, a density
matrix was created as a convex combination of vectors representing contexts, fol-
lowing the quantum-mechanical intuition. The new method, on the other hand, is
based on the philosophy that there might exist correlations between the contexts,
and it directly implements the reasoning presented in Section 1. The examples of
that section argue in favour of density matrices over vectors for basis correlation
cases, and our new density matrices are built in the same way as prescribed by the
general pattern present in such cases.
3. We present additional analysis based on a new toy example for cases where there is
a correlation between the contexts (in other words basis vectors/words), and show
that density matrices built using the method described above do respect the entail-
ment relations in these cases and do so better than vectors.
4. Finally, we take advantage of the space provided in the journal version and provide
more background on the categorical constructions used in CCDS.
Categorical Preliminaries and Examples
Categorical Compositional Distributional Semantic (CCDS) relies on the theory of cat-
egories, originated in the work of MacLane [32]. It is based on a special type of cate-
gories, known as compact closed categories, developed in [26]. We will briefly recall a
few of the major notions that are important to our work from these theories and refer
the reader for the complete list of definitions and properties to [32,26]. An introduction
to the subject with a focus on compact closed categories is presented in [9].
The main inhabitants of a category C are its objects and morphisms. The objects are
denoted by A, B, C and the morphisms by f, g. If f is a morphism from A to B, we
5
denote it by f : A → B, similarly g : B → C denotes a morphism from B to C. Each
object A has an identity morphism, denoted by 1A : A → A. The morphisms are closed
under composition, that is, given f : A → B and g : B → C, there is a morphism
g ◦ f : A → C from A to C. Composition is associative, that is:
f ◦ (g ◦ h) = (f ◦ g) ◦ h
with identity morphisms its units, that is:
f ◦ 1A = f
and
1B ◦ f = f
A monoidal category has a binary operation defined on its objects and morphisms, re-
ferred to as tensor and denoted by A ⊗ B on objects and similarly by f ⊗ g on mor-
phisms. This operation is associative and has a unit I, which is an object of the category.
Associativity of tensor and it having a unit means that we have:
A ⊗ (B ⊗ C) = (A ⊗ B) ⊗ C
A ⊗ I = I ⊗ A = A
On a pair of morphisms (f : A → C, g : B → D), the tensor operation is defined as
follows:
f ⊗ g : A ⊗ B → C ⊗ D
It satisfies a bifunctoriality property, that is, the following equation holds:
(g1 ⊗ g2) ◦ (f1 ⊗ f2) = (g1 ◦ f1) ⊗ (g2 ◦ f2) .
for f1, f2 : A → C and g1, g2 : B → D.
A compact closed category is a monoidal category, where each of its objects has two
contravariant functors defined on them; these are referred to as left and right adjoints
and they are to satisfy an adjunction property. Given an object A, its adjoints are denoted
by Ar and Al and are referred to as right and left adjoints. Part of the property they
satisfy says that they are equipped with the following morphisms:
A ⊗ Ar r
A−→ I
ηr
A−→ Ar ⊗ A
Al ⊗ A
l
A−→ I
ηl
A−→ A ⊗ Al
In other words, for each object A, there exists in a compact closed category an object
Ar, an object Al and the above four morphisms. These morphisms satisfy the following
equalities, sometimes referred to by the term yanking:
A) ◦ (ηl
(1A ⊗ l
A ⊗ 1Al ) ◦ (1Al ⊗ ηl
(l
A ⊗ 1A) = 1A
A) = 1Al
A ⊗ 1A) ◦ (1A ⊗ ηr
(r
(1Ar ⊗ r
A) ◦ (ηr
A) = 1A
A ⊗ 1Ar ) = 1Ar
A self adjoint compact closed category is one in which the objects and their adjoints
are the same, that is for every object A we have
Al = Ar = A
A strongly monoidal functor F between a monoidal category C and another monoidal
category D is a map F : C → D, which assigns to each object A of C an object F (A)
6
of D and to each morphism f : A → B of C, a morphism F (f ) : F (A) → F (B) of D.
It preserves the identities and the compositions of C. That is, we have
F (1A) = 1F (A)
F (g ◦ f ) = F (g) ◦ F (f )
Moreover, we have the following equations:
F (A ⊗ B) = F (A) ⊗ F (B)
F (I) = I
These mean that F preserves the tensor and its unit in both directions. A strongly
monoidal functor on two compact closed categories C and D preserves the adjoints,
that is we have:
F (Al) = F (A)l
F (Ar) = F (A)r
The above definitions are given in a strict monoidal sense. In a non-strict setting,
the equalities of the monoidal properties are replaced with isomorphisms. We work
with three examples of compact closed categories: pregroup algebras, the category of
finite dimensional vector spaces and linear maps, and the completely positive maps over
them. Below we show how each of these is a compact closed category.
Pregroup algebras PRG. A pregroup algebra is a partially ordered monoid where each
element has a left and a right adjoint; it is denoted by PRG = (P,≤,·, 1, (−)r, (−)l).
The notion of adjunction here means that for each p ∈ P , we have a pr and a pl in P
such that:
p · pr ≤ 1 ≤ pr · p
pl · p ≤ 1 ≤ p · pl
A pregroup algebra is a compact closed category in the following way: the elements of
the partial order p ∈ P are the objects of the category. The partial orderings between
the elements are the morphisms of the category, that is for p, q ∈ P we have:
p → q
iff
p ≤ q
The monoid multiplication of the pregroup algebra is a monoidal tensor; this is because
we can form the monoid multiplication of elements of the partial ordering p ⊗ q and
that this multiplication preserves the ordering, that is we have:
p ≤ q
and p(cid:48) ≤ q(cid:48) =⇒ p ⊗ p(cid:48) ≤ q ⊗ q(cid:48)
The unit of this multiplication is 1, since we have:
p · 1 = 1 · p = p
The multiplication is associative as well, as denoted via the following inequality which
holds in PRG:
p · (q · r) = (p · q) · r
Each element of the pregroup algebra has a left and a right adjoint and the adjunction
inequalities expressed above mean that the adjunction morphisms exist, that is we have
the following:
p ⊗ pr
r
p→ 1
ηr
p→ pr ⊗ p
pl ⊗ p
l
p→ 1
ηl
p→ p ⊗ pl
In order to see that the above satisfy the yanking equalities, consider the first yanking
case, which is as follows:
7
(1A ⊗ l
A ⊗ 1A) = 1A
In a pregroup algebra setting, this will look like as follows:
p ⊗ 1p) = 1p
A) ◦ (ηl
(1p ⊗ l
p) ◦ (ηl
We form (ηl
p ⊗ 1p) by multiplying both sides of the ηl
p inequality by p:
1 ≤ p · pl =⇒ 1 · p ≤ p · pl · p
Similarly, we form (1p ⊗ l
p) by multiplying both sides of the l
pl · p ≤ 1 =⇒ p · pl · p ≤ p · 1
p inequality by p:
Then we compose these two morphisms, which in partial order terms amounts to ap-
plying the transitivity of the partial order to them, as follows
1 · p ≤ p · pl · p ≤ p · 1
Thus we obtain the following inequality:
1 · p ≤ 1 · p
which is true since the partial order is reflexive. The other three yanking equalities are
proven in the same way.
Finite-dimensional vector spaces with fixed orthonormal basis and linear maps.
Finite dimensional vector spaces over reals R and the linear maps between the spaces
form a compact closed category, denoted by FVectR. The objects of this category are
the vector spaces, while its morphisms are the linear maps between them. The monoidal
tensor of the category is the tensor product of vector spaces which can be extended to
f→ W and V (cid:48) g→ W (cid:48), their tensor is
linear maps as follows: For two linear maps V
denoted by f ⊗ g and is defined to be the following map:
V ⊗ V (cid:48) f⊗g−→ W ⊗ W (cid:48)
The unit of the monoidal tensor is the unit of the tensor product of the vector spaces,
which is the scalar field, since we have the following for every vector space V :
V ⊗ R ∼= R ⊗ V ∼= V
For each vector space V , its dual space V ∗ is its left and right adjoint, that is:
V l = V r := V ∗
In the presence of a fixed orthonormal basis, which is the case here and for vector spaces
of a distributional semantics, we have a way of transforming V ∗ to V and V to V ∗.
8
Such categories, denoted by FdVectR, are thus self adjoint compact closed categories.
Moreover, their tensor (and the tensor of of FVectR more generally) is symmetric, that
is we have:
V ⊗ W ∼= W ⊗ V
As a result, the two r and l maps become the same map and similarly so for the η
maps. That is we have:
:= r ∼= l
η := ηr ∼= ηl
Thus the and η maps of this category will acquire the following forms:
Given(cid:80)
ij Cij
defined as follows:
V : V ⊗ V → R
ηV : R → V ⊗ V
−→vi ⊗ −→vj ∈ V ⊗ V and a basis {−→v i}i for V , the above are concretely
(cid:88)
V
Cij
(cid:88)
ij
Cij(cid:104)−→vi−→vj(cid:105)
:=
−→vi ⊗ −→vj
(cid:88)
η(1) :=
−→vi ⊗ −→vi
ij
for the map and as follows:
i
for the η map. In order to see that the above satisfy the yanking equalities, again consider
the first yanking equality; in its vectorial form, for one side of the equality we have to
build the following morphism:
(1V ⊗ V ) ◦ (ηV ⊗ 1V )
which is obtained by the following composition of morphisms:
ηV ⊗1V−→ V ⊗ V ⊗ V 1V ⊗V−→ V ⊗ R
R ⊗ V
This is equal to the identity morphism on V , since we have:
R ⊗ V ∼= V ⊗ R ∼= V
due to the fact that R is the unit of tensor in FVect.
Finite-dimensional vector spaces and completely positive maps CPM(FVectR). The
category CPM(FVectR) over finite dimensional vector spaces and linear maps is also
compact closed. The CPM construction was originally defined over Hilbert spaces
[44]. In previous work, we show how it also applies to the simpler case of vector spaces
over reals [2]. The corresponding construction yields a category whose objects are of
the form V ⊗ V ∗, elements of which represent density operators. This property is re-
ferred to by the Choi-Jamiolkowski correspondence, for more on this see [9]. Recall
9
that these are self-adjoint, semi-definite positive, and have trace 1. The general form of
a density matrice v ∈ V ⊗ V ∗ is as follows:
(1)
where pi's define a probability distribution over the set of −→c i vectors, thus we have:
v :=
pi
(cid:88)
i
−→c i ⊗ −→c i
(cid:88)
0 ≤ pi ≤ 1
pi = 1
i
The −→c i vectors are referred to by pure states and the v is referred to by a mixed state,
in quantum mechanic terminology.
Morphisms of CPM(FVectR) are linear maps which are moreover completely pos-
itive. Again, recall that a completely positive map between two density matrices pre-
serves the structure of a density matrix. In category theoretic terms, these maps are
morphisms of the following form:
f : V ⊗ V ∗ → W ⊗ W ∗
for which there exist a vector space X and a linear map g : V → X ⊗ W such that the
following map exists in FVectR:
f = (g ⊗ g) ◦ (1W⊗W ⊗ ηX )
The category CPM(FVectR) inherits the symmetry property of FVectR, that is we have:
(V ⊗ V ∗) ⊗ (W ⊗ W ∗) ∼= (W ⊗ W ∗) ⊗ (V ⊗ V ∗)
Also, similar to FVectR, its left and right adjoints become equal and reduce to the ten-
sor product of dual spaces. This is easily shown as follows for the left adjoint and by
recalling that (−)∗ is involutive and that the compact closure is self adjoint:
(V ⊗ V ∗)l = (V ∗)l(⊗)∗V ∗ ∼= (V ∗)∗ ⊗ V ∗ ∼= V ⊗ V ∗
The case of right adjoint is similar. Also, similar to FVectR, in the presence of a fixed
basis, the category becomes self adjoint, that is we have:
(V ⊗ V ∗)∗ ∼= V ⊗ V ∗
The and η maps of CPM(FVectR) are obtained by tensoring the and η maps in
FVectR. In the presence of a fix basis, these will have the following forms:
: V ⊗ V ⊗ V ⊗ V → R
η : R → V ⊗ V ⊗ V ⊗ V
Concretely, these maps are given as follows for the case:
(cid:88)
V
:=
(cid:88)
−→vi ⊗ −→vj ⊗ −→vk ⊗ −→vl
Cijkl
Cijkl(cid:104)−→vi−→vj(cid:105)(cid:104)−→vk−→vl(cid:105)
ijkl
ijkl
10
and as follows for the η case:
η(1) :=
(cid:88)
i
−→vi ⊗ −→vi ⊗ −→vi ⊗ −→vi
Finally, we leave it to the reader to verify that the yanking equalities are also satisfied
in a very similar way they are satisfied in FVectR.
Categorical Compositional Distributional Semantics (CCDS)
In its most abstract form, a CCDS is denoted as follows:
(CSyn,CSem, F, [[ ]])
It consists of a compact closed category for syntax CSyn, a compact closed category for
semantics CSem, a strongly monoidal functor F : CSyn → CSem between the two, and a
semantic map [[ ]] : Σ∗ → CSem from the set of strings of a language Σ∗ to the compact
closed category of semantics.
Meanings of phrases and sentences of a language are related to the meanings of
words of that language via a principle known to the formal semanticist as the principle
of lexical substitution. In a CCDS, this principle takes the following form:
[[w1w2 ··· wn]] := F (α)([[w1]] ⊗ [[w2]] ⊗ ··· [[wn]])
(2)
for w1w2 ··· wn ∈ Σ∗ a string of words, i.e. we have wi ∈ Σ for each wi in the string,
and where α denotes the grammatical structure of w1w2 ··· wn, i.e. a morphism in the
compact closed category of syntax CSyn. On the left-hand side of the above equation,
[[w1w2 ··· wn]] is the semantics of a string of words and on the right-hand side, each
[[wi]] is the semantics of a word in that string.
In practice, the abstract model is instantiated to concrete settings. One needs a con-
crete setting to represent the syntax, a concrete setting to represent the semantics, a
concrete way of relating the words of a language, i.e. elements of Σ, to semantic rep-
resentations in CSem, and a concrete way of relating the syntactic elements to their se-
mantic counterparts, that is a concrete way of representing the functor F on atomic
elements of syntax and semantics. Below, we show how one can do such a many-fold
instantiation for the cases of PRG for syntax and FVectR for vector semantics, and for
the cases of PRG as syntax and CPM(FVectR) for density matrix semantics.
Instantiation to (PRG, FVectR, F, [[ ]])
In this instantiation, on the syntactic side, we work with a pregroup grammar; this is a
pregroup algebra applied to reasoning about syntax and grammatical structures and has
been developed by Lambek [28]. We provide an overview below.
A pregroup grammar is a pregroup algebra denoted by T (B); this notation is to ex-
press the fact that the pregroup algebra is generated over the set B of basic grammatical
types of a language. We assume B to be the set {n, s}, where n denotes the type of a
noun phrase and s the type of a sentence. The pregroup grammar comes equipped with
a relation R ⊆ T (B) × Σ that assigns grammatical types from T (B) to the vocabulary
Σ of a language. Some examples from the English language are as follows:
Grammatical Relation Pregroup Type
adjectives
intransitive verbs
transitive verbs
adverbs
n · nl
nr · s
nr · s · nl
sr · s
11
Examples
red, big, round
sleep, sneeze, snooze
gave, hold, own
yesterday, quickly, slowly
In a pregroup grammar, the grammatical structure of a string of words w1w2 ··· wn,
for wi ∈ Σ, is the following morphism of category PRG:
t1 · t2 · ··· · tn
α→ t
where we are taking PRG to be the compact closed categorical form of our pregroup
algebra T (B). Each ti is a grammatical type assigned to the word wi. Formally, this
means that we have ti ∈ R[wi]. By means of examples, each ti lives in the middle
column of the exemplary table above. For example, for a word w5 = 'red', we have that
t5 = n · nl, for w18 = 'sleep', we have that t18 = nr · s, and so on.
On the semantic side, we work with FVectR, as previously introduced, that is the
compact closed category of finite dimensional vector spaces and linear maps. Thus, our
syntax-semantics map is a strongly monoidal functor with the following form:
F : PRG → FVectR
The concrete form of the functor we are interested in acts as follows on the basic types
of PRG:
F (n) := N
F (s) = S
where N and S are two vector spaces in FVectR. The strong monoidality of F results
in certain equalities on the non-atomic elements of PRG, examples of which are as
follows:
F (p · q) = F (p) ⊗ F (q) F (1) = R F (pr) = F (pl) = F (p)∗
These extend to the morphisms, for example we have the following morphism inequal-
ities:
F (p ≤ q) = F (p) → F (q)
F (p · pr ≤ 1) = F (p)
as well as the following similar ones for the left adjoints:
F (1 ≤ pr · p) = ηF (p)
F (pl · p ≤ 1) = F (p)
F (1 ≤ p · pl) = ηF (p)
In this setting, the meaning representations of words are vectors; that is, [[v]], for v
a word or a string of words, is a vector −→v , hence the principle of lexical substitution
instantiates as follows:
−−−−−−−−→
w1w2 ··· wn := F (α)(−→w 1 ⊗ −→w 2 ⊗ ··· ⊗ −→w n)
(3)
w1w2 ··· wn the vector representation of the string w1w2 ··· wn and −→wi the vector
for −−−−−−−−→
representation of word wi in the string.
12
Instantiation to (PRG, CPM(FVectR), F, [[ ]])
The syntactic side is as in the previous case. On the semantic side, we work in the
compact closed category CPM(FVectR). The passage from FVectR to CPM(FVectR)
is functorial. Thus, the categorical compositional distributional semantics works along
the following functor:
F : PRG → FVectR → CPM(FVectR)
Here, the meaning representations of words are density matrices, that is [[v]] is v, for v
a word or a string of words, hence the principle of lexical substitution instantiates as
follows:
(cid:92)w1 ··· wn := F (α)( w1 ⊗ ··· ⊗ wn)
(4)
for (cid:92)w1 ··· wn the density matrix representation of the string w1w2 ··· wn and wi the
density matrix representation of word wi, for each word of the string.
KL-Divergence and Relative Entropy
(cid:80)
For a vector space V with a chosen orthonormal basis {−→vi}i, a normalized vector −→v =
−→vi can be seen as a probability distribution over the basis. In this case one can
i pi
define a notion of entropy for −→v as follows:
S(−→v ) = −(cid:88)
which is the same as the entropy of the probability distribution P = (cid:80)
i pi over the
For two vectors −→v ,−→w with probability distributions P and Q, the distance between
pi ln pi
basis.
i
their entropies, referred to by Kullback-Leibler divergence, is defined as:
(cid:88)
KL(−→v (cid:107)−→w ) =
pj(ln pj − ln qj)
This is a measure of distinguishability. One can define a degree of representativeness
based on this measure:
j
RKL(−→v ,−→w ) =
1
1 + KL(−→v (cid:107)−→w )
This is a real number in the unit interval. When there are non zero weights on the basis
elements of −→v that are zero in −→w , then ln 0 = ∞ (by convention 0 ln 0 = 0) and so
RKL(−→v ,−→w ) = 0. So when the support of P is not included in the support of Q then
RKL = 0, and when P = Q then RKL = 1.
Both KL-divergence and representativeness are asymmetric measures. The follow-
ing measure, referred to by Jensen-Shannon divergence, provides a symmetric version:
(cid:19)(cid:21)
(cid:20)
(cid:18)
(cid:19)
(cid:18)
JS(−→v ,−→w ) =
1
2
KL
P(cid:107) P + Q
2
+ KL
Q(cid:107) P + Q
2
13
thonormal basis as v =(cid:80)
If there are correlations between the basis of V , these can be represented by a pos-
itive semi-definite symmetric matrix. Suppose we write this matrix in the chosen or-
−→vi ⊗ −→vj . The diagonal entries of v are probabilities over
ij pij
the basis, so we have:
(cid:88)
pii = 1
ii
The non-diagonal entries denote the correlations between the basis. The correlation
between −→vi and −→vj is the same as the correlation between −→vj and −→vi . The matrix v
given in the form above is the matrix form of a density operator in the chosen basis
{−→vi}i.
follows:
Density matrices have a notion of entropy, called von Neumann entropy, defined as
N (v) = −Tr(v ln v)
They also have a notion of KL-divergence:
N (v w) = Tr v(ln v − ln w)
The representativeness between two density matrices is defined in a similar way as for
vectors. It is a real number in the unit interval, with 0 and 1 values as described before:
RN (v, w) =
1
1 + N (PQ)
The density matrix version of the Jensen-Shannon divergence is obtained by replacing
S with N.
A vector can be represented as a diagonal density matrix on the chosen basis {−→vi}i.
In this case, entropy and von Neumann entropy are the same, since the density matrix
has no information on its non-diagonal elements, denoting a zero correlation between
the chosen basis.
Distributional Inclusion Hypothesis for Vectors and Density
Matrices
According to the distributional inclusion hypothesis (DIH) if word v entails word w
then the set of contexts of v are included in the set of contexts of w. This makes sense
since it means that whenever word v is used in a context, it can be replaced with word
w, in a way such that the meaning of w subsumes the meaning of v. For example, 'cat'
entails 'animal', hence in the sentence 'A cat is drinking milk', one can replace 'cat'
with 'animal' and the meaning of the resulting sentence subsumes that of the original
sentence. On the other hand, 'cat' does not entail 'goldfish', evident from the fact that
the sentence 'A goldfish is drinking milk' is very unlikely to appear in a real corpus.
Different asymmetric measures on probability distributions have been used to model
and empirically evaluate the DIH. Entropy-based measures such as KL-divergence is
among successful such measures. Take the orthonormal basis of a distributional space
to be the context lemmas of a corpus and this measure becomes zero if there are con-
texts with zero weights in −→v that do not have zero weights in −→w . In other words,
14
RKL(−→v ,−→w ) = 0 when v does not entail w. The contrapositive of this provides a de-
gree of entailment:
−→v (cid:96) −→w ⇒ RKL(−→v ,−→w ) (cid:54)= 0
(5)
The α-skew divergence of Lee [29] and a symmetric version of it based on JS [12] are
variations on the above.
Similarly, for density matrices one can use the degree of representativeness of two
density matrices RN to check for inclusion of contexts.
v (cid:96) w ⇒ RN (v, w) (cid:54)= 0
(6)
Here contexts can be single context lemmas for the diagonal elements where the basis
are reflexive pairs (pi, pi); contexts can also be pairs of two context lemmas for the
non-diagonal elements where the basis are pairs (pi, qj) with pi (cid:54)= qj. Hence, not only
we are checking inclusion over single contexts, but also over correlated contexts. The
following example shows why this notion leads to a richer notion of entailment.
Example 1. For the sake of simplicity suppose we do not care about the frequencies
per se, but whether the bases occurred with the target word at all. So the entries are
always either 1 or 0. Consider a distributional space with basis {aquarium, pet, fish}
and two target words: 'cat' and 'goldfish' therein. Assume that we have seen 'cat' in
the context of 'fish', and also independently, in the context of 'pet'. Assume further that
we have seen the word 'goldfish' in the context of 'aquarium', and also in the contexts
of 'pet' and 'fish', but whenever it was in the context of 'pet', 'fish' was also around:
for example they always occurred in the same sentence. Hence, we have never seen
'goldfish' with 'pet' or 'fish' separately. This signifies a correlation between 'pet' and
'fish' for the target word 'goldfish'.
This correlation is not representable in the vector case and as a result, whereas 'cat'
does not normally entail 'goldfish', its vector representation does, as the set of contexts
of 'cat' is included in the set of contexts of 'goldfish':
aquarium pet fish
1
1
1
1
1
0
goldfish
cat
By moving to a matrix setting, we are able to represent this correlation and get the cor-
rect entailment relation between the two words. In this case, the basis are pairs of the
original basis elements. Abbreviating them to their first letters, the matrix representa-
tions of 'cat' and 'goldfish' become:
goldfish a p f
1 0 0
0 0 1
0 1 0
a
p
f
cat a p f
a 0 0 0
p 0 1 0
f 0 0 1
It is easy to see that in this case the inclusion between the basis vectors, which now
come in pairs, fails and as a result neither word entails the other. So we get a correct
relationship.
15
Fig. 1. Inclusion of subspaces in the 'goldfish' example.
The above are not density matrices, we make them into such by using Equation 1,
goldfish = −→a ⊗ −→a + (−→p +
as a result of which we obtain the following:
−→
f ) ⊗ (−→p +
cat = (−→p ⊗ −→p ) + (
−→
f )
−→
f ⊗ −→
f )
The explicit denotations of the basis vectors are as follows:
−→
f = (0, 0, 1)
−→a = (1, 0, 0)
−→p = (0, 1, 0)
The resulting density matrices have the following tabular form:
goldfish a p f
1 0 0
0 1 1
0 1 1
a
p
f
cat a p f
a 0 0 0
p 0 1 0
f 0 0 1
The lack of inclusion between these representations becomes apparent from Figure 1,
where it is shown that the subspaces spanned by the basis vectors of the density matrices
do not have an overlap.
Without taking correlations of the basis into account, DIH has been strengthened
from another perspective and by the realization that contexts should not be all treated
equally. Various measures were introduced to weight the contexts based on their promi-
nence, for example by taking into account their rank [47,8,27]. From the machine learn-
ing side, classifiers have been trained to learn the entailment relation at the word level
[5]. All of these improvements are applicable to the above density matrix setting.
petfishaquariumpetfishaquarium(b) goldfish(a) catpetfishaquarium(c) orthogonality of subspaces16
Categorical Compositional Distributional Entailment
The distributional co-occurrence hypothesis does not naturally extend from the level of
words to the level of sentences. One cannot mimic the basic insights of the setting and
say that sentences that have similar contexts have similar meanings, or that meaning of
a sentence can be derived from the meanings of the words or sentences around it. The
same fact holds about the distributional inclusion hypothesis and entailment, which does
not naturally extend from words to phrases/sentences. One cannot say that a sentence
s1 entails a sentence s2 when the contexts of s1 are included in the contexts of s2. In
the same lines, one cannot say that two sentences entail each other if their meanings
subsume each other. In this case, and similar to the case of co-occurrence distributions
and similarity, entailment should be computed compositionally.
In this section, we define a compositional distributional notion of entailment based
on the (vector and density matrix) representations of the words therein, the entailment
relations between them, and the grammatical structures of the sentences. This notion is
similar to the entailment-as-monotonicity notion of entailment in Natural Logic, which
is based on an upward/downward monotonicity relationship between the meanings of
words [31]. Whereas in Natural Logic grammatical structures of sentences are treated
on a case by case phrase-structure basis, in our setting the strongly monoidal F functor
works in a modular and uniform fashion.
Given a CCDS, in either of its vectors or density matrices instantiations, we define
a compositional notion of entailment, as follows:
Definition 1. Categorical compositional distributional entailment (CCDE). For two strings
v1v2 ··· vn and w1w2 ··· wk, and X either KL or N, we have v1v2 ··· vn (cid:96) w1w2 ··· wk
whenever RX ([[v1 ··· vn]], [[w1 ··· wk]]) (cid:54)= 0.
We show that this entailment can be made compositional for phrases and sentences
that have the same number of words and the same grammatical structure and wherein
the words entail each other point-wisely. We make this precise below.
Theorem 1. For all i, 1 ≤ i ≤ n and vi, wi words, we have
vi (cid:96) wi ⇒ v1v2 ··· vn (cid:96) w1w2 ··· wn
whenever the v1v2 ··· vn and w1w2 ··· wn have the same grammatical structure.
Proof. Consider the case of density matrices. By Eq. 6 and CCDE, it suffices to show:
∀vi, wi RN (vi, wi) (cid:54)= 0 =⇒ RN ( (cid:92)v1 ··· vn, (cid:92)w1 ··· wn) (cid:54)= 0
(7)
By definition, R(vi, wi) (cid:54)= 0 is equivalent to the existence of ri ∈ R and a positive
operator v(cid:48)
i. Thus to prove the implication in 7 one can
equivalently prove that there exist ri, q ∈ R and positive operators v(cid:48)
i such that wi = ri vi + v(cid:48)
i, π(cid:48) such that:
∀vi, wi
wi = ri vi + v(cid:48)
i =⇒ (cid:92)w1 ··· wn = q · (cid:92)v1 ··· vn + π(cid:48)
According to the principle of lexical substitution with density matrices (Eq. 4) we have:
(cid:92)v1 ··· vn := F (α)( v1 ⊗ ··· ⊗ vn) + π(cid:48) (cid:92)w1 ··· wn := F (β)( w1 ⊗ ··· ⊗ wn)
17
for α the grammatical structure of (cid:92)v1 ··· vn and β the grammatical structure of (cid:92)w1 ··· wn.
Thus what we want to prove becomes equivalent to the following:
∀vi, wi
i =⇒ F (β)( w1 ⊗ ··· ⊗ wn) = qF (α)( v1 ⊗ ··· ⊗ vn) + π(cid:48)
In order to prove the above, we assume the antecedent and prove the consequence. That
is, we assume that for all vi and wi there exist real numbers ri ∈ R and positive opera-
tors v(cid:48)
i and prove the consequence. To prove the consequence,
we proceed as follow. Start from the assumption, that is for all 1 ≤ i ≤ n we have
i, such that wi = ri vi + v(cid:48)
wi = ri vi + v(cid:48)
This is equivalent to:
equivalent to:
equivalent to:
vi (cid:96) wi
v1 (cid:96) w1,··· , vn (cid:96) wn
RN (v1, w1) (cid:54)= 0,··· , RN (vn, wn) (cid:54)= 0
w1 = r1 vi + v(cid:48)
1,··· , wn = rnvn + v(cid:48)
n
for ri and v(cid:48)
i as defined previously. Using this, for the tensor of w1 to wn we obtain:
w1 ⊗ ··· ⊗ wn = (r1 vi + v(cid:48)
1) ⊗ ··· ⊗ (rnvn + v(cid:48)
n)
which by bilinearity of tensor is equivalent to:
r1 ··· rn( v1 ⊗ ··· ⊗ vn) + Π
1 ⊗ v2 ⊗ ··· ⊗ vn) + (r2v1 ⊗ v(cid:48)
where Π is an expression of the following form:
2 ⊗ ··· ⊗ v(cid:48)
(r1 v(cid:48)
Since the vi's are density matrices (hence positive), the v(cid:48)
i's are positive operators, and
summation and taking tensors preserves positivity, Π is also a positive operator. Recall
that (cid:92)v1 ··· vn and (cid:92)w1 ··· wn had the same grammatical structures, hence we have that
F (α) = F (β). Denote this same structure with f. We have:
n) + ··· + (rnv1 ⊗ v2 ⊗ ··· ⊗ v(cid:48)
n)
f ( w1 ⊗ ··· ⊗ wn) = f (r1 ··· rn( v1 ⊗ ··· ⊗ vn) + Π)
Since f is a completely positive map, it is also linear, thus we have:
f (r1 ··· rn( v1 ⊗ ··· ⊗ vn) + Π) = r1 ··· rnf ( v1 ⊗ ··· ⊗ vn) + f (Π)
Since f is completely positive f (Π) is also positive. So we have shown:
qF (α)( v1 ⊗ ··· ⊗ vn) + π(cid:48)
for q = r1 ··· rn and π(cid:48) := f (Π).
18
−→
v(cid:48)
−→
v(cid:48)
−→v i +
i such that −→w i = ri
The proof for the case of vectors follows the same steps and it is simpler. In this case,
−→v i (cid:96) −→w i is equivalent to RKL(−→v i,−→w i) (cid:54)= 0, which is equivalent to the existence
of ri ∈ R and another vector
i. Thus we drop the
requirement about the existence of positive operators and wherever it is used in the
above, replace it with just a vector. In this case, the fact that f is a linear map, i.e.
a morphism in FVectR rather than CPM(FVectR), would suffice to get the required
result. End of proof. (cid:3)
The above proposition means if w1 represents v1 and w2 represents v2 and so on
until wn and vn, then the string w1w2 ··· wn represents the string v1v2 ··· vn composi-
tionally, from meanings of phrases/sentences. That is, the degree of representativeness
of words -- either based on KL-divergence or von Neumann entropy -- extends to the
degree of representativeness of phrases and sentences.
Working with Real Data
The purpose of this section is twofold. First, we elaborate on the motivation of the
'goldfish-cat' example (i.e. Example 1) of Section 1 and present five other cases of
word pairs and their co-occurrence counts from real data. Here our goal is to show that
the correlation between the basis words, i.e. words corresponding to basis vectors, helps
avoid unwanted entailments. Then, we present a linguistic application of the proposed
vector and density matrix models in a small-scale phrase/sentence entailment task based
on data collected from a text corpus.
Correlation of Basis Words
Our goal in this section is to ground the 'goldfish-cat' example of Section 1 in real data.
That is, we find pairs of words that would wrongly entail each other in the vector view
of the distributional hypothesis. Then, we find basis words for these words in a way that
these basis words correlate with each other. Finally, we show that the corresponding
density matrix representations of the words do not entail each other, or do so to a much
lesser degree than the vector case. We chose the word pairs, the basis words, and the
co-occurrence counts from real data.
In the first part of the experiment we are verifying two things. First is that whether
data reflects the fact that whenever the first word in the pair occurred in the context of
one of the basis words, was the other basis word also present in the context window or
not. Second, we want to show that the second word of the pair did occur with one of
the basis words without the other one being around. The word pairs and their correlated
basis vectors are as follows:
word pair
base 1
(evidence, cigarette) smoking
base 2
gun
crossing
owl
fish
gun
pool
zebra
night
pet
toy
(car, animal)
(bird, dancing)
(goldfish, cat)
(BB, rifle)
(chlorine, fish)
swimming
19
In order to ensure a correlation between the basis words, we chose these in a way to
form two-word non-compositional compound nouns, a list of some of which is provided
in [38]. After choosing the basis words, we pick some target words. These word pairs
were chosen such that one of the words in the pair would be related to the meaning
of the compound as a whole and the other word of the pair would be related to the
meaning of only one of the words in the compound. For instance, in the first word pair,
the word 'evidence' is related to the meaning of the full compound, 'smoking gun',
whereas the word "cigarette' is related only to one of the nouns in the compound, in this
case to 'smoking'. Similarly, in the second pair, 'car' is related to 'zebra crossing' and
'animal' just to 'zebra'. By means of example, what we aim to verify is that whenever
'evidence' occurred in the same context with 'smoking', 'gun' was also around, but it
was also the case that 'cigarette' was present close to 'smoking' without 'gun' being
around. Similarly for the other case, we want to verify that whenever 'car' occurred in
the same context with 'zebra', the word 'crossing' was around, but 'animal' did occur
with 'zebra' without 'crossing' being around.
We collected co-occurrence counts for the pairs and the basis words. In all the ex-
ample word pairs, the vectors of the words have non-zero weights on both of the basis
words, leading to inclusions of their contexts, indicating a wrong entailment relation
between the two words of the pair. As an example, for the (evidence, cigarette) and
(car, animal) pairs, the vector representations are as follows:
smoking
gun
evidence
cigarette
1390
4429
468
121
zebra
81
animal 389
car
crossing
332
44
The matrix versions of these words were indeed more indicative of the lack of an
entailment relation within the pair. In this case, one of the words had a small number on
its off diagonal entries and the other word had a larger number there. For example, the
matrix representations of the words of the (evidence, cigarette) word pair are as follows:
evidence smoking
smoking
1390
67
gun
gun
67
468
cigarette smoking
smoking
4429
gun
0
gun
0
121
The off diagonal counts are the counts for the basis pair (smoking,gun), i.e. 'evidence'
was close to both 'gun' and 'smoking' for 67 times, whereas the cases where 'cigarette'
was close to both 'smoking' and 'gun' was 0. This pattern is similar for the (car, animal)
pair, but with less extreme non-zero off diagonal weights:
zebra
car
zebra
81
crossing 11
crossing
11
332
animal zebra
389
zebra
crossing
1
crossing
1
44
In this case, 'car' was close to both 'zebra' and 'crossing' for 11 times, whereas this
number for 'animal' was only 1. We observed a similar pattern for the other word pairs.
In order to compare them, we normalised the off diagonal weights by dividing them by
20
their sum and obtained a number between 0 and 1 for all the cases. These numbers are
presented in the table below in decreasing order:
word pair
(evidence, cigarette)
(car, animal)
(bird, dancing)
(goldfish, cat)
(BB, rifle)
(chlorine, fish)
off diagonal
word 1
1.00
0.91
0.85
0.71
0.69
0.56
off diagonal
word 2
0.00
0.09
0.15
0.29
0.31
0.44
In all the cases, the off diagonal ratios are more than 50% apart from each other, which
indicates a less than 50% overlap in their density matrix subspaces. Although real data is
noisy, we do have a perfect separation: in the (evidence, cigarette) case, the off diagonal
ratios are 100% apart. This number decreases to about 90% for (car,animal), to 85% for
(bird, dancing) and to 0.71% for (goldfish, cat). The ratio of the last two word pairs is
lower than the rest, but still above 50%. This is because the compounds from which
we derived the basis words for these pairs are not as non-compositional as the other
compounds. In other words, the word 'pool' occurs many times on its own when it
means 'swimming pool' and the word 'toy' is often dropped from the compound 'toy
gun' when talking about BB.
Here, we have only considered and provided data for modelling correlations be-
tween pairs of basis. This can in theory be extended to correlations between n-tuples of
basis, for any n ≥ 3. In order to do so, one has to apply the CPM construction n times,
resulting in semantic categories CPM(CPM(··· (CPM)))
(FVectR) and work with
higher order density operators that embed in the extended spaces. Providing real data
for these general settings can be difficult due to sparsity problems, as one has to gather
information about co-occurrences of n + 1 words at the same time (the target word and
the n-tuples of basis). A possible solution to this problem is to take the limit of these
co-occurrences as n grows and only work until n's that allow for gathering reasonable
quantities of co-occurrence data. Choosing the number to which n tends to is related to
the existence of n-word non-compositional compounds in language. In principle, this
number can grow arbitrarily large, as for any n-word such compound, one is able to
create a larger one with n + 1 words. In practice, however, text corpora contain data for
n's that are small (usually not greater than 2 or 3).
(cid:124)
(cid:123)(cid:122)
n
(cid:125)
Toy Entailment Application
Dataset. In order to create our dataset, we first randomly selected 300 verbs from the
most frequent 5000 words in the British National Corpus,1 and randomly picked either
a hyponym or a hyponym from WordNet, provided that these also occurred more than
1 BNC is a 100 million word collection (around 2 million sentences) of samples of writ-
ten and spoken language from a wide range of sources, available at http://www.
natcorp.ox.ac.uk/
21
500 times in the BNC. Next, each entailing verb was paired with one of its subject
or object nouns, which had again occurred more than 500 times. The corresponding
entailed verb was paired with an appropriate hypernym of this noun chosen from the set
described above. Recall that one has the following entailment between the hyponyms
and the hypernyms:
hyponym (cid:96) hypernym
This procedure created 300 phrase/sentence entailments of the form
(cid:96)
entry 2
entry 1
subject1 verb1 (cid:96) subject2 verb2
verb1 object1 (cid:96) verb2 object2.
Many of these 300 pairs did not reflect an easily recognisable entailment. As our
goal was to collect human judgements for the degrees of entailments, we had to have
pairs in which the entailment or lack thereof was obvious for humans. Thus, from these
300 entries, we selected 23 pairs to reflect three ranges of entailment degrees, classified
as follows:
1. Both the subjects (or objects) and the verbs entail each other respectively, that is:
subject1 (cid:96) subject2
object1 (cid:96) object2
and
and
verb1 (cid:96) verb2
verb1 (cid:96) verb2
2. Either the subjects (or objects) entail each other or the verbs do, that is
subject1 (cid:96) subject2
object1 (cid:96) object2
or
or
verb1 (cid:96) verb2
verb1 (cid:96) verb2
3. Neither the subjects (or objects) nor the verbs entail each other (or at least they did
not do so in a clear way), that is
subject1 (cid:48) subject2
object1 (cid:48) object2
and
and
verb1 (cid:48) verb2
verb1 (cid:48) verb2
Whereas the pairs created by the above procedure cover entailments between short
two-word phrases and sentences, we were also interested in providing results for full
transitive sentences. In order to do that, we used the 23 pairs to form subject-verb-object
entailments by following the procedure below:
-- pairing the subject of an intransitive sentence and its hypernym with a verb phrase
and its hypernym, for example 'people' in 'people strike' was paired with 'group'
in 'group attacks' and 'clarify rule' was paired with 'explain process',
-- pairing the object of a verb phrase and its hypernym with an intransitive sentence
and its hypernym, for example 'task' in 'arrange task' was paired with 'work' in
'organise work' and 'notice advertise' was paired with 'sign announce'.
22
Similar to the intransitive sentence and verb phrase case, we went through the re-
sulting sentences and chose 12 of them that had either easily recognisable entailments
for humans or were obviously not entailing each other, again relative to the human eye.
These reflected three ranges of entailment degrees classified as follows:
1. Both the subjects (or objects) and the verb phrases (or the intransitive sentences)
entailed each other, that is:
subject1 (cid:96) subject2
object1 (cid:96) object2
and
and
verb phrase1 (cid:96) verb phrase2
intr. sentence1 (cid:96) intr. sentence2
2. Either the subjects (or objects) or the verb phrases (or the intransitive sentences)
3. Neither the subjects (or objects) nor the verb phrases (or the intransitive sentences)
entailed each other, that is:
subject1 (cid:96) subject2
object1 (cid:96) object2
entailed each other, that is:
subject1 (cid:48) subject2
object1 (cid:48) object2
or
or
verb phrase1 (cid:96) verb phrase2
intr. sentence1 (cid:96) intr. sentence2
and
and
verb phrase1 (cid:48) verb phrase2
intr. sentence1 (cid:48) intr. sentence2
The degree of entailment between the produced phrases and sentences were evalu-
ated by 16 annotators. These were either logic or computational linguistics profession-
als. They provided their scores in a scale from 1 (no entailment) to 7 (full entailment).
The 1-7 scale was chosen following common practice in the empirical computational
linguistics literature, for example see [34]. Each entailment was scored by the average
across all annotators. The human judgements agreed with the three classes of entail-
ments, described above. That is, we had three clear bands of judgements:
1. The entries in which both subjects/objects and verbs/verb phrases/intransitive sen-
tences entailed each other, got an average annotation above 4. For example we had:
Entry
intr. sentence
verb phrase
trans. sentence
entry 1 (cid:96) entry 2
people strike (cid:96) group attacks
notice advertises (cid:96) sign announces
clarify rule (cid:96) explain process
recommend development (cid:96) suggest improvement
people clarify rule (cid:96) group explain process
office arrange task (cid:96) staff organize work
Avg. judgement
4.313
5.375
5.000
5.375
5.000
5.500
2. The entries in which either only subjects/objects entailed each other or only verbs/verb
phrases/intransitive sentences did, got an average annotation between 1 and 4. For
example:
Entry
intr. sentence
verb phrase
trans. sentence
entry 1 (cid:96) entry 2
corporation appoints (cid:96) firm founds
boy recognizes (cid:96) man remembers
confidence restores (cid:96) friendship renews
corporation appoint people (cid:96) firm found group
people read letter (cid:96) corporation anticipate document
23
Avg. judg.
3.313
2.938
2.625
2.937
2.062
In the first case, 'corporation' clearly entails 'firm', but the entailment relationship
between 'appoints' and 'founds' is unclear. In the second case, clearly 'boy' en-
tails 'man', but it is not so obvious if 'recognise' entails 'remember'. In the third
case, again 'restores' clearly entails 'renews', but the relationship between 'con-
fidence' and 'friendship' is less evident. In the fourth case, 'corporation' clearly
entails 'firm', but the relationship between 'appoint people' and 'found group' is
not very obvious.
3. The entries which were non-entailing, i.e. it was not clear if we had an entailment
relationship between the subjects/objects and it was not clear if we had an en-
tailment relationship between the verbs/verb phrases/intransitive sentences, got an
average annotation below 2. For example:
Entry
intr. sentence
verb phrase
trans. sentence
entry 1 (cid:96) entry 2
editor threatens (cid:96) application predicts,
progress reduces (cid:96) development replaces
confirm number (cid:96) approve performance
man recall time (cid:96) firm cancel term
editor threatens man (cid:96) application predicts number
Avg. judgement
1.125
1.225
1.813
1.125
1.625
Consider for example the fourth entry: it is clear that neither 'editor' entails 'appli-
cation', nor 'threatens man' entails 'predicts number'. Similarly, in the third entry,
'confirm' does not entail 'approve' and 'number' does not entail 'performance'.
Also similarly in the first case, it is clear that 'editor' does not entail 'application'
and neither does 'threatens' entail 'predicts'.
Basic vector space. The distributional space where the vectors of the words live is
a 300-dimensional space produced by non-negative matrix factorization (NMF). The
original vectors were 2,000-dimensional vectors weighted by local mutual information
(LMI), for which the contexts counts had been collected from a 5-word window around
each target word. The vectors were trained on the concatenation of ukWaC and Wack-
ypedia corpora.2
Entailment via KL-divergence in FVectR. For degrees of entailment obtained via
KL-divergence, we work on the instantiation of CCDS to FVectR for the three types of
phrases/sentences in our dataset:
1. verb phrases, which we will refer to by "verb noun",
2. intransitive sentences, which we will refer to by "noun verb",
2 Around 132 million sentences of English text, available at http://wacky.sslmit.
unibo.it/doku.php?id=corpora/
24
3. transitive sentences, which we will refer to by "noun verb noun(cid:48)".
The vector representations of these are obtained by applying Equation 2, which result
in the following expressions:
−−−−−−→
verb noun := F (α)(−→v ⊗ −→n ) = (1S ⊗ N )(−→v ⊗ −→n )
−−−−−−→
noun verb := F (α)(−→n ⊗ −→v ) = (N ⊗ 1S)(−→n ⊗ −→v )
(8)
(9)
−−−−−−−−−−→
noun verb noun(cid:48) := F (α)(−→n ⊗ −→v ⊗ −→
The first two of the above items simplify to the matrix multiplications between the
matrix of the verb and the vector of the noun, as follows, for −→n T the transpose of the
vector of the noun:
n(cid:48) ) = (N ⊗ 1S ⊗ N )(−→n ⊗ −→v ⊗ −→
n(cid:48) )
(10)
−→v × −→n
−→n T × −→v
(11)
(12)
The vector representation of a "noun verb noun(cid:48)'" sentence simplifies to the tensor
contraction between the cube of the verb and the vector of noun(cid:48), and then the matrix
multiplication between the matrix of the result and the vector of the noun, as follows:
−→n T × −→v × −→
n(cid:48)
(13)
For details of these computations, we refer the reader to our previous work [10,15,25],
where these and other forms of sentences have been worked out for a variety of different
nouns and verbs, as well as adjectives (for sentences with adjectival modifiers).
Matrices and Cubes of Verbs. Vectors of nouns −→n are created using the usual dis-
tributional method. For producing the verb matrices for verbs taking a single argument
(either at the subject or the object position), we work with a variation of the method
suggested in [15], referred to by relational. Specifically, we define the verb matrix as
follows:
−→v matrix = −→v (cid:12)(cid:88)
(−→n i ⊗ −→n i)
i
(14)
In the above, −→ni enumerates all the nouns that the verb has modified across the cor-
pus in various phrases and sentences. −→v is the distributional vector of the verb, built
in the same way as the noun vectors. The original relational method computed the ma-
trix of the verb by encoding in it the information about the noun arguments of the verb
across the corpus, the same as we do above. The above formulation enriches this encod-
ing, via the use of the point-wise multiplication operation (cid:12), by also taking into account
the distributional vector of the verb −→v , hence encoding directly information about the
distributions of the verb. Substituting this in the matrix multiplication of the expression
in Eq. 11 and simplifying it, provides us with the following vector representation for
"verb-noun" and "noun-verb" expressions:
−−−−−−→
verb noun = −→v (cid:12)(cid:88)
−−−−−−→
noun verb =
(cid:104)−→n −→n i(cid:105)−→n i
(15)
i
25
Roughly speaking, the above says that the vector meaning of any such phrase/sentence
represents the contextual properties of the verb of the phrase together with the common
contextual properties of the nouns of the phrase/sentence and the nouns that the verb
has modified across the corpus.
In order to represent the meaning of transitive verbs, the matrices of Equation 14
are embedded into cubes Cijk by copying either their i'th or their j'th dimension into
the extra k'th dimension of the cube. Thus obtaining the following two cubes:
Ciij
and
Cijj
This operation is formally referred to as a Frobenius algebra copying operation and
is extensively discussed and applied in previous work, e.g. [25,22,36,23,33,21]. The
first embedding (providing us with the cube Ciij) is referred to as copy subject and
the second one (providing us with the cube Cijj) as copy object. The sentence vectors
produced by the two methods when we substitute such cubes in Equation 13 take the
following form:
Copy Subject: (−→v matrix × −→n object) (cid:12) −→n subject
Copy Object: (−→v matrix × −→n subject) (cid:12) −→n object
(16)
(17)
where −→n subject, −→n object are the distributional vectors for the subject and the object of
the transitive sentence, and −→v matrix the matrix of the verb, in our case created as in
Eq. 14.
Since each one of the above embeddings puts emphasis on a different argument of
the transitive verb, it is reasonable for one to represent the meaning of the transitive
sentence by further combining both of them into a single representation, for example as
below:
−→v CopySubject + −→v CopyObject
−→v CopySubject (cid:12) −→v CopyObject
(18)
Entailment via relative entropy in CPM(FVectR). In the case of degrees of entail-
ment using relative entropy, we work with the instantiation of CCDS to CPM(FVectR),
where Equation 2 results in a density matrix, computed as follows for a "verb noun"
phrase, a "noun verb" and a "noun verb noun(cid:48)" sentence, respectively:
noun verb noun(cid:48) := F (α)(n ⊗ v ⊗ n(cid:48)) = (N ⊗ 1S ⊗ N )(n ⊗ v ⊗ n(cid:48))
verb noun := F (α)(v ⊗ n) = (1S ⊗ N )(v ⊗ n)
noun verb := F (α)(n ⊗ v) = (N ⊗ 1S)(n ⊗ v)
(19)
(20)
(21)
where v, n and n(cid:48) are the density matrices of the verb and the nouns, respectively, and
⊗ is the tensor product in CPM(FVectR). These simplify to the following formulae:
(22)
(23)
(24)
TrN (v ◦ (n ⊗ 1S))
TrN ((n ⊗ 1S) ◦ v)
TrN,N (v ◦ (n ⊗ 1S ⊗ n(cid:48)))
26
For details of the computations and examples with different nouns and verbs and sen-
tence forms, see Piedeleu et al. [36] and Kartsaklis [22].
The above formulae and equations of density matrices for words, phrases and sen-
tences are theoretical. In what follows, we implement two concrete ways of creating
density matrices, one directly based on the correlations between the bases and another
by algebraically operating on the vectors.
Density matrices by direct correlation. We describe a generic process for creat-
ing density matrices based on correlations between the basis vectors, similar to those
demonstrated in the 'goldfish' example of Section 1 and depicted graphically in Fig-
ure 1. Co-occurrence counts are collected for a target word w and every pair of words
(wi, wj) (not necessarily in sequence) that occur in the same context with wt. By using
these statistics and treating the pairs of words as a single basis, one can build an upper-
or lower-triangular matrix, let us denote it by M. Since the statistics were correlated re-
gardless of the order of the words wi and wj, we can expand M to a symmetric matrix.
This is a routine procedure and is done by copying the upper or the lower triangle into
the other half of the matrix. Formally speaking, we have:
Mij = Mji
In order for the matrices to be density matrices, they have to be positive semi-
definite. This can be enforced in different ways, one of which is by turning M to a
row diagonally dominant matrix. This is a matrix for every i-th row of which we have:
Mii ≥(cid:88)
i(cid:54)=j
Mij
That is, in all of the rows of this matrix, the magnitude of the diagonal entry is greater
than or equal to the sum of the magnitudes of the non-diagonal entries. In our case,
since the non-diagonal entries are counts, they are positive, and thus the entries and
their magnitudes are equal. We then normalise this matrix by its trace and obtain a
density matrix.
Density matrices from distributional vectors. In contrast with the previous section,
the construction we present here follows directly the quantum-mechanical intuition ex-
pressed in Equation 1 that a density matrix is a probability distribution over a set of
vectors. For a target word w, we define this set {−→ci}i to consist of vectorial representa-
tions of the various contexts in which w occurs: for example, −→ci can be the average of
the distributional vectors for all other words in the same sentence with w. In symbols,
the density matrix corresponding to a word w is defined as follows:
(cid:88)
w =
−→ci ⊗ −→ci
pi
(25)
where i iterates through all contexts of word w.
i
27
Density matrices for transitive verbs. The Frobenius embeddings (briefly discussed
for the case of standard verb matrices above) can be also applied on the density matrix
formulation, producing the following representations for transitive sentences:
Copy Subject: subj (cid:12) TrN,N (v ◦ (1N ⊗ obj))
Copy Object: TrN,N (v ◦ ( subj ⊗ 1N )) (cid:12) obj
(26)
(27)
subj, and obj are density matrices created using one of the two methods (by
where v,
direct correlation or from distributional vectors) presented above. Note that merging the
two representations into one as in Equation 18 is also possible, since both element-wise
addition and element-wise multiplication of two density matrices preserve the underly-
ing structure.
From word to phrase and sentence density matrices. Substituting a word density
matrix in Equations 22 to 24 and simplifying, results in the following density matrix
representations for each phrase/sentence:
noun verb =
verb noun = vT × n × v
noun verb noun(cid:48) = vT × (n ⊗ n(cid:48)) × v
(28)
(29)
Again, the formulation is the same for a "verb noun" and a "noun verb" phrase. In
simple terms, the above result in density matrices that take into account the contextual
properties of the verb, the contextual properties of the nouns of the phrase/sentence, and
those of the nouns that the verb has modified across the corpus, with the added value
that these properties now reflect correlations between the various contexts through the
use of density matrices.
Entailment for simple vector composition. Finally, as a comparison, we also work
with degrees of entailment obtained by computing KL-divergence on a simple compo-
sitional model achieved via element-wise addition and element-wise multiplication of
the vectors of the words in the phrase:
−−−−−−→
−−−−−−→
verb noun+ = −→v + −→n
noun verb+ =
−→
n(cid:48)
−−−−−−−−−−→
noun verb noun(cid:48)
−→
n(cid:48) denote the distributional vectors of the verb and the nouns, respec-
−−−−−−→
−−−−−−→
verb noun(cid:12) = −→v (cid:12) −→n
noun verb(cid:12) =
−−−−−−−−−−→
noun verb noun(cid:48)(cid:12) = −→n (cid:12) −→v (cid:12) −→
n(cid:48)
+ = −→n + −→v +
where −→v and −→n ,
tively.
The experiment proceeds as follows: We firstly produce phrase/sentence vectors
and density matrices by composing the vectors or the density matrices of the individual
words in each phrase, and then we compute an entailment value for each pair of phrases;
in the case of vectors, this value is given by the representativeness on the KL-divergence
between the phrase vectors, while for the density matrix case it is the representativeness
on the von Neumann entropy between the density matrices of the phrases/sentences.
The performance of each model is expressed as the Spearman's correlation of the model
predictions with the human judgements.
28
The results for the verb phrase/intransitive sentence entailment are presented in Ta-
ble 1. A non-compositional baseline is also included: we computed RKL for the lexical
vectors of the heads of the sentences, that is their verbs. The upper bound is the inter-
annotator agreement.
Model
Baseline (vector of verb)
Categorical
ρ
Inf F1 Acc
0.24 0.37 0.57 0.74
0.66 0.56 0.74 0.78
RKL (vectors)
RN (density matrices by direct correlation) 0.42 0.67 0.80 0.87
RN (density matrices from vectors)
0.48 0.60 0.76 0.78
Simple
KL (e.w. addition)
R+
(cid:12)
KL (e.w. multiplication)
R
Upper bound
0.52 0.52 0.71 0.78
0.41 0.32 0.64 0.61
0.66
Table 1. Results for the verb phrase/intransitive sentence entailment experiment.
We also present informedness, F1-score and accuracy for a binarised variation of the
task, in which a phrase/sentence pair is classified as "entailment" or "non-entailment"
depending on whether its average human score was above or below the mean of the
annotation range. Informedness is an information-theoretic measure that takes into ac-
count the true negatives count (something that is not the case for F1-score, for exam-
ple) and thus it is more appropriate for small and relatively balanced datasets such as
ours. The numbers we present for the binary task are based on selecting an appropriate
threshold for each model, above of which entailment scores are classified as positive.
This threshold was selected in order to optimize informedness.
The results show that all the compositional models (for both vectors and density
matrices) outperformed the non-compositional baseline. In the correlation task, the
categorical vector model RKL was better, achieving a score that matches the inter-
annotator agreement; in the classification task, the categorical density matrix models
RN are ahead in every measure. From the two density models we implemented, the
one based on distributional vectors (Equation 1) has a better degree of correlation with
human judgements, but the one that directly reflects basis correlation presents the best
binary performance, with accuracy 0.87 and informedness 0.67.
A snapshot of the results including the highest and lowest pairs according to human
judgements are shown in Table 2. We see that although each model returns values in a
slightly different range, all of them follow to some extent the general pattern of human
annotations. From all three models, the predictions of the model based on element-wise
multiplication of vectors are quite marginal. The categorical models and addition of
vectors return more balanced results, without avoiding small mistakes.
Table 3 presents the results for a transitive entailment experiment, based on the 12
subject-verb-object entailments created as described earlier in this section. We have not
a similar table to Table 2 for transitive cases, since we have many more models for the
Humans
Entailment
arrange task (cid:96) organize work
5.50 (0.785) - T
recommend development (cid:96) suggest improvement 5.38 (0.768) - T
advertise notice (cid:96) announce sign
5.38 (0.768) - T
confirm number (cid:96) approve performance
1.81 (0.258) - F
recall time (cid:96) cancel term
1.63 (0.232) - F
editor threathen (cid:96) application predict
1.13 (0.161) - F
Categorical
RKL(0.12) RN (0.17) R+
0.164 - T
0.146 - T
0.114 - F
0.111 - F
0.070 - F
0.082 - F
0.371 - T
0.250 - T
0.187 - T
0.140 - F
0.169 - F
0.184 - T
29
Simple
(cid:12)
KL (0.13) R
KL (0.08)
0.192 - T
0.142 - T
0.084 - T
0.182 - T
0.090 - T
0.100 - F
0.084 - T
0.087 - F
0.072 - F
0.126 - F
0.092 - F
0.080 - F
Table 2. A snapshot of the phrase entailment experiment. The human judgements are
between 1 and 7, with their values normalised between 0 and 1 in brackets. The model
predictions are between 0 and 1. T and F indicate classification of each phrase pair
as entailment or non-entailment according to each model. The numbers that appear in
brackets at the headers are the classification thresholds optimizing informedness for the
various models. RN refers to the density matrix model based on word vectors.
transitive case and most of these models acquired the same score (0.83/0.92) due to the
small size of the dataset. For the categorical compositional models we apply the Frobe-
nius embeddings as described earlier, and combinations of these. For the density matrix
formulation we use density matrices created from vectors, since this method showed
better correlation with human judgements for the intransitive sentence entailment task.
The results follow a pattern very similar to that of the intransitive sentence/verb phrase
entailment experiment: For the correlation task, the highest performance comes from
a categorical model using standard matrices and vectors, specifically the Frobenius ad-
ditive model (copy subject + copy model); this model presents a correlation 0.72, very
close to the inter-annotator agreement (0.75). However, the highest performance in the
classification task comes once more from density matrix models, exactly as in the pre-
vious experiment. On the other hand, this time some of the other models scored lower
than the non-compositional baseline, possibly demonstrating an amount of correlation
between sentence length and effectiveness of the model.
Conclusion and Future Directions
We reviewed the categorical compositional distributional semantic (CCDS) model, which
extends the distributional hypothesis from words to strings of words. We showed that
the model can also extend the distributional inclusion hypothesis (DIH) from words
to phrases and sentences. In this case, one is able to derive entailment results over
strings of words, from the entailments that hold between their constituent words. We
recalled how the vector-based CCDS, which normally works with the category of finite-
dimensional vector spaces and linear maps FbVectR, can be extended to include density
matrices and completely positive maps, by moving to the category CPM(FVectR). We
reviewed the existing notion of KL-divergence and its application to word level entail-
ment on vector representations of words. We then argued for and showed that moving
from vectors to density matrices strengthens the DIH.
As contributions, on the theoretical side we proved that strings of words whose
words point-wisely entail each other and where the strings have the same grammatical
30
Model
Baseline (vector of verb)
Categorical
ρ
Inf F1 Acc
0.40 0.62 0.75 0.83
0.43 0.12 0.33 0.67
RKL Copy-subject
0.42 0.62 0.75 0.83
RKL Copy-object
0.72 0.62 0.75 0.83
RKL Copy-subject + Copy-object
RKL Copy-subject (cid:12) Copy-object
0.70 0.62 0.75 0.83
0.38 0.75 0.86 0.92
RN (density matrices from vectors, Copy Subject)
RN (density matrices from vectors, Copy Object)
0.26 0.62 0.75 0.83
RN (density matrices from vectors, Copy Subject + Copy Object) 0.34 0.75 0.86 0.92
RN (density matrices from vectors, Copy Subject (cid:12) Copy Object) 0.06 0.62 0.75 0.83
Simple
KL (e.w. addition)
R+
(cid:12)
KL (e.w. multiplication)
R
Upper bound
0.68 0.62 0.75 0.83
0.14 0.38 0.57 0.75
0.75
Table 3. Results for the transitive sentence entailment experiment.
structure, admit a compositional notion of entailment. This is an extension of the result
of the conference version of this paper [13], where a similar proof was presented for
phrases and sentences which had grammatical structures that only consisted of epsilon-
maps and identities. The previous result naturally excluded the cases where Frobenius or
bialgberas are needed, e.g. for relative pronouns, as shown in [41,30], for coordination
and intonation as shown in [21,24], and for quantification, as shown in [18]. The general
version of the theorem proved in this paper is applicable to all these cases.
On the experimental side, we presented two small scale tasks, both performed on
real data. First, we presented evidence that density matrices do indeed give rise to
a richer notion of entailment at the word level. This evidence consisted of pairs of
words whose vector representations, built from real data, indicated a false entailment
between the words, but where their density matrices, also built from real data, cor-
rected the problem. Second, we built vector and density matrix representations for short
phrase/sentences, computed the KL divergence and entropy between pairs of them and
applied the results to a phrase/sentence entailment task. Our dataset consisted of pairs
of intransitive sentences, object-verb phrases, and transitive sentences. The theoretical
argument of the paper favours categorical composition over simple element-wise op-
erators between vectors, and our results were supportive of this. The density matrices
formulation worked better on the classification task. For correlation between the degrees
of entailment as predicted by the model and as judged by humans, the composition over
standard matrices and vectors performed better. For the intransitive/verb-phrase entail-
ment task, the concrete CCDS instantiations on vectors and density matrices performed
clearly above the baseline, while for the transitive sentence entailment task, some mod-
els scored lower than the baseline due to the increased complexity and the greater sen-
tence lengths. A large scale experiment to confirm these predictions constitutes work in
progress.
31
Theorem 1 showed a relationship between the CCDS meanings of words (repre-
sented by vectors or density matrices), the corresponding word-level entailments thereof,
and the grammatical structures of sentences. The proven relationship is, however, re-
strictive. It only holds for sentences that have the same grammatical structure. Study-
ing this restriction and extending the theorem to a general form is work in progress.
We aim to prove a similar relationship between sentences that do not necessarily have
the same grammatical structure, but that a possibly weaker relationship holds between
their grammatical structures. Note however that we can still compute the degree of
entailment between any two sentences in the current setting. Sentence representations
of our setting are either vectors (in the FbVectR instantiation) or density matrices (in
the CPM(FVectR) instantiation); in each case one can calculate the representativeness
of Shannon's entropy or the KL divergence between them and compare the results in a
case by case basis. What remains unproved is that under which conditions these degrees
remain nonzero, which is what is proved in Theorem 1 for a special case.
KL-divergence and quantum relative entropy give rise to an ordering on vectors
and density matrices, respectively, which represents the difference in the information
contents of the underlying words as given by vectors and density matrices. Exploring
this order and the notion of logic that may arise from it is work in progress. The work
of Widdows [48] and Preller [37] might be relevant to this task.
Acknowledgements
Sadrzadeh is supported by EPSRC CAF grant EP/J002607/1 and Kartsaklis by AFOSR
grant FA9550-14-1-0079. Balkır was supported by a Queen Mary Vice Principal schol-
arship, when contributing to this project.
References
1. Balkır, E.: Using Density Matrices in a Compositional Distributional Model of Meaning.
Master's thesis, University of Oxford (2014)
2. Balkır, E., Sadrzadeh, M., Coecke, B.: Distributional sentence entailment using density ma-
trices. In: FTP-ENTC Proceedings of the First International Conference on Theoretical Top-
ics in Computer Science (TTCS). vol. 9541, pp. 1 -- 22 (2015)
3. Bankova, D., Coecke, B., Lewis, M., Marsden, D.: Graded entailment for compositional
distributional semantics (2016), http://arxiv.org/abs/1601.04908
4. Baroni, M., Zamparelli, R.: Nouns are vectors, adjectives are matrices: Representing
adjective-noun constructions in semantic space. In: Conference on Empirical Methods in
Natural Language Processing (EMNLP-10). Cambridge, MA (2010)
5. Baroni, M., Bernardi, R., Do, N.Q., Shan, C.c.: Entailment above the word level in distri-
butional semantics. In: Proceedings of the 13th Conference of the European Chapter of the
Association for Computational Linguistics. pp. 23 -- 32. Association for Computational Lin-
guistics (2012)
6. Blacoe, W., Kashefi, E., Lapata, M.: A quantum-theoretic approach to distributional seman-
tics. In: Proceedings of the 2013 Conference of the North American Chapter of the Associa-
tion for Computational Linguistics: Human Language Technologies. pp. 847 -- 857 (2013)
7. Clark, S., Pulman, S.: Combining symbolic and distributional models of meaning. In: Pro-
ceedings of the AAAI Spring Symposium on Quantum Interaction. pp. 52 -- 55 (2007)
32
8. Clarke, D.: Context-theoretic semantics for natural language: an overview. In: Proceedings
of the workshop on geometrical models of natural language semantics. pp. 112 -- 119. Asso-
ciation for Computational Linguistics (2009)
9. Coecke, B., Paquette, E.O.: Categories for the practising physicist. Springer (2010)
10. Coecke, B., Sadrzadeh, M., Clark, S.: Mathematical foundations for a compositional distri-
butional model of meaning. Linguistic Analysis 36 (2010)
11. Dagan, I., Glickman, O., Magnini, B.: The pascal recognising textual entailment challenge.
In: Machine learning challenges. evaluating predictive uncertainty, visual object classifica-
tion, and recognising tectual entailment, pp. 177 -- 190. Springer (2006)
12. Dagan, I., Lee, L., Pereira, F.C.N.: Similarity-based models of word cooccurrence probabil-
ities. Mach. Learn. 34(1-3), 43 -- 69 (1999)
13. Esma Balkir, Dimitri Kartsaklis, M.S.: Sentence entailment in compositional distributional
semantics. In: Fourteenth International Symposium on Artificial Intelligence and Mathemat-
ics (2016), http://arxiv.org/abs/1512.04419
14. Firth, J.R.: A Synopsis of Linguistic Theory, 1930-1955. Studies in Linguistic Analysis pp.
1 -- 32 (1957)
15. Grefenstette, E., Sadrzadeh, M.: Experimental support for a categorical compositional dis-
tributional model of meaning. In: Proceedings of the Conference on Empirical Methods in
Natural Language Processing. pp. 1394 -- 1404. Association for Computational Linguistics
(2011)
16. Grefenstette, E., Sadrzadeh, M.: Concrete models and empirical evaluations for the categor-
ical compositional distributional model of meaning. Computational Linguistics 41, 71 -- 118
(2015)
17. Harris, Z.: Distributional structure. Word (1954)
18. Hedges, J., Sadrzadeh, M.: A generalised quantifier theory of natural language in categorical
compositional distributional semantics with bialgebras. In: EPTCS Proceedings of the 13th
International Conference on Quantum Physics and Logic, to appear (June 2016)
19. Herbelot, A., Ganesalingam, M.: Measuring semantic content in distributional vectors. In:
Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics.
vol. 2, pp. 440 -- 445. Association for Computational Linguistics (2013)
20. Kalchbrenner, N., Grefenstette, E., Blunsom, P.: A convolutional neural network for mod-
elling sentences. In: Proceedings of the 52nd Annual Meeting of the Association for Com-
putational Linguistics (Volume 1: Long Papers). pp. 655 -- 665. Association for Computational
Linguistics (2014)
21. Kartsaklis, D.: Coordination in categorical compositional distributional semantics. In:
EPTCS Proceedings of the Workshop on Semantic Spaces at the Intersection of NLP, Physics
and Cognitive Science, to appear (June 2016)
22. Kartsaklis, D.: Compositional Distributional Semantics with Compact Closed Categories and
Frobenius Algebras. Ph.D. thesis, University of Oxford (2015)
23. Kartsaklis, D., Sadrzadeh, M.: Prior disambiguation of word tensors for constructing sen-
tence vectors. In: Proceedings of the 2013 Conference on Empirical Methods in Natural
Language Processing (EMNL). pp. 1590 -- 1601 (2013)
24. Kartsaklis, D., Sadrzadeh, M.: A Frobenius model of information structure in categorical
compositional distributional semantics. In: Proceedings of the 14th Meeting on Mathematics
of Language (2015)
25. Kartsaklis, D., Sadrzadeh, M., Pulman, S.: A unified sentence space for categorical
distributional-compositional semantics: Theory and experiments. In: COLING 2012, 24th
International Conference on Computational Linguistics, Proceedings of the Conference:
Posters, 8-15 December 2012, Mumbai, India. pp. 549 -- 558 (2012)
33
26. Kelly, G., Laplaza, M.: Coherence for compact closed categories. Journal of Pure and
Applied Algebra 19(0), 193 -- 213 (1980), http://www.sciencedirect.com/
science/article/pii/0022404980901012
27. Kotlerman, L., Dagan, I., Szpektor, I., Zhitomirsky-Geffet, M.: Directional distributional
similarity for lexical inference. Natural Language Engineering 16(04), 359 -- 389 (2010)
28. Lambek, J.: Type grammars as pregroups. Grammars 4(1), 21 -- 39 (2001)
29. Lee, L.: Measures of distributional similarity. In: Proceedings of the 37th Annual Meeting
of the Association for Computational Linguistics on Computational Linguistics. pp. 25 -- 32
(1999)
30. M. Sadrzadeh, S. Clark, C.C.: Frobenius anatomy of word meanings 2: possessive relative
pronouns. Journal of Logic and Computation 26, 785 -- 815 (2016)
31. MacCartney, B., Manning, C.D.: Natural logic for textual inference. In: ACL Workshop on
Textual Entailment and Paraphrasing. Association for Computational Linguistics (2007)
32. MacLane, S.: Categories for the Working Mathematician. Springer (1971)
33. Milajevs, D., Kartsaklis, D., Sadrzadeh, M., Purver, M.: Evaluating neural word representa-
tions in tensor-based compositional settings. In: Proceedings of the 2014 Conference on Em-
pirical Methods in Natural Language Processing (EMNLP). pp. 708 -- 719. Association for
Computational Linguistics, Doha, Qatar (October 2014), http://www.aclweb.org/
anthology/D14-1079
34. Mitchell, J., Lapata, M.: Composition in distributional models of semantics. Cognitive Sci-
ence 34(8), 1388 -- 1439 (2010)
35. Piedeleu, R.: Ambiguity in Categorical Models of Meaning. Master's thesis, University of
Oxford (2014)
36. Piedeleu, R., Kartsaklis, D., Coecke, B., Sadrzadeh, M.: Open system categorical quantum
semantics in natural language processing. In: Proceedings of the 6th Conference on Algebra
and Coalgebra in Computer Science. Nijmegen, Netherlands (2015)
37. Preller, A.: From Sentence to Concept, a Linguistic Quantum Logic. Tech. Rep. RR-11019,
LIRMM (Jun 2011), http://hal-lirmm.ccsd.cnrs.fr/lirmm-00600428
38. Reddy, S., McCarthy, D., Manandhar, S.: An empirical study on compositionality in com-
pound nouns. In: Proceedings of the 5th International Joint Conference on Natural Language
Processing (IJCNLP-11) (2011)
39. Rimell, L.: Distributional lexical entailment by topic coherence. In: Proceedings of the
14th Conference of the European Chapter of the Association for Computational Linguistics,
EACL 2014, April 26-30, 2014, Gothenburg, Sweden. pp. 511 -- 519 (2014)
40. Rubenstein, H., Goodenough, J.: Contextual Correlates of Synonymy. Communications of
the ACM 8(10), 627 -- 633 (1965)
41. Sadrzadeh, M., Clark, S., Coecke, B.: Frobenius anatomy of word meanings i: subject and
object relative pronouns. Journal of Logic and Computation 23, 1293 -- 1317 (2013)
42. Salton, G., Wong, A., Yang, C.S.: A vector space model for automatic indexing. Commun.
ACM 18, 613 -- 620 (1975)
43. Schutze, H.: Automatic Word Sense Discrimination. Computational Linguistics 24, 97 -- 123
(1998)
44. Selinger, P.: Dagger compact closed categories and completely positive maps. Electronic
Notes in Theoretical Computer Science 170, 139 -- 163 (2007)
45. Socher, R., Huval, B., Manning, C., A., N.: Semantic compositionality through recursive
matrix-vector spaces. In: Conference on Empirical Methods in Natural Language Processing
2012 (2012)
46. Turney, P.D.: Similarity of semantic relations. Computational Linguistics 32(3), 379 -- 416
(2006)
34
47. Weeds, J., Weir, D., McCarthy, D.: Characterising measures of lexical distributional similar-
ity. In: Proceedings of the 20th international conference on Computational Linguistics. No.
1015, Association for Computational Linguistics (2004)
48. Widdows, D.: Geometry and Meaning. Center for the Study of Language and Informa-
tion/SRI (2004)
|
1611.08813 | 1 | 1611 | 2016-11-27T09:53:36 | Semi Supervised Preposition-Sense Disambiguation using Multilingual Data | [
"cs.CL"
] | Prepositions are very common and very ambiguous, and understanding their sense is critical for understanding the meaning of the sentence. Supervised corpora for the preposition-sense disambiguation task are small, suggesting a semi-supervised approach to the task. We show that signals from unannotated multilingual data can be used to improve supervised preposition-sense disambiguation. Our approach pre-trains an LSTM encoder for predicting the translation of a preposition, and then incorporates the pre-trained encoder as a component in a supervised classification system, and fine-tunes it for the task. The multilingual signals consistently improve results on two preposition-sense datasets. | cs.CL | cs | Semi Supervised Preposition-Sense Disambiguation
using Multilingual Data
Department of Computer Science
Department of Computer Science
Yoav Goldberg
Bar-Ilan University
Hila Gonen
Bar-Ilan University
6
1
0
2
v
o
N
7
2
]
L
C
.
s
c
[
1
v
3
1
8
8
0
.
1
1
6
1
:
v
i
X
r
a
[email protected]
[email protected]
Abstract
Prepositions are very common and very ambiguous, and understanding their sense is critical
for understanding the meaning of the sentence. Supervised corpora for the preposition-sense
disambiguation task are small, suggesting a semi-supervised approach to the task. We show
that signals from unannotated multilingual data can be used to improve supervised preposition-
sense disambiguation. Our approach pre-trains an LSTM encoder for predicting the translation
of a preposition, and then incorporates the pre-trained encoder as a component in a supervised
classification system, and fine-tunes it for the task. The multilingual signals consistently improve
results on two preposition-sense datasets.
1
Introduction
Preposition-sense disambiguation (Litkowski and Hargraves, 2005; Litkowski and Hargraves, 2007;
Schneider et al., 2015; Schneider et al., 2016), is the task of assigning a category to a preposition in
context (see Section 2.1). Choosing the correct sense of a preposition is crucial for understanding the
meaning of the text. This important semantic task is especially challenging from a learning perspective
as only little amounts of annotated training data are available for it. Indeed, previous systems (see Sec-
tions 2.1.1 and 5.4) make extensive use of the vast and human-curated WordNet lexicon (Miller, 1995)
in order to compensate for the small size of the annotated data and obtain good accuracies.
Instead, we propose to deal with the scarcity of annotated data by taking a semi-supervised approach.
We rely on the intuition that word ambiguity tends to differ between languages (Dagan et al., 1991),
and show that multilingual corpora can provide a good signal for the preposition sense disambiguation
task. Multilingual corpora are vast and relatively easy to obtain (Resnik and Smith, 2003; Koehn, 2005;
Steinberger et al., 2006), making them appealing candidates for use in a semi-supervised setting.
Our approach (Section 4) is based on representation learning (Bengio et al., 2013), and can also be
seen as an instance of multi-task (Caruana, 1997), or transfer learning (Pan and Yang, 2010). First,
we train an LSTM-based neural network (Hochreiter and Schmidhuber, 1997) to predict a foreign (say,
French) preposition given the context of an English preposition. This trains the network to map con-
texts of English prepositions to representations that are predictive of corresponding foreign prepositions,
which are in turn correlated with preposition senses. The learned mapper, which takes into account large
amounts of parallel text, is then incorporated into a monolingual preposition-sense disambiguation sys-
tem (Section 3) and is fine-tuned based on the small amounts of available supervised data. We show that
the multilingual signal is effective for the preposition-sense disambiguation task on two different datasets
(Section 5).
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. License details:
http://creativecommons.org/licenses/by-sa/4.0/
2 Background
2.1 Preposition Sense Disambiguation
Prepositions are very common, very ambiguous and tend to carry different meanings in different contexts.
Consider the following 3 sentences: "You should book a room for 2 nights", "For some reason, he is not
here yet" and "I went there to get a present for my mother". The preposition "for" has 3 different
readings in these sentences: in the first sentence it indicates DURATION, in the second it indicates an
EXPLANATION, and in the third a BENEFICIARY. The preposition-sense disambiguation task is defined
as follows: given a preposition within a sentential context, decide which category it belongs to, or what
its role in the sentence is. Choosing the right sense of a preposition is central to understanding the
meaning of an utterance (Baldwin et al., 2009).
2.1.1 Previous Work and Available Corpora
The preposition-sense disambiguation task was the focus of the SemEval 2007 shared task (Litkowski
and Hargraves, 2007), based on the set of senses defined in The Preposition Project (TPP) (Litkowski
and Hargraves, 2005), with three participating systems (Ye and Baldwin, 2007; Yuret, 2007; Popescu
et al., 2007). Since then, it was tackled in several additional works (Dahlmeier et al., 2009; Tratz and
Hovy, 2009; Hovy et al., 2010; Tratz, 2011; Srikumar and Roth, 2013b), some of which used different
preposition sense inventories and corpora, based on subsets of the TPP dictionary. Srikumar and Roth
(2013b) modeled semantic relations expressed by prepositions. For this task, they presented a variation
of the TPP inventory, by collapsing related preposition senses, so that all senses are shared between
all prepositions (Srikumar and Roth, 2013a). Schneider et al (2015) further improve this inventory and
define a new annotation scheme.
There are two main datasets for this task: the corpus of the SemEval 2007 shared task (Litkowski and
Hargraves, 2007), and the Web-reviews corpus (Schneider et al., 2016):
SemEval 2007 Corpus This corpus covers 34 prepositions with 16,557 training and 8096 test sen-
tences, each containing a single preposition example. The sentences were extracted from the FrameNet
database,1 based mostly on the British National Corpus (with 75%/25% of informative-writings/literary).
Each preposition has a different set of possible senses, with a range of 2 to 25 possible senses for a given
preposition. We use the original split to train and test sets.
Web-reviews Corpus Schneider et al (2015) introduce a new, unified and improved sense inventory
and corpus (Schneider et al., 2016) in which all prepositions share the same set of senses (senses from
a unified inventory are often referred to as supersenses). This corpus contains text in the online re-
views genre. It is much smaller than the SemEval corpus, with 4,250 preposition mentions covering
114 different prepositions which are annotated into 63 fine-grained senses. The senses are grouped
in a hierarchy, from which we chose a coarse-grained subset of 12 senses for this work: AFFECTOR,
ATTRIBUTE, CIRCUMSTANCE, CO-PARTICIPANT, CONFIGURATION, EXPERIENCER, EXPLANATION,
MANNER, PLACE, STIMULUS, TEMPORAL, UNDERGOER. We find the Web-reviews corpus more ap-
pealing than the SemEval one: the unified sense inventory makes the sense-predictions more suitable
for use in downstream applications. While our focus in this work is the Web-reviews corpus, we are the
first to report results on this dataset. For the sake of comparison to previous work, we also evaluate our
models on the SemEval corpus.
2.2 Neural Networks and Notation
We use w1:n to indicate a list of vectors, and wn:1 to indicate the reversed list. We use ◦ for vector
concatenation, and x[j] for selecting the jth element in a vector x.
A multi-layer perceptron (MLP) is a non linear classifier. In this work, we focus on MLPs with a
single hidden layer and a softmax output transformation, and define the function M LP (x) as:
1http://framenet.icsi.berkeley.edu/
M LP (x) = softmax(U (g(W x + b1)) + b2)
where g is a non-linear activation function such as ReLU or tanh, W and U are input-to-hidden and
hidden-to-output transformation matrices, and b1 and b2 are optional bias terms. We use subscripts
(M LPf 1, M LPf 2) to denote MLPs with different parameters.
Recurrent Neural Networks (RNNs) (Elman, 1990) allow the representation of arbitrary sized se-
quences, without limiting the length of the history. RNN models have been proven to effectively model
sequence-related phenomena such as line lengths, brackets and quotes (Karpathy et al., 2015).
In our implementation we use the long short-term memory network (LSTM), a subtype of the RNN
(Hochreiter and Schmidhuber, 1997). LST M (w1:i) is the output vector resulting from inputing the items
w1, ..., wi into the LSTM in order.
3 Monolingual Preposition Sense Classification
We start by describing an MLP-based model for classifying prepositions to their senses. For an English
sentence s = w1, ..., wn and a preposition position i,2 we classify to the sense y as:
y = argmax
j
M LPsense(φ(s, i))[j]
where φ(s, i) is a feature vector composed of 19 features. The features are based on the features of
Tratz and Hovy (2009), and are similar in spirit to those used in previous attempts at preposition sense
disambiguation. We deliberately do not include WordNet based features, as we want to focus on features
that do not require extensive human-curated resources. This makes our model applicable for use in other
languages with minimal change. We use the following features: (1) The embedding of the preposition.
(2) The embeddings of the lemmas of the two words before and after the preposition, of the head of the
preposition in the dependency tree, and of the first modifier of the preposition. (3) The embeddings of
the POS tags of these words, of the preposition, and of the head's head. (4) The embeddings of the labels
of the edges to the head of the preposition, to the head's head and to the first modifier of the preposition.
(5) A boolean that indicates whether one of the two words that follow the preposition is capitalized. The
English sentences were parsed using the spaCy parser.3
The network (including the embedding vectors) is trained using cross entropy loss. This model per-
forms relatively well, achieving an accuracy of 73.34 on the Web-reviews corpus, way above the most-
frequent-sense baseline of 62.37. On the SemEval corpus, it achieves an accuracy of 74.8, outperforming
all participants in the original shared task (Section 5). However, these results are limited by the small
size of both training sets. In what follows, we will improve the model using unannotated data.
4 Semi-Supervised Learning Using Multilingual Data
Our goal is to derive a representation from unannotated data that is predictive of preposition-senses.
We suggest using multilingual data, following the intuition that preposition ambiguity usually differs
between languages (Dagan et al., 1991). For example, consider the following two sentences, taken from
the Europarl parallel corpus (Koehn, 2005): "What action will it take to defuse the crisis and tension
in the region?", and "These are only available in English, which is totally unacceptable". In the first
sentence, the preposition "in" is translated into the French preposition "dans", whereas in the second
one, it is translated into the French preposition "en". Thus, a representation that is predictive of the
preposition's translation is likely to be predictive also of its sense.
Learning a representation from a multilingual corpus We train a neural network model to encode
the context of an English preposition as a vector, and predict the foreign preposition based on the context
vector. The resulting context encodings will then be predictive of the foreign prepositions, and hopefully
also of the preposition senses.
We derive a training set of roughly 7.4M instances from the Europarl corpus (Koehn, 2005). Europoarl
contains sentence-aligned data in 21 languages. We started by using several ones, and ended up with a
2We also support multi-word prepositions in this work. The extension is trivial.
3https://spacy.io/
subset of 12 languages4 that together constitute a good representation of the different language families
available in the corpus. Though adding the other languages is possible, we did not experiment with them.
To extract the training set, we first word-align5 the sentence-aligned data, and then create a dataset of
English sentences where each preposition is matched to its translation in a foreign language. Since the
alignment of prepositions is noisier than that of content words, we use a heuristic to improve precision:
given a candidate foreign-preposition, we verify that the two words surrounding it are aligned to the two
words surrounding the English preposition. Additionally, we filter out, for each English preposition, all
foreign prepositions that were aligned to it in less than 5% of the cases.
We then train the context representations according to the following model. For an English sentence
s = w1, ..., wn, a preposition position i and a target preposition p in language L, we encode the context
as a concatenation of two LSTMs, one reading the sentence from the beginning up to but not including
the preposition, and the other in reverse:
ctx(s, i) = LST Mf (w1:i−1) ◦ LST Mb(wn:i+1)
This is similar to a BiLSTM encoder, with the difference that the encoding does not include the prepo-
sition wi but only its context. By ignoring the preposition, we force the model to focus on the context,
and help it share information between different prepositions. Indeed, including the preposition in the en-
coder resulted in better performance in foreign preposition classification, but the resulting representation
was not as effective when used for the sense disambiguation task.
The context vector is then fed into a language specific MLP for predicting the target preposition:
p = argmax
j
M LPL(ctx(s, i))[j]
The context-encoder and the word embeddings are shared across languages, but the MLP classifiers
that follow are language specific. By using multiple languages, we learn more robust representations.
The English word embeddings can be initialized randomly, or using pre-trained embedding vectors,
as we explore in Section 5.1. The network is trained using cross entropy loss, and the error is back-
propagated through the context-encoder and the word embeddings.
Using the representation for sense classification Once the encoder is trained over the multilingual
data, we incorporate it in the supervised sense-disambiguation model by concatenating the representation
obtained from the context encoder to the feature vector. Concretely, the supervised model now becomes:
y = argmax
j
M LPsense(ctx(s, i) ◦ φ(s, i))[j]
where ctx(s, i) is the output vector of the context-encoder and φ(s, i) is the feature vector as before.
The network is trained using cross entropy loss, and the error back-propagates also to the context-
encoder and to the word embeddings to maximize the model's ability to adapt to the preposition-sense
disambiguation task. The complete model is depicted in Figure 1.
5 Empirical results
Implementation details The models were implemented using PyCNN.6 All models were trained using
SGD, shuffling the examples before each of the 5 epochs. When training a sense prediction model, we
use early stopping and choose the best performing model on the development set. The sense-prediction
MLP uses ReLU activation, and foreign preposition MLPs use tanh, with no bias terms. Unless noted
otherwise, we use randomly initialized embedding vectors. For each experiment, we chose the param-
eters that maximized the accuracy on the dev set.7 The accuracies we report are the average accuracies
over 5 different seeds.
4Bulgarian, Czech, Danish, German, Greek, Spanish, French, Hungarian, Italian, Polish, Romanian and Swedish.
5Word-alignment is done using the cdec aligner (Dyer et al., 2010).
6https://github.com/clab/cnn
7In most of the experiments, the best results are achieved when the hidden-layer of the sense-prediction MLPs is of the
size 500, and the preposition embedding is of size 200. In some cases, the best results are achieved with different dimensions.
French prepositions German prepositions Spanish prepositions
Prepositions supersenses
dans, en, sur, ..., par
mit, vor, zu, ..., gegen
sobre, con, para, ..., a
Temporal, Place, Manner, ..., Explanation
M LPF R
M LPGE
M LPSP
M LPsense
φ(he booked a ... ,5)
context representation
he
booked
a
room
for
two
nights
Figure 1: The suggested model for incorporating multilingual data in classifying prepositions to senses. First, a context-
encoder (at the bottom, the green and red squares are LSTM cells) is trained on the Europarl corpus, with a different MLP for
each language (left dashed frame). Then, the representation obtained from the context-encoder is added to the feature vector
when classifying a preposition to senses (right dashed frame).
5.1 Evaluation on the Web-reviews corpus
Using multilingual data Our main motivation in this work was to train a representation which is useful
for the preposition-sense disambiguation task. Thus, we compare the performance of our model using
the representation obtained from the context-encoder (multilingual model) with the model that does not
use this representation (base model). We use the train/test split provided with the corpus. We further
split the train set into train and dev sets, by assigning every fourth example of each sense to the dev set,
yielding 2552/845/853 instances of train/dev/test.
The results are presented in Table 1. We see an improvement of 2.86 points when using the pre-trained
context representations, improving the average result from 73.34 to 76.20.
To verify that the improvement stems from pre-training the context-encoder on multilingual data and
not from adding the context-encoder as is, we also evaluated the performance of a model identical to
the multilingual model, but with no pre-training on the multilingual data (context model, middle row of
Table 1). The context model achieved a very similar result to that of the base model – 73.76, indicating
that adding the context-encoder to the base model is not the source of the improvement.
Model
base
+context
+context(multilingual)
Accuracy
73.34 (71.63-73.97)
73.76 (71.86-75.38)
76.20 (74.91-77.26)
Table 1: The average accuracies on the test set of the Web-reviews corpus on 5 different seeds. Numbers in brackets indicate
the min and max accuracy across seeds.
Using monolingual or bilingual data only
In order to verify the contribution of incorporating infor-
mation from 12 languages, we also experiment with monolingual and bilingual models. For the mono-
lingual model we train a model similar to our multilingual one, but when trying to predict the English
preposition itself, rather than the foreign one, ignoring the multilingual signal altogether. For the bilin-
gual models we train 12 separate models similar to our multilingual model, where each one is trained
only on the training examples of a single language.
As shown in Table 2, both the monolingual and the bilingual models improve over the base model
(with the exception of Czech), but no improvement is as significant as that of the multilingual model.
In addition, we see that the strength of the model does not depend solely on the number of training
examples.
Adding external word embeddings Another way of incorporating semi-supervised data into a model
is using pre-trained word embeddings. We evaluate our model when using external word embeddings
These two parameters were tuned on the dev set. The embeddings of the features are of dimension 4, with the exception of the
lemmas, which are of dimension 50. The dimension of the input to the LSTMs (word embeddings) is 128. Both LSTMs have a
single layer with 100 nodes, thus, the representation of the context obtained from the context-encoder is of dimension 200. The
hidden-layer of the foreign-preposition MLP is of size 32.
Language
None (base model)
Czech
Polish
Italian
Romanian
Hungarian
Bulgarian
Spanish
German
Danish
Greek
French
English (monolingual)
Swedish
All 12 languages
Accuracy
Improvement Num. of training examples
73.34 (71.63-73.97)
73.06 (72.57-73.86)
73.93 (73.15-74.79)
73.97 (72.22-75.26)
74.09 (73.15-74.56)
74.42 (73.27-75.15)
74.44 (73.27-74.91)
74.65 (73.51-75.73)
74.73 (73.74-75.62)
75.08 (74.21-77.49)
75.12 (74.09-76.20)
75.43 (74.21-77.02)
75.68 (74.79-76.55)
75.87 (74.68-77.49)
76.20 (74.91-77.26)
–
-0.28
+0.59
+0.63
+0.75
+1.08
+1.10
+1.31
+1.39
+1.74
+1.78
+2.09
+2.34
+2.53
+2.86
–
190,850
166,101
810,589
205,520
40,302
292,908
1,267,400
603,861
1,131,915
586,494
1,033,267
7,483,206
1,153,999
7,483,206
Table 2: The average accuracies on the test set of the Web-reviews corpus on 5 different seeds, using monolingual and
bilingual models, along with the improvement over the base model and the number of training examples in each language.
Numbers in brackets indicate the min and max accuracy across seeds.
instead of randomly initialized word embeddings. We perform three experiments: 1. using external word
embeddings only for the words that are fed into the context-encoder. 2. using external word embeddings
only for the lemmas of the features. 3. using external word embeddings for both.
We use two sets of word embeddings: 5-window-bag-of-words-based and dependency-based, both
trained by Levy and Goldberg (2014) on English Wikipedia.8 As shown in Table 3, both pre-trained
embeddings improve the performance of all models in most cases. In all cases, the multilingual model
outperforms the base model and the context model, both achieving similar results. Using external word
embeddings for both the features and the context-encoder helps the most. The best result of 78.55 is
achieved by the multilingual model, improving the result of the base model under the same conditions
by 1.71 points.
Model
Context-encoder embeddings only
Bow
Deps
Feature embeddings only
Bow
Deps
Embeddings for both
Bow
Deps
73.34 (71.63-73.97)
base
76.84 (76.32-77.26)
+context
74.07 (72.10-75.15)
77.73 (77.14-78.43)
78.55 (77.37-79.37)
+context(multilingual) 75.57 (73.51-77.84)
Table 3: The average accuracies on the test set of the Web-reviews corpus with different pre-trained embeddings on 5 different
seeds. Numbers in brackets indicate the min and max accuracy across seeds. Bow: 5-words window; Deps: dependency-based.
76.95 (75.85-77.96)
77.14 (76.79-78.08)
78.45 (77.49-79.48)
76.84 (76.32-77.26)
77.47 (75.85-78.55)
77.58 (77.14-78.66)
73.34 (71.63-73.97)
74.42 (73.62-75.03)
75.90 (75.03-76.55)
76.95 (75.85-77.96)
76.72 (75.85-77.96)
77.58 (77.02-78.08)
5.2 Evaluation on the SemEval corpus
Adaptations to the SemEval corpus
In the SemEval corpus each preposition has a different set of
senses, and the natural approach is to learn a different model for each one. We call this the disjoint
approach. However, we found this approach a bit wasteful in terms of exploiting the annotated data,
and we propose a model that uses the information from all prepositions simultaneously (unified). In the
unified approach, we create an MLP classifier for each preposition, but all of them share a single input-
to-hidden transformation matrix and a single bias term. Formally, for a preposition p, we define its MLP
as follows:
M LPp(x) = softmax(Up(g(W x + b1)) + b2p)
where W is the shared input-to-hidden transformation matrix, b1 is the shared bias term, and Up and b2p
are preposition-specific hidden-to-output transformation matrix and bias term, respectively. This unified
model is trained over the training examples of all prepositions together.
The SemEval corpus sometimes provides multiple senses for a given preposition instance. In both
the disjoint and the unified approaches we treat these cases by generalizing the cross entropy loss for
multiple correct classes. In the common case, where each training example has a single correct class, the
8https://levyomer.wordpress.com/2014/04/25/dependency-based-word-embeddings/
cross entropy loss is defined as − log pi, where pi is the probability that the model assigns to the correct
class. Here, instead of using − log pi, we use − log((cid:80)
i∈C pi), where C is the set of correct classes.
Results The model performs well also on the SemEval corpus, achieving an accuracy of 76.9. Note
that we use the exact same parameters that were tuned on the dev set of the Web-reviews corpus, with no
additional tuning on this corpus.
As shown in Table 4, the unified model, which trains on all prepositions simultaneously, performs
better than a separate model for each preposition (disjoint model), and achieves an improvement of 1.3
points when using the multilingual model. In addition, in both cases we get a significant improvement
over the base model when using the pre-trained context-representation. In the unified model, adding the
pre-trained context-representation improves the result by 2.1 points. As in the case of the Web-reviews
corpus, we can see that this improvement does not stem from adding the context representation as is.
Pre-training the representation is essential for achieving these improved results.
Model
base
+context
+context(multilingual)
Disjoint
73.7 (73.3-74.1)
73.8 (73.6-74.0)
75.6 (75.4-75.8)
Unified
74.8 (74.4-75.4)
75.4 (74.8-75.8)
76.9 (76.4-77.7)
Table 4: The average accuracies on the test set of the SemEval corpus on 5 different seeds, with both the disjoint and the
unified models. Numbers in brackets indicate the min and max accuracy across seeds.
Similar to the results on the Web-reviews Corpus, when using external word embeddings both for the
words that are fed into the context-encoder and for the features, we get an improvement in all models,
with an average improvement of 3 points when using the 5-words-window based embeddings. The best
result amongst the three models is of 79.6 and is achieved by the multilingual model, improving over the
base model by 2.5 points. The results are shown in Table 5.
Note that unlike previous experiments, adding external word embeddings improves the context model
over the base model significantly, approaching the results of the multilingual model. For this reason,
we also evaluated a model in which we concatenate both contexts: that of the context model (no pre-
training), and that of the multilingual model (pre-trained on the multilingual data). In the case where both
models achieve similar results, combining both contexts further improves the result, which indicates that
they are complementary. The best result of 80.0 is achieved when using both contexts with the 5-window-
bag-of-words-based embeddings. We also evaluated this combined model on the Web-reviews corpus,
but got no improvement in most cases. This was predictable since in all experiments on that corpus we
had a large difference between the results of the context model and of the multilingual model. The only
case where we saw an improvement with both contexts was when using dependency-based embeddings
for both the features and the context-encoder. The difference between the two datasets can be explained
by the much larger size of the SemEval dataset, which allows the context encoder to learn from more
data, even without pre-training on multilingual data.
Model
base
+context
+context(multilingual)
+both contexts
Bow
77.1 (76.9-77.2)
79.5 (78.8-79.9)
79.6 (79.3-79.9)
80.0 (79.8-80.2)
Deps
76.6 (76.3-76.9)
78.5 (78.0-78.8)
79.3 (78.8-79.6)
79.2 (78.6-79.5)
None
74.8 (74.4-75.4)
75.4 (74.8-75.8)
76.9 (76.4-77.7)
77.3 (77.2-77.5)
Table 5: The average accuracies on the test set of the SemEval corpus on 5 different seeds, with the unified model, when
using external word embeddings for both the context-encoder and the features. Numbers in brackets indicate the min and max
accuracy across seeds. Bow: 5-words window; Deps: dependency-based; None: no external word embeddings.
5.3 Using Ensembles
We create an ensemble by training 5 different models (each with a different random seed), and predict test
instances using a majority vote over the models. The results are presented in Table 6. As expected, results
in all models further improve when using the ensemble. Using the multilingual context helps also when
using the ensemble. We see an improvements of 1.99 points on the web-reviews corpus, improving the
result to 80.54. The performance on the SemEval corpus improves by 1.7 points, and reaches an accuracy
of 81.7. These results are higher than those of the base model by 2.93 and 2.2 points, respectively.
Model
Web-reviews Corpus
Average
Ensemble
base
+context
+context(multilingual)
+both contexts
76.84 (76.32-77.26)
77.73 (77.14-78.43)
78.55 (77.37-79.37)
79.34 (78.43-80.19)
77.61
78.90
80.54
79.84
SemEval Corpus
Average
77.1 (76.9-77.2)
79.5 (78.8-79.9)
79.6 (79.3-79.9)
80.0 (79.8-80.2)
Ensemble
79.5
81.1
81.2
81.7
Table 6: The results on both datasets on 5 different seeds as reported in Tables 3 and 5 in comparison to the results using the
ensemble. Numbers in brackets indicate the min and max accuracy across seeds.
5.4 Comparison to previous systems
Table 7 compares our SemEval results with those of previous systems. The system of Ye and Baldwin
(2007) got the highest result out of the three participating systems in the SemEval 2007 shared task.
They extracted features such as POS tags and WordNet-based features, and also high level features (e.g
semantic role tags), using a word window of up to seven words, in a Maximum Entropy classifier. Tratz
and Hovy (2009) got a higher result with similar features by using a set of positions that are syntactically
related to the preposition instead of a fixed window size. The best performing systems are of Hovy et al
(2010) and of Srikumar and Roth (2013b). Both systems rely on vast and thoroughly-engineered feature
sets, including many WordNet based features. Hovy et al (2010) explored different word choices (i.e, a
fixed window vs. syntactically related words) and different methods of extracting them, while Srikumar
and Roth (2013b) improved performance by jointly predicting preposition senses and relations.
In contrast, our models do not include any WordNet based features, making them applicable also for
languages lacking such resources. Our models achieve competitive results, outperforming most previ-
ous systems, despite using relatively few features and performing hyper-parameter tuning only on the
different domain Web-reviews corpus.
Model
base
+context
+context(multilingual)
+context(multilingual) + embeddings
+both contexts + embeddings
+both contexts + embeddings + ensemble
Hovy et al (2010) – using WordNet features
Srikumar and Roth (2013b) – using WordNet features
Tratz and Hovy (2009) – using WordNet features
MELB-YB (Ye and Baldwin, 2007) – using WordNet features
KU (Yuret, 2007)
IRST-BP (Popescu et al., 2007)
Most Frequent Sense
Accuracy
74.8
75.4
76.9
79.6
80.0
81.7
84.8
84.78
76.4
69.3
54.7
49.6
39.6
Table 7: The accuracies on the test set of the SemEval corpus, in comparison to previous systems.
5.5 Error Analysis
Figure 2 depicts the percentage of correct assignments of the base model, in comparison to the multi-
lingual model, per sense and per preposition (only the 10 most common prepositions are shown). Both
models use pre-trained word embeddings and ensembles. Clearly, there is a systematic improvement
across most prepositions and senses.
6 Related work
Transfer learning and representation learning Transfer learning is a methodology that aims to re-
duce annotation efforts by first learning a model on a different domain or a closely related task, and then
transfer the gained knowledge to the main task (Pan and Yang, 2010). Multi-task learning (MTL) is an
approach of transfer learning in which several tasks are trained in parallel while using a shared represen-
tation. The different tasks can benefit from each other through this representation (Caruana, 1997). In
(a) prepositions
(b) senses
Figure 2: Assignments on the dev set of the Web-reviews corpus per preposition (a) and per sense (b). Left bars stand for the
base model, right bars stand for the multilingual model. In blue are correct assignments, and in red incorrect ones.
this work we use MTL to improve preposition-sense disambiguation, by using an auxiliary multilingual
task – predicting translations of prepositions.
A simple method for sharing information in transfer learning as well as in MTL, is using represen-
tations that are shared between related tasks. Representation learning (Bengio et al., 2013) is a closely
related field that aims to establish techniques for learning robust and expressive data representations. A
well-known effort in this field is that of learning word embeddings for use in a wide range of NLP tasks
(Mikolov et al., 2013; Al-Rfou et al., 2013; Levy and Goldberg, 2014; Pennington et al., 2014). While
those representations are highly effective in many cases, other scenarios require representations of a full
sentence, or of a context around a target word, rather than representations of single words. Contexts are
often represented by some manipulation over the embeddings of their words. Such representations have
been successfully used for tasks such as context-sensitive similarity (Huang et al., 2012), word sense dis-
ambiguation (Chen et al., 2014) and lexical substitution (Melamud et al., 2015). An alternative approach
for context representation is encoding a context of arbitrary length into a single vector using LSTMs.
This approach has been proven to outperform the previous attempts in a variety of tasks such as Seman-
tic Role Labeling (Zhou and Xu, 2015), Natural Language Inference (Bowman et al., 2015) and Sentence
Completion (Melamud et al., 2016). We follow the LSTM-based approach for context representation.
Learning from multilingual data The use of multilingual data for improving monolingual tasks has
a long tradition in NLP, and has been used for target word selection (Dagan et al., 1991); word sense
disambiguation (Diab and Resnik, 2002); and syntactic parsing and named entity recognition (Burkett et
al., 2010), to name a few examples. A dominant approach for exploiting multilingual data is that of cross-
lingual projection. This approach assumes a good model exists in one language, and uses annotations in
that language in order to constrain possible annotations in another. Projections were successfully used for
dependency grammar induction (Ganchev et al., 2009), and for transferring tools such as morphological
analyzers and part-of-speech taggers from English to languages with fewer resources (Yarowsky et al.,
2001; Yarowsky and Ngai, 2001). A different approach is applying multilingual constraints on existing
monolingual models, as done for parsing (Smith and Smith, 2004; Burkett and Klein, 2008) and for
morphological segmentation (Snyder and Barzilay, 2008).
Of much relevance to this work are also previous attempts to improve monolingual representations
using bilingual data (Faruqui and Dyer, 2014). Previous works focus on creating sense-specific word
embeddings instead of the common word-form specific embeddings (Ettinger et al., 2016; Suster et al.,
2016), and also on representing words using their context (Kawakami and Dyer, 2015; Hermann and
Blunsom, 2013). While we rely on the assumption most of these works have in common, according to
which translations may serve as a strong signal for different senses of words, the novelty of our work
is in focusing on prepositions rather than content words, and in jointly representing a context for both a
multilingual and a monolingual tasks, which results in an improvement of the monolingual model.
7 Conclusions and Future Work
We show that multilingual data can be used to improve the accuracy of preposition-sense disambiguation.
The key idea is to train a context-encoder on vast amounts of parallel data, and by that, to obtain a context
representation that is predictive of the sense. We show an improvement of the accuracy in all experiments
upon using this representation. Our model achieves an accuracy of 80.54 on the Web-reviews corpus, and
an accuracy of 81.7 on the SemEval corpus, with significant improvements over models that do not use
the multilingual signals. Our result on the SemEval corpus outperforms most previous works, without
using any manually curated lexicons.
Acknowledgements
The work is supported by The Israeli Science Foundation (grant number 1555/15).
References
[Al-Rfou et al.2013] Rami Al-Rfou, Bryan Perozzi, and Steven Skiena. 2013. Polyglot: Distributed word repre-
sentations for multilingual nlp. In Proceedings of CoNLL 2013.
[Baldwin et al.2009] Timothy Baldwin, Valia Kordoni, and Aline Villavicencio. 2009. Prepositions in applications:
A survey and introduction to the special issue. Computational Linguistics, 35(2):119–149.
[Bengio et al.2013] Yoshua Bengio, Aaron Courville, and Pascal Vincent. 2013. Representation learning: A review
and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798–1828.
[Bowman et al.2015] Samuel R Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. 2015. A
large annotated corpus for learning natural language inference. In Proceedings of EMNLP.
[Burkett and Klein2008] David Burkett and Dan Klein. 2008. Two languages are better than one (for syntactic
parsing). In Proceedings of EMNLP, pages 877–886.
[Burkett et al.2010] David Burkett, Slav Petrov, John Blitzer, and Dan Klein. 2010. Learning better monolingual
models with unannotated bilingual text. In Proceedings of CoNLL, pages 46–54.
[Caruana1997] Rich Caruana. 1997. Multitask learning. Machine Learning, 28:41–75.
[Chen et al.2014] Xinxiong Chen, Zhiyuan Liu, and Maosong Sun. 2014. A unified model for word sense repre-
sentation and disambiguation. In Proceedings of EMNLP, pages 1025–1035.
[Dagan et al.1991] Ido Dagan, Alon Itai, and Ulrike Schwall. 1991. Two languages are more informative than one.
In Proceedings of ACL, pages 130–137.
[Dahlmeier et al.2009] Daniel Dahlmeier, Hwee Tou Ng, and Tanja Schultz. 2009. Joint learning of preposition
senses and semantic roles of prepositional phrases. In Proceedings of EMNLP, pages 450–458.
[Diab and Resnik2002] Mona Diab and Philip Resnik. 2002. An unsupervised method for word sense tagging
using parallel corpora. In Proceedings of ACL, pages 255–262.
[Dyer et al.2010] Chris Dyer, Adam Lopez, Juri Ganitkevitch, Johnathan Weese, Ferhan Ture, Phil Blunsom, Hen-
dra Setiawan, Vladimir Eidelman, and Philip Resnik. 2010. cdec: A decoder, alignment, and learning frame-
work for finite-state and context-free translation models. In Proceedings of ACL.
[Elman1990] Jeffrey L. Elman. 1990. Finding structure in time. Cognitive science, 14(2):179–211.
[Ettinger et al.2016] Allyson Ettinger, Philip Resnik, and Marine Carpuat. 2016. Retrofitting sense-specific word
vectors using parallel text. In Proceedings of NAACL-HLT, pages 1378–1383.
[Faruqui and Dyer2014] Manaal Faruqui and Chris Dyer. 2014.
using multilingual correlation. In Proceedings of EACL.
Improving vector space word representations
[Ganchev et al.2009] Kuzman Ganchev, Jennifer Gillenwater, and Ben Taskar. 2009. Dependency grammar induc-
tion via bitext projection constraints. In Proceedings of ACL-IJCNLP, pages 369–377.
[Hermann and Blunsom2013] Karl Moritz Hermann and Phil Blunsom. 2013. Multilingual distributed representa-
tions without word alignment. In Proceedings of ICLR.
[Hochreiter and Schmidhuber1997] Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long short-term memory.
Neural computation, 9(8):1735–1780.
[Hovy et al.2010] Dirk Hovy, Stephen Tratz, and Eduard Hovy. 2010. What's in a preposition? dimensions of
sense disambiguation for an interesting word class. In Proceedings of COLING.
[Huang et al.2012] Eric H Huang, Richard Socher, Christopher D Manning, and Andrew Y Ng. 2012. Improving
word representations via global context and multiple word prototypes. In Proceedings of ACL, pages 873–882.
[Karpathy et al.2015] Andrej Karpathy, Justin Johnson, and Fei-Fei Li. 2015. Visualizing and understanding re-
current networks. arXiv:1506.02078.
[Kawakami and Dyer2015] Kazuya Kawakami and Chris Dyer. 2015. Learning to represent words in context with
multilingual supervision. arXiv:1511.04623.
[Koehn2005] Philipp Koehn. 2005. Europarl: A parallel corpus for statistical machine translation. In Proceedings
of MT summit, volume 5, pages 79–86.
[Levy and Goldberg2014] Omer Levy and Yoav Goldberg. 2014. Dependency-based word embeddings. In Pro-
ceedings of ACL.
[Litkowski and Hargraves2005] Ken Litkowski and Orin Hargraves. 2005. The preposition project. In Proceed-
ings of the Second ACL-SIGSEM Workshop on the Linguistic Dimensions of Prepositions and their Use in
Computational Linguistics Formalisms and Applications, pages 171–179.
[Litkowski and Hargraves2007] Ken Litkowski and Orin Hargraves. 2007. Semeval-2007 task 06: Word-sense
disambiguation of prepositions. In Proceedings of the 4th International Workshop on Semantic Evaluations,
pages 24–29.
[Melamud et al.2015] Oren Melamud, Omer Levy, and Ido Dagan. 2015. A simple word embedding model for
In Proceedings of the 1st Workshop on Vector Space Modeling for Natural Language
lexical substitution.
Processing, pages 1–7.
[Melamud et al.2016] Oren Melamud, Jacob Goldberger, and Ido Dagan. 2016. context2vec: Learning generic
context embedding with bidirectional lstm. In Proceedings of CoNLL.
[Mikolov et al.2013] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013. Distributed
representations of words and phrases and their compositionality. In Advances in neural information processing
systems.
[Miller1995] George A Miller. 1995. Wordnet: a lexical database for English. Communications of the ACM,
38(11):39–41.
[Pan and Yang2010] Sinno Jialin Pan and Qiang Yang. 2010. A survey on transfer learning. IEEE Transactions on
knowledge and data engineering, 22(10):1345–1359.
[Pennington et al.2014] Jeffrey Pennington, Richard Socher, and Christopher D Manning. 2014. Glove: Global
vectors for word representation. In Proceedings of EMNLP 2014.
[Popescu et al.2007] Octavian Popescu, Sara Tonelli, and Emanuele Pianta. 2007. IRST-BP: Preposition disam-
biguation based on chain clarifying relationships contexts. In Proceedings of the 4th International Workshop on
Semantic Evaluations.
[Resnik and Smith2003] Philip Resnik and Noah A Smith. 2003. The web as a parallel corpus. Computational
Linguistics, 29(3):349–380.
[Schneider et al.2015] Nathan Schneider, Vivek Srikumar, Jena D. Hwang, and Martha Palmer. 2015. A hierarchy
In Proceedings of the 9th Linguistic Annotation Workshop, pages
with, of, and for preposition supersenses.
112–123.
[Schneider et al.2016] Nathan Schneider, Jena D. Hwang, Vivek Srikumar, Meredith Green, Abhijit Suresh,
In Pro-
Kathryn Conger, Tim O'Gorman, and Martha Palmer. 2016. A corpus of preposition supersenses.
ceedings of the 10th Linguistic Annotation Workshop.
[Smith and Smith2004] David A Smith and Noah A Smith. 2004. Bilingual parsing with factored estimation:
Using english to parse korean. In Proceedings of EMNLP.
[Snyder and Barzilay2008] Benjamin Snyder and Regina Barzilay. 2008. Cross-lingual propagation for morpho-
logical analysis. In Proceedings of AAAI.
[Srikumar and Roth2013a] Vivek Srikumar and Dan Roth.
arXiv:1305.5785.
2013a. An inventory of preposition relations.
[Srikumar and Roth2013b] Vivek Srikumar and Dan Roth. 2013b. Modeling semantic relations expressed by
prepositions. Transactions of the Association for Computational Linguistics, 1:231–242.
[Steinberger et al.2006] Ralf Steinberger, Bruno Pouliquen, Anna Widiger, Camelia Ignat, Tomaz Erjavec, Dan
Tufis, and D´aniel Varga. 2006. The jrc-acquis: A multilingual aligned parallel corpus with 20+ languages. In
Proceedings of LREC.
[Suster et al.2016] Simon Suster, Ivan Titov, and Gertjan van Noord. 2016. Bilingual learning of multi-sense
embeddings with discrete autoencoders. arXiv:1603.09128.
[Tratz and Hovy2009] Stephen Tratz and Dirk Hovy. 2009. Disambiguation of preposition sense using linguisti-
cally motivated features. In Proceedings of NAACL-HLT Student Research Workshop and Doctoral Consortium,
pages 96–100.
[Tratz2011] Stephen Tratz. 2011. Semantically-enriched parsing for natural language understanding. Ph.D.
thesis, University of Southern California.
[Yarowsky and Ngai2001] David Yarowsky and Grace Ngai. 2001.
Inducing multilingual pos taggers and np
bracketers via robust projection across aligned corpora. In Proceedings of NAACL.
[Yarowsky et al.2001] David Yarowsky, Grace Ngai, and Richard Wicentowski. 2001. Inducing multilingual text
analysis tools via robust projection across aligned corpora. In Proceedings of HLT.
[Ye and Baldwin2007] Patrick Ye and Timothy Baldwin. 2007. MELB-YB: Preposition sense disambiguation
using rich semantic features. In Proceedings of the 4th International Workshop on Semantic Evaluations, pages
241–244.
[Yuret2007] Deniz Yuret. 2007. KU: Word sense disambiguation by substitution.
International Workshop on Semantic Evaluations, pages 207–213.
In Proceedings of the 4th
[Zhou and Xu2015] Jie Zhou and Wei Xu. 2015. End-to-end learning of semantic role labeling using recurrent
neural networks. In Proceedings of ACL.
|
1909.02265 | 1 | 1909 | 2019-09-05T08:47:49 | Towards Task-Oriented Dialogue in Mixed Domains | [
"cs.CL"
] | This work investigates the task-oriented dialogue problem in mixed-domain settings. We study the effect of alternating between different domains in sequences of dialogue turns using two related state-of-the-art dialogue systems. We first show that a specialized state tracking component in multiple domains plays an important role and gives better results than an end-to-end task-oriented dialogue system. We then propose a hybrid system which is able to improve the belief tracking accuracy of about 28% of average absolute point on a standard multi-domain dialogue dataset. These experimental results give some useful insights for improving our commercial chatbot platform FPT.AI, which is currently deployed for many practical chatbot applications. | cs.CL | cs | Towards Task-Oriented Dialogue in Mixed Domains
Tho Luong Chi
FPT Technology Research Institute
FPT University, Hanoi, Vietnam
[email protected]
Phuong Le-Hong
FPT Technology Research Institute
Vietnam National University, Hanoi, Vietnam
[email protected]
9
1
0
2
p
e
S
5
]
L
C
.
s
c
[
1
v
5
6
2
2
0
.
9
0
9
1
:
v
i
X
r
a
Abstract -- This work investigates the task-oriented dialogue
problem in mixed-domain settings. We study the effect of alter-
nating between different domains in sequences of dialogue turns
using two related state-of-the-art dialogue systems. We first show
that a specialized state tracking component in multiple domains
plays an important role and gives better results than an end-
to-end task-oriented dialogue system. We then propose a hybrid
system which is able to improve the belief tracking accuracy
of about 28% of average absolute point on a standard multi-
domain dialogue dataset. These experimental results give some
useful insights for improving our commercial chatbot platform
FPT.AI, which is currently deployed for many practical chatbot
applications.
Index Terms -- task-oriented dialogue; multi-domain belief
tracking; mixed-domain belief tracking; natural language pro-
cessing
I. INTRODUCTION
In this work, we investigate the problem of task-oriented
dialogue in mixed-domain settings. Our work is related to two
lines of research in Spoken Dialogue System (SDS), namely
task-oriented dialogue system and multi-domain dialogue sys-
tem. We briefly review the recent literature related to these
topics as follows.
Task-oriented dialogue systems are computer programs
which can assist users to complete tasks in specific domains
by understanding user requests and generating appropriate re-
sponses within several dialogue turns. Such systems are useful
in domain-specific chatbot applications which help users find a
restaurant or book a hotel. Conventional approach for building
a task-oriented dialogue system is concerned with building
a quite complex pipeline of many connected components.
These components are usually independently developed which
include at
language
understanding module, a dialogue state tracking module, a
dialogue policy learning module, and a answer generation
module. Since these systems components are usually trained
independently, their optimization targets may not fully align
with the overall system evaluation criteria [1]. In addition,
such a pipeline system often suffers from error propagation
where error made by upstream modules are accumuated and
got amplified to the downstream ones.
least four crucial modules: a natural
To overcome the above limitations of pipeline task-oriented
dialogue systems, much research has focused recently in
designing end-to-end learning systems with neural network-
based models. One key property of task-oriented dialogue
model is that it is required to reason and plan over multiple di-
alogue turns by aggregating useful information during the con-
versation. Therefore, sequence-to-sequence models such as the
encoder-decoder based neural network models are proven to be
suitable for both task-oriented and non-task-oriented systems.
Serban et al. proposed to build end-to-end dialogue systems
using generative hierarchical recurrent encoder-decoder neural
network [2]. Li et al. presented persona-based models which
incorporate background information and speaking style of in-
terlocutors into LSTM-based seq2seq network so as to improve
the modeling of human-like behavior [3]. Wen et al. designed
an end-to-end trainable neural dialogue model with modularly
connected components [4]. Bordes et al. [5] proposed a task-
oriented dialogue model using end-to-end memory networks.
At the same time, many works explored different kinds of
networks to model the dialogue state, such as copy-augmented
networks [6], gated memory networks [7], query-regression
networks [8]. These systems do not perform slot-filling or user
goal tracking; they rank and select a response from a set of
response candidates which are conditioned on the dialogue
history.
One of the significant effort in developing end-to-end task-
oriented systems is the recent Sequicity framework [9]. This
framework also relies on the sequence-to-sequence model and
can be optimized with supervised or reinforcement learning.
The Sequicity framework introduces the concept of belief span
(bspan), which is a text span that tracks the dialogue states
at each turn. In this framework, the task-oriented dialogue
problem is decomposed into two stages: bspan generation and
response generation. This framework has been shown to sig-
nificantly outperform state-of-the-art pipeline-based methods.
The second line of work in SDS that is related to this work is
concerned with multi-domain dialogue systems. As presented
above, one of the key components of a dialogue system is
dialogue state tracking, or belief tracking, which maintains
the states of conversation. A state is usually composed of
user's goals, evidences and information which is accumulated
along the sequence of dialogue turns. While the user's goal
and evidences are extracted from user's utterances, the useful
information is usually aggregated from external resources such
as knowledge bases or dialogue ontologies. Such knowledge
bases contain slot type and slot value entries in one or several
predefined domains. Most approaches have difficulty scaling
up with multiple domains due to the dependency of their model
parameters on the underlying knowledge bases. Recently,
Ramadan et al. [10] has introduced a novel approach which
Fig. 1. Sequicity architecture.
utilizes semantic similarity between dialogue utterances and
knowledge base terms, allowing the information to be shared
across domains. This method has been shown not only to scale
well to multi-domain dialogues, but also outperform existing
state-of-the-art models in single-domain tracking tasks.
The problem that we are interested in this work is task-
oriented dialogue in mixed-domain settings. This is different
from the multi-domain dialogue problem above in several
aspects, as follows:
• First, we investigate the phenomenon of alternating be-
tween different dialogue domains in subsequent dialogue
turns, where each turn is defined as a pair of user
question and machine answer. That is, the domains are
mixed between turns. For example, in the first turn, the
user requests some information of a restaurant; then in
the second turn, he switches to the a different domain,
for example, he asks about the weather at a specific
location. In a next turn, he would either switch to a new
domain or come back to ask about some other property
of the suggested restaurant. This is a realistic scenario
which usually happens in practical chatbot applications in
our observations. We prefer calling this problem mixed-
domain dialogue rather than multiple-domain dialogue.
• Second, we study the effect of the mixed-domain setting
in the context of multi-domain dialogue approaches to see
how they perform in different experimental scenarios.
The main findings of this work include:
• A specialized state tracking component in multiple do-
mains still plays an important role and gives better results
than a state-of-the-art end-to-end task-oriented dialogue
system.
• A combination of specialized state tracking system and an
end-to-end task-oriented dialogue system is beneficial in
mix-domain dialogue systems. Our hybrid system is able
to improve the belief tracking accuracy of about 28%
of average absolute point on a standard multi-domain
dialogue dataset.
• These experimental results give some useful insights on
data preparation and acquisition in the development of the
chatbot platform FPT.AI1, which is currently deployed for
many practical chatbot applications.
The remainder of this paper is structured as follows. First,
Section II discusses briefly the two methods in building
dialogue systems that our method relies on. Next, Section III
presents experimental settings and results. Finally, Section IV
concludes the paper and gives some directions for future work.
II. METHODOLOGY
In this section, we present briefly two methods that we use
in our experiments which have been mentioned in the previous
section. The first method is the Sequicity framework and the
second one is the state-of-the-art multi-domain dialogue state
tracking approach.
A. Sequicity
Figure 1 shows the architecture of the Sequicity framework
as described in [9]. In essence, in each turn, the Sequicity
model first takes a bspan (B1) and a response (R1) which
are determined in the previous step, and the current human
question (U2) to generate the current bspan. This bspan is
then used together with a knowledge base to generate the
corresponding machine answer (R2), as shown in the right
part of Figure 1.
The left part of that figure shows an example dialogue in a
mixed-domain setting (which will be explained in Section III).
1http://fpt.ai/
Fig. 2. Multi-domain belief tracking with knowledge sharing.
B. Multi-domain Dialogue State Tracking
Figure 2 shows the architecture of the multi-domain belief
tracking with knowledge sharing as described in [10]. This is
the state-of-the-art belief tracker for multi-domain dialogue.
This system encodes system responses with 3 bidirectional
LSTM network and encodes user utterances with 3+1 bidirec-
tional LSTM network. There are in total 7 independent LSTMs.
For tracking domain, slot and value, it uses 3 corresponding
LSTMs, either for system response or user utterance. There is
one special LSTM to track the user affirmation. The semantic
similarity between the utterances and ontology terms are
learned and shared between domains through their embeddings
in the same semantic space.
III. EXPERIMENTS
In this section, we present experimental settings, different
then
scenarios and results. We first present
implementation settings, and finally obtained results.
the datasets,
A. Datasets
We use the publicly available dataset KVRET [6] in our
is created by the Wizard-of-Oz
experiments. This dataset
method [11] on Amazon Mechanical Turk platform. This
dataset includes dialogues in 3 domains: calendar, weather,
navigation (POI) which is suitable for our mix-domain dia-
logue experiments. There are 2,425 dialogues for training, 302
for validation and 302 for testing, as shown in the upper half
of Table I.
In this original dataset, each dialogue is of a single domain
where all of its turns are on that domain. Each turn is
composed of a sentence pair, one sentence is a user utterance,
the other sentence is the corresponding machine response.
A dialogue is a sequence of turns. To create mix-domain
dialogues for our experiments, we make some changes in this
dataset as follows:
• We keep the dialogues in the calendar domain as they
are.
• We take a half of dialogues in the weather domain and
a half of dialogues in the POI domain and mix their
turns together, resulting in a dataset of mixed weather-
POI dialogues. In this mixed-domain dialogue, there is a
turn in the weather domain, followed by a turn in POI
domain or vice versa.
We call this dataset the sequential turn dataset. Since the
start turn of a dialogue has a special role in triggering the
learning systems, we decide to create another and different
mixed-domain dataset with the following mixing method:
• The first turn and the last turn of each dialogue are kept
as in their original.
• The internal turns are mixed randomly.
We call this dataset the random turn dataset. Some statistics
of these mixed-domain datasets are shown in the lower half
of the Table I.
B. Experimental Settings
For the task-oriented Sequicity model, we keep the best
parameter settings as reported in the original framework, on
the same KVRET dataset [9]. In particular, the hidden size of
GRU unit is set to 50; the learning rate of Adam optimizer is
0.003. In addition to the original GRU unit, we also re-run this
framework with simple RNN unit to compare the performance
of different recurrent network types. The Sequicity tool is
freely available for download.2
2https://github.com/WING-NUS/sequicity
SOME STATISTICS OF THE DATASETS USED IN OUR EXPERIMENTS. THE ORIGINAL KVRET DATASET IS SHOWN IN THE UPPER HALF OF THE TABLE. THE
MIXED DATASET IS SHOWN IN THE LOWER HALF OF THE TABLE.
TABLE I
Dataset
Dialogues
Domains
Dataset
Domains
Train
Test
Dev.
KVRET
Train: 2,425 ; Test: 302 ; Dev.: 302
calendar
weather
POI
MIXED DOMAINS
calendar
weather
828
102
102
398
50
50
POI
400
50
50
Mixed weather -- POI
400
50
50
For the multi-domain belief tracker model, we set the hidden
size of LSTM units to 50 as in the original model; word
embedding size is 300 and number of training epochs is 100.
The corresponding tool is also freely available for download.3
about 75.62% of Success F1 in comparison to about 81.1%
(as reported in the Sequicity paper, not shown in our table).
Appendix A shows some example dialogues generated auto-
matically by our implemented system.
C. Results
Our experimental results are shown in Table II. The first
half of the table contains results for task-oriented dialogue
with the Sequicity framework with two scenarios for training
data preparation. For each experiment, we run our models
for 3 times and their scores are averaged as the final score.
The mixed training scenario performs the mixing of both the
training data, development data and the test data as described
in the previous subsection. The non-mixed training scenario
performs the mixing only on the development and test data,
keeps the training data unmixed as in the original KVRET
dataset. As in the Sequicity framework, we report entity
match rate, BLEU score and Success F1 score. Entity match
rate evaluates task completion,
it determines if a system
can generate all correct constraints to search the indicated
entities of the user. BLEU score evaluates the language quality
of generated responses. Success F1 balances the recall and
precision rates of slot answers. For further details on these
metrics, please refer to [9].
the GRU unit
In the first series of experiments, we evaluate the Sequicity
framework on different mixing scenarios and different recur-
rent units (GRU or RNN), on two mixing methods (sequential
turn or random turn), as described previously. We see that
when the training data is kept unmixed, the match rates are
better than those of the mixed training data. It is interesting
to note that
is much more sensitive with
mixed data than the simple RNN unit with the corresponding
absolute point drop of about 10%, compared to about 3.5%.
However, the entity match rate is less important than the
Success F1 score, where the GRU unit outperforms RNN in
both sequential turn and random turn by a large margin. It is
logical that if the test data are mixed but the training data are
unmixed, we get lower scores than when both the training data
and test data are mixed. The GRU unit is also better than the
RNN unit on response generation in terms of BLEU scores.
We also see that the task-oriented dialogue system has
difficulty running on mixed-domain dataset; it achieves only
3https://github.com/osmanio2/multi-domain-belief-tracking
In the second series of experiments, we evaluate the belief
tracking components of two systems, the specialized multi-
domain belief tracker and the Sequicity bspan component. As
shown in the lower half of the Table II, Sequicity capability
of belief tracking is much worse than that of the multi-domain
belief tracker. The slot accuracy gap between the tools is about
21.6%, the value accuracy gap is about 34.4%; that is a large
average gap of 28% of accuracy. This result suggests a future
work on combining a specialized belief tracking module with
an end-to-end task-oriented dialogue system to improve further
the performance of the overall dialogue system.
D. Error Analysis
In this subsection, we present an example of erroneous
mixed dialogue with multple turns. Table III shows a dialogue
in the test set where wrong generated responses of the Sequic-
ity system are marked in bold font.
In the first turn, the system predicts incorrectly the bspan,
thus generates wrong slot values (heavy traffic and
Pizza Hut). The word Pizza Hut is an arbitrary value
selected by the system when it cannot capture the correct
value home in the bspan. In the second turn, the machine is
not able to capture the value this_week. This failure does
not manifest immediately at this turn but it is accumulated to
make a wrong answer at the third turn (monday instead of
this_week).
The third turn is of domain weather and the fourth turn
is switched to domain POI. The bspan value cleveland
is retained through cross domain, resulting in an error in the
fourth turn, where cleveland is shown instead of home.
This example demonstrates a weakness of the system when
being trained on a mixed-domain dataset. In the fifth turn,
since the system does not recognize the value fastest in
the bspan, it generates a random and wrong value moderate
traffic. Note that the generated answer of the sixth turn
is correct despite of the wrong predicted bspan; however, it is
likely that if the dialogue continues, this wrong bspan may re-
sult in more answer mistakes. In such situations, multi-domain
belief tracker usually performs better at bspan prediction.
OUR EXPERIMENTAL RESULTS. MATCH. AND SUCC. F1 ARE ENTITY MATCH RATE AND SUCCESS F1. THE UPPER HALF OF THE TABLE SHOWS RESULTS
OF TASK-ORIENTED DIALOGUE WITH THE SEQUICITY FRAMEWORK. THE LOWER HALF OF THE TABLE SHOWS RESULTS OF MULTI-DOMAIN BELIEF
TABLE II
TRACKER.
Case 1 - sequential turn
Match.
Sequicity
mixed training
non-mixed training
GRU
RNN
GRU
RNN
Belief tracker
Multi-domain
Sequicity
0.6367
0.7354
0.7399
0.7706
Domain -
accuracy
0.8253
BLEU
0.1930
0.1847
0.1709
0.1453
Slot -
accuracy
0.9329
0.7171
Case 2 - random turn
BLEU
0.1862
0.1729
0.1820
0.1580
Succ. F1
0.7562
0.7105
0.7173
0.6633
Succ. F1 Match.
0.7358
0.6860
0.6591
0.7129
0.7488
0.7055
0.6156
0.6995
Value -
accuracy
0.9081
0.5644
A MIXED DIALOGUE EXAMPLE IN THE TEST SET WITH ERRONEOUS GENERATED RESPONSES. THE LAST TWO COLUMNS SHOW RESPECTIVELY THE
SYSTEM'S GENERATED BSPAN AND THE GOLD BSPAN OR BELIEF TRACKER.
TABLE III
Turn
1.Human
1.Machine
2.Human
2.Machine
3.Human
3.Machine
4.Human
4.Machine
5.Human
5.Machine
6.Human
6.Machine
Dialogue
car please send me the fastest route to go back home
there is heavy traffic on the way to Pizza Hut.
what is the weather like this week
what city are you interested in ?
Cleveland .
it will be clear sky on monday
what is the address ?
cleveland is located at 5672 barringer street
please send me the fastest route on screen and let 's go there
, thank you !
there is moderate traffic on our way but i sent the route to
your screen , drive carefully !
thank .
you are welcome .
Domain
POI
POI
Weather info
Weather info
Weather info
Weather info
POI
POI
POI
POI
Generated bspan
EOS_Z1
Gold bspan
home fastest EOS_Z1
EOS_Z1
this_week EOS_Z1
cleveland EOS_Z1
cleveland EOS_Z1
cleveland EOS_Z1
home fastest EOS_Z1
cleveland EOS_Z1
home fastest EOS_Z1
cleveland EOS_Z1
EOS_Z1
[4] Tsung-Hsien Wen, David Vandyke, Nikola Mrksic, Milica Gasic, Lina M.
Rojas-Barahona, Pei-Hao Su, Stefan Ultes, and Steve Young. A
network-based end-to-end trainable task-oriented dialogue system.
In
Proceedings of EACL, 2017.
[5] Antoine Bordes, Y-Lan Boureau, and Jason Weston. Learning end-to-
end goal-oriented dialogue. In Proceedings of ICLR, 2017.
[6] Mihail Eric and Christopher D. Manning. A copy-augmented sequence-
to-sequence architecture gives good performance on task-oriented dia-
logue. In Proceedings of EACL, 2017.
[7] Fei Liu and Julien Perez. Gated end-to-end memory networks.
In
Proceedings of EACL, 2017.
[8] Min Joon Seo, Hannaneh Hajishirzi, and Ali Farhadi. Query-regression
networks for machine comprehension. In Preprint ArXiv, 2016.
[9] Wenqiang Lei, Xisen Jin, Zhaochun Ren, Xiangnan He, Min-Yen Kan,
and Dawei Yin. Sequicity: Simplifying task-oriented dialogue systems
with single sequence-to-sequence architectures. In Proceedings of ACL,
2018.
[10] Milica Gasic Osman Ramadan, Paweł Budzianowski. Large-scale multi-
domain belief tracking with knowledge sharing. In Proceedings of ACL,
2018.
[11] John F Kelley.
iterative design methodology for user-friendly natural
language office information applications. ACM Transactions on Infor-
mation Systems, 2(1):26 -- 41, 1984.
IV. CONCLUSION
We have presented the problem of mixed-domain task-
oriented dialogue and its empirical results on two datasets.
We employ two state-of-the-art, publicly available tools, one
is the Sequicity framework for task-oriented dialogue, and
another is the multi-domain belief tracking system. The belief
tracking capability of the specialized system is much better
than that of the end-to-end system. We also show the difficulty
of task-oriented dialogue systems on mixed-domain datasets
through two series of experiments. These results give some
useful insights in combining the approaches to improve the
performance of a commercial chatbot platform which is under
active development in our company. We plan to extend this
current research and integrate its fruitful results into a future
version of the platform.
REFERENCES
[1] Bing Liu, Gokhan Tur, Dilek Hakkani-Tur, Pararth Shah, and Larry
Heck. Dialogue learning with human teaching and feedback in end-to-
end trainable task-oriented dialogue systems. In Proceedings of NAACL,
2018.
[2] Iulian Serban, Alessandro Sordoni, Yoshua Bengio, Aaron C. Courville,
and Joelle Pineau. Building end-to-end dialogue systems using genera-
tive hierarchical neural network models. In Proceedings of AAAI, 2016.
[3] Jiwei Li, Michel Galley, Chris Brockett, Georgios P. Spithourakis,
Jianfeng Gao, and Bill Dolan. A persona-based neural conversation
model. In Proceedings of ACL, 2016.
APPENDIX
The following is three example dialogues generated by our
system. The first dialogue is in single-domain.
Dialogue 1
Domain
Calendar
Calendar
Turn
Human What time is my next din-
ner event and who will be
attending?
your dinner is on MONDAY
at 5 PM .
That will do, thanks.
you are welcome
Human
Machine
Machine
The next two dialogues are in mixed-domains.
Turn
Human
Dialogue 2
ad-
Please give me
dress and directions to home
within 5 miles of here,
avoiding all heavy traffic.
the
Domain
POI
Machine HOME is located at 5671
POI
Human
BARRINGER STREET
what is the forecast for the
next 7 days?
weather info
Machine what city are you interested
weather info
Human
Machine
Human
Machine
Turn
Human
Machine
Human
in ?
Cleveland, will it be windy? weather info
it will not be windy in
weather info
Cleveland this week .
Thank you.
you're welcome.
Dialogue 3
are there any chinese restau-
rants nearby?
the closest
is TAI PAN
restaurant , and TAI PAN
is 5 miles away with NO
TRAFFIC
what's the weather like to-
day?
Domain
POI
POI
weather info
Machine what city are you wanting to
weather info
Human
know the weather for ?
for
please?weather info
Newyork
city
Machine Today is CLEAR SKIES,
weather info
Human
Machine
Human
Machine
and WARM.
ok, good, set the direction to
there
the address is 830 Almanor
Ln , i sent it on your screen
ok thanks
you're welcome !
POI
POI
|
1907.11983 | 1 | 1907 | 2019-07-27T21:51:52 | A Hybrid Neural Network Model for Commonsense Reasoning | [
"cs.CL"
] | This paper proposes a hybrid neural network (HNN) model for commonsense reasoning. An HNN consists of two component models, a masked language model and a semantic similarity model, which share a BERT-based contextual encoder but use different model-specific input and output layers. HNN obtains new state-of-the-art results on three classic commonsense reasoning tasks, pushing the WNLI benchmark to 89%, the Winograd Schema Challenge (WSC) benchmark to 75.1%, and the PDP60 benchmark to 90.0%. An ablation study shows that language models and semantic similarity models are complementary approaches to commonsense reasoning, and HNN effectively combines the strengths of both. The code and pre-trained models will be publicly available at https://github.com/namisan/mt-dnn. | cs.CL | cs | A Hybrid Neural Network Model for Commonsense Reasoning
Pengcheng He1, Xiaodong Liu2, Weizhu Chen1, Jianfeng Gao2
1 Microsoft Dynamics 365 AI 2 Microsoft Research
{penhe,xiaodl,wzchen,jfgao}@microsoft.com
9
1
0
2
l
u
J
7
2
]
L
C
.
s
c
[
1
v
3
8
9
1
1
.
7
0
9
1
:
v
i
X
r
a
Abstract
This paper proposes a hybrid neural network
(HNN) model for commonsense reasoning.
An HNN consists of two component mod-
els, a masked language model and a seman-
tic similarity model, which share a BERT-
based contextual encoder but use different
model-specific input and output layers. HNN
obtains new state-of-the-art results on three
classic commonsense reasoning tasks, push-
ing the WNLI benchmark to 89%, the Wino-
grad Schema Challenge (WSC) benchmark to
75.1%, and the PDP60 benchmark to 90.0%.
An ablation study shows that language mod-
els and semantic similarity models are com-
plementary approaches to commonsense rea-
soning, and HNN effectively combines the
strengths of both. The code and pre-trained
models will be publicly available at https:
//github.com/namisan/mt-dnn.
1. The city councilmen refused the demonstra-
tors a permit because they feared violence.
Who feared violence?
A. The city councilmen B. The demon-
strators
2. The city councilmen refused the demonstra-
tors a permit because they advocated vio-
lence. Who advocated violence?
A. The city councilmen B. The demon-
strators
3. The trophy doesn't fit in the brown suitcase
because it is too big. What is too big?
A. The trophy B. The suitcase
4. The trophy doesn't fit in the brown suitcase
because it is too small. What is too small?
A. The trophy B. The suitcase
1
Introduction
Commonsense reasoning is fundamental to natural
language understanding (NLU). As shown in the
examples in Table 1, in order to infer what the pro-
noun "they" refers to in the first two statements,
one has to leverage the commonsense knowledge
that "demonstrators usually cause violence and
city councilmen usually fear violence." Similarly,
it is obvious to humans what the pronoun "it"
refers to in the third and fourth statements due to
the commonsense knowledge that "An object can-
not fit in a container because either the object (tro-
phy) is too big or the container (suitcase) is too
small."
In this paper, we study two classic common-
sense reasoning tasks:
the Winograd Schema
Challenge (WSC) and Pronoun Disambiguation
Problem (PDP) (Levesque et al., 2011; Davis and
Marcus, 2015). Both tasks are formulated as
an anaphora resolution problem, which is a form
Table 1: Examples from Winograd Schema Challenge
(WSC). The task is to identify the reference of the pro-
noun in bold.
of co-reference resolution, where a machine (AI
agent) must identify the antecedent of an ambigu-
ous pronoun in a statement. WSC and PDP dif-
fer from other co-reference resolution tasks (Soon
et al., 2001; Ng and Cardie, 2002; Peng et al.,
2016) in that commonsense knowledge, which
cannot be explicitly decoded from the given text,
is needed to solve the problem, as illustrated in the
examples in Table 1.
Comparing with other commonsense reason-
ing tasks, such as COPA (Roemmele et al.,
2011), Story Cloze Test (Mostafazadeh et al.,
2016), Event2Mind (Rashkin et al., 2018), SWAG
(Zellers et al., 2018), ReCoRD (Zhang et al.,
2018), and so on, WSC and PDP better approxi-
mate real human reasoning, can be easily solved
by native English-speaker (Levesque et al., 2011),
and yet are challenging for machines. For exam-
ple, the WNLI task, which is derived from WSC,
is considered the most challenging NLU task in
the General Language Understanding Evaluation
(GLUE) benchmark (Wang et al., 2018). Most ma-
chine learning models can hardly outperform the
naive baseline of majority voting (scored at 65.1)
1, including BERT (Devlin et al., 2018a) and Dis-
tilled MT-DNN (Liu et al., 2019a).
While traditional methods of commonsense rea-
soning rely heavily on human-crafted features
and knowledge bases (Rahman and Ng, 2012a;
Sharma et al., 2015; Schuller, 2014; Bailey et al.,
2015; Liu et al., 2017), we explore in this study
machine learning approaches using deep neural
networks (DNN). Our method is inspired by two
categories of DNN models proposed recently.
The first are neural language models trained on
large amounts of text data. Trinh and Le (2018)
proposed to use a neural language model trained
on raw text from books and news to calculate
the probabilities of the natural language sentences
which are constructed from a statement by replac-
ing the to-be-resolved pronoun in the statement
with each of its candidate references (antecedent),
and then pick the candidate with the highest prob-
ability as the answer. Kocijan et al. (2019) showed
that a significant improvement can be achieved by
fine-tuning a pre-trained masked language model
(BERT in their case) on a small amount of WSC
labeled data.
The second category of models are seman-
tic similarity models. Wang et al. (2019) for-
mulated WSC and PDP as a semantic matching
problem, and proposed to use two variations of
the Deep Structured Similarity Model (DSSM)
(Huang et al., 2013) to compute the semantic sim-
ilarity score between each candidate antecedent
and the pronoun by (1) mapping the candidate and
the pronoun and their context into two vectors,
respectively, in a hidden space using deep neu-
ral networks, and (2) computing cosine similarity
between the two vectors. The candidate with the
highest score is selected as the result.
The two categories of models use different in-
ductive biases when predicting outputs given in-
puts, and thus capture different views of the data.
While language models measure the semantic co-
1See
the GLUE
leaderboard
at
https://
gluebenchmark.com/leaderboard
herence and wholeness of a statement where the
pronoun to be resolved is replaced with its candi-
date antecedent, DSSMs measure the semantic re-
latedness of the pronoun and its candidate in their
context.
Therefore,
inspired by multi-task learning
(Caruana, 1997; Liu et al., 2015, 2019b), we pro-
pose a hybrid neural network (HNN) model that
combines the strengths of both neural language
models and a semantic similarity model. As
shown in Figure 1, HNN consists of two com-
ponent models, a masked language model and a
deep semantic similarity model. The two compo-
nent models share the same text encoder (BERT),
but use different model-specific input and output
layers. The final output score is the combina-
tion of the two model scores. The architecture of
HNN bears a strong resemblance to that of Multi-
Task Deep Neural Network (MT-DNN) (Liu et al.,
2019b), which consists of a BERT-based text en-
coder that is shared across all tasks (models) and a
set of task (model) specific output layers. Follow-
ing (Liu et al., 2019b; Kocijan et al., 2019), the
training procedure of HNN consists of two steps:
(1) pretraining the text encoder on raw text 2, and
(2) multi-task learning of HNN on WSCR which
is the most popular WSC dataset, as suggested by
Kocijan et al. (2019).
HNN obtains new state-of-the-art results with
significant improvements on three classic com-
monsense reasoning tasks, pushing the WNLI
benchmark in GLUE to 89%, the WSC benchmark
3 (Levesque et al., 2011) to 75.1%, and the PDP-60
benchmark 4 to 90.0%. We also conduct an abla-
tion study which shows that language models and
semantic similarity models provide complemen-
tary approaches to commonsense reasoning, and
HNN effectively combines the strengths of both.
2 The Proposed HNN Model
The architecture of the proposed hybrid model is
shown in Figure 1. The input includes a sentence
S, which contains the pronoun to be resolved, and
a candidate antecedent C. The two component
models, masked language model (MLM) and se-
2In this study we use the pre-trained BERT large models
released by the authors.
3https://cs.nyu.edu/faculty/davise/
papers/WinogradSchemas/WS.html
4https://cs.nyu.edu/faculty/davise/
papers/WinogradSchemas/PDPChallenge2016.
xml
Figure 1: Architecture of the hybrid model for commonsense reasoning. The model consists of two component
models, a masked language model (MLM) and a semantic similarity model (SSM). The input includes the sentence
S, which contains a pronoun to be resolve, and a candidate antecedent C. The two component models share the
BERT-based contextual encoder, but use different model-specific input and output layers. The final output score is
the combination of the two component model scores.
mantic similarity model (SSM), share the BERT-
based contextual encoder, but use different model-
specific input and output layers. The final output
score, which indicates whether C is the correct
candidate of the pronoun in S, is the combination
of the two component model scores.
2.1 Masked Language Model (MLM)
This component model follows Kocijan et al.
(2019).
In the input layer, a masked sentence
is constructed using S by replacing the to-be-
resolved pronoun in S with a sequence of N
[MASK] tokens, where N is the number of tokens
in candidate C.
In the output layer, the likelihood of C being re-
ferred to by the pronoun in S is scored using the
BERT-based masked language model Pmlm(CS).
If C = {c1...cN} consists of multiple tokens,
log Pmlm(CS) is computed as the average of log-
probabilities of each composing token:
Pmlm(CS) = exp
(cid:88)
(cid:32)
(cid:33)
1
N
k=1...N
log Pmlm(ckS)
(1)
.
2.2 Semantic Similarity Model (SSM)
In the input layer, we treat sentence S and candi-
date C as a pair (S, C) that is packed together as
a word sequence, where we add the [CLS] token
as the first token and the [SEP] token between S
and C.
After applying the shared embedding layers, we
obtain the semantic representations of S and C,
denoted as s ∈ Rd and c ∈ Rd, respectively.
We use the contextual embedding of [CLS] as s.
Suppose C consists of N tokens, whose contex-
tual embeddings are h1, ..., hN , respectively. The
semantic representation of the candidate C, c, is
computed via attention as follows:
s(cid:62)W1hk√
αk = softmax(
(2)
),
d
(cid:88)
c =
αk · hk.
(3)
k=1...N
where W1 is a learnable parameter matrix, and α
is the attention score.
We use the contextual embedding of the first to-
ken of the pronoun in S as the semantic represen-
tation of the pronoun, denoted as p ∈ Rd. In the
output layer, the semantic similarity between the
pronoun and the context is computed using a bi-
linear model:
Sim(C, S) = p(cid:62)W2c,
(4)
where W2 is a learnable parameter matrix. Then,
SSM predicts whether C is a correct candidate
(i.e., (C, S) is a positive pair, labeled as y = 1)
using the logistic function:
Pssm(y = 1C, S) =
.
(5)
The final output score of pair (S, C) is a linear
combination of the MLM score of Eqn. 1 and the
SSM score of Eqn. 5:
1 + exp (−Sim(C, S))
1
Score(C, S) =
1
2
[Pmlm(CS)+Pssm(y = 1C, S)].
(6)
2.3 The Training Procedure
We train our model of Figure 1 on the WSCR
dataset, which consists of 1886 sentences, each
being paired with a positive candidate antecedent
and a negative candidate.
The shared BERT encoder is initialized using
the published BERT uncased large model (Devlin
et al., 2018a). We then finetune the model on the
WSCR dataset by optimizing the combined objec-
tives:
Lmlm + Lssm + Lrank,
(7)
where Lmlm is the negative log-likelihood based
on the masked language model of Eqn. 1, and
Lssm is the cross-entropy loss based on semantic
similarity model of Eqn. 5.
Lrank is the pair-wise rank loss. Consider a
sentence S which contains a pronoun to be re-
solved, and two candidates C+ and C−, where
C+ is correct and C− is not. We want to maxi-
mize ∆ = Score(S, C+) − Score(S, C−), where
Score(.) is defined by Eqn. 6. We achieve this via
optimizing a smoothed rank loss:
Lrank = log(1 + exp (−γ(∆ + β))),
(8)
where γ ∈ [1, 10] is the smoothing factor and
β ∈ [0, 1] the margin hyperparameter.
In our
experiments, the default setting is γ = 10, and
β = 0.6.
3 Experiments
We evaluate the proposed HNN on three common-
sense benchmarks: WSC (Levesque et al., 2012),
PDP605 and WNLI. WNLI is derived from WSC,
and is considered the most challenging NLU task
in the GLUE benchmark (Wang et al., 2018).
5https://cs.nyu.edu/faculty/davise/
papers/WinogradSchemas/PDPChallenge2016.
xml
3.1 Datasets
Corpus
WNLI
PDP60
WSC
WSCR
#Train
#Dev
-
-
-
1322
634 + 71
-
-
564
#Test
146
60
285
-
Table 2: Summary of the three benchmark datasets:
WSC, PDP60 and WNLI, and the additional dataset
WSCR. Note that we only use WSCR for training. For
WNLI, we merge its official training set containing 634
instances and dev set containing 71 instances as its final
dev set.
Table 2 summarizes the datasets which are used
in our experiments. Since the WSC and PDP60
datasets do not contain any training instances, fol-
lowing (Kocijan et al., 2019), we adopt the WSCR
dataset (Rahman and Ng, 2012b) for model train-
ing and selection. WSCR contains 1886 instances
(1322 for training and the rest as dev set). Each
instance is presented using the same structure as
that in WSC.
For the WNLI instances, we convert them to
the format of WSC as illustrated in Table 3: we
first detect pronouns in the premise using spaCy6;
then given the detected pronoun, we search its left
of the premise in hypothesis to find the longest
common substring (LCS) ignoring character case.
Similarly, we search its right part to the LCS; by
comparing the indexes of the extracted LSCs, we
extract the candidate. A detailed example of the
conversion process is provided in Table 3.
Implementation Detail
3.2
Our implementation of HNN is based on the Py-
Torch implementation of BERT7. All the models
are trained with hyper-parameters depicted as fol-
lows unless stated otherwise. The shared layer
is initialized by the BERT uncased large model.
Adam (Kingma and Ba, 2014) is used as our opti-
mizer with a learning rate of 1e-5 and a batch size
of 32 or 16. The learning rate is linearly decayed
during training with 100 warm up steps. We select
models based on the dev set by greedily searching
epochs between 8 and 10. The trainable parame-
ters, e.g., W1 and W2, are initialized by a trun-
cated normal distribution with a mean of 0 and a
6https://spacy.io
7https://github.com/huggingface/
pytorch-pretrained-BERT
1. Premise: The cookstove was warming the
kitchen, and the lamplight made it seem even
warmer.
Hypothesis: The lamplight made the cook-
stove seem even warmer.
Index of LCS in the hypothesis: left[0, 2],
right[5, 7]
Candidate: [3, 4] (the cookstove)
2. Premise: The cookstove was warming the
kitchen, and the lamplight made it seem even
warmer.
Hypothesis: The lamplight made the kitchen
seem even warmer.
Index of LCS in the hypothesis: left[0, 2],
right[5, 7]
Candidate: [3, 4] (the kitchen)
3. Premise: The cookstove was warming the
kitchen, and the lamplight made it seem even
warmer.
Hypothesis: The lamplight made the lamp-
light seem even warmer.
Index of LCS in the hypothesis: left[0, 2],
right[5, 7]
Candidate: [3, 4] (the lamplight)
4. Converted: The cookstove was warming the
kitchen, and the lamplight made it seem even
warmer.
A. the cookstove B. the kitchen C. the
lamplight
Table 3: Examples of transforming WNLI to WSC for-
mat. Note that the text highlighted by brown is the
longest common substring from the left part of pronoun
it, and the text highlighted by violet is the longest com-
mon substring from its right.
standard deviation of 0.01. The margin hyperpa-
rameter, β in Eqn. 8, is set to 0.6 for MLM and
0.5 for SSM, and γ is set to 10 for all tasks. We
also apply SWA (Izmailov et al., 2018) to improve
the generalization of models. All the texts are
tokenized using WordPieces, and are chopped to
spans containing 512 tokens at most.
3.3 Results
We compare our HNN with a list of state-of-the-art
models in the literature, including BERT (Devlin
et al., 2018b), GPT-2 (Radford et al., 2019) and
DSSM (Wang et al., 2019). The brief description
of each baseline is introduced as follows.
1. BERTLARGE-LM (Devlin et al., 2018b): This
is the large BERT model, and we use MLM to
predict a score for each candidate following
Eq 1.
2. GPT-2 (Radford et al., 2019): During predic-
tion, We first replace the pronoun in a given
sentence with its candidates one by one. We
use the GPT-2 model to compute a score for
each new sentence after the replacement, and
select the candidate with the highest score as
the final prediction.
3. BERTWiki-WSCR and BERTWSCR (Kocijan
et al., 2019): These two models use the same
approach as BERTLARGE-LM, but are trained
with different additional training data. For
example, BERTWiki-WSCR is firstly fine-tuned
on the constructed Wikipedia data and then
on WSCR. BERTWSCR is directly fine-tuned
on WSCR.
4. DSSM (Wang et al., 2019): It is the unsu-
pervised semantic matching model trained on
the dataset generated with heuristic rules.
5. HNN: It is the proposed hybrid neural net-
work model.
The main results are reported in Table 4.
Compared with all the baselines, HNN obtains
much better performance across three bench-
marks. This clearly demonstrates the advantage
of the HNN over existing models. For exam-
ple, HNN outperforms the previous state-of-the-
art BERTWiki-WSCR model with a 11.7% abso-
lute improvement (83.6% vs 71.9%) on WNLI
and a 2.8% absolute improvement (75.1% vs
72.2%) on WSC in terms of accuracy. Mean-
while, it achieves a 11.7% absolute improvement
over the previous state-of-the-art BERTLARGE-LM
model on PDP60 in accuracy. Note that both
BERTWiki-WSCR and BERTLARGE-LM are using lan-
guage model-based approaches to solve the pro-
noun resolution problem. On the other hand, We
observe that DSSM without pre-training is com-
parable to BERTLARGE-LM which is pre-trained on
the large scale text corpus (63.0% vs 62.0% on
WSC and 75.0% vs 78.3% on PDP60). Our results
show that HNN, combining the strengths of both
DSSM and BERTWSCR, has consistently achieved
new state-of-the-art results on all three tasks.
WNLI WSC PDP60
75.0
78.3
65.1
-
DSSM (Wang et al., 2019)
BERTLARGE-LM (Devlin et al., 2018a)
GPT-2 (Radford et al., 2019)
BERTWiki-WSCR (Kocijan et al., 2019)
BERTWSCR (Kocijan et al., 2019)
HNN
HNNensemble
-
71.9
70.5
83.6
89.0
63.0
62.0
70.7
72.2
70.3
75.1
-
-
-
-
90.0
-
Table 4: Test results
Figure 2: Comparison with SSM and MLM on WNLI examples.
WNLI WSCR WSC PDP60
77.1
90.0
HNN
86.7
-SSM
74.5
-MLM 75.1
88.3
75.1
72.6
72.3
85.6
82.4
83.7
Table 5: Ablation study of the two component model in
HNN. Note that WNLI and WSCR are reported on dev
sets while WSC and PDP60 are reported on test sets.
To further boost the WNLI accuracy on the
GLUE benchmark leaderboard, we record the
model prediction at each epoch, and then produce
the final prediction based on the majority voting
from the last six model predictions. We refer to the
ensemble of six models as HNNensemble in Table 4.
HNNensemble brings a 5.4% absolute improvement
(89.0% vs 83.6%) on WNLI in terms of accuracy.
3.4 Ablation study
In this section, we study the importance of each
component in HNN by answering following ques-
tions:
How important are the two component models:
MLM and SSM?
To answer this question, we first remove each
component model, either SSM or MLM, and then
report the performance impact of these compo-
nent models. Table 5 summarizes the experimen-
tal results. It is expected that the removal of ei-
ther component model results in a significant per-
formance drop. For example, with the removal
of SSM, the performance of HNN is downgraded
from 77.1% to 74.5% on WNLI. Similarly, with
the removal of MLM, HNN only obtains 75.1%,
which amounts to a 2% drop. All these observa-
tions clearly demonstrate that SSM and MLM are
complementary to each other and the HNN model
benefits from the combination of both.
Figure 2 gives several examples showing how
SSM and MLM complement each other on WNLI.
We see that in the first pair of examples, MLM
correctly predicts the label while SSM does not.
This is due to the fact that "the roof repaired" ap-
pears more frequently than "the tree repaired" in
the text corpora used for model pre-training. How-
ever, in the second pair, since both "the demonstra-
tors" and "the city councilment" could advocate
violence and neither occurs significantly more of-
ten than the other, SSM is more effective in dis-
tinguishing the difference based on their context.
The proposed HNN, which combines the strengths
of these two models, can obtain the correct results
in both cases.
Does the additional ranking loss help?
As in Eqn. 7, the training objective of HNN
model contains three losses. The first two are
based on the two component models, respectively,
and the third one, as defined in Eqn. 8, is a ranking
loss based on the score function in Eqn. 6. At first
glance, the ranking loss seems redundant. Thus,
we compare two versions of HNN trained with and
without the ranking loss. Experimental results are
shown in Table 6. We see that without the rank-
ing loss, the performance of HNN drops on three
datasets: WNLI, WSCR and WSC. On the PDP60
dataset, without the ranking loss, the model per-
forms slightly better. However, since the test set
of PDP60 includes only 60 samples, the difference
is not statistically significant. Thus, we decide to
always include the ranking loss in the training ob-
jective of HNN.
HNN
HNN-Rank
WNLI WSCR WSC PDP60
77.1
90.0
91.7
74.8
75.1
71.9
85.6
85.1
Table 6: Ablation study of the ranking loss. Note that
WNLI and WSCR are reported on dev sets while WSC
and PDP60 are reported on test sets.
Is the WNLI task a ranking or classification
task?
Figure 3: Comparison of different task formulation on
WNLI.
The WNLI task can be formulated as either a
ranking task or a classification task. To study the
difference in problem formulation, we conduct ex-
periments to compare the performance of a model
used as a classifier or a ranker. For example, given
a trained HNN, when it is used as a classifier we
set a threshold to decide label (0/1) for each input.
When it is used as a ranker, we simply pick the
top-ranked candidate as the correct answer. We
run the comparison using all three models HNN,
MLM and SSM. As shown in Figure 3, the rank-
ing formulation is consistently better than the clas-
sification formulation for this task. For example,
the difference in the HNN model is about absolute
2.5% (74.6% vs 77.1%) in terms of accuracy.
4 Conclusion
We propose a hybrid neural network (HNN) model
for commonsense reasoning. HNN consists of two
component models, a masked language model and
a deep semantic similarity model, which share a
BERT-based contextual encoder but use different
model-specific input and output layers.
HNN obtains new state-of-the-art results on
three classic commonsense reasoning tasks, push-
ing the WNLI benchmark to 89%,
the WSC
benchmark to 75.1%, and the PDP60 benchmark
to 90.0%. We also justify the design of HNN via a
series of ablation experiments.
In future work, we plan to extend HNN to more
sophisticated reasoning tasks, especially those
where large-scale language models like BERT and
GPT do not perform well, as discussed in (Gao
et al., 2019; Niven and Kao, 2019).
Acknowledgments
We would like to thank Michael Patterson from
Microsoft for his help on the paper.
References
Daniel Bailey, Amelia Harrison, Yuliya Lierler,
Vladimir Lifschitz, and Julian Michael. 2015. The
winograd schema challenge and reasoning about
In Knowledge Representation; Coref-
correlation.
erence Resolution; Reasoning.
Rich Caruana. 1997. Multitask learning. Machine
learning, 28(1):41 -- 75.
Ernest Davis and Gary Marcus. 2015. Commonsense
reasoning and commonsense knowledge in artificial
intelligence. Communications of the ACM.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and
Kristina Toutanova. 2018a. Bert: Pre-training of
deep bidirectional transformers for language under-
standing. arXiv preprint arXiv:1810.04805.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and
Kristina Toutanova. 2018b. Bert: Pre-training of
deep bidirectional transformers for language under-
standing. arXiv preprint arXiv:1810.04805.
Jianfeng Gao, Michel Galley, and Lihong Li. 2019.
Neural approaches to conversational ai. Founda-
tions and Trends R(cid:13) in Information Retrieval, 13(2-
3):127 -- 298.
Po-Sen Huang, Xiaodong He, Jianfeng Gao, Li Deng,
Alex Acero, and Larry Heck. 2013. Learning deep
structured semantic models for web search using
clickthrough data. In Proceedings of the 22nd ACM
international conference on Conference on informa-
tion & knowledge management, pages 2333 -- 2338.
ACM.
Pavel Izmailov, Dmitrii Podoprikhin, Timur Garipov,
Dmitry Vetrov, and Andrew Gordon Wilson. 2018.
Averaging weights leads to wider optima and better
generalization. arXiv preprint arXiv:1803.05407.
Diederik Kingma and Jimmy Ba. 2014. Adam: A
method for stochastic optimization. arXiv preprint
arXiv:1412.6980.
Vid Kocijan, Ana-Maria Cretu, Oana-Maria Camburu,
Yordan Yordanov, and Thomas Lukasiewicz. 2019.
A surprisingly robust trick for winograd schema
challenge. arXiv preprint arXiv:1905.06290.
Hector Levesque, Ernest Davis, and Leora Morgen-
stern. 2012. The winograd schema challenge.
In
Thirteenth International Conference on the Princi-
ples of Knowledge Representation and Reasoning.
Hector J Levesque, Ernest Davis, and Leora Morgen-
stern. 2011. The winograd schema challenge.
In
AAAI spring symposium: Logical formalizations of
commonsense reasoning.
Quan Liu, Hui Jiang, Zhen-Hua Ling, Xiaodan Zhu,
Si Wei, and Yu Hu. 2017. Combing context and
commonsense knowledge through neural networks
In AAAI
for solving winograd schema problems.
Spring Symposium Series.
Xiaodong Liu, Jianfeng Gao, Xiaodong He, Li Deng,
Kevin Duh, and Ye-Yi Wang. 2015. Representa-
tion learning using multi-task deep neural networks
for semantic classification and information retrieval.
In Proceedings of the 2015 Conference of the North
American Chapter of the Association for Computa-
tional Linguistics: Human Language Technologies,
pages 912 -- 921.
Xiaodong Liu, Pengcheng He, Weizhu Chen, and
Improving multi-task deep
Jianfeng Gao. 2019a.
neural networks via knowledge distillation for
arXiv preprint
natural
arXiv:1904.09482.
language understanding.
Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jian-
feng Gao. 2019b. Multi-task deep neural networks
for natural language understanding. arXiv preprint
arXiv:1901.11504.
Nasrin Mostafazadeh, Nathanael Chambers, Xiaodong
He, Devi Parikh, Dhruv Batra, Lucy Vanderwende,
Pushmeet Kohli, and James Allen. 2016. A cor-
pus and cloze evaluation for deeper understanding
of commonsense stories. In Proceedings of the Con-
ference of the North American Chapter of the Asso-
ciation for Computational Linguistics: Human Lan-
guage Technologies.
Vincent Ng and Claire Cardie. 2002.
Improving ma-
chine learning approaches to coreference resolution.
In Proceedings of the Association for Computational
Linguistics. Association for Computational Linguis-
tics.
Timothy Niven and Hung-Yu Kao. 2019. Probing neu-
ral network comprehension of natural language ar-
guments. arXiv preprint arXiv:1907.07355.
Haoruo Peng, Yangqiu Song, and Dan Roth. 2016.
Event detection and co-reference with minimal su-
pervision. In Proceedings of the conference on em-
pirical methods in natural language processing.
Alec Radford, Jeffrey Wu, Rewon Child, David Luan,
Dario Amodei, and Ilya Sutskever. 2019. Language
models are unsupervised multitask learners.
Altaf Rahman and Vincent Ng. 2012a. Resolving
complex cases of definite pronouns: The winograd
schema challenge. In Proceedings of the Joint Con-
ference on Empirical Methods in Natural Language
Processing and Computational Natural Language
Learning.
Altaf Rahman and Vincent Ng. 2012b. Resolving
complex cases of definite pronouns:
the winograd
schema challenge. In Proceedings of the 2012 Joint
Conference on Empirical Methods in Natural Lan-
guage Processing and Computational Natural Lan-
guage Learning, pages 777 -- 789. Association for
Computational Linguistics.
Hannah Rashkin, Maarten Sap, Emily Allaway,
Noah A. Smith, and Yejin Choi. 2018. Event2mind:
Commonsense inference on events, intents, and re-
actions. In Proceedings of the Association for Com-
putational Linguistics.
Melissa Roemmele, Cosmin Adrian Bejan, and An-
drew S Gordon. 2011. Choice of plausible alterna-
tives: An evaluation of commonsense causal reason-
ing. In AAAI Spring Symposium: Logical Formal-
izations of Commonsense Reasoning.
Peter Schuller. 2014. Tackling winograd schemas by
formalizing relevance theory in knowledge graphs.
In Knowledge Representation and Reasoning Con-
ference.
Arpit Sharma, Nguyen H. Vo, Somak Aditya, and
Chitta Baral. 2015. Towards addressing the wino-
grad schema challenge: Building and using a se-
mantic parser and a knowledge hunting module. In
Proceedings of the International Conference on Ar-
tificial Intelligence.
Wee Meng Soon, Hwee Tou Ng,
and Daniel
Chung Yong Lim. 2001. A machine learning ap-
proach to coreference resolution of noun phrases.
Computational linguistics.
Trieu H Trinh and Quoc V Le. 2018. A simple
method for commonsense reasoning. arXiv preprint
arXiv:1806.02847.
Alex Wang, Amapreet Singh, Julian Michael, Felix
Hill, Omer Levy, and Samuel R Bowman. 2018.
Glue: A multi-task benchmark and analysis platform
for natural language understanding. arXiv preprint
arXiv:1804.07461.
Shuohang Wang, Sheng Zhang, Yelong Shen, Xi-
aodong Liu, Jingjing Liu, Jianfeng Gao, and Jing
Jiang. 2019. Unsupervised deep structured seman-
tic models for commonsense reasoning. In Proceed-
ings of the 2019 Conference of the North American
Chapter of the Association for Computational Lin-
guistics: Human Language Technologies, Volume
1 (Long and Short Papers), pages 882 -- 891, Min-
neapolis, Minnesota. Association for Computational
Linguistics.
Rowan Zellers, Yonatan Bisk, Roy Schwartz, and Yejin
Choi. 2018. Swag: A large-scale adversarial dataset
for grounded commonsense inference. In Proceed-
ings of the Conference on Empirical Methods in Nat-
ural Language Processing.
Sheng Zhang, Xiaodong Liu, Jingjing Liu, Jianfeng
Gao, Kevin Duh, and Benjamin Van Durme. 2018.
ReCoRD: Bridging the Gap between Human and
Machine Commonsense Reading Comprehension.
arXiv preprint arXiv:1810.12885.
|
1806.03692 | 1 | 1806 | 2018-06-10T17:05:31 | Deconvolution-Based Global Decoding for Neural Machine Translation | [
"cs.CL",
"cs.AI",
"cs.LG"
] | A great proportion of sequence-to-sequence (Seq2Seq) models for Neural Machine Translation (NMT) adopt Recurrent Neural Network (RNN) to generate translation word by word following a sequential order. As the studies of linguistics have proved that language is not linear word sequence but sequence of complex structure, translation at each step should be conditioned on the whole target-side context. To tackle the problem, we propose a new NMT model that decodes the sequence with the guidance of its structural prediction of the context of the target sequence. Our model generates translation based on the structural prediction of the target-side context so that the translation can be freed from the bind of sequential order. Experimental results demonstrate that our model is more competitive compared with the state-of-the-art methods, and the analysis reflects that our model is also robust to translating sentences of different lengths and it also reduces repetition with the instruction from the target-side context for decoding. | cs.CL | cs |
Deconvolution-Based Global Decoding for Neural Machine Translation
Junyang Lin1,2, Xu Sun2, Xuancheng Ren2, Shuming Ma2, Jinsong Su3, Qi Su1
1School of Foreign Languages, Peking University
2MOE Key Lab of Computational Linguistics, School of EECS, Peking University
3School of Software, Xiamen University
{linjunyang, xusun, renxc, shumingma, sukia}@pku.edu.cn
[email protected]
Abstract
A great proportion of sequence-to-sequence (Seq2Seq) models for Neural Machine Translation
(NMT) adopt Recurrent Neural Network (RNN) to generate translation word by word following
a sequential order. As the studies of linguistics have proved that language is not linear word
sequence but sequence of complex structure, translation at each step should be conditioned on the
whole target-side context. To tackle the problem, we propose a new NMT model that decodes the
sequence with the guidance of its structural prediction of the context of the target sequence. Our
model generates translation based on the structural prediction of the target-side context so that
the translation can be freed from the bind of sequential order. Experimental results demonstrate
that our model is more competitive compared with the state-of-the-art methods, and the analysis
reflects that our model is also robust to translating sentences of different lengths and it also
reduces repetition with the instruction from the target-side context for decoding.
1 Introduction
Deep learning has achieved tremendous success in machine translation, outperforming the traditional
linguistic-rule-based and statistical methods. In recent studies of Neural Machine Translation (NMT),
most models are based on the sequence-to-sequence (Seq2Seq) model based on the encoder-decoder
framework (Kalchbrenner and Blunsom, 2013; Sutskever et al., 2014; Cho et al., 2014) with the attention
mechanism (Bahdanau et al., 2014; Luong et al., 2015). While traditional linguistic-rule-based and sta-
tistical methods of machine translation require much work of feature engineering, NMT can be trained in
the end-to-end fashion. Besides, the attention mechanism can model the alignment relationship between
the source text and translation (Bahdanau et al., 2014; Luong et al., 2015), and some recent improved
versions of attention have proved successful in this task (Tu et al., 2016; Mi et al., 2016; Meng et al.,
2016; Xiong et al., 2017; Vaswani et al., 2017).
However, the decoding pattern of the recent Seq2Seq models is inconsistent with the linguistic analy-
sis. As the conventional decoder translates words in a sequential order, the current generation is highly
dependent on the previous generation and it is short of the knowledge about future generation. Nida
(1969) pointed out that translation goes through a process of analysis, transfer and reconstruction, involv-
ing the deep syntactic and semantic structure of the source and target languages. Language generation
involves complex syntactic analysis and semantic integration, instead of a step-by step word generation
(Frazier, 1987). Moreover, from the perspective of semantics and pragmatics, the syntactic analysis of ut-
terance can be guided by the global lexical-semantic and discourse information (Altmann and Steedman,
1988; Trueswell et al., 1994, 1993; Tyler and Marslen-Wilson, 1977). In brief, the process of transla-
tion is in need of the global information from the target-side context, but the decoding pattern of the
conventional Seq2Seq model in NMT does not meet the requirement.
Recent researches in NMT have taken this issue into consideration by the implementation of bidi-
rectional decoding. Some methods of bidirectional decoding (Liu et al., 2016; Cong et al., 2017) rerank
the candidate translations with the scores from the bidirectional decoding. However, these bidirectional
This work is licensed under a Creative Commons Attribution 4.0 International License.
License details:
http://creativecommons.org/licenses/by/4.0/
decoding methods cannot provide effective complementary information due to the limited search space
of beam search.
In this article, we extend the conventional attention-based Seq2Seq model by introducing the
deconvolution-based decoder, which is a Convolutional Neural Network (CNN) to perform deconvo-
lution. Recently, deconvolution has been applied to the studies of natural language (Zhang et al., 2017;
Shen et al., 2017), which can be regarded as the transposition of the convolution (Long et al., 2015;
Noh et al., 2015). Zhang et al. (2017) applied this method to natural language by modeling sentences
with a convolution-deconvolution autoencoder. The study of Zhang et al. (2017) showed that the decon-
volution solves the problems by reconstructing a representation of high quality irrespective to the order or
length. It can be found that deconvolution owns the potential to provide global information for guidance
of decoding. Therefore, we follow this idea and propose a new model with deconvolution for NMT.
To be specific, the conventional RNN encoder encodes the source sentences to new representations and
sends the final state to the decoder, and the conventional RNN decoder decodes it to the target sentences
with the attention to the encoder outputs.
In our model, our designed deconvolution-based decoder
decodes the final state of the encoder to a matrix representing the global information of the target-side
contexts. Each column of the matrix is learned to be close to the word embedding of the target words.
The conventional RNN decoder can attend to the columns for the information of the target-side context
to perform global decoding in the translation.
Our contributions in this study are illustrated in the following:
• We propose a new model for NMT, which contains a deconvolution-based decoder to provide global
information of the target-side contexts to the RNN decoder, so that the model is able to perform
global decoding1.
• Experimental results demonstrate that our model outperforms the baseline models in both
the Chinese-to-English translation and the English-to-Vietnamese translation, outperforming the
Seq2Seq model in the BLEU score evaluation with the advantages of BLEU score 2.82 and 1.54
respectively.
• The analysis shows that our model that performs global decoding is more capable of reducing
repetition and more robust to the translation of sentences of different lengths, and the case study
reflects that it is able to capture the syntactic structure for the translation and has a better reflection
of the semantic meaning of the source text.
2 Model
In the following, we introduce the details of our model, including the encoder, the deconvolution-based
decoder and the conventional RNN-based decoder. The functions of each decoder are illustrated below
to show how they collaborate to improve the quality of the translation.
2.1 Encoder
In our model, the encoder reads the embeddings of the input text sequence x = {x1, ..., xn} and encodes
a sequence of encoder outputs h = {h1, ..., hn}. The final hidden state hn is sent to the decoder as the
initial state for it to decode a sequence of output text. The encoder outputs provide the information of
the source-side contexts to our RNN-Based decoder through the attention mechanism.
The encoder in our model is a bidirectional LSTM (Hochreiter and Schmidhuber, 1997), which reads
−→
hn} and
the input in two directions to generate two sequences of hidden states
←−
h = {
←−
hn}, where:
−→
h = {
−→
h1,
−→
h3, ...,
−→
h2,
←−
h1,
←−
h2,
←−
h3, ...,
−→
hi = LST M(xi,
←−
hi = LST M(xi,
−−→
hi−1, Ci−1)
←−−
hi−1, Ci−1)
(1)
(2)
The encoder outputs corresponding to each time step are concatenated as hi = [
−→
hi ;
←−
hi].
1The code is released in https://github.com/lancopku/DeconvDec
Figure 1: Model architecture. There are three components in the proposed model, i.e., the LSTM encoder,
the deconvolution-based decoder, and the conventional LSTM decoder. The encoder distills the input
sentence into a state hn, which is then used in the deconvolution-based decoder to obtain the global
information of the target-side contexts. Based on the target-side contexts and the input-side contexts, the
conventional LSTM decoder generates the output from the state hn.
2.2 Deconvolution-Based Decoder
In our model, there are two decoders, which perform different tasks for the whole decoding process.
While the RNN-based decoder is similar to the conventional decoder, which decodes the output text
sequence in a sequential order and attends to the annotations of the encoder via the attention mechanism,
our proposed deconvolution-based decoder does not decode the text but provide global information of the
target-side contexts to the RNN-based decoder so that it can decode structurally instead of sequentially.
To be specific, the deconvolution-based decoder learns to generate the word embedding matrix of the
target text sequence.
In order to provide global information of the target-side contexts to the RNN decoder, we implement
a multilayer CNN as the deconvolution-based decoder to perform deconvolution. With deconvolution, it
is available for a vector or a small matrix to be transformed to a large matrix. In our model, the decon-
volution is implemented on the final states in both directions from the encoder. As words in our model
are represented with word embedding vectors, sentences can be formed as word embedding matrices.
In our model, the deconvolution-based decoder is designed to learn word embedding matrices of the
target sequences with the representation matrix from the encoder. As the conjugate operation of con-
volution, deconvolution expands the dimension of the input representation to a matrix of our designed
size. There are L layers in the deconvolution, each of which has fl filters of kernel size kl. The ith filter
l and padding pi
W i
l
performs deconvolution on the input representation matrix I ∈ Rm×dim (m × dim refers to the size of
the input representation matrix), the final hidden state of the encoder. The computation of convolution is
illustrated as below:
l ∈ Rk×dim (dim refers to the size of the input representation vector) with stride si
l = g(W i
ci
l ∗ X + b)
(3)
where X refers to the convolved matrix and g refers to non-linear activation function, which is ReLU
(Nair and Hinton, 2010) following Zhang et al. (2017), and deconvolution is its transposed operation.
With the input I, our objective of the deconvolution operation is to generate a word embedding matrix
E ∈ RT ×dim where T refers to the sentence length designed for the output text sequence, which is a
hyper-parameter. At the lth layer, deconvolution generates a matrix El ∈ RTl×dim where Tl = Tl−1 ×
sl + kl − 2 × pl. With the control of stride and kernel size, the height of the matrix can be assigned,
and with the control of the number of filters, the width of the matrix can also be assigned, which are the
length of the output sequence and the dimension of the word embedding respectively.
The deconvolution-based decoder can generate meaningful representation with information different
from that in the conventional RNN decoder. The conventional RNN decoder generates sequence in a way
similar to Markov Decision Process, which is highly dependent on the previous generation and follows
(a) Deconvolution-based decoder.
(b) Deconvolution.
Figure 2: Deconvolution-based decoder. On the right shows an example of a 1d deconvolution on a input
of size 2 with a kernel of size 4, a padding of 1 and, a stride of 2. The depth means the dimension of the
channel, which is dim in our case.
a strict sequential order, so it contains high sequential dependency. On the contrary, the deconvolution-
based decoder generates a word embedding matrix depending on the representation from the encoder
without considering the order, which does not have the problem of long-term dependency. Moreover,
although it is not capable as the RNN encoder to generate coherent text, it reveals the information of the
text from a global perspective, including syntactic and semantic features.
2.3 RNN-Based Decoder
Different from the deconvolution-based decoder, the RNN-based decoder is responsible for decoding the
representation hn to generate the translation y = {y1, ..., ym}. With the final encoder state as the initial
state, the decoder is initialized to decode in sequential order, until it generates the token representing
the end of sentence. During decoding, the attention mechanism is applied for the decoder to extract
the information from the source-side contexts, which are the annotations of the encoder, as well as the
information from the target-side contexts, which are the outputs of the deconvolution-based decoder.
For the RNN-based decoder, we implement a unidirectional LSTM. The output of the RNN-based
decoder at each time step is sent into a feed-forward neural network to be projected into the space of the
target vocabulary Y ∈ RY ×dim for the prediction of the translated word. At each time step, the decoder
generates a word yt by sampling from a conditional probability distribution of the target vocabulary
Pvocab, where:
Pvocab = sof tmax(Wovt)
vt = g(st, ct, ct)
st = LST M (yt−1, st−1, Ct−1)
(4)
(5)
(6)
where g(·) refers to non-linear activation function, and ct and ct are the outputs of the attention mecha-
nism, which are illustrated in the following.
The attention mechanism in our model is the global attention mechanism (Luong et al., 2015). Dif-
ferent from the conventional attention mechanism, which only computes the attention scores on the
source-side contexts, the attention mechanism in our model consists of two parts. The first one is similar
to the conventional one, attending to the source-side contexts from the encoder, but the second one is
original, which attends to the target-side contexts, which is the word embedding matrix generated by the
deconvolution-based decoder. By attending to the encoder annotations, the model computes the attention
αt,i of the RNN-based decoder output st on the annotations of the encoder hi and generates the context
vector ct. Similarly, by attending to the outputs of the deconvolution-based decoder, the RNN-based de-
coder computes the attentions of st on each column Ei of its matrix E and generates the context vector
ct:
ct =
ct =
n
Xi=1
Xi=1
n
αt,ihi
αt,iEi
(7)
(8)
where αt,i and αt,i are defined as below (as they are computed in the same way, they are both represented
by αt,i and the annotations are represented by xi):
exp(et,i)
j=1exp(et,j)
Pn
αt,i =
et,i = s⊤
t−1Waxi
(9)
(10)
2.4 Training
The training for the Seq2Seq model is usually based on maximum likelihood estimation. Given the
parameters θ and source text x, the model generates a sequence y. The learning process is to minimize
the negative log-likelihood between the generated text y and reference y, which in our context is the
sequence in target language for machine translation:
L = −
1
N
N
T
Xi=1
Xt=1
log P (y
(i)
t
y
(i)
<t, x(i), θ)
(11)
where the loss function is equivalent to maximizing the conditional probability of sequence y given
parameters θ and source sequence x.
However, as there are two decoders in our model, the loss function should also be designed for the
deconvolution-based decoder. In our model, we compute the smooth L1 loss between the generated ma-
trix of the deconvolution-based decoder E and the word embedding matrix E (which both contain M
elements), which is more robust to outliers (Girshick, 2015), as well as the cross-entropy loss between
the prediction of the deconvolution-based decoder y and reference y given the parameters of the encoder
and the deconvolution-based decoder θ
. Therefore, the generated matrix E can be closer to the word
embedding matrix E, and it contains information beneficial to the prediction of the target words. More-
over, for the cross entropy loss of the deconvolution-based decoder, we apply the method of Ma et al.
(2018a) as it increases no parameter for the prediction by computing the cosine similarity between the
output and the word embeddings. To sum up, the loss function is defined as below:
′
L = −
1
N
N
T
Xi=1
(
Xt=1
log P (y
(i)
t
y
(i)
<t, x(i), θ) +
M
Xm=1
smoothL1(Em − Em) +
T
Xt=1
log P (y
(i)
t
′
x(i), θ
)) (12)
where smooth L1 loss is defined below:
smoothL1(x, y) = (cid:26) 0.5 x − y 2
if x − y < 1
x − y 1 −0.5 if x − y ≥ 1
2
(13)
We have tested L1 loss, L2 loss as well as smooth L1 loss in our experiments and found that smooth
L1 loss encourages the model to reach the best performance.
3 Experiment
3.1 Datasets
We evaluate our proposed model on the NIST translation task for the Chinese-to-English translation and
provide the analysis on the same task. Moreover, in order to evaluate the performance of our model on
the low-resource translation, we also evaluate our model on the IWLST 2015 (Cettolo et al., 2015) for
the English-to-Vietnamese translation task.
Chinese-to-English Translation For the NIST translation task, we train our model on 1.25M sentence
pairs extracted from LDC2002E18, LDC2003E07, LDC2003E14, Hansards portion of LDC2004T07,
LDC2004T08 and LDC2005T06, with 27.9M Chinese words and 34.5M English words. Following
Wang et al. (2016), we validate our model on the dataset for the NIST 2002 translation task and tested
our model on that for the NIST 2003, 2004, 2005, 2006 translation tasks. We use the most frequent 30K
words for both the Chinese vocabulary and the English vocabulary, which includes around 97.4% and
99.5% of the Chinese and English words in the training data. The sentence pairs longer than 50 words
are filtered. The evaluation metric is BLEU (Papineni et al., 2002).
English-to-Vietnamese Translation The data is from the translated TED talks, containing around
133K training sentence pairs provided by the IWSLT 2015 Evaluation Campaign (Cettolo et al., 2015).
We follow the studies of Huang et al. (2017), and use the same preprocessing methods as well as the
same validation and the test set. The validation set is the TED tst2012 with 1553 sentences and the test
set is the TED tst2013 with 1268 sentences. The English vocabulary is 17.7K words and the Vietnamese
vocabulary is 7K words. The evaluation metric is also BLEU score.
3.2 Setting
We implement the models on PyTorch2, and the experiments are conducted on an NVIDIA 1080Ti GPU.
Both the size of word embedding and the number of units in the hidden layers are 512, and the batch
size is 64. We use Adam optimizer (Kingma and Ba, 2014) to train the model with the setting β1 = 0.9,
β2 = 0.98 and ǫ = 1 × 10−9 following Vaswani et al. (2017), and we initialize the learning rate to
0.0003.
Gradient clipping is applied so that the norm of the gradients cannot be larger than a constant, which
is 10 in our experiments. Dropout is used with the dropout rate set to 0.3 for the Chinese-to-English
translation and 0.4 for the English-to-Vietnamese translation, based on the performance on the validation
set.
Based on the performance on the validation set, we use beam search with a beam width of 10 to
generate translation for the evaluation and test, and we normalize the log-likelihood scores by sentence
length.
3.3 Baselines
For the Chinese-to-English translation, we compare our model with the state-of-the-art NMT systems for
the task.
• Moses An open source phrase-based translation system with default configurations and a 4-gram
language model trained on the training data for the target language;
• RNNsearch An attention-based Seq2Seq with fine-tuned hyperparameters (Bahdanau et al., 2014);
• Coverage The method extends RNNSearch with a coverage model for the attention mechanism that
tackles the problem of over-translation and under-translation (Tu et al., 2016);
• Lattice The Seq2Seq model with a word-lattice-based RNN encoder that tackles the problem of
tokenization in NMT (Su et al., 2016);
• InterAtten The Seq2Seq model that records the interactive history of decoding (Meng et al., 2016);
• MemDec Based on the RNNSearch, it is equipped with external memory that the model reads and
writes during decoding (Wang et al., 2016).
For the English-to-Vietnamese translation, we compare our model with the recent NMT models for
this task, and we present the results of the baselines reported in their articles.
2http://pytorch.org
Model
Moses
RNNSearch
Lattice
Coverage
InterAtten
MemDec
Seq2Seq+Attention
+DeconvDec
MT-03 MT-04 MT-05 MT-06 Ave.
32.43
33.08
34.32
34.49
35.09
36.16
35.32
38.04
34.14
35.32
36.50
38.34
37.73
39.81
37.25
39.75
31.47
31.42
32.40
34.91
35.53
35.91
33.52
36.77
30.81
31.61
32.77
34.25
34.32
35.98
33.54
36.32
32.21
32.86
34.00
35.49
35.67
36.97
34.91
37.73
Table 1: Results of our model and the baselines (the results are those reported in the referred articles, and
the models are trained on the identical training data or larger training data) on the Chinese-to-English
translation, tested on the NIST Machine Translation tasks in 2003, 2004, 2005, 2006 by BLEU score
evaluation.
Model
RNNSearch-1
RNNSearch-2
LabelEmb
NPMT
Seq2Seq+Attention
+DeconvDec
BLEU
23.30
26.10
26.80
27.69
26.93
28.47
Table 2: Results of our model and the baselines (directly reported in the referred articles) on the English-
to-Vietnamese translation, tested on the TED tst2013 with the BLEU score evaluation.
• RNNsearch-1 The attention-based Seq2Seq model by Luong and Manning (2015);
• RNNsearch-2 The implementation of the attention-based Seq2Seq by Huang et al. (2017);
• LabelEmb Extending RNNSearch with soft target representation (Sun et al., 2017);
• NPMT The Neural Phrased-based Machine Translation model by Huang et al. (2017);
4 Results and Analysis
4.1 Results
Table 1 shows the overall results of the models on the Chinese-to-English translation task. Beside our
reimplementation of the attention-based Seq2Seq model, we report the results of the recent NMT models,
which are results in their original articles or improved results of the reimplementation. To facilitate fair
comparison, we compare with the baselines that are trained on the same training data. The results have
shown that for the NIST 2003, 2004, 2005 and 2006 translation tasks, our model with the deconvolution-
based decoder outperforms the baselines, and the advantage of BLEU score over the attention-based
Seq2Seq model is 2.82 on average compared with our reimplementation of the attention-based Seq2Seq
model. From the results mentioned above, it can be inferred that the global information of the target-side
contexts retrieved from the deconvolution-based decoder is contributive to the translation. Our analysis
and case study in the following can further demonstrate how the deconvolution-based decoder improves
the attention-based Seq2Seq model.
Table 2 presents the results of the models on the English-to-Vietnamese translation. Compared with
the attention-based Seq2Seq model, including the implementation with the strongest performance, our
model with the deconvolution-based decoder can outperform it with the advantage of BLEU score 1.54.
We also display the most recent model NPMT (Huang et al., 2017) trained and tested on the dataset.
w/o DeconvDec
DeconvDec
s
e
t
a
c
i
l
p
u
d
e
h
t
f
o
%
20
15
10
5
0
1-gram 2-gram 3-gram 4-gram
)
%
(
U
E
L
B
38
36
34
32
30
28
26
24
22
w/o DeconvDec
DeconvDec
0
10 20 30 40 50 60
(a) Percentage of the duplicates at the sentence level.
(b) BLEU scores on sentences of different lengths
Figure 3: Percentage of the duplicates at sentence level and the BLEU scores on sentences of dif-
ferent lengths Tested on the NIST 2003 dataset. The red bar and line indicate the performance of our
model, and the blue bar and line indicate that of the attention-based SeqSeq model.
Compared with NPMT, our model has an advantage of BLEU score 0.78. It can be indicated that for
the low-resource translation, the information from the deconvolution-based decoder is important, which
brings significant improvement to the conventional attention-based Seq2Seq model.
4.2 Analysis
As our model generates translation with global information from the deconvolution-based decoder, it
should learn to reduce repetition as it can learn to avoid generating same contents according to the
conjecture by the deconvolution-based decoder about the target-side contexts. In order to test whether
our model can mitigate the problem of repetition in translation, we test the repetition on the NIST 2003
dataset, following See et al. (2017). The proportions of the duplicates of 1-gram, 2-gram, 3-gram and
4-gram in each sentence are calculated. Results on Figure 3(a) show that our model generates less
repetitive translation. In particular, the proportion of duplicates of our model is less than half of that of
the conventional Seq2Seq model.
Moreover, to validate its robustness on different sentence-length levels, we test the BLEU scores on
sentences of length no shorter than 10 to 60 of the NIST 2003 dataset. According to the results on
Figure 3(b), though with the increase in length, the performance of our model is always stronger than the
Seq2Seq model. However, with the increase of length, the advantage of our model becomes smaller. This
is consistent with our hypothesis. Since the length of generation of the deconvolution-based decoder is
assigned a particular value (30 words in Chinese-to-English translation) due to the limited computation
resources, there is not enough global target-side information for translating long sentences (say, longer
than 30 words). In our future work, we will delve into this problem and conduct further research to
reduce computation cost.
Figure 4 presents the attention heatmaps of the RNN-based decoder on the generated matrix of the
deconvolution-based decoder in the English-to-Vietnamese translation. They reflect that the RNN-based
decoder has diverse local focuses on the self-contained target-side contexts at different time steps. Con-
trary to the conventional attention on the source-side contexts which captures the corresponding an-
notations, it focuses on groups of the columns of the generated matrix from the deconvolution-based
decoder. With the guidance of the information of global decoding, the model generates translation of
higher accuracy and higher coherence. However, as the deconvolution-based decoder is not responsible
for generating translation, it is hard to interpret what each column of the generated matrix represents.
Moreover, as it does not capture alignment relationship as the conventional attention mechanism does,
it is our future work to improve the attention on the outputs of the deconvolution-based decoder and
explain the group focuses as shown in the heatmaps.
Figure 4: Attention heatmaps of the RNN-based decoder on the deconvolution-based decoder
Words on the left refer to the translation of the RNN-based decoder. The heatmaps show that the RNN-
based decoder can focus on certain parts of the outputs from the deconvolution-based decoder.
4.3 Case Study
Table 3 demonstrates three examples of the translation of our model in comparison with the Seq2Seq
model and the golden translation. In Table 3(a), while the Seq2Seq model cannot recognize the objects
of the main clause and the infinitive, causing inaccuracy and repetition, our model better captures the
syntactic structure of the sentence and translates the main idea of the source text, though leaving the
information "that causes disease". In Table 3(b), the source sentence is more complicated. With a tem-
poral adverbial clause, its syntactic structure is more complex than simple sentence. The translation of
the conventional Seq2Seq model cannot capture the syntactic information in the source text and regards
the "parliament members" as the argument of the predicate "talk". Moreover, it is confused by the word
"中期", meaning "middle", and translates "mid - autumn festival". In comparison, our model can recog-
nize the adverbial clause and the main clause as well as their syntactic structures. In Table 3(c), it can be
shown that when translating the long and relatively complex text, the baseline model makes a series of
mistake of repetition. In contrast, the translation generated by our model though repeats the word "dis-
aster", it is much more coherent and more semantically consistent with the source text as it successfully
presents "sent 250,000 yuan" corresponding to the source text "调拨25万元人民币", while the baseline
cannot translate the content.
5 Related Work
In the following, we review the studies in NMT and the application of deconvolution in NLP.
Kalchbrenner and Blunsom (2013); Cho et al. (2014); Sutskever et al. (2014) studied the application
of the encoder-decoder framework on the machine translation task, which launched the development of
NMT. Another significant innovation in this field is the attention mechanism, which builds connection
between the translated contents and the source text (Bahdanau et al., 2014; Luong et al., 2015). To im-
prove the quality of NMT, researchers have focused on improving the attention mechanism. Tu et al.
(2016) and Mi et al. (2016) modeled coverage in the NMT, Meng et al. (2016) and Xiong et al. (2017)
incorporated the external memory to the attention, and Xia et al. (2017) as well as Lin et al. (2018a)
utilized the information from the previous generation by target-side attention and memory for attention
history respectively. For more target-side information, Ma et al. (2018b) incorporated bag of words as
target. A breakthrough of NMT in recent years is that Vaswani et al. (2017) invented a model only with
the attention mechanism that reached the state-of-the-art performance.
Although many researches in NLP focused on the application of RNN, CNN is also an important
type of network for the study of language (Kim, 2014; Kalchbrenner et al., 2014; Zhang et al., 2015;
Lin et al., 2018b). Also, its application in NMT has been successful (Gehring et al., 2017). Recently,
deconvolution was applied to modeling text (Zhang et al., 2017; Shen et al., 2017), which is able to
construct a representation of high quality with the self-contained information.
Text: 基因 科学家 的 目标 是 , 提供 诊断 工具 以 发现 致病 的 缺陷 基因
Gold: the goal of geneticists is to provide diagnostic tools to identify defective genes that cause
diseases
Seq2Seq: the objective of genetic scientists is to provide genes to detect genetic genetic genes
DeconvDec:
the objective of the gene scientist
is to provide diagnostic tools
to detect
the
defective genes
(a)
Text: 叛军 暗杀 两位 菲 国 国会 议员 后, 菲律宾 总统 雅罗育 在 二零零一 年 中期 停止 与 共
党 谈判 。
Gold: after the rebels assassinated two philippine legislators , philippine president arroyo ceased
negotiations with the communist party in mid 2001 .
Seq2Seq: philippine president gloria arroyo stopped the two philippine parliament members in
the mid - autumn festival .
DeconvDec: philippine president gloria arroyo stopped holding talks with the communist party
after the rebels assassinated two philippine parliament members .
(b)
Text: 中国 红十字会 已 在 24日 地震 发生 后 紧急 向 新疆 灾区 调拨 25万 元 人民币 , 又 于
25日 向 灾区 派出 救灾 工作组 。
Gold: china red cross has released 250 thousand renminbi for the xinjiang disaster area immediately
after the earthquake on the 24th . a disaster relief team was dispatched to the area on the 25th .
Seq2Seq:
,
emergency relief team sent an emergency team to xinjiang for disaster relief in the disaster areas
the red cross society of china ( red cross ) , the china red cross society ( red cross )
after the earthquake on 24 june .
DeconvDec: the china red cross society has sent 250,000 yuan to the disaster areas in xinjiang after
the earthquake occurred on the 24 th, and sent a relief team to disaster disaster areas on the 25 th.
(c)
Table 3: Two examples of the translation of our model in comparison with the conventional attention-
based Seq2Seq model on the NIST 2003 Chinese-to-English translation task. The errors in the translation
are colored in red and the successful translation of some particular contents are colored in yellow (e.g.,
the contents that the model successfully translates but the other does not).
6 Conclusion and Future Work
In this paper, we propose a new model with the global decoding mechanism. With our deconvolution-
based decoder, which provides global information of the target-side contexts, the model can effectively
exploit the information for the inference of syntactic structure and semantic meaning in the transla-
tion. Experimental results on the Chinese-to-English translation and English-to-Vietnamese translation
demonstrate that our model outperforms the baseline models, and the analysis shows that our model gen-
erates less repetitive translation and demonstrates higher robustness to the sentences of different lengths.
Furthermore, the case study shows that the translation of our model better observes the syntactic and
semantic requirements for the translation and generates coherent and accurate translation with fewer
irrelevant contents.
In the future, we will further develop analysis of the mechanism of deconvolution in NMT and try to
figure out its generalized patterns for the construction of the target-side contexts.
Acknowledgements
This work was supported in part by National Natural Science Foundation of China (No. 61673028) and
the National Thousand Young Talents Program. Xu Sun is the corresponding author of this paper.
References
G Altmann and M Steedman. 1988. Interaction with context during human sentence processing. Cogni-
tion, 30(3):191.
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2014. Neural machine translation by jointly
learning to align and translate. CoRR, abs/1409.0473.
Mauro Cettolo, Jan Niehues, Sebastian Stuker, Luisa Bentivogli, Roldano Cattoni, and Marcello Fed-
erico. 2015. The iwslt 2015 evaluation campaign. Proc. of IWSLT, Da Nang, Vietnam.
Kyunghyun Cho, Bart van Merrienboer, C¸ aglar G ulc¸ehre, Dzmitry Bahdanau, Fethi Bougares, Holger
Schwenk, and Yoshua Bengio. 2014. Learning phrase representations using RNN encoder-decoder for
statistical machine translation. In EMNLP 2014, pages 1724–1734.
Duy Vu Hoang Cong, Gholamreza Haffari, and Trevor Cohn. 2017. Towards decoding as continuous
optimisation in neural machine translation. In EMNLP 2017, pages 146–156.
Lyn Frazier. 1987. Sentence Processing: A Tutorial Review.
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N. Dauphin. 2017. Convolutional
sequence to sequence learning. In ICML 2017, pages 1243–1252.
Ross Girshick. 2015. Fast r-cnn. Computer Science.
Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long short-term memory. Neural Computation,
9(8):1735–1780.
Po-Sen Huang, Chong Wang, Dengyong Zhou, and Li Deng. 2017. Neural phrase-based machine trans-
lation. CoRR, abs/1706.05565.
Nal Kalchbrenner and Phil Blunsom. 2013. Recurrent continuous translation models. In EMNLP 2013,
pages 1700–1709.
Nal Kalchbrenner, Edward Grefenstette, and Phil Blunsom. 2014. A convolutional neural network for
modelling sentences. In ACL 2014, pages 655–665.
Yoon Kim. 2014. Convolutional neural networks for sentence classification.
In EMNLP 2014, pages
1746–1751.
Diederik P. Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. CoRR,
abs/1412.6980.
Junyang Lin, Shuming Ma, Qi Su, and Xu Sun. 2018a. Decoding-history-based adaptive control of
attention for neural machine translation. CoRR, abs/1802.01812.
Junyang Lin, Xu Sun, Shuming Ma, and Qi Su. 2018b. Global encoding for abstractive summarization.
CoRR, abs/1805.03989.
Lemao Liu, Masao Utiyama, Andrew Finch, and Eiichiro Sumita. 2016. Agreement on target-
bidirectional neural machine translation. In NAACL HLT 2016, pages 411–416.
Jonathan Long, Evan Shelhamer, and Trevor Darrell. 2015. Fully convolutional networks for semantic
segmentation. In CVPR 2015, pages 3431–3440.
Minh-Thang Luong and Christopher D Manning. 2015. Stanford neural machine translation systems
In Proceedings of the International Workshop on Spoken Language
for spoken language domains.
Translation.
Thang Luong, Hieu Pham, and Christopher D. Manning. 2015. Effective approaches to attention-based
neural machine translation. In EMNLP 2015, pages 1412–1421.
Shuming Ma, Xu Sun, Wei Li, Sujian Li, Wenjie Li, and Xuancheng Ren. 2018a. Query and output:
Generating words by querying distributed word representations for paraphrase generation. In NAACL-
HLT 2018, pages 196–206.
Shuming Ma, Xu Sun, Yizhong Wang, and Junyang Lin. 2018b. Bag-of-words as target for neural
machine translation. CoRR, abs/1805.04871.
Fandong Meng, Zhengdong Lu, Hang Li, and Qun Liu. 2016. Interactive attention for neural machine
translation. In COLING 2016, pages 2174–2185.
Haitao Mi, Baskaran Sankaran, Zhiguo Wang, and Abe Ittycheriah. 2016. Coverage embedding models
for neural machine translation. In EMNLP 2016, pages 955–960.
Vinod Nair and Geoffrey E. Hinton. 2010. Rectified linear units improve restricted boltzmann machines.
In ICML 2010, pages 807–814.
Eugene A Nida. 1969. Science of translation. Language, pages 483–498.
Hyeonwoo Noh, Seunghoon Hong, and Bohyung Han. 2015. Learning deconvolution network for se-
mantic segmentation. In ICCV 2015, pages 1520–1528.
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for automatic
evaluation of machine translation. In ACL, 2002, pages 311–318.
Abigail See, Peter J. Liu, and Christopher D. Manning. 2017. Get to the point: Summarization with
pointer-generator networks. In ACL 2017, pages 1073–1083.
Dinghan Shen, Yizhe Zhang, Ricardo Henao, Qinliang Su, and Lawrence Carin. 2017. Deconvolutional
latent-variable model for text sequence matching. CoRR, abs/1709.07109.
Jinsong Su, Zhixing Tan, Deyi Xiong, and Yang Liu. 2016. Lattice-based recurrent neural network
encoders for neural machine translation. CoRR, abs/1609.07730.
Xu Sun, Bingzhen Wei, Xuancheng Ren, and Shuming Ma. 2017. Label embedding network: Learning
label representation for soft training of deep networks. CoRR, abs/1710.10393.
Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. 2014. Sequence to sequence learning with neural net-
works. In NIPS, 2014, pages 3104–3112.
J. C. Trueswell, M. K. Tanenhaus, and S. M. Garnsey. 1994. Semantic influences on parsing: Use
of thematic role information in syntactic ambiguity resolution. Journal of Memory and Language,
33(3):285–318.
J. C. Trueswell, M. K. Tanenhaus, and C Kello. 1993. Verb-specific constraints in sentence process-
ing: separating effects of lexical preference from garden-paths. Journal of Experimental Psychology
Learning Memory and Cognition, 19(3):528–553.
Zhaopeng Tu, Zhengdong Lu, Yang Liu, Xiaohua Liu, and Hang Li. 2016. Modeling coverage for neural
machine translation. In ACL 2016.
Lorraine K. Tyler and William D. Marslen-Wilson. 1977. The on-line effects of semantic context on
syntactic processing. Journal of Verbal Learning and Verbal Behavior, 16(6):683–692.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz
Kaiser, and Illia Polosukhin. 2017. Attention is all you need. CoRR, abs/1706.03762.
Mingxuan Wang, Zhengdong Lu, Hang Li, and Qun Liu. 2016. Memory-enhanced decoder for neural
machine translation. In EMNLP 2016, pages 278–286.
Yingce Xia, Fei Tian, Tao Qin, Nenghai Yu, and Tie-Yan Liu. 2017. Sequence generation with target
attention.
In Machine Learning and Knowledge Discovery in Databases - European Conference,
ECML PKDD 2017, Skopje, Macedonia, September 18-22, 2017, Proceedings, Part I, pages 816–831.
Hao Xiong, Zhongjun He, Xiaoguang Hu, and Hua Wu. 2017. Multi-channel encoder for neural machine
translation. CoRR, abs/1712.02109.
Xiang Zhang, Junbo Jake Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text
classification. In NIPS, 2015, pages 649–657.
Yizhe Zhang, Dinghan Shen, Guoyin Wang, Zhe Gan, Ricardo Henao, and Lawrence Carin. 2017. De-
convolutional paragraph representation learning. In NIPS 2017, pages 4172–4182.
|
1706.03762 | 5 | 1706 | 2017-12-06T03:30:32 | Attention Is All You Need | [
"cs.CL",
"cs.LG"
] | The dominant sequence transduction models are based on complex recurrent or convolutional neural networks in an encoder-decoder configuration. The best performing models also connect the encoder and decoder through an attention mechanism. We propose a new simple network architecture, the Transformer, based solely on attention mechanisms, dispensing with recurrence and convolutions entirely. Experiments on two machine translation tasks show these models to be superior in quality while being more parallelizable and requiring significantly less time to train. Our model achieves 28.4 BLEU on the WMT 2014 English-to-German translation task, improving over the existing best results, including ensembles by over 2 BLEU. On the WMT 2014 English-to-French translation task, our model establishes a new single-model state-of-the-art BLEU score of 41.8 after training for 3.5 days on eight GPUs, a small fraction of the training costs of the best models from the literature. We show that the Transformer generalizes well to other tasks by applying it successfully to English constituency parsing both with large and limited training data. | cs.CL | cs |
Attention Is All You Need
Ashish Vaswani∗
Google Brain
[email protected]
Noam Shazeer∗
Google Brain
[email protected]
Niki Parmar∗
Google Research
[email protected]
Jakob Uszkoreit∗
Google Research
[email protected]
Llion Jones∗
Google Research
[email protected]
Aidan N. Gomez∗ †
University of Toronto
[email protected]
Łukasz Kaiser∗
Google Brain
[email protected]
Illia Polosukhin∗ ‡
[email protected]
Abstract
The dominant sequence transduction models are based on complex recurrent or
convolutional neural networks that include an encoder and a decoder. The best
performing models also connect the encoder and decoder through an attention
mechanism. We propose a new simple network architecture, the Transformer,
based solely on attention mechanisms, dispensing with recurrence and convolutions
entirely. Experiments on two machine translation tasks show these models to
be superior in quality while being more parallelizable and requiring significantly
less time to train. Our model achieves 28.4 BLEU on the WMT 2014 English-
to-German translation task, improving over the existing best results, including
ensembles, by over 2 BLEU. On the WMT 2014 English-to-French translation task,
our model establishes a new single-model state-of-the-art BLEU score of 41.8 after
training for 3.5 days on eight GPUs, a small fraction of the training costs of the
best models from the literature. We show that the Transformer generalizes well to
other tasks by applying it successfully to English constituency parsing both with
large and limited training data.
1
Introduction
Recurrent neural networks, long short-term memory [13] and gated recurrent [7] neural networks
in particular, have been firmly established as state of the art approaches in sequence modeling and
∗Equal contribution. Listing order is random. Jakob proposed replacing RNNs with self-attention and started
the effort to evaluate this idea. Ashish, with Illia, designed and implemented the first Transformer models and
has been crucially involved in every aspect of this work. Noam proposed scaled dot-product attention, multi-head
attention and the parameter-free position representation and became the other person involved in nearly every
detail. Niki designed, implemented, tuned and evaluated countless model variants in our original codebase and
tensor2tensor. Llion also experimented with novel model variants, was responsible for our initial codebase, and
efficient inference and visualizations. Lukasz and Aidan spent countless long days designing various parts of and
implementing tensor2tensor, replacing our earlier codebase, greatly improving results and massively accelerating
our research.
†Work performed while at Google Brain.
‡Work performed while at Google Research.
31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA.
transduction problems such as language modeling and machine translation [35, 2, 5]. Numerous
efforts have since continued to push the boundaries of recurrent language models and encoder-decoder
architectures [38, 24, 15].
Recurrent models typically factor computation along the symbol positions of the input and output
sequences. Aligning the positions to steps in computation time, they generate a sequence of hidden
states ht, as a function of the previous hidden state ht−1 and the input for position t. This inherently
sequential nature precludes parallelization within training examples, which becomes critical at longer
sequence lengths, as memory constraints limit batching across examples. Recent work has achieved
significant improvements in computational efficiency through factorization tricks [21] and conditional
computation [32], while also improving model performance in case of the latter. The fundamental
constraint of sequential computation, however, remains.
Attention mechanisms have become an integral part of compelling sequence modeling and transduc-
tion models in various tasks, allowing modeling of dependencies without regard to their distance in
the input or output sequences [2, 19]. In all but a few cases [27], however, such attention mechanisms
are used in conjunction with a recurrent network.
In this work we propose the Transformer, a model architecture eschewing recurrence and instead
relying entirely on an attention mechanism to draw global dependencies between input and output.
The Transformer allows for significantly more parallelization and can reach a new state of the art in
translation quality after being trained for as little as twelve hours on eight P100 GPUs.
2 Background
The goal of reducing sequential computation also forms the foundation of the Extended Neural GPU
[16], ByteNet [18] and ConvS2S [9], all of which use convolutional neural networks as basic building
block, computing hidden representations in parallel for all input and output positions. In these models,
the number of operations required to relate signals from two arbitrary input or output positions grows
in the distance between positions, linearly for ConvS2S and logarithmically for ByteNet. This makes
it more difficult to learn dependencies between distant positions [12]. In the Transformer this is
reduced to a constant number of operations, albeit at the cost of reduced effective resolution due
to averaging attention-weighted positions, an effect we counteract with Multi-Head Attention as
described in section 3.2.
Self-attention, sometimes called intra-attention is an attention mechanism relating different positions
of a single sequence in order to compute a representation of the sequence. Self-attention has been
used successfully in a variety of tasks including reading comprehension, abstractive summarization,
textual entailment and learning task-independent sentence representations [4, 27, 28, 22].
End-to-end memory networks are based on a recurrent attention mechanism instead of sequence-
aligned recurrence and have been shown to perform well on simple-language question answering and
language modeling tasks [34].
To the best of our knowledge, however, the Transformer is the first transduction model relying
entirely on self-attention to compute representations of its input and output without using sequence-
aligned RNNs or convolution. In the following sections, we will describe the Transformer, motivate
self-attention and discuss its advantages over models such as [17, 18] and [9].
3 Model Architecture
Most competitive neural sequence transduction models have an encoder-decoder structure [5, 2, 35].
Here, the encoder maps an input sequence of symbol representations (x1, ..., xn) to a sequence
of continuous representations z = (z1, ..., zn). Given z, the decoder then generates an output
sequence (y1, ..., ym) of symbols one element at a time. At each step the model is auto-regressive
[10], consuming the previously generated symbols as additional input when generating the next.
The Transformer follows this overall architecture using stacked self-attention and point-wise, fully
connected layers for both the encoder and decoder, shown in the left and right halves of Figure 1,
respectively.
2
Figure 1: The Transformer - model architecture.
3.1 Encoder and Decoder Stacks
Encoder: The encoder is composed of a stack of N = 6 identical layers. Each layer has two
sub-layers. The first is a multi-head self-attention mechanism, and the second is a simple, position-
wise fully connected feed-forward network. We employ a residual connection [11] around each of
the two sub-layers, followed by layer normalization [1]. That is, the output of each sub-layer is
LayerNorm(x + Sublayer(x)), where Sublayer(x) is the function implemented by the sub-layer
itself. To facilitate these residual connections, all sub-layers in the model, as well as the embedding
layers, produce outputs of dimension dmodel = 512.
Decoder: The decoder is also composed of a stack of N = 6 identical layers. In addition to the two
sub-layers in each encoder layer, the decoder inserts a third sub-layer, which performs multi-head
attention over the output of the encoder stack. Similar to the encoder, we employ residual connections
around each of the sub-layers, followed by layer normalization. We also modify the self-attention
sub-layer in the decoder stack to prevent positions from attending to subsequent positions. This
masking, combined with fact that the output embeddings are offset by one position, ensures that the
predictions for position i can depend only on the known outputs at positions less than i.
3.2 Attention
An attention function can be described as mapping a query and a set of key-value pairs to an output,
where the query, keys, values, and output are all vectors. The output is computed as a weighted sum
of the values, where the weight assigned to each value is computed by a compatibility function of the
query with the corresponding key.
3
Scaled Dot-Product Attention
Multi-Head Attention
Figure 2: (left) Scaled Dot-Product Attention. (right) Multi-Head Attention consists of several
attention layers running in parallel.
3.2.1 Scaled Dot-Product Attention
√
We call our particular attention "Scaled Dot-Product Attention" (Figure 2). The input consists of
queries and keys of dimension dk, and values of dimension dv. We compute the dot products of the
query with all keys, divide each by
dk, and apply a softmax function to obtain the weights on the
values.
In practice, we compute the attention function on a set of queries simultaneously, packed together
into a matrix Q. The keys and values are also packed together into matrices K and V . We compute
the matrix of outputs as:
Attention(Q, K, V ) = softmax(
QK T√
dk
)V
(1)
1√
dk
The two most commonly used attention functions are additive attention [2], and dot-product (multi-
plicative) attention. Dot-product attention is identical to our algorithm, except for the scaling factor
of
. Additive attention computes the compatibility function using a feed-forward network with
a single hidden layer. While the two are similar in theoretical complexity, dot-product attention is
much faster and more space-efficient in practice, since it can be implemented using highly optimized
matrix multiplication code.
While for small values of dk the two mechanisms perform similarly, additive attention outperforms
dot product attention without scaling for larger values of dk [3]. We suspect that for large values of
dk, the dot products grow large in magnitude, pushing the softmax function into regions where it has
extremely small gradients 4. To counteract this effect, we scale the dot products by 1√
dk
.
3.2.2 Multi-Head Attention
Instead of performing a single attention function with dmodel-dimensional keys, values and queries,
we found it beneficial to linearly project the queries, keys and values h times with different, learned
linear projections to dk, dk and dv dimensions, respectively. On each of these projected versions of
queries, keys and values we then perform the attention function in parallel, yielding dv-dimensional
output values. These are concatenated and once again projected, resulting in the final values, as
depicted in Figure 2.
variables with mean 0 and variance 1. Then their dot product, q · k =(cid:80)dk
4To illustrate why the dot products get large, assume that the components of q and k are independent random
i=1 qiki, has mean 0 and variance dk.
4
Multi-head attention allows the model to jointly attend to information from different representation
subspaces at different positions. With a single attention head, averaging inhibits this.
MultiHead(Q, K, V ) = Concat(head1, ..., headh)W O
where headi = Attention(QW Q
i , KW K
i
, V W V
i )
Where the projections are parameter matrices W Q
and W O ∈ Rhdv×dmodel.
In this work we employ h = 8 parallel attention layers, or heads. For each of these we use
dk = dv = dmodel/h = 64. Due to the reduced dimension of each head, the total computational cost
is similar to that of single-head attention with full dimensionality.
i ∈ Rdmodel×dv
i ∈ Rdmodel×dk, W K
i ∈ Rdmodel×dk, W V
3.2.3 Applications of Attention in our Model
The Transformer uses multi-head attention in three different ways:
• In "encoder-decoder attention" layers, the queries come from the previous decoder layer,
and the memory keys and values come from the output of the encoder. This allows every
position in the decoder to attend over all positions in the input sequence. This mimics the
typical encoder-decoder attention mechanisms in sequence-to-sequence models such as
[38, 2, 9].
• The encoder contains self-attention layers. In a self-attention layer all of the keys, values
and queries come from the same place, in this case, the output of the previous layer in the
encoder. Each position in the encoder can attend to all positions in the previous layer of the
encoder.
• Similarly, self-attention layers in the decoder allow each position in the decoder to attend to
all positions in the decoder up to and including that position. We need to prevent leftward
information flow in the decoder to preserve the auto-regressive property. We implement this
inside of scaled dot-product attention by masking out (setting to −∞) all values in the input
of the softmax which correspond to illegal connections. See Figure 2.
3.3 Position-wise Feed-Forward Networks
In addition to attention sub-layers, each of the layers in our encoder and decoder contains a fully
connected feed-forward network, which is applied to each position separately and identically. This
consists of two linear transformations with a ReLU activation in between.
FFN(x) = max(0, xW1 + b1)W2 + b2
(2)
While the linear transformations are the same across different positions, they use different parameters
from layer to layer. Another way of describing this is as two convolutions with kernel size 1.
The dimensionality of input and output is dmodel = 512, and the inner-layer has dimensionality
df f = 2048.
3.4 Embeddings and Softmax
Similarly to other sequence transduction models, we use learned embeddings to convert the input
tokens and output tokens to vectors of dimension dmodel. We also use the usual learned linear transfor-
mation and softmax function to convert the decoder output to predicted next-token probabilities. In
our model, we share the same weight matrix between the two embedding layers and the pre-softmax
linear transformation, similar to [30]. In the embedding layers, we multiply those weights by
dmodel.
√
3.5 Positional Encoding
Since our model contains no recurrence and no convolution, in order for the model to make use of the
order of the sequence, we must inject some information about the relative or absolute position of the
5
Table 1: Maximum path lengths, per-layer complexity and minimum number of sequential operations
for different layer types. n is the sequence length, d is the representation dimension, k is the kernel
size of convolutions and r the size of the neighborhood in restricted self-attention.
Layer Type
Complexity per Layer
Self-Attention
Recurrent
Convolutional
Self-Attention (restricted)
O(n2 · d)
O(n · d2)
O(k · n · d2)
O(r · n · d)
Sequential Maximum Path Length
Operations
O(1)
O(n)
O(1)
O(1)
O(1)
O(n)
O(logk(n))
O(n/r)
tokens in the sequence. To this end, we add "positional encodings" to the input embeddings at the
bottoms of the encoder and decoder stacks. The positional encodings have the same dimension dmodel
as the embeddings, so that the two can be summed. There are many choices of positional encodings,
learned and fixed [9].
In this work, we use sine and cosine functions of different frequencies:
P E(pos,2i) = sin(pos/100002i/dmodel)
P E(pos,2i+1) = cos(pos/100002i/dmodel)
where pos is the position and i is the dimension. That is, each dimension of the positional encoding
corresponds to a sinusoid. The wavelengths form a geometric progression from 2π to 10000 · 2π. We
chose this function because we hypothesized it would allow the model to easily learn to attend by
relative positions, since for any fixed offset k, P Epos+k can be represented as a linear function of
P Epos.
We also experimented with using learned positional embeddings [9] instead, and found that the two
versions produced nearly identical results (see Table 3 row (E)). We chose the sinusoidal version
because it may allow the model to extrapolate to sequence lengths longer than the ones encountered
during training.
4 Why Self-Attention
In this section we compare various aspects of self-attention layers to the recurrent and convolu-
tional layers commonly used for mapping one variable-length sequence of symbol representations
(x1, ..., xn) to another sequence of equal length (z1, ..., zn), with xi, zi ∈ Rd, such as a hidden
layer in a typical sequence transduction encoder or decoder. Motivating our use of self-attention we
consider three desiderata.
One is the total computational complexity per layer. Another is the amount of computation that can
be parallelized, as measured by the minimum number of sequential operations required.
The third is the path length between long-range dependencies in the network. Learning long-range
dependencies is a key challenge in many sequence transduction tasks. One key factor affecting the
ability to learn such dependencies is the length of the paths forward and backward signals have to
traverse in the network. The shorter these paths between any combination of positions in the input
and output sequences, the easier it is to learn long-range dependencies [12]. Hence we also compare
the maximum path length between any two input and output positions in networks composed of the
different layer types.
As noted in Table 1, a self-attention layer connects all positions with a constant number of sequentially
executed operations, whereas a recurrent layer requires O(n) sequential operations. In terms of
computational complexity, self-attention layers are faster than recurrent layers when the sequence
length n is smaller than the representation dimensionality d, which is most often the case with
sentence representations used by state-of-the-art models in machine translations, such as word-piece
[38] and byte-pair [31] representations. To improve computational performance for tasks involving
very long sequences, self-attention could be restricted to considering only a neighborhood of size r in
6
the input sequence centered around the respective output position. This would increase the maximum
path length to O(n/r). We plan to investigate this approach further in future work.
A single convolutional layer with kernel width k < n does not connect all pairs of input and output
positions. Doing so requires a stack of O(n/k) convolutional layers in the case of contiguous kernels,
or O(logk(n)) in the case of dilated convolutions [18], increasing the length of the longest paths
between any two positions in the network. Convolutional layers are generally more expensive than
recurrent layers, by a factor of k. Separable convolutions [6], however, decrease the complexity
considerably, to O(k · n · d + n · d2). Even with k = n, however, the complexity of a separable
convolution is equal to the combination of a self-attention layer and a point-wise feed-forward layer,
the approach we take in our model.
As side benefit, self-attention could yield more interpretable models. We inspect attention distributions
from our models and present and discuss examples in the appendix. Not only do individual attention
heads clearly learn to perform different tasks, many appear to exhibit behavior related to the syntactic
and semantic structure of the sentences.
5 Training
This section describes the training regime for our models.
5.1 Training Data and Batching
We trained on the standard WMT 2014 English-German dataset consisting of about 4.5 million
sentence pairs. Sentences were encoded using byte-pair encoding [3], which has a shared source-
target vocabulary of about 37000 tokens. For English-French, we used the significantly larger WMT
2014 English-French dataset consisting of 36M sentences and split tokens into a 32000 word-piece
vocabulary [38]. Sentence pairs were batched together by approximate sequence length. Each training
batch contained a set of sentence pairs containing approximately 25000 source tokens and 25000
target tokens.
5.2 Hardware and Schedule
We trained our models on one machine with 8 NVIDIA P100 GPUs. For our base models using
the hyperparameters described throughout the paper, each training step took about 0.4 seconds. We
trained the base models for a total of 100,000 steps or 12 hours. For our big models,(described on the
bottom line of table 3), step time was 1.0 seconds. The big models were trained for 300,000 steps
(3.5 days).
5.3 Optimizer
We used the Adam optimizer [20] with β1 = 0.9, β2 = 0.98 and = 10−9. We varied the learning
rate over the course of training, according to the formula:
lrate = d−0.5
model · min(step_num−0.5, step_num · warmup_steps−1.5)
(3)
This corresponds to increasing the learning rate linearly for the first warmup_steps training steps,
and decreasing it thereafter proportionally to the inverse square root of the step number. We used
warmup_steps = 4000.
5.4 Regularization
We employ three types of regularization during training:
Residual Dropout We apply dropout [33] to the output of each sub-layer, before it is added to the
sub-layer input and normalized. In addition, we apply dropout to the sums of the embeddings and the
positional encodings in both the encoder and decoder stacks. For the base model, we use a rate of
Pdrop = 0.1.
7
Table 2: The Transformer achieves better BLEU scores than previous state-of-the-art models on the
English-to-German and English-to-French newstest2014 tests at a fraction of the training cost.
Model
ByteNet [18]
Deep-Att + PosUnk [39]
GNMT + RL [38]
ConvS2S [9]
MoE [32]
Deep-Att + PosUnk Ensemble [39]
GNMT + RL Ensemble [38]
ConvS2S Ensemble [9]
Transformer (base model)
Transformer (big)
BLEU
EN-DE EN-FR
23.75
24.6
25.16
26.03
26.30
26.36
27.3
28.4
39.2
39.92
40.46
40.56
40.4
41.16
41.29
38.1
41.8
EN-FR
1.0 · 1020
1.4 · 1020
1.5 · 1020
1.2 · 1020
8.0 · 1020
1.1 · 1021
1.2 · 1021
2.3 · 1019
9.6 · 1018
2.0 · 1019
1.8 · 1020
7.7 · 1019
Training Cost (FLOPs)
EN-DE
3.3 · 1018
2.3 · 1019
Label Smoothing During training, we employed label smoothing of value ls = 0.1 [36]. This
hurts perplexity, as the model learns to be more unsure, but improves accuracy and BLEU score.
6 Results
6.1 Machine Translation
On the WMT 2014 English-to-German translation task, the big transformer model (Transformer (big)
in Table 2) outperforms the best previously reported models (including ensembles) by more than 2.0
BLEU, establishing a new state-of-the-art BLEU score of 28.4. The configuration of this model is
listed in the bottom line of Table 3. Training took 3.5 days on 8 P100 GPUs. Even our base model
surpasses all previously published models and ensembles, at a fraction of the training cost of any of
the competitive models.
On the WMT 2014 English-to-French translation task, our big model achieves a BLEU score of 41.0,
outperforming all of the previously published single models, at less than 1/4 the training cost of the
previous state-of-the-art model. The Transformer (big) model trained for English-to-French used
dropout rate Pdrop = 0.1, instead of 0.3.
For the base models, we used a single model obtained by averaging the last 5 checkpoints, which
were written at 10-minute intervals. For the big models, we averaged the last 20 checkpoints. We
used beam search with a beam size of 4 and length penalty α = 0.6 [38]. These hyperparameters
were chosen after experimentation on the development set. We set the maximum output length during
inference to input length + 50, but terminate early when possible [38].
Table 2 summarizes our results and compares our translation quality and training costs to other model
architectures from the literature. We estimate the number of floating point operations used to train a
model by multiplying the training time, the number of GPUs used, and an estimate of the sustained
single-precision floating-point capacity of each GPU 5.
6.2 Model Variations
To evaluate the importance of different components of the Transformer, we varied our base model
in different ways, measuring the change in performance on English-to-German translation on the
development set, newstest2013. We used beam search as described in the previous section, but no
checkpoint averaging. We present these results in Table 3.
In Table 3 rows (A), we vary the number of attention heads and the attention key and value dimensions,
keeping the amount of computation constant, as described in Section 3.2.2. While single-head
attention is 0.9 BLEU worse than the best setting, quality also drops off with too many heads.
5We used values of 2.8, 3.7, 6.0 and 9.5 TFLOPS for K80, K40, M40 and P100, respectively.
8
Table 3: Variations on the Transformer architecture. Unlisted values are identical to those of the base
model. All metrics are on the English-to-German translation development set, newstest2013. Listed
perplexities are per-wordpiece, according to our byte-pair encoding, and should not be compared to
per-word perplexities.
N dmodel
6
512
dff
2048
Pdrop
0.1
ls
0.1
dv
64
512
128
32
16
h
8
1
4
16
32
dk
64
512
128
32
16
16
32
2
4
8
256
1024
1024
4096
32
128
32
128
0.0
0.2
0.0
0.2
positional embedding instead of sinusoids
6
1024
4096
16
0.3
base
(A)
(B)
(C)
(D)
(E)
big
PPL
train
steps
(dev)
100K 4.92
5.29
5.00
4.91
5.01
5.16
5.01
6.11
5.19
4.88
5.75
4.66
5.12
4.75
5.77
4.95
4.67
5.47
4.92
300K 4.33
BLEU params
×106
(dev)
25.8
65
24.9
25.5
25.8
25.4
25.1
25.4
23.7
25.3
25.5
24.5
26.0
25.4
26.2
24.6
25.5
25.3
25.7
25.7
26.4
58
60
36
50
80
28
168
53
90
213
Table 4: The Transformer generalizes well to English constituency parsing (Results are on Section 23
of WSJ)
Parser
Training
WSJ 23 F1
Vinyals & Kaiser el al. (2014) [37] WSJ only, discriminative
WSJ only, discriminative
WSJ only, discriminative
WSJ only, discriminative
WSJ only, discriminative
Petrov et al. (2006) [29]
Zhu et al. (2013) [40]
Dyer et al. (2016) [8]
Transformer (4 layers)
Zhu et al. (2013) [40]
Huang & Harper (2009) [14]
McClosky et al. (2006) [26]
Vinyals & Kaiser el al. (2014) [37]
Transformer (4 layers)
Luong et al. (2015) [23]
Dyer et al. (2016) [8]
semi-supervised
semi-supervised
semi-supervised
semi-supervised
semi-supervised
multi-task
generative
88.3
90.4
90.4
91.7
91.3
91.3
91.3
92.1
92.1
92.7
93.0
93.3
In Table 3 rows (B), we observe that reducing the attention key size dk hurts model quality. This
suggests that determining compatibility is not easy and that a more sophisticated compatibility
function than dot product may be beneficial. We further observe in rows (C) and (D) that, as expected,
bigger models are better, and dropout is very helpful in avoiding over-fitting. In row (E) we replace our
sinusoidal positional encoding with learned positional embeddings [9], and observe nearly identical
results to the base model.
6.3 English Constituency Parsing
To evaluate if the Transformer can generalize to other tasks we performed experiments on English
constituency parsing. This task presents specific challenges: the output is subject to strong structural
9
constraints and is significantly longer than the input. Furthermore, RNN sequence-to-sequence
models have not been able to attain state-of-the-art results in small-data regimes [37].
We trained a 4-layer transformer with dmodel = 1024 on the Wall Street Journal (WSJ) portion of the
Penn Treebank [25], about 40K training sentences. We also trained it in a semi-supervised setting,
using the larger high-confidence and BerkleyParser corpora from with approximately 17M sentences
[37]. We used a vocabulary of 16K tokens for the WSJ only setting and a vocabulary of 32K tokens
for the semi-supervised setting.
We performed only a small number of experiments to select the dropout, both attention and residual
(section 5.4), learning rates and beam size on the Section 22 development set, all other parameters
remained unchanged from the English-to-German base translation model. During inference, we
increased the maximum output length to input length + 300. We used a beam size of 21 and α = 0.3
for both WSJ only and the semi-supervised setting.
Our results in Table 4 show that despite the lack of task-specific tuning our model performs sur-
prisingly well, yielding better results than all previously reported models with the exception of the
Recurrent Neural Network Grammar [8].
In contrast to RNN sequence-to-sequence models [37], the Transformer outperforms the Berkeley-
Parser [29] even when training only on the WSJ training set of 40K sentences.
7 Conclusion
In this work, we presented the Transformer, the first sequence transduction model based entirely on
attention, replacing the recurrent layers most commonly used in encoder-decoder architectures with
multi-headed self-attention.
For translation tasks, the Transformer can be trained significantly faster than architectures based
on recurrent or convolutional layers. On both WMT 2014 English-to-German and WMT 2014
English-to-French translation tasks, we achieve a new state of the art. In the former task our best
model outperforms even all previously reported ensembles.
We are excited about the future of attention-based models and plan to apply them to other tasks. We
plan to extend the Transformer to problems involving input and output modalities other than text and
to investigate local, restricted attention mechanisms to efficiently handle large inputs and outputs
such as images, audio and video. Making generation less sequential is another research goals of ours.
The code we used to train and evaluate our models is available at https://github.com/
tensorflow/tensor2tensor.
Acknowledgements We are grateful to Nal Kalchbrenner and Stephan Gouws for their fruitful
comments, corrections and inspiration.
References
[1] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint
arXiv:1607.06450, 2016.
[2] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly
learning to align and translate. CoRR, abs/1409.0473, 2014.
[3] Denny Britz, Anna Goldie, Minh-Thang Luong, and Quoc V. Le. Massive exploration of neural
machine translation architectures. CoRR, abs/1703.03906, 2017.
[4] Jianpeng Cheng, Li Dong, and Mirella Lapata. Long short-term memory-networks for machine
reading. arXiv preprint arXiv:1601.06733, 2016.
[5] Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Fethi Bougares, Holger Schwenk,
and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical
machine translation. CoRR, abs/1406.1078, 2014.
[6] Francois Chollet. Xception: Deep learning with depthwise separable convolutions. arXiv
preprint arXiv:1610.02357, 2016.
10
[7] Junyoung Chung, Çaglar Gülçehre, Kyunghyun Cho, and Yoshua Bengio. Empirical evaluation
of gated recurrent neural networks on sequence modeling. CoRR, abs/1412.3555, 2014.
[8] Chris Dyer, Adhiguna Kuncoro, Miguel Ballesteros, and Noah A. Smith. Recurrent neural
network grammars. In Proc. of NAACL, 2016.
[9] Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N. Dauphin. Convolu-
tional sequence to sequence learning. arXiv preprint arXiv:1705.03122v2, 2017.
[10] Alex Graves. Generating sequences with recurrent neural networks.
arXiv:1308.0850, 2013.
arXiv preprint
[11] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for im-
age recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern
Recognition, pages 770–778, 2016.
[12] Sepp Hochreiter, Yoshua Bengio, Paolo Frasconi, and Jürgen Schmidhuber. Gradient flow in
recurrent nets: the difficulty of learning long-term dependencies, 2001.
[13] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation,
9(8):1735–1780, 1997.
[14] Zhongqiang Huang and Mary Harper. Self-training PCFG grammars with latent annotations
across languages. In Proceedings of the 2009 Conference on Empirical Methods in Natural
Language Processing, pages 832–841. ACL, August 2009.
[15] Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring
the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016.
[16] Łukasz Kaiser and Samy Bengio. Can active memory replace attention? In Advances in Neural
Information Processing Systems, (NIPS), 2016.
[17] Łukasz Kaiser and Ilya Sutskever. Neural GPUs learn algorithms. In International Conference
on Learning Representations (ICLR), 2016.
[18] Nal Kalchbrenner, Lasse Espeholt, Karen Simonyan, Aaron van den Oord, Alex Graves, and Ko-
ray Kavukcuoglu. Neural machine translation in linear time. arXiv preprint arXiv:1610.10099v2,
2017.
[19] Yoon Kim, Carl Denton, Luong Hoang, and Alexander M. Rush. Structured attention networks.
In International Conference on Learning Representations, 2017.
[20] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
[21] Oleksii Kuchaiev and Boris Ginsburg. Factorization tricks for LSTM networks. arXiv preprint
arXiv:1703.10722, 2017.
[22] Zhouhan Lin, Minwei Feng, Cicero Nogueira dos Santos, Mo Yu, Bing Xiang, Bowen
Zhou, and Yoshua Bengio. A structured self-attentive sentence embedding. arXiv preprint
arXiv:1703.03130, 2017.
[23] Minh-Thang Luong, Quoc V. Le, Ilya Sutskever, Oriol Vinyals, and Lukasz Kaiser. Multi-task
sequence to sequence learning. arXiv preprint arXiv:1511.06114, 2015.
[24] Minh-Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attention-
based neural machine translation. arXiv preprint arXiv:1508.04025, 2015.
[25] Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated
corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993.
[26] David McClosky, Eugene Charniak, and Mark Johnson. Effective self-training for parsing. In
Proceedings of the Human Language Technology Conference of the NAACL, Main Conference,
pages 152–159. ACL, June 2006.
11
[27] Ankur Parikh, Oscar Täckström, Dipanjan Das, and Jakob Uszkoreit. A decomposable attention
model. In Empirical Methods in Natural Language Processing, 2016.
[28] Romain Paulus, Caiming Xiong, and Richard Socher. A deep reinforced model for abstractive
summarization. arXiv preprint arXiv:1705.04304, 2017.
[29] Slav Petrov, Leon Barrett, Romain Thibaux, and Dan Klein. Learning accurate, compact,
and interpretable tree annotation. In Proceedings of the 21st International Conference on
Computational Linguistics and 44th Annual Meeting of the ACL, pages 433–440. ACL, July
2006.
[30] Ofir Press and Lior Wolf. Using the output embedding to improve language models. arXiv
preprint arXiv:1608.05859, 2016.
[31] Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words
with subword units. arXiv preprint arXiv:1508.07909, 2015.
[32] Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton,
and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts
layer. arXiv preprint arXiv:1701.06538, 2017.
[33] Nitish Srivastava, Geoffrey E Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdi-
nov. Dropout: a simple way to prevent neural networks from overfitting. Journal of Machine
Learning Research, 15(1):1929–1958, 2014.
[34] Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-to-end memory
networks. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors,
Advances in Neural Information Processing Systems 28, pages 2440–2448. Curran Associates,
Inc., 2015.
[35] Ilya Sutskever, Oriol Vinyals, and Quoc VV Le. Sequence to sequence learning with neural
networks. In Advances in Neural Information Processing Systems, pages 3104–3112, 2014.
[36] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna.
Rethinking the inception architecture for computer vision. CoRR, abs/1512.00567, 2015.
[37] Vinyals & Kaiser, Koo, Petrov, Sutskever, and Hinton. Grammar as a foreign language. In
Advances in Neural Information Processing Systems, 2015.
[38] Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang
Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google's neural machine
translation system: Bridging the gap between human and machine translation. arXiv preprint
arXiv:1609.08144, 2016.
[39] Jie Zhou, Ying Cao, Xuguang Wang, Peng Li, and Wei Xu. Deep recurrent models with
fast-forward connections for neural machine translation. CoRR, abs/1606.04199, 2016.
[40] Muhua Zhu, Yue Zhang, Wenliang Chen, Min Zhang, and Jingbo Zhu. Fast and accurate
shift-reduce constituent parsing. In Proceedings of the 51st Annual Meeting of the ACL (Volume
1: Long Papers), pages 434–443. ACL, August 2013.
12
Attention Visualizations
Figure 3: An example of the attention mechanism following long-distance dependencies in the
encoder self-attention in layer 5 of 6. Many of the attention heads attend to a distant dependency of
the verb 'making', completing the phrase 'making...more difficult'. Attentions here shown only for
the word 'making'. Different colors represent different heads. Best viewed in color.
13
Input-Input Layer5ItisinthisspiritthatamajorityofAmericangovernmentshavepassednewlawssince2009makingtheregistrationorvotingprocessmoredifficult.<EOS><pad><pad><pad><pad><pad><pad>ItisinthisspiritthatamajorityofAmericangovernmentshavepassednewlawssince2009makingtheregistrationorvotingprocessmoredifficult.<EOS><pad><pad><pad><pad><pad><pad>Figure 4: Two attention heads, also in layer 5 of 6, apparently involved in anaphora resolution. Top:
Full attentions for head 5. Bottom: Isolated attentions from just the word 'its' for attention heads 5
and 6. Note that the attentions are very sharp for this word.
14
Input-Input Layer5TheLawwillneverbeperfect,butitsapplicationshouldbejust-thisiswhatwearemissing,inmyopinion.<EOS><pad>TheLawwillneverbeperfect,butitsapplicationshouldbejust-thisiswhatwearemissing,inmyopinion.<EOS><pad>Input-Input Layer5TheLawwillneverbeperfect,butitsapplicationshouldbejust-thisiswhatwearemissing,inmyopinion.<EOS><pad>TheLawwillneverbeperfect,butitsapplicationshouldbejust-thisiswhatwearemissing,inmyopinion.<EOS><pad>Figure 5: Many of the attention heads exhibit behaviour that seems related to the structure of the
sentence. We give two such examples above, from two different heads from the encoder self-attention
at layer 5 of 6. The heads clearly learned to perform different tasks.
15
Input-Input Layer5TheLawwillneverbeperfect,butitsapplicationshouldbejust-thisiswhatwearemissing,inmyopinion.<EOS><pad>TheLawwillneverbeperfect,butitsapplicationshouldbejust-thisiswhatwearemissing,inmyopinion.<EOS><pad>Input-Input Layer5TheLawwillneverbeperfect,butitsapplicationshouldbejust-thisiswhatwearemissing,inmyopinion.<EOS><pad>TheLawwillneverbeperfect,butitsapplicationshouldbejust-thisiswhatwearemissing,inmyopinion.<EOS><pad> |
1709.01058 | 2 | 1709 | 2018-08-28T14:04:39 | A Unified Query-based Generative Model for Question Generation and Question Answering | [
"cs.CL"
] | We propose a query-based generative model for solving both tasks of question generation (QG) and question an- swering (QA). The model follows the classic encoder- decoder framework. The encoder takes a passage and a query as input then performs query understanding by matching the query with the passage from multiple per- spectives. The decoder is an attention-based Long Short Term Memory (LSTM) model with copy and coverage mechanisms. In the QG task, a question is generated from the system given the passage and the target answer, whereas in the QA task, the answer is generated given the question and the passage. During the training stage, we leverage a policy-gradient reinforcement learning algorithm to overcome exposure bias, a major prob- lem resulted from sequence learning with cross-entropy loss. For the QG task, our experiments show higher per- formances than the state-of-the-art results. When used as additional training data, the automatically generated questions even improve the performance of a strong ex- tractive QA system. In addition, our model shows bet- ter performance than the state-of-the-art baselines of the generative QA task. | cs.CL | cs | A Unified Query-based Generative Model for
Question Generation and Question Answering
Linfeng Song1, Zhiguo Wang2 and Wael Hamza2
1Department of Computer Science, University of Rochester, Rochester, NY 14627
2IBM T.J. Watson Research Center, Yorktown Heights, NY 10598
8
1
0
2
g
u
A
8
2
]
L
C
.
s
c
[
2
v
8
5
0
1
0
.
9
0
7
1
:
v
i
X
r
a
Abstract
We propose a query-based generative model for solving
both tasks of question generation (QG) and question an-
swering (QA). The model follows the classic encoder-
decoder framework. The encoder takes a passage and
a query as input then performs query understanding by
matching the query with the passage from multiple per-
spectives. The decoder is an attention-based Long Short
Term Memory (LSTM) model with copy and coverage
mechanisms. In the QG task, a question is generated
from the system given the passage and the target answer,
whereas in the QA task, the answer is generated given
the question and the passage. During the training stage,
we leverage a policy-gradient reinforcement learning
algorithm to overcome exposure bias, a major prob-
lem resulted from sequence learning with cross-entropy
loss. For the QG task, our experiments show higher per-
formances than the state-of-the-art results. When used
as additional training data, the automatically generated
questions even improve the performance of a strong ex-
tractive QA system. In addition, our model shows bet-
ter performance than the state-of-the-art baselines of the
generative QA task.
Introduction
Recently both question generation and question answering
tasks are receiving increasing attention from both the indus-
trial and academic communities. The task of question gen-
eration (QG) is to generate a fluent and relevant question
given a passage and a target answer, while the task of ques-
tion answering (QA) is to generate a correct answer given
a passage and a question. Both tasks have massive indus-
trial values: QA has been used in industrial products such
as search engines, while QG is helpful for improving QA
systems by automatically increasing the training data. It can
also be used to generate questions for educational purposes
such as language learning.
For the QG task, existing work either entirely ignores the
target answer (Du, Shao, and Cardie, 2017) while generat-
ing the corresponding question, or directly hard-codes the
answer positions into the passage (Zhou et al., 2017; Yang
et al., 2017; Subramanian et al., 2017; Tang et al., 2017;
Copyright c(cid:13) 2018, Association for the Advancement of Artificial
Intelligence (www.aaai.org). All rights reserved.
Wang, Yuan, and Trischler, 2017; Yuan et al., 2017), so that
sequence-to-sequence model (Sutskever, Vinyals, and Le,
2014) can be simply utilized. These methods only highlight
the answer positions, but neglect other potential interactions
between the passage and the target answer. In addition, this
kind of methods will shrivel when the target answer does
not occur in the passage verbatim. For the QA task, most
of the existing literatures (Wang and Jiang, 2016; Wang et
al., 2016; Shen et al., 2016; Wang et al., 2017; Chen et al.,
2017; Xiong, Zhong, and Socher, 2016; Seo et al., 2016; Lee
et al., 2016; Yu et al., 2016; Dhingra et al., 2017) focus on
the extractive QA scenario, where they assume that the tar-
get answer occurs in the passage verbatim. The task then is
to extract a span of consecutive words from the passage as
the final answer. However, these methods may not work well
on the generative QA scenario, where the correct answer is
not a span in the given passage.
In this paper, we cast both the QG and QA tasks into one
process by firstly matching the input passage against the
query, then generating the output according to the match-
ing results. Our model follows the classic encoder-decoder
framework, where the encoder takes a passage and a query
as input, then performs query understanding by matching the
query with the passage from multiple perspectives, and the
decoder is an attention-based LSTM model with copy (Gul-
cehre et al., 2016; Gu et al., 2016; See, Liu, and Manning,
2017) and coverage (Tu et al., 2016; Mi et al., 2016) mecha-
nisms. Here a perspective is a way of matching the query and
the passage. In the QG task, the input query is the target an-
swer, and the decoder generates a question for the target an-
swer, whereas in the QA task, the input query is a question,
and the decoder generates the corresponding answer. To the
best of our knowledge, there is no existing work dealing with
both tasks using the same framework. In the QG task, we are
the first to investigate query understanding before generating
questions. By matching the target answer against the passage
from multiple perspectives, our model captures more inter-
actions between the answer and the passage, so that it can
generate more precise question for the answer. Moreover,
our model does not require that the answer literally occurs
in the passage. In the QA task, our model generates answers
word by word, and it has the capacity to generate answers
that do not literally occur in the passage. Therefore, it natu-
rally works for the generative QA scenario.
Figure 1: Model overview.
We first pretrain the model with the cross-entropy loss,
then fine tune with policy-gradient reinforcement learning to
alleviate the exposure bias problem, resulting from sequence
learning with the cross-entropy loss. In our policy-gradient
reinforcement learning algorithm, we adopt a similar sam-
pling strategy as the scheduled sampling strategy (Bengio
et al., 2015) for generating the sampled output. We per-
form experiments on the SQuAD dataset (Rajpurkar et al.,
2016) for the QG task, and on the "description" subset of
the MS-MARCO (Nguyen et al., 2016) dataset for the gen-
erative QA task. Experimental results on the QG task show
that our model outperforms previous state-of-the-art meth-
ods, and the automatically generated questions can even im-
prove an extractive QA system. For the generative QA task,
our model shows better performance than other generative
systems.
Model
Figure 1 shows the architecture of our model. The
model takes two components as input: a passage P =
(p1, ..., pj, ..., pN ) of
length N, and a query Q =
(q1, ..., qi, ..., qM ) of length M, then generates the output
sequence X = (x1, ..., xL) word by word. Specifically, the
model follows the encoder-decoder framework. The encoder
matches each time-step of the passage against all time-steps
of the query from multiple perspectives, and encodes the
matching result into a "Multi-perspective Memory". In ad-
dition, the decoder generates the output sequence one word
at a time based on the "Multi-perspective Memory".
Multi-Perspective Matching Encoder
The left-hand side of Figure 1 depicts the architecture of our
encoder. Its goal is to perform comprehensive understanding
of the query and the passage. The encoder first represents all
words within the passage and the query with word embed-
dings (Mikolov et al., 2013). In order to incorporate contex-
tual information into the representation of each time-step of
the passage or the query, we utilize a bi-directional LSTM
(BiLSTM) (Hochreiter and Schmidhuber, 1997) layer to en-
code the passage and the query individually:
←−
hq
i = LSTM(
−→
hq
i = LSTM(
←−
hp
j = LSTM(
−→
hp
j = LSTM(
←−−
hq
i+1, qi)
−−→
hq
i−1, qi)
←−−
hp
j+1, pj)
−−→
hp
j−1, pj),
←−
hq
i ;
i = [
j = [
←−
hp
j ;
−→
hp
j ].
where qi and pj are embedding of the i-th word in the query
and the j-th word in the passage. Then, the contextual vec-
tors for each time-step of the query and the passage are
constructed by concatenating the outputs from the BiLSTM
layer: hq
−→
hq
i ] and hp
We utilize a matching layer on top of the contextual
vectors to match each time-step of the passage with all
time-steps of the query. Apparently, this is the most crucial
layer in our encoder. Inspired by Wang, Hamza, and Florian
(2017), we adopt the multi-perspective matching method for
the matching layer. We define four matching strategies, as
shown in Figure 2, to match the passage with the query from
multiple granularities.
(1) Full-Matching. As shown in Figure 2 (a), each for-
ward (or backward) contextual vector of the passage is com-
pared with the last time-step of the forward (or backward)
representation of the query.
(2) Maxpooling-Matching. As shown in Figure 2 (b),
each forward (or backward) contextual vector of the passage
is compared with every forward (or backward) contextual
&'&(&)…………,',(,-………….'.(.)…………0"0/Multi-perspectiveMatching Layer…1'1(0………AttentionDistributionVocabularyDistributionFinalDistributionMulti-perspectiveMemoryDecoder231−23Encodersimilarity according to that perspective is defined as:
mk = cos(Wk ◦ v1, Wk ◦ v2),
where ◦ is the element-wise multiplication operation. So
fm(v1, v2; W) represents the matching results between v1
and v2 from all perspectives. Intuitively, each perspective
calculates the cosine similarity between two input vectors,
and it is associated with a weight vector trained to highlight
different dimensions of the input vectors. This can be re-
garded as considering different part of the semantics cap-
tured in the vector.
The final matching vector mj for each time-step of the
passage is the concatenation of the matching results of all
four strategies. We also employ another BiLSTM layer on
top of the matching layer to smooth the matching results. We
concatenate the contextual vectors, hp
j , of the passage and
matching vectors to be the Multi-perspective Memory H,
which contains both the passage information and the match-
ing information.
LSTM Decoder
The right-hand side of Figure 1 is our decoder. Basically,
it is an attention-based LSTM model (Bahdanau, Cho, and
Bengio, 2014) with copy and coverage mechanisms. The de-
coder takes the "Multi-perspective Memory" as the attention
memory, and generates the output one word at a time.
Concretely, while generating the t-th word xt, the de-
coder considers five factors as the input: (1) the "Multi-
perspective Memory" H = {h0, ..., hi, ..., hN}, where each
vector hi ∈ H aligns to the i-th word in the passage; (2) the
previous hidden state of the LSTM model st−1; (3) the em-
bedding of previously generated word xt−1; (4) the previous
context vector ct−1, which is calculated from the attention
mechanism with H being the attentional memory; and (5)
the previous coverage vector ut−1, which is the accumula-
tion of all attention distributions so far. When t = 0, we
initialize s−1, c−1 and u−1 as zero vectors, and fix x−1 to
be the embedding of the sentence start token "<s>".
For each time-step t, the decoder first feeds the concate-
nation of the previous word embedding xt−1 and context
vector ct−1 into the LSTM model to update the hidden state:
st = LSTM(st−1, [xt−1, ct−1])
Second, the attention distribution αt,i for each time-step of
the "Multi-perspective Memory" hi ∈ H is calculated with
the following equations:
et,i = vT
e tanh(Whhi + Wsst + Wuut−1 + be)
(cid:80)N
exp(et,i)
j=1 exp(et,j)
αt,i =
where Wh, Ws, Wv, be and ve are learnable parameters. The
coverage vector ut is then updated by ut = ut−1 + αt. And
the new context vector ct is calculated via:
N(cid:88)
i=1
ct =
αt,ihi
Figure 2: Diagrams for different matching strategies, where
fm is a matching function between two vectors. The inputs
include the contextual vector of one time-step of the passage
(left orange block) and the contextual vectors of all time-
steps of the query (right blue blocks). The output is a vector
of matching values (top green block) calculated via fm.
vectors of the query, and only the maximum value of each
dimension is retained.
(3) Attentive-Matching. As shown in Figure 2 (c), we
first calculate the cosine similarities between each forward
(or backward) contextual vector of the passage and every
forward (or backward) contextual vector of the question.
Then, we take the cosine similarities as the weights, and cal-
culate an attention vector for the entire query by computing
a weighted sum of all the contextual vectors of the query.
Finally, we match each forward (or backward) contextual
vector of the passage with its corresponding attentive vector.
(4) Max-Attentive-Matching. As shown in Figure 2 (d),
this strategy is similar to the Attentive-Matching strategy.
However, instead of taking the weighed sum of all the con-
textual vectors as the attentive vector, we pick the contextual
vector with the highest cosine similarity as the attentive vec-
tor. Then, we match each contextual vector of the passage
with its new attentive vector.
These four match strategies require a function fm to
match two vectors. Theoretically, any functions for match-
ing two vectors would work here. Inspired by Wang et
al. (2016), we adopt the multi-perspective cosine matching
function defined as:
m = fm(v1, v2; W),
where v1 and v2 are d-dimensional input vectors, W ∈ Rl×d
is the learnable parameter of multi-perspective weight, and
l is the number of perspectives. Each row Wk ∈ W repre-
sents the weights associated with one perspective, and the
......𝑓4......𝑓4𝑓4𝑓4𝑓4............element-wise maximum(a) Full-Matching(b) Maxpooling-Matching......weighted-sum𝑓4(c) Attentive-Matching......max𝑓4(d) Max-Attentive-MatchingThen, the output probability distribution over a vocabulary
of words at the current state is calculated by:
Pvocab = softmax(V2(V1[st, ct] + b1) + b2),
where V1, V2, b1 and b2 are learnable parameters. The num-
ber of rows in V2 represents the number of words in the vo-
cabulary.
On top of the LSTM decoder, we adopt the copy mecha-
nism (Gulcehre et al., 2016; Gu et al., 2016; See, Liu, and
Manning, 2017) to integrate the attention distribution into
the final vocabulary distribution. The probability distribu-
tion is defined as the interpolation between two probability
distributions:
Pf inal = gtPvocab + (1 − gt)Pattn,
where gt is the switch for controlling generating a word
from the vocabulary or directly copying it from the passage.
Pvocab is the generating probability distribution as defined
above, and Pattn is calculated based on the attention dis-
tribution αt by merging probabilities of duplicated words.
Intuitively, gt is relevant to the current decoder state, the at-
tention results and the input. Therefore, inspired by See, Liu,
and Manning (2017), we define it as:
s st + wT
x xt−1 + bg),
gt = σ(wT
c ct + wT
where vectors wc, ws, wx and scalar bg are learnable param-
eters.
Policy Gradient Reinforcement Learning via
Scheduled Sampling
A common way of training a sequence generation model
is to optimize the log-likelihood of the gold-standard out-
put sequence Y ∗ = y∗
T with the cross-entropy
loss:
0, ..., y∗
t , ..., y∗
lce = − T(cid:88)
log p(y∗
t y∗
t−1, ..., y∗
0, X; θ),
t=1
where X is the model input, and θ represents the trainable
model parameters.
However, this method suffers from two main issues. First,
during the training stage, the ground-truth of the previous
word y∗
t−1 is taken as the input to predict the probabilities
of the next word yt. But, in the testing stage, the ground-
truth y∗
t−1 is not available, and the model has to rely on the
previously generated word yt−1. If the model selected a dif-
ferent yt−1 than the ground-truth y∗
t−1, then the following
generated sequence could deviate from the gold-standard se-
quence. This issue is known as the "exposure bias problem".
Second, models trained with the cross-entropy loss are opti-
mized for the log-likelihood of a sequence which is different
from the evaluation metrics.
In this work, we utilize a reinforcement learning method
to address the exposure bias problem and directly optimize
the evaluation metrics. Concretely, we adopt the "REIN-
FORCE with a baseline" algorithm (Williams, 1992), a well-
known policy-gradient reinforcement learning algorithm, to
train our model, because it has shown the effectiveness
for several sequence generation tasks (Paulus, Xiong, and
if random.random() < pf lip then
Data: gold-standard sequence Y ∗
Data: greedy search sequence Y
Result: sampled sequence Y s
if i < len( Y ) then
1 S ← [];
2 for i in range(len(Y ∗)) do
3
4
5
6
7
8
9
10
11
12 end
end
S.append(Y ∗[i]) ;
end
else
else
S.append( Y [i]) ;
S.append(Y ∗[i]) ;
Algorithm 1: Scheduled Sampling Strategy
T(cid:88)
Socher, 2017; Rennie et al., 2016). Formally, the loss func-
tion is defined as:
lrl = (r( Y ) − r(Y s))
log p(ys
tys
t−1, ..., ys
0, x; θ),
t=1
0, ..., ys
T is the sampled sequence, Y is the
where Y s = ys
sequence generated from a baseline, and the function r(Y )
is the reward calculated based on the evaluation metric. In-
tuitively, the loss function lrl enlarges the log-probability of
the sampled sequence Y s, if Y s is better than the baseline
Y in terms of the evaluation metric r(Y ), or vice versa. In
this work, for the QG task, we use the BLEU score (Papineni
et al., 2002) as the reward, and for the QA task, we use the
ROUGE score (Lin, 2004) as the reward.
tys
t−1, ..., ys
1, x; θ). However,
Following Rennie et al. (2016), we take the greedy
search result from the current model as the baseline se-
quence Y . Rennie et al. (2016) generated the sampled
sequence Y s according to the probability distribution of
this sampling strategy
p(ys
doesn't work well for our tasks. One possible reason is that
our tasks have much larger search space. Inspired by Ben-
gio et al. (2015), we designed a new "Scheduled Sampling"
strategy to construct the sampled sequence Y s from both
the gold-standard sequence Y ∗ and the greedy search se-
quence Y . As shown in Algorithm 1, it goes through the
gold-standard sequence Y ∗ word by word (Line 2), and re-
places with the corresponding word from the greedy search
sequence Y with probability pf lip (Line 4-8). If the greedy
search sequence is shorter than the gold-standard sequence,
the ground-truth word is used after exceeding the end of the
greedy search sequence (Line 10). Our experiments show
that sampling the sequence according to the model distribu-
tion, as Rennie et al. (2016) does, usually produces outputs
worse than the greedy search sequence, so it does not help
very much. On the other hand, our sampling strategy usually
generates better outputs than the greedy search sequence.
Experimental Setup
We conduct experiments on two tasks: question generation
(QG) and generative question answering (QA).
Models
Du, Shao, and Cardie (2017)
Zhou et al. (2017)
w/o rich feature (baseline)
MPQG
MPQG+R
--
--
12.84
13.98
--
--
18.02
18.77
Split 1
Split 2
BLEU-4 METEOR ROUGE-L BLEU-4
12.28
39.75
16.62
--
--
41.39
42.72
--
13.29
12.59(*)
13.39
13.91
Table 1: Results on question generation. *There is no published scores for Zhou et al. (2017) without the rich features, so we
re-implemented their system and show the result.
Question Generation For the QG task, we evaluate the
quality of generated questions with some automatic eval-
uation metrics such as BLEU (Papineni et al., 2002) and
ROUGE (Lin, 2004), as well as their effectiveness in im-
proving an extractive QA system. We conduct experiments
on the SQuAD dataset (Rajpurkar et al., 2016) by comparing
our model with Du, Shao, and Cardie (2017) and Zhou et al.
(2017) in terms of BLEU, METEOR (Banerjee and Lavie,
2005) and ROUGE. The dataset contains 536 articles and
over 100k questions related to the articles. Here, we follow
Du, Shao, and Cardie (2017) and Zhou et al. (2017) to con-
duct experiments on the accessible part as our entire dataset.
Since Du, Shao, and Cardie (2017) and Zhou et al. (2017)
conducted their experiments using different training/dev/test
split, we conduct experiments on both splits, and compare
with their reported performance.
In addition, we also evaluate our model from a more prac-
tical aspect by examining whether the automatically gener-
ated questions are helpful for improving an extractive QA
system. We use the data split of Du, Shao, and Cardie
(2017), and conduct experiments on low-resource settings,
where only (10%, 20%, or 50%) of the human-labeled ques-
tions in the training data are available. For example, in the
10% setting, we first train our QG model with the 10% avail-
able training data, then generate questions for the remaining
90% instances in the training data, where the human-labeled
questions are abandoned.1 Finally, we train an extractive QA
system with the 10% human-labeled questions and the 90%
automatically generated questions. The extractive QA sys-
tem we choose is Wang et al. (2016), but our framework does
not make any assumptions about the extractive QA systems
being used.
Generative QA For this task, we conduct experiments on
the MS MARCO dataset (Nguyen et al., 2016), which con-
tains around 100k queries and 1M passages. The design pur-
pose of this dataset is to generate the answer given the top
10 returned documents from a search engine, where the an-
swer is not necessary in the documents. Even though the
answers in this dataset are human generated rather than ex-
tracted from candidate documents, we found that the an-
swers of around 66% questions can be exactly matched in
the passage, and a large number of the remaining answers
1We assume the gold answers are available when generating
questions for the remaining 90% instances, and leave automatic
answer selection as future work, since the primary goal here is to
evaluate the quality of automatically generated questions.
just have a small difference with the content in the passages.2
Among all types of questions ("numeric", "entity", "loca-
tion", "person" and "description"), the "description" subset
has the most percentage of answers that can not be exactly
matched in the passage. Therefore, for the generative QA ex-
periments, we follow Nguyen et al. (2016) to conduct exper-
iments on the "description" subset, and compare with their
reported results.
For both tasks, our model is first trained for 15 epochs
with the cross-entropy loss, then fine-tuned for 15 epochs
using our policy gradient algorithm. Adam (Kingma and Ba,
2014) is used for parameter optimization, and the learning
rate is set to 0.005 and 0.0001 for cross entropy and pol-
icy gradient phases respectively. The encoder and decoder
share the same pre-trained word embeddings, which are
the 300-dimensional GloVe (Pennington, Socher, and Man-
ning, 2014) word vectors pre-trained from the 840B com-
mon crawl corpus, and the embeddings are not updated dur-
ing training. For all experiments, the flip probability pf lip is
set to 0.1, the number of perspectives l is set to 5, and the
weight for the coverage loss η is set to 0.1. For all experi-
ments, the model yielding the best performance on the dev
set is picked for evaluation on the test set.
Experimental Results
Question Generation
We compare our model with Du, Shao, and Cardie (2017)
and Zhou et al. (2017) on the question generation task, and
show the results in Table 1. Since Zhou et al. (2017) adopts
rich features (such as named entity tags and part-of-speech
tags), we re-implement a version without these rich features
(w/o rich feature) for fair comparison. We also implement
two versions of our model: (1) MPQG is our model only
trained with the cross-entropy loss, and (2) MPQG+R is
our model fine-tuned with the policy gradient reinforcement
learning algorithm after pretraining.
First, our MPQG model outperforms the comparing sys-
tems on both data splits, which shows the effectiveness of
our multi-perspective matching encoder. Our MPQG model,
which only takes word features, shows even better perfor-
mance than the feature-rich (with POS and NE tags) system
of Zhou et al. (2017). Du, Shao, and Cardie (2017) utilized
the sequence-to-sequence (Peng et al., 2016) model to take
the passage as input and then generated the questions, where
2They are generated by dropping or paraphrasing one span from
the supporting sentence (containing answer) in the passage.
Passage: nikola tesla -lrb- serbian cyrillic : Nikola Tesla ; 10
july [1856] -- 7 january 1943 -rrb- was a serbian american inventor
, electrical engineer , mechanical engineer , physicist , and futur-
ist best known for his contributions to the design of the modern
alternating current -lrb- ac -rrb- electricity supply system .
Target Answer: 1856
Reference: when was nikola tesla born ?
Baseline: when was nikola tesla 's inventor ?
MPQG: when was nikola tesla born ?
MPQG+R: when was nikola tesla born ?
Passage: zhéng -lrb- chinese : 正 -rrb- meaning " [right] " , "
just " , or " true " , would have received the mongolian adjectival
modifiers , creating " jenggis " , which in medieval romanization
would be written " genghis " .
Target Answer: right
Reference: what does zhéng mean ?
Baseline: what are the names of the " jenggis " ?
MPQG: what does zhéng UNK mean ?
MPQG+R: what does zhéng mean ?
Passage: kenya is known for its [safaris , diverse climate and ge-
ography , and expansive wildlife reserves] and national parks such
as the east and west tsavo national park , the maasai mara , lake
nakuru national park , and aberdares national park .
Target Answer: safaris , diverse climate and geography , and ex-
pansive wildlife reserves
Reference: what is kenya known for ?
Baseline: what are the two major rivers that are known for the east
and west tsavo national park ?
MPQG: what is kenya known for ?
MPQG+R: what is kenya known for ?
Table 2: Examples of generated questions. In each passage, the
target answer is italic and is within brackets. The baseline is our
implementation of Zhou et al. (2017) without rich features.
they entirely ignored the target answer. Therefore, the gen-
erated questions are independent of the target answer. Zhou
et al. (2017) hard-coded the target answer positions into the
passage, and employed the sequence-to-sequence model to
consume the position-encoded passages, then generated the
questions. This method only considered the target answer
positions, but neglected the relations between the target an-
swer and other parts of the passage. If the target answer does
not literally occur in the passage, this method will shrivel.
Conversely, our MPQG model matches the target answer
against the passage from multiple perspectives. Therefore,
it can capture more interactions between the target answer
and the passage, and result in a more suitable question for
the target answer.
Second, our MPQG+R model works better than the
MPQG model on both splits, showing the effectiveness of
our policy gradient training algorithm.
To better illustrate the advantage of our model, we show
some comparative results of different models in Table 2,
where the Baseline system is our implementation of Zhou
et al. (2017) without rich features. Generally, our MPQG
model generates better questions than Zhou et al. (2017).
Taking the first case as an example, the baseline fails to rec-
ognize that "1856" is the year when "nikola tesla" is born,
while our MPQG learns that from the pattern "day month
year - day month year", which frequently occurs in the train-
ing data. For the third case, the baseline fails to generate the
correct output as the query is very long and complicated.
On the other hand, our MPQG model is able to capture that,
because it performs comprehensive matching between the
target answer and the passages. In addition, our MPQG+R
model fixes some small mistakes of MPQG by directly op-
timizing the evaluation metrics, such as the second case in
Table 2.
Question Generation for Extractive QA
Table 3 shows the results on improving an extractive QA
system with automatically generated questions. Here F1
measures the overlap between the prediction and the refer-
ence in terms of bags of tokens, and exact match (EM) mea-
sures the percentage where the prediction is identical to the
reference (Rajpurkar et al., 2016). The baseline is trained
only on the part where gold questions are available, while
the others are trained on the combination of the gold ques-
tions and the automatically generated questions, but with
different methods of generating questions: (1) w/ window,
a strong baseline from Yang et al. (2017), uses the previous
and the following 5 tokens of the target answer as the pseudo
question, and (2) w/ MPQG+R generates questions with our
MPQG+R model.
First, we can see that w/ MPQG+R outperforms the base-
line under all settings in terms of both F1 and EM scores,
especially under the 10% setting, where we observe 3 and
5 points gains in terms of F1 and EM scores. This shows
the effectiveness of our model. Second, the comparing re-
sults between w/ MPQG+R and w/ window show that the
improvements of w/ MPQG+R are not due to simply enlarg-
ing the training data, but because of the higher quality of the
generated questions. Yang et al. (2017) showed that w/ win-
dow can significantly improve their baseline, while it is not
true in our experiment. One reason could be that our base-
line is much stronger than theirs. For example, our system
achieves 50.54% EM score under 10% setting, while theirs
only got an EM score of 24.92%.
Generative QA
For the generative QA experiment, we compare our model
with the generative models in Nguyen et al. (2016) on
the "description" subset of MS-MARCO dataset. Table 4
shows the corresponding performance. Among all the com-
paring methods, Best Passage selects the best passage in
terms of the ROUGE-L score, and obviously it accesses
the reference. Passage Ranking ranks the passage by a
deep structured semantic model of Huang et al. (2013). Se-
quence to Sequence is a vanilla sequence-to-sequence model
(Sutskever, Vinyals, and Le, 2014). Memory Network adopts
the end-to-end memory network (Sukhbaatar et al., 2015) as
the encoder, and a vanilla RNN model as the decoder. We
also implement a baseline system "vanilla-cosine", which
only apply the vanilla cosine similarity for the matching
function fm in our encoder, and is only trained with the
cross-entropy loss.
First, we can see that our MPQG+R model outperforms
all other systems by a large margin, and is close to Best
Passage, even though Best Passage accesses the reference.
Methods
10% 20% 50% 10% 20% 50%
61.61
64.13
baseline
w/ window
61.23
64.00
w/ MPQG+R 64.52
65.30
73.67
73.35
74.50
50.54
50.48
55.44
F1
68.38
66.80
69.28
Exact Match (EM)
57.63
56.31
59.66
Table 3: Results on improving extractive QA with automatically generated questions.
Models
Best Passage
Passage Ranking
Sequence to Sequence
Memory Network
vanilla-cosine
MPQG
MPQG+R
ROUGE-L
35.1
17.7
8.9
11.9
19.9
31.5
32.9
Table 4: Results on the "description" subset of MS-MARCO.
Besides, our MPQG model outperforms the vanilla-cosine
model showing the effectiveness of our multi-perspective
matching encoder. Finally, MPQG+R outperforms MPQG
by around 1.4 ROUGE-L points, showing the effectiveness
of our policy-gradient learning strategy.
Related Work
For question generation (QG), our work extends previous
work (Du, Shao, and Cardie, 2017; Zhou et al., 2017; Yang
et al., 2017; Subramanian et al., 2017; Tang et al., 2017;
Wang, Yuan, and Trischler, 2017; Yuan et al., 2017) by per-
forming query understanding. Tang et al. (2017); Yang et al.
(2017) joins the QG task with the QA task, but they still con-
duct the QG task. The only difference is that they directly
optimize the QA performance rather than a general metric
(such as BLEU). On the other hand, our model can conduct
both tasks of QG and QA.
For question answering (QA), most previous works
(Wang and Jiang, 2016; Wang et al., 2016; Shen et al.,
2016; Wang et al., 2017; Chen et al., 2017; Xiong, Zhong,
and Socher, 2016; Seo et al., 2016; Lee et al., 2016; Yu et
al., 2016; Dhingra et al., 2017) focus on the extractive QA
scenario, which predicts a continuous span in the passage
as the answer. Obviously, they rely on the assumption that
the answer can be exactly matched in the passage. On the
other hand, our model performs generative QA, which gen-
erates the answer word-by-word, and does not rely on this
assumption. The generative QA is valuable for studying, as
we can not guarantee the assumption being true for all sce-
narios. Tan et al. (2017) claims to perform generative QA,
but it still relies on an extractive QA system by generating
answers from the extractive results. One notable exclusion
is Yin et al. (2015), which generate factoid answers from
a knowledge base (KB). One significant difference is that
their method matches the query against a KB, whereas ours
performs matching against unstructured texts. Besides, we
leverage policy gradient learning to alleviate the exposure
bias problem, which they also suffer from.
Conclusion
In this paper, we introduced a query-based generative model,
which can be used on both question generation and ques-
tion answering. Following the encoder-decoder framework,
a multi-perspective matching encoder is designed to perform
query and passage understanding, and an LSTM model with
coverage and copy mechanisms is leveraged as the decoder
to generate the target sequence. In addition, we leverage a
policy gradient learning algorithm to alleviate the exposure
bias problem, which generative models suffer from when
training with the cross-entropy loss. Experiments on both
question generation and question answering tasks show su-
perior performances of our model, which outperforms the
state-of-the-art models. From the results we conclude that
query understanding is important for question generation,
and that policy gradient is effective on tackling the expo-
sure bias problem resulted by sequence learning with cross-
entropy loss. For the future work, we will consider adding
adversarial data, which has been shown successful on plenty
of areas(Peng et al., 2018).
References
Bahdanau, D.; Cho, K.; and Bengio, Y. 2014. Neural ma-
chine translation by jointly learning to align and translate.
arXiv preprint arXiv:1409.0473.
Banerjee, S., and Lavie, A. 2005. METEOR: An auto-
matic metric for mt evaluation with improved correlation
with human judgments. In Proceedings of the ACL work-
shop on intrinsic and extrinsic evaluation measures for
machine translation and/or summarization.
Bengio, S.; Vinyals, O.; Jaitly, N.; and Shazeer, N. 2015.
Scheduled sampling for sequence prediction with recur-
rent neural networks. In NIPS 2015, 1171 -- 1179.
Chen, D.; Fisch, A.; Weston, J.; and Bordes, A. 2017. Read-
ing wikipedia to answer open-domain questions. In Pro-
ceedings of ACL 2017.
Dhingra, B.; Liu, H.; Yang, Z.; Cohen, W.; and Salakhutdi-
nov, R. 2017. Gated-attention readers for text compre-
hension. In Proceedings of ACL 2017.
Du, X.; Shao, J.; and Cardie, C. 2017. Learning to ask: Neu-
ral question generation for reading comprehension. arXiv
preprint arXiv:1705.00106.
Gu, J.; Lu, Z.; Li, H.; and Li, V. O. 2016.
Incorporating
copying mechanism in sequence-to-sequence learning. In
Proceedings of ACL 2017.
Gulcehre, C.; Ahn, S.; Nallapati, R.; Zhou, B.; and Bengio,
Y. 2016. Pointing the unknown words. In Proceedings of
ACL 2017.
Hochreiter, S., and Schmidhuber, J. 1997. Long short-term
memory. Neural computation 9(8):1735 -- 1780.
Huang, P.-S.; He, X.; Gao, J.; Deng, L.; Acero, A.; and Heck,
L. 2013. Learning deep structured semantic models for
In Proceedings of
web search using clickthrough data.
CIKM 2013, 2333 -- 2338.
Kingma, D., and Ba, J. 2014. Adam: A method for stochastic
optimization. arXiv preprint arXiv:1412.6980.
Lee, K.; Salant, S.; Kwiatkowski, T.; Parikh, A.; Das, D.;
and Berant, J. 2016. Learning recurrent span represen-
tations for extractive question answering. arXiv preprint
arXiv:1611.01436.
Lin, C.-Y. 2004. Rouge: A package for automatic evalua-
tion of summaries. In Text summarization branches out:
Proceedings of the ACL-04 workshop. Barcelona, Spain.
Mi, H.; Sankaran, B.; Wang, Z.; and Ittycheriah, A. 2016.
A coverage embedding model for neural machine transla-
tion. In EMNLP 2016.
Mikolov, T.; Chen, K.; Corrado, G.; and Dean, J. 2013. Ef-
ficient estimation of word representations in vector space.
arXiv preprint arXiv:1301.3781.
Nguyen, T.; Rosenberg, M.; Song, X.; Gao, J.; Tiwary, S.;
Majumder, R.; and Deng, L. 2016. MS MARCO: A hu-
man generated machine reading comprehension dataset.
arXiv preprint arXiv:1611.09268.
Papineni, K.; Roukos, S.; Ward, T.; and Zhu, W.-J. 2002.
BLEU: a method for automatic evaluation of machine
translation. In Proceedings of ACL 2002.
Paulus, R.; Xiong, C.; and Socher, R.
2017. A deep
reinforced model for abstractive summarization. arXiv
preprint arXiv:1705.04304.
Peng, X.; Feris, R. S.; Wang, X.; and Metaxas, D. N. 2016.
A recurrent encoder-decoder network for sequential face
alignment. In European conference on computer vision,
38 -- 56. Springer, Cham.
Peng, X.; Tang, Z.; Yang, F.; Feris, R. S.; and Metaxas, D.
2018. Jointly optimize data augmentation and network
training: Adversarial data augmentation in human pose
In Proceedings of the IEEE Conference on
estimation.
Computer Vision and Pattern Recognition, 2226 -- 2234.
Pennington, J.; Socher, R.; and Manning, C. 2014. Glove:
Global vectors for word representation. In Proceedings of
EMNLP 2014, 1532 -- 1543.
Rajpurkar, P.; Zhang, J.; Lopyrev, K.; and Liang, P. 2016.
SQuAD: 100,000+ questions for machine comprehension
of text. In Proceedings of EMNLP 2016, 2383 -- 2392.
Rennie, S. J.; Marcheret, E.; Mroueh, Y.; Ross, J.; and Goel,
V. 2016. Self-critical sequence training for image cap-
tioning. arXiv preprint arXiv:1612.00563.
See, A.; Liu, P. J.; and Manning, C. D. 2017. Get to the
point: Summarization with pointer-generator networks.
arXiv preprint arXiv:1704.04368.
Seo, M.; Kembhavi, A.; Farhadi, A.; and Hajishirzi, H. 2016.
Bidirectional attention flow for machine comprehension.
arXiv preprint arXiv:1611.01603.
Shen, Y.; Huang, P.-S.; Gao, J.; and Chen, W. 2016. Rea-
sonet: Learning to stop reading in machine comprehen-
sion. arXiv preprint arXiv:1609.05284.
Subramanian, S.; Wang, T.; Yuan, X.; and Trischler, A.
2017. Neural models for key phrase detection and ques-
tion generation. arXiv preprint arXiv:1706.04560.
Sukhbaatar, S.; Weston, J.; Fergus, R.; et al. 2015. End-to-
end memory networks. In NIPS 2015, 2440 -- 2448.
Sutskever, I.; Vinyals, O.; and Le, Q. V. 2014. Sequence to
sequence learning with neural networks. In NIPS 2014,
3104 -- 3112.
Tan, C.; Wei, F.; Yang, N.; Lv, W.; and Zhou, M. 2017.
S-net: From answer extraction to answer generation
arXiv preprint
for machine reading comprehension.
arXiv:1706.04815.
Tang, D.; Duan, N.; Qin, T.; and Zhou, M. 2017. Question
answering and question generation as dual tasks. arXiv
preprint arXiv:1706.02027.
Tu, Z.; Lu, Z.; Liu, Y.; Liu, X.; and Li, H. 2016. Modeling
coverage for neural machine translation. arXiv preprint
arXiv:1601.04811.
Wang, S., and Jiang, J. 2016. Machine comprehension
arXiv preprint
using match-lstm and answer pointer.
arXiv:1608.07905.
Wang, Z.; Mi, H.; Hamza, W.; and Florian, R. 2016. Multi-
perspective context matching for machine comprehen-
sion. arXiv preprint arXiv:1612.04211.
Wang, W.; Yang, N.; Wei, F.; Chang, B.; and Zhou, M. 2017.
Gated self-matching networks for reading comprehension
and question answering. In Proceedings of ACL 2017.
Wang, Z.; Hamza, W.; and Florian, R. 2017. Bilateral multi-
perspective matching for natural language sentences. In
IJCAI 2017.
Wang, T.; Yuan, X.; and Trischler, A. 2017. A joint model
for question answering and question generation. arXiv
preprint arXiv:1706.01450.
Williams, R. J. 1992. Simple statistical gradient-following
algorithms for connectionist reinforcement learning. Ma-
chine learning 8(3-4):229 -- 256.
Xiong, C.; Zhong, V.; and Socher, R. 2016. Dynamic coat-
tention networks for question answering. arXiv preprint
arXiv:1611.01604.
Yang, Z.; Hu, J.; Salakhutdinov, R.; and Cohen, W. W.
Semi-supervised qa with generative domain-
2017.
adaptive nets. arXiv preprint arXiv:1702.02206.
Yin, J.; Jiang, X.; Lu, Z.; Shang, L.; Li, H.; and Li, X. 2015.
arXiv preprint
Neural generative question answering.
arXiv:1512.01337.
Yu, Y.; Zhang, W.; Hasan, K.; Yu, M.; Xiang, B.; and
Zhou, B. 2016. End-to-end answer chunk extraction
and ranking for reading comprehension. arXiv preprint
arXiv:1610.09996.
Yuan, X.; Wang, T.; Gulcehre, C.; Sordoni, A.; Bachman, P.;
Subramanian, S.; Zhang, S.; and Trischler, A. 2017. Ma-
chine comprehension by text-to-text neural question gen-
eration. arXiv preprint arXiv:1705.02012.
Zhou, Q.; Yang, N.; Wei, F.; Tan, C.; Bao, H.; and Zhou, M.
2017. Neural question generation from text: A prelimi-
nary study. arXiv preprint arXiv:1704.01792.
|
1612.04426 | 1 | 1612 | 2016-12-13T23:09:49 | Improving Neural Language Models with a Continuous Cache | [
"cs.CL",
"cs.LG"
] | We propose an extension to neural network language models to adapt their prediction to the recent history. Our model is a simplified version of memory augmented networks, which stores past hidden activations as memory and accesses them through a dot product with the current hidden activation. This mechanism is very efficient and scales to very large memory sizes. We also draw a link between the use of external memory in neural network and cache models used with count based language models. We demonstrate on several language model datasets that our approach performs significantly better than recent memory augmented networks. | cs.CL | cs |
Under review as a conference paper at ICLR 2017
IMPROVING NEURAL LANGUAGE MODELS WITH A
CONTINUOUS CACHE
Edouard Grave, Armand Joulin, Nicolas Usunier
Facebook AI Research
{egrave,ajoulin,usunier}@fb.com
ABSTRACT
We propose an extension to neural network language models to adapt their pre-
diction to the recent history. Our model is a simplified version of memory aug-
mented networks, which stores past hidden activations as memory and accesses
them through a dot product with the current hidden activation. This mechanism is
very efficient and scales to very large memory sizes. We also draw a link between
the use of external memory in neural network and cache models used with count
based language models. We demonstrate on several language model datasets that
our approach performs significantly better than recent memory augmented net-
works.
1
INTRODUCTION
Language modeling is a core problem in natural language processing, with many applications such
as machine translation (Brown et al., 1993), speech recognition (Bahl et al., 1983) or dialogue
agents (Stolcke et al., 2000). While traditional neural networks language models have obtained state-
of-the-art performance in this domain (Jozefowicz et al., 2016; Mikolov et al., 2010), they lack the
capacity to adapt to their recent history, limiting their application to dynamic environments (Dodge
et al., 2015). A recent approach to solve this problem is to augment these networks with an external
memory (Graves et al., 2014; Grefenstette et al., 2015; Joulin & Mikolov, 2015; Sukhbaatar et al.,
2015). These models can potentially use their external memory to store new information and adapt
to a changing environment.
While these networks have obtained promising results on language modeling datasets (Sukhbaatar
et al., 2015), they are quite computationally expensive. Typically, they have to learn a parametrizable
mechanism to read or write to memory cells (Graves et al., 2014; Joulin & Mikolov, 2015). This may
limit both the size of their usable memory as well as the quantity of data they can be trained on. In
this work, we propose a very light-weight alternative that shares some of the properties of memory
augmented networks, notably the capability to dynamically adapt over time. By minimizing the
computation burden of the memory, we are able to use larger memory and scale to bigger datasets.
We observe in practice that this allows us to surpass the perfomance of memory augmented networks
on different language modeling tasks.
Our model share some similarities with a model proposed by Kuhn (1988), called the cache model.
A cache model stores a simple representation of the recent past, often in the form of unigrams, and
uses them for prediction (Kuhn & De Mori, 1990). This contextual information is quite cheap to
store and can be accessed efficiently. It also does not need any training and can be appplied on
top of any model. This makes this model particularly interesting for domain adaptation (Kneser &
Steinbiss, 1993).
Our main contribution is to propose a continuous version of the cache model, called Neural Cache
Model, that can be adapted to any neural network language model. We store recent hidden activations
and use them as representation for the context. Using simply a dot-product with the current hidden
activations, they turn out to be extremely informative for prediction. Our model requires no training
and can be used on any pre-trained neural networks.
It also scales effortlessly to thousands of
memory cells. We demonstrate the quality of the Neural Cache models on several language model
tasks and the LAMBADA dataset (Paperno et al., 2016).
1
Under review as a conference paper at ICLR 2017
2 LANGUAGE MODELING
A language model is a probability distribution over sequences of words. Let V be the size of the
vocabulary; each word is represented by a one-hot encoding vector x in RV = V, corresponding to
its index in the vocabulary. Using the chain rule, the probability assigned to a sequence of words
x1, . . . , xT can be factorized as
T(cid:89)
p(x1, ..., xT ) =
p(xt xt−1, ..., x1).
t=1
Language modeling is often framed as learning the conditional probability over words, given the
history (Bahl et al., 1983).
This conditional probability is traditionally approximated with non-parameteric models based on
counting statistics (Goodman, 2001). In particular, smoothed N-gram models (Katz, 1987; Kneser &
Ney, 1995) achieve good performance in practice (Mikolov et al., 2011). Parametrized alternatives
are either maximum entropy language models (Rosenfeld, 1996), feedforward networks (Bengio
et al., 2003) or recurrent networks (Mikolov et al., 2010).
In particular, recurrent networks are
currently the best solution to approximate this conditional probability, achieving state-of-the-arts
performance on standard language modeling benchmarks (Jozefowicz et al., 2016; Zilly et al., 2016).
Recurrent networks. Assuming that we have a vector ht ∈ Rd encoding the history xt, ..., x1,
the conditional probability of a word w can be parametrized as
pvocab(w xt, ..., x1) ∝ exp(h(cid:62)
t ow).
The history vector ht is computed by a recurrent network by recursively applying an equation of the
form
ht = Φ (xt, ht−1) ,
where Φ is a function depending on the architecture of the network. Several architecture for recur-
rent networks have been proposed, such as the Elman network (Elman, 1990), the long short-term
memory (LSTM) (Hochreiter & Schmidhuber, 1997) or the gated recurrent unit (GRU) (Chung
et al., 2014). One of the simplest recurrent networks is the Elman network (Elman, 1990), where
ht = σ (Lxt + Rht−1) ,
where σ is a non-linearity such as the logistic or tanh functions, L ∈ Rd×V is a word embedding
matrix and R ∈ Rd×d is the recurrent matrix. The LSTM architecture is particularly interesting in
the context of language modelling (Jozefowicz et al., 2016) and we refer the reader to Graves et al.
(2013) for details on this architecture.
The parameters of recurrent neural network language models are learned by minimizing the nega-
tive log-likelihood of the training data. This objective function is usually minimized by using the
stochastic gradient descent algorithm, or variants such as Adagrad (Duchi et al., 2011). The gradient
is computed using the truncated backpropagation through time algorithm (Werbos, 1990; Williams
& Peng, 1990).
Cache model. After a word appears once in a document, it is much more likely to appear again.
As an example, the frequency of the word tiger on the Wikipedia page of the same name is 2.8%,
compared to 0.0037% over the whole Wikipedia. Cache models exploit this simple observation
to improve n-gram language models by capturing long-range dependencies in documents. More
precisely, these models have a cache component, which contains the words that appeared in the
recent history (either the document or a fixed number of words). A simple language model, such as
a unigram or smoothed bigram model, is fitted on the words of the cache and interpolated with the
static language model (trained over a larger dataset). This technique has many advantages. First,
this is a very efficient way to adapt a language model to a new domain. Second, such models can
predict out-of-vocabulary words (OOV words), after seeing them once. Finally, this helps capture
long-range dependencies in documents, in order to generate more coherent text.
2
Under review as a conference paper at ICLR 2017
Id
R
(h1, x2)
(h2, x3)
(h3, x4)
Id
Id
R
R
h1
L
x1
h2
L
x2
Id
h3
L
x3
x5
O
h4
L
x4
3 NEURAL CACHE MODEL
Figure 1: The neural cache stores
the previous hidden states in memory
cells. They are then used as keys to re-
trieve their corresponding word, that
is the next word. There is no transfor-
mation applied to the storage during
writing and reading.
The Neural Cache Model adds a cache-like memory to neural network language models. It exploits
the hidden representations ht to define a probability distribution over the words in the cache. As
illustrated Figure 1, the cache stores pairs (hi, xi+1) of a hidden representation, and the word which
was generated based on this representation (we remind the reader that the vector hi encodes the
history xi, ..., x1). At time t, we then define a probability distribution over words stored in the cache
based on the stored hidden representations and the current one ht as
pcache(w h1..t, x1..t) ∝ t−1(cid:88)
1{w=xi+1} exp(θh(cid:62)
t hi)
i=1
of
point
view of memory-augmented
where the scalar θ is a parameter which controls the flatness of the distribution. When θ is equal
to zero, the probability distribution over the history is uniform, and our model is equivalent to a
unigram cache model (Kuhn & De Mori, 1990).
From the
probability
pcache(w h1..t, x1..t) given by the neural cache model can be interpreted as the probability
to retrieve the word w from the memory given the query ht, where the desired answer is the next
word xt+1. Using previous hidden states as keys for the words in the memory, the memory lookup
operator can be implemented with simple dot products between the keys and the query. In contrast
to existing memory-augmented neural networks, the neural cache model avoids the need to learn the
memory lookup operator. Such a cache can thus be added to a pre-trained recurrent neural language
model without fine tuning of the parameters, and large cache size can be used with negligible impact
on the computational cost of a prediction.
neural
networks,
the
Neural cache language model. Following the standard practice in n-gram cache-based language
models, the final probability of a word is given by the linear interpolation of the cache language
model with the regular language model, obtaining:
p(w h1..t, x1..t) = (1 − λ)pvocab(w ht) + λpcache(w h1..t, x1..t) .
Instead of taking a linear interpolation between the two distribution with a fixed λ, we also consider
a global normalization over the two distribution:
p(w h1..t, x1..t) ∝
exp(h(cid:62)
t ow) +
1{w=xi+1} exp(θh(cid:62)
t hi + α)
.
i=1
This corresponds to taking a softmax over the vocabulary and the words in the cache. The parameter
α controls the weight of the cache component, and is the counterpart of the λ parameter for linear
interpolation.
The addition of the neural cache to a recurrent neural language model inherits the advantages of n-
gram caches in usual cache-based models: The probability distribution over words is updated online
depending on the context, and out-of-vocabulary words can be predicted as soon as they have been
seen at least once in the recent history. The neural cache also inherits the ability of the hidden states
of recurrent neural networks to model longer-term contexts than small n-grams, and thus allows for
a finer modeling of the current context than e.g., unigram caches.
3
(cid:32)
t−1(cid:88)
(cid:33)
Under review as a conference paper at ICLR 2017
Figure 2: Perplexity on the validation set of Penn Tree Bank for linear interpolation (left) and
global normalization (right), for various values of hyperparameters θ, λ and α. We use a cache
model of size 500. The base model has a validation perplexity of 86.9. The best linear interpolation
has a perplexity of 74.6, while the best global normalization has a perplexity of 74.9.
Model
RNN+LSA+KN5+cache (Mikolov & Zweig, 2012)
LSTM (Zaremba et al., 2014)
Variational LSTM (Gal & Ghahramani, 2015)
Recurrent Highway Network (Zilly et al., 2016)
Pointer Sentinel LSTM (Merity et al., 2016)
LSTM (our implem.)
Neural cache model
Test PPL
90.3
78.4
73.4
66.0
70.9
82.3
72.1
Table 1: Test perplexity on the Penn Tree Bank.
Training procedure. For now, we first train the (recurrent) neural network language model, with-
out the cache component. We only apply the cache model at test time, and choose the hyperparam-
eters θ and λ (or α) on the validation set. A big advantage of our method is that it is very easy
and cheap to apply, with already trained neural models. There is no need to perform backpropaga-
tion over large contexts, and we can thus apply our method with large cache sizes (larger than one
thousand).
4 RELATED WORK
Cache model. Adding a cache to a language model was intoducted in the context of speech recog-
nition(Kuhn, 1988; Kupiec, 1989; Kuhn & De Mori, 1990). These models were further extended by
Jelinek et al. (1991) into a smoothed trigram language model, reporting reduction in both perplexity
and word error rates. Della Pietra et al. (1992) adapt the cache to a general n-gram model such that
it satisfies marginal constraints obtained from the current document.
Adaptive language models. Other adaptive language models have been proposed in the past:
Kneser & Steinbiss (1993) and Iyer & Ostendorf (1999) dynamically adapt the parameters of their
model to the recent history using different weight interpolation schemes. Bellegarda (2000) and
Coccaro & Jurafsky (1998) use latent semantic analysis to adapt their models to the current context.
Similarly, topic features have been used with either maximum entropy models (Khudanpur & Wu,
2000) or recurrent networks (Mikolov & Zweig, 2012; Wang & Cho, 2015). Finally, Lau et al.
(1993) proposes to use pairs of distant of words to capture long-range dependencies.
Memory augmented neural networks.
In the context of sequence prediction, several memory
augmented neural networks have obtained promising results (Sukhbaatar et al., 2015; Graves et al.,
2014; Grefenstette et al., 2015; Joulin & Mikolov, 2015). In particular, Sukhbaatar et al. (2015)
stores a representation of the recent past and accesses it using an attention mechanism Bahdanau
et al. (2014). Sukhbaatar et al. (2015) shows that this reduces the perplexity for language modeling.
4
0.00.20.40.60.81.0theta0.050.10.150.20.250.30.350.4lambdaLinear interpolation (ptb)788490960.00.080.160.240.320.4theta0.00.51.01.52.02.53.03.5alphaGlobal normalization (ptb)78849096Under review as a conference paper at ICLR 2017
Figure 3: Perplexity on the validation set of wikitext2 for linear interpolation (left) and global
normalization (right), for various values of hyperparameters θ, λ and α. We use a cache model of
size 2000. The base model has a validation perplexity of 104.2. The best linear interpolation has a
perplexity of 72.1, while the best global normalization has a perplexity of 73.5.
Model
Zoneout + Variational LSTM (Merity et al., 2016)
Pointer Sentinel LSTM (Merity et al., 2016)
LSTM (our implementation)
Neural cache model (size = 100)
Neural cache model (size = 2,000)
wikitext2
wikitext103
100.9
80.8
99.3
81.6
68.9
-
-
48.7
44.8
40.8
Table 2: Test perplexity on the wikitext datasets. The two datasets share the same validation and
test sets, making all the results comparable.
This approach has been successfully applied to question answering, when the answer is contained
in a given paragraph (Chen et al., 2016; Hermann et al., 2015; Kadlec et al., 2016; Sukhbaatar et al.,
2015). Similarly, Vinyals et al. (2015) explores the use of this mechanism to reorder sequences
of tokens. Their network uses an attention (or "pointer") over the input sequence to predict which
element should be selected as the next output. Gulcehre et al. (2016) have shown that a similar
mechanism called pointer softmax could be used in the context of machine translation, to decide
which word to copy from the source to target.
Independently of our work, Merity et al. (2016) apply the same mechanism to recurrent network.
Unlike our work, they uses the current hidden activation as a representation of the current input
(while we use it to represent the output). This requires additional learning of a transformation
between the current representation and those in the past. The advantage of our approach is that we
can scale to very large caches effortlessly.
5 EXPERIMENTS
In this section, we evaluate our method on various language modeling datasets, which have different
sizes and characteristics. On all datasets, we train a static recurrent neural network language model
with LSTM units. We then use the hidden representations from this model to obtain our cache, which
is interpolated with the static LSTM model. We also evaluate a unigram cache model interpolated
with the static model as another baseline.
5.1 SMALL SCALE EXPERIMENTS
Datasets.
In this section, we describe experiments performed on two small datasets: the Penn
Tree Bank (Marcus et al., 1993) and the wikitext2 (Merity et al., 2016) datasets. The Penn
Tree Bank dataset is made of articles from the Wall Street Journal, contains 929k training tokens
and has a vocabulary size of 10k. The wikitext2 dataset is derived from Wikipedia articles,
contains 2M training tokens and has a vocabulary size of 33k. These datasets contain non-shuffled
documents, therefore requiring models to capture inter-sentences dependencies to perform well.
5
0.00.20.40.60.81.0theta0.050.10.150.20.250.30.350.4lambdaLinear interpolation (wikitext2)728088961040.00.080.160.240.320.4theta0.00.51.01.52.02.53.03.5alphaGlobal normalization (wikitext2)72808896104Under review as a conference paper at ICLR 2017
Figure 4: Test perplexity as a function of the number of words in the cache, for our method and a
unigram cache baseline. We observe that our approach can uses larger caches than the baseline.
Implementation details. We train recurrent neural network language models with 1024 LSTM
units, regularized with dropout (probability of dropping out units equals to 0.65). We use the Ada-
grad algorithm, with a learning rate of 0.2, a batchsize of 20 and initial weight uniformly sampled in
the range [−0.05, 0.05]. We clip the norm of the gradient to 0.1 and unroll the network for 30 steps.
We consider cache sizes on a logarithmic scale, from 50 to 10, 000, and fit the cache hyperparameters
on the validation set.
Results. We report the perplexity on the validation sets in Figures 2 and 3, for various values
of hyperparameters, for linear interpolation and global normalization. First, we observe that on
both datasets, the linear interpolation method performs slightly better than the global normalization
approach. It is also easier to apply in practice, and we thus use this method in the remainder of this
paper. In Tables 1 and 2, we report the test perplexity of our approach and state-of-the-art models.
Our approach is competitive with previous models, in particular with the pointer sentinel LSTM
model of Merity et al. (2016). On Penn Tree Bank, we note that the improvement over the base
model is similar for both methods. On the wikitext2 dataset, both methods obtain similar results
when using the same cache size (100 words). Since our method is computationally cheap, it is easy
to increase the cache to larger values (2, 000 words), leading to dramatic improvements (30% over
the baseline, 12% over a small cache of 100 words).
5.2 MEDIUM SCALE EXPERIMENTS
Datasets and implementation details.
In this section, we describe experiments performed over
two medium scale datasets: text8 and wikitext103. Both datasets are derived from Wikipedia,
but different pre-processing were applied. The text8 dataset contains 17M training tokens and
has a vocabulary size of 44k words, while the wikitext103 dataset has a training set of size
103M, and a vocabulary size of 267k words. We use the same setting as in the previous section,
except for the batchsize (we use 128) and dropout parameters (we use 0.45 for text8 and 0.25 for
wikitext103). Since both datasets have large vocabularies, we use the adaptive softmax (Grave
et al., 2016) for faster training.
Results. We report the test perplexity as a function of the cache size in Figure 4, for the neural
cache model and a unigram cache baseline. We observe that our approach can exploits larger cache
sizes, compared to the baseline.
In Table 2, we observe that the improvement in perplexity of
our method over the LSTM baseline on wikitext103 is smaller than for wikitext2 (approx.
16% v.s. 30%). The fact that improvements obtained with more advanced techniques decrease
when the size of training data increases has already been observed by Goodman (2001). Both
wikitext datasets sharing the same test set, we also observe that the LSTM baseline, trained
on 103M tokens (wikitext103), strongly outperforms more sophisticated methods, trained on
2M tokens (wikitext2). For these two reasons, we believe that it is important to evaluate and
compare methods on relatively large datasets.
6
102103104cache size (log scale)95100105110115120125perplexitytext8baselineunigramneural102103104cache size (log scale)40414243444546474849perplexitywikitext103baselineunigramneuralUnder review as a conference paper at ICLR 2017
Model
LSTM-500 (Mikolov et al., 2014)
SCRNN (Mikolov et al., 2014)
MemNN (Sukhbaatar et al., 2015)
LSTM-1024 (our implem.)
Neural cache model
Test
156
161
147
121.8
99.9
Model
WB5 (Paperno et al., 2016)
WB5+cache (Paperno et al., 2016)
LSTM-512 (Paperno et al., 2016)
LSTM-1024 (our implem.)
Neural cache model
Dev
3125
768
5357
4088
138
Ctrl
285
270
149
94
129
(a) text8
(b) lambada
Table 3: Perplexity on the text8 and lambada datasets. WB5 stands for 5-gram language model
with Witten-Bell smoothing.
Figure 5: Perplexity on the development and control sets of lambada, as a function of the interpo-
lation parameters λ.
5.3 EXPERIMENTS ON THE LAMBADA DATASET
Finally, we report experiments carried on the lambada dataset, introduced by Paperno et al. (2016).
This is a dataset of short passages extracted from novels. The goal is to predict the last word of the
excerpt. This dataset was built so that human subjects solve the task perfectly when given the full
context (approx. 4.6 sentences), but fail to do so when only given the sentence with the target word.
Thus, most state-of-the-art language models fail on this dataset. The lambada training set contains
approximately 200M tokens and has a vocabulary size of 93, 215. We report results for our method
in Table 3, as well the performance of baselines from Paperno et al. (2016). Adding a neural cache
model to the LSTM baseline strongly improves the performance on the lambada dataset. We also
observe in Figure 5 that the best interpolation parameter between the static model and the cache
is not the same for the development and control sets. This is due to the fact that more than 83%
of passages of the development set include the target word, while this is true for only 14% of the
control set. Ideally, a model should have strong results on both sets. One possible generalization of
our model would be to adapt the interpolation parameter based on the current vector representation
of the history ht.
6 CONCLUSION
We presented the neural cache model to augment neural language models with a longer-term mem-
ory that dynamically updates the word probablilities based on the long-term context. A neural cache
can be added on top of a pre-trained language model at negligible cost. Our experiments on both lan-
guage modeling tasks and the challenging LAMBADA dataset shows that significant performance
gains can be expected by adding this external memory component.
Technically, the neural cache models is similar to some recent memory-augmented neural networks
such as pointer networks. However, its specific design makes it possible to avoid learning the mem-
ory lookup component. This makes the neural cache appealing since it can use larger cache sizes
than memory-augment networks and can be applied as easily as traditional count-based caches.
7
0.00.20.40.60.81.0lambda0100200300400500600700perplexitylambadaControlDevelopmentUnder review as a conference paper at ICLR 2017
REFERENCES
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to
align and translate. arXiv preprint arXiv:1409.0473, 2014.
Lalit R Bahl, Frederick Jelinek, and Robert L Mercer. A maximum likelihood approach to continuous speech
recognition. PAMI, 1983.
Jerome R Bellegarda. Exploiting latent semantic information in statistical language modeling. Proceedings of
the IEEE, 2000.
Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic language
model. JMLR, 2003.
Peter F Brown, Vincent J Della Pietra, Stephen A Della Pietra, and Robert L Mercer. The mathematics of
statistical machine translation: Parameter estimation. Computational linguistics, 1993.
Danqi Chen, Jason Bolton, and Christopher D Manning. A thorough examination of the cnn/daily mail reading
comprehension task. arXiv preprint arXiv:1606.02858, 2016.
Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated re-
current neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
Noah Coccaro and Daniel Jurafsky. Towards better integration of semantic predictors in statistical language
modeling. In ICSLP. Citeseer, 1998.
Stephen Della Pietra, Vincent Della Pietra, Robert L Mercer, and Salim Roukos. Adaptive language modeling
using minimum discriminant estimation. In Proceedings of the workshop on Speech and Natural Language,
1992.
Jesse Dodge, Andreea Gane, Xiang Zhang, Antoine Bordes, Sumit Chopra, Alexander Miller, Arthur Szlam,
and Jason Weston. Evaluating prerequisite qualities for learning end-to-end dialog systems. arXiv preprint
arXiv:1511.06931, 2015.
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic
optimization. JMLR, 2011.
Jeffrey L Elman. Finding structure in time. Cognitive science, 1990.
Yarin Gal and Zoubin Ghahramani. A theoretically grounded application of dropout in recurrent neural net-
works. arXiv preprint arXiv:1512.05287, 2015.
Joshua T Goodman. A bit of progress in language modeling. Computer Speech & Language, 2001.
Edouard Grave, Armand Joulin, Moustapha Cissé, David Grangier, and Hervé Jégou. Efficient softmax ap-
proximation for gpus. arXiv preprint arXiv:1609.04309, 2016.
A. Graves, A. Mohamed, and G. Hinton. Speech recognition with deep recurrent neural networks. In ICASSP,
2013.
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014.
Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, and Phil Blunsom. Learning to transduce with
unbounded memory. In Advances in Neural Information Processing Systems, pp. 1828–1836, 2015.
Caglar Gulcehre, Sungjin Ahn, Ramesh Nallapati, Bowen Zhou, and Yoshua Bengio. Pointing the unknown
words. arXiv preprint arXiv:1603.08148, 2016.
Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman,
and Phil Blunsom. Teaching machines to read and comprehend. In NIPS, 2015.
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 1997.
Rukmini M Iyer and Mari Ostendorf. Modeling long distance dependence in language: Topic mixtures versus
dynamic cache models. IEEE Transactions on speech and audio processing, 1999.
Frederick Jelinek, Bernard Merialdo, Salim Roukos, and Martin Strauss. A dynamic language model for speech
recognition. In HLT, 1991.
Armand Joulin and Tomas Mikolov. Inferring algorithmic patterns with stack-augmented recurrent nets. In
Advances in Neural Information Processing Systems, pp. 190–198, 2015.
8
Under review as a conference paper at ICLR 2017
Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of
language modeling. arXiv preprint arXiv:1602.02410, 2016.
Rudolf Kadlec, Martin Schmid, Ondrej Bajgar, and Jan Kleindienst. Text understanding with the attention sum
reader network. arXiv preprint arXiv:1603.01547, 2016.
Slava M Katz. Estimation of probabilities from sparse data for the language model component of a speech
recognizer. ICASSP, 1987.
Sanjeev Khudanpur and Jun Wu. Maximum entropy techniques for exploiting syntactic, semantic and colloca-
tional dependencies in language modeling. Computer Speech & Language, 2000.
Reinhard Kneser and Hermann Ney. Improved backing-off for m-gram language modeling. In ICASSP, 1995.
Reinhard Kneser and Volker Steinbiss. On the dynamic adaptation of stochastic language models. In ICASSP,
1993.
Roland Kuhn. Speech recognition and the frequency of recently used words: A modified markov model for
natural language. In Proceedings of the 12th conference on Computational linguistics-Volume 1, 1988.
Roland Kuhn and Renato De Mori. A cache-based natural language model for speech recognition. PAMI, 1990.
Julien Kupiec. Probabilistic models of short and long distance word dependencies in running text. In Proceed-
ings of the workshop on Speech and Natural Language, 1989.
Raymond Lau, Ronald Rosenfeld, and Salim Roukos. Trigger-based language models: A maximum entropy
approach. In ICASSP, 1993.
Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of
english: The penn treebank. Computational linguistics, 1993.
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv
preprint arXiv:1609.07843, 2016.
Tomas Mikolov and Geoffrey Zweig. Context dependent recurrent neural network language model. In SLT,
2012.
Tomas Mikolov, Martin Karafiát, Lukas Burget, Jan Cernock`y, and Sanjeev Khudanpur. Recurrent neural
network based language model. In INTERSPEECH, 2010.
Tomas Mikolov, Anoop Deoras, Stefan Kombrink, Lukas Burget, and Jan Cernock`y. Empirical evaluation and
combination of advanced language modeling techniques. In INTERSPEECH, 2011.
Tomas Mikolov, Armand Joulin, Sumit Chopra, Michael Mathieu, and Marc'Aurelio Ranzato. Learning longer
memory in recurrent neural networks. arXiv preprint arXiv:1412.7753, 2014.
Denis Paperno, Germán Kruszewski, Angeliki Lazaridou, Quan Ngoc Pham, Raffaella Bernardi, Sandro
Pezzelle, Marco Baroni, Gemma Boleda, and Raquel Fernández. The lambada dataset: Word prediction
requiring a broad discourse context. arXiv preprint arXiv:1606.06031, 2016.
Ronald Rosenfeld. A maximum entropy approach to adaptive statistical language modeling. Computer, Speech
and Language, 1996.
Andreas Stolcke, Noah Coccaro, Rebecca Bates, Paul Taylor, Carol Van Ess-Dykema, Klaus Ries, Elizabeth
Shriberg, Daniel Jurafsky, Rachel Martin, and Marie Meteer. Dialogue act modeling for automatic tagging
and recognition of conversational speech. Computational linguistics, 2000.
Sainbayar Sukhbaatar, Szlam Arthur, Jason Weston, and Rob Fergus. End-to-end memory networks. In NIPS,
2015.
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In NIPS, 2015.
Tian Wang and Kyunghyun Cho. Larger-context language modelling. arXiv preprint arXiv:1511.03729, 2015.
Paul J Werbos. Backpropagation through time: what it does and how to do it. 1990.
Ronald J Williams and Jing Peng. An efficient gradient-based algorithm for on-line training of recurrent net-
work trajectories. Neural computation, 1990.
Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv preprint
arXiv:1409.2329, 2014.
Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutník, and Jürgen Schmidhuber. Recurrent highway
networks. arXiv preprint arXiv:1607.03474, 2016.
9
|
1907.11065 | 2 | 1907 | 2019-07-26T01:49:33 | DropAttention: A Regularization Method for Fully-Connected Self-Attention Networks | [
"cs.CL"
] | Variants dropout methods have been designed for the fully-connected layer, convolutional layer and recurrent layer in neural networks, and shown to be effective to avoid overfitting. As an appealing alternative to recurrent and convolutional layers, the fully-connected self-attention layer surprisingly lacks a specific dropout method. This paper explores the possibility of regularizing the attention weights in Transformers to prevent different contextualized feature vectors from co-adaption. Experiments on a wide range of tasks show that DropAttention can improve performance and reduce overfitting. | cs.CL | cs |
DropAttention: A Regularization Method for
Fully-Connected Self-Attention Networks
Lin Zehui
Fudan University
[email protected]
Pengfei Liu ∗
Fudan University
[email protected]
Luyao Huang
Fudan University
[email protected]
Junkun Chen
Fudan University
[email protected]
Xipeng Qiu †
Fudan University
[email protected]
Xuanjing Huang
Fudan University
[email protected]
Abstract
Variants dropout methods have been designed for the fully-connected layer, con-
volutional layer and recurrent layer in neural networks, and shown to be effective
to avoid overfitting. As an appealing alternative to recurrent and convolutional
layers, the fully-connected self-attention layer surprisingly lacks a specific dropout
method. This paper explores the possibility of regularizing the attention weights in
Transformers to prevent different contextualized feature vectors from co-adaption.
Experiments on a wide range of tasks show that DropAttention can improve perfor-
mance and reduce overfitting.
1
Introduction
As an effective and easy-to-implement regularization method, Dropout has been first designed for
fully-connected layers in neural models Srivastava et al. [2014]. Over the past few years, a host of
variants of dropout have been introduced. For recurrent neural networks (RNNs), dropout is only
applied to the input layers before the successful attempt in Krueger et al. [2016]; Semeniuta et al.
[2016]; Gal and Ghahramani [2016]. Also, a dozen of dropout methods for convolutional neural
networks (CNNs) have been proposed in Tompson et al. [2015]; Huang et al. [2016]; Larsson et
al. [2016]; Gastaldi [2017]; Ghiasi et al. [2018]; Zoph et al. [2018]; Yamada et al. [2018]. On
the other hand, fully-connected self-attention neural networks, such as Transformers Vaswani et al.
[2017], have emerged as a very appealing alternative to RNNs and CNNs when dealing with sequence
modelling tasks.
Although Transformers incorporate dropout operators in their architecture, the regularization effect
of dropout in the self-attention has not been thoroughly analyzed in the literature.
The success of the adaption of dropout for fully-connected, convolutional and recurrent layers gives
us a tantalizing hint that a more specific dropout for self-attentional operators might be needed.
∗Co-mentoring
†Corresponding author
Preprint. Under review.
Methods
Dropout Srivastava et al. [2014]
DropConnect Wan et al. [2013]
SpatialDropout Kalchbrenner et al. [2014]
Cutout DeVries and Taylor [2017]
DropEmb Gal and Ghahramani [2016]
Variational Dropout [Gal and Ghahramani, 2016] Unit
Zoneout Krueger et al. [2016]
Unit
DropBlock Ghiasi et al. [2018]
Region of Units
DropAttention
Region of Weights
Dropped Objects
Unit
Weight
Unit
Unit
Weight
Spaces
Hidden
Hidden
Hidden
Input
Input
Hidden
Hidden
Hidden
Input& Hidden
Layers
FCN
FCN
CNN
CNN
Lookup
RNN
RNN
CNN
Self-Attention
Table 1: A comparison of published methods for dropout. "Unit" denotes the neuron of a hidden
vector while "Weight" represents the learnable parameter or attention score. "FCN" refers to the
fully-connected layer.
Additionally, the original publicly code3 of Transformer Vaswani et al. [2017] with Dropout trick
also provides the evidence for this work, although it's less understood why it works and how it
might be extended. In this paper, we demonstrate the benefit of dropout in self-attention layers
(DropAttention) with two key distinctions compared with the dropout used in fully-connected layers
and recurrent layers. The first is that DropAttention randomly sets attention weights to zero, which can
be interpreted as dropping a set of neurons along different dimensions. Specifically, DropAttention
aims to encourage the model to utilize the full context of the input sequences rather than relying
solely on a small piece of features. For example, for sentiment classification, the prediction is usually
dominated by one or several emotional words, ignoring other informative patterns. This can make the
model overfit some specific patterns. In fully-connected and recurrent layers, dropout discourages the
complex co-adaptation of different units in the same layer, while DropAttention prevents different
contextualized feature vectors from co-adapting, learning features which are generally helpful for
task-specific prediction. Secondly, in addition to dropping out individual attentional units, we also
explore the possibility of operating in contiguous regions. It is inspired by DropBlock Ghiasi et al.
[2018] where units in a contiguous region of a convolutional feature map are discarded together. It is
a more effective way of dropping for attention layers, since a semantic unit are usually composed
of several spatially consecutive words. Experiments on a wide range of tasks with different-scale
datasets show that DropAttention can improve performance and reduce overfitting.
2 Related Work
We present a summary of existing models by highlighting differences among dropped object, spaces
and layers as shown in Table 1. The original idea of Dropout is proposed by Srivastava et al. [2014] for
fully-connected networks, which is regarded as an effective regularization method. After that, many
dropout techniques for specific network architectures, such as CNNs and RNNs, have been proposed.
For CNNs, most successful methods require the noise to be structured Tompson et al. [2015]; Huang
et al. [2016]; Larsson et al. [2016]; Gastaldi [2017]; Ghiasi et al. [2018]; Zoph et al. [2018]; Yamada
et al. [2018]. For example, SpatialDropoutKalchbrenner et al. [2014] is used to address the spatial
correlation problem. DropConnect Wan et al. [2013] sets a randomly selected subset of weights
within the network to zero. For RNNs, Variational Dropout Gal and Ghahramani [2016] and ZoneOut
Krueger et al. [2016] are most widely used methods. In Variational Dropout, dropout rate is learned
and the same neurons are dropped at every timestep. In ZoneOut, it stochastically forces some hidden
units to maintain their previous values instead of dropping. Different from these methods, in this
paper, we explore how to drop information on self-attention layers.
3https://github.com/tensorflow/tensor2tensor
2
3 Background
3.1 Transformer Architecture
The typical fully-connected self-attention architecture is the Transformer Vaswani et al. [2017], which
uses the scaled dot-product attention to model the intra-interactions of a sequence. Given a sequence
of vectors H ∈ Rl×d, where l and d represent the length of and the dimension of the input sequence,
the self-attention projects H into three different matrices: the query matrix Q, the key matrix K and
the value matrix vector V , and uses scaled dot-product attention to get the output representation.
Q, K, V = HW Q, HW K, HW V
QK T√
dk
Attn(Q, K, V ) = softmax(
)V,
(1)
(2)
where W Q, W K, W V ∈ Rd×dk are learnable parameters and softmax() is performed row-wise.
To enhance the ability of self-attention, multi-head self-attention is introduced as an extension of the
single head self-attention, which jointly model the multiple interactions from different representation
spaces,
MultiHead(H) = [head1; ...; headk]W O,
(3)
(4)
where
i (i ∈ [1, h]) are learnable parameters. Transformer consists of several
where W O, W Q
stacked multi-head self-attention layers and fully-connected layers. Assuming the input of the
self-attention layer is H, its output H is calculated by
headi = Attn(HW Q
i , HW K
i
, HW V
i ),
i , W K
i
, W V
Z =H + MultiHead(layer-norm(H)),
H =Z + MLP(layer-norm(Z)),
(5)
(6)
where layer − norm(·) represents the layer normalization Ba et al. [2016] .
Besides, since the self-attention ignores the order information of a sequence, a positional embedding
P E is used to represent the positional information.
3.2 Dropout
Dropout Srivastava et al. [2014] is a popular regularization form for fully-connected neural network.
It breaks up co-adaptation between units, therefore it can significantly reduce overfitting and improve
test performance. Each unit of a hidden layer h(l) ∈ Rd is dropped with probability p by setting it to
0.
h(l+1) = f (W m (cid:12) h(l)),
(7)
where m ∈ {0, 1}d is a binary mask vector with each element j drawn independently from mj ∼
Bernoulli(p), and (cid:12) denotes element-wise production.
DropConnect Wan et al. [2013] is a generalization of Dropout. It randomly drops hidden layers
weights instead of units. Assume M is a binary mask matrix drawn from Mij ∼ Bernoulli(p), W
is the hidden layer weights. Then DropConnect can be formulated as,
h(l+1) = f ((W (cid:12) M )h(l))
(8)
Dropout essentially drops the entire column of the weight matrix. Therefore, Dropout can be regarded
as a special case of DropConnect, where a whole column weight is dropped.
Since Dropout and DropConnect achieve great success on fully-connected layer, a natural motivation
is whether a specific dropout method is needed for the fully-connected self-attention networks.
Experiments conducted shows that a new dropout method designed for fully-connected self-attention
networks can also reduce overfitting and obtain improvements.
3
(a) DropAttention(c)
(b) DropAttention(e)
Figure 1: Illustration of DropAttentions over a 5 × 5 attention weight matrix. The "yellow" elements
are dropped. The size of drop window is w = 2 and drop rate is p = 0.4.
4 DropAttention
In this section, we will introduce our attention regularization method: DropAttention.
Given a sequence of vectors H ∈ Rl×d, the fully-connected self-attention layer can be reformulated
into
where Λ = softmax( QKT√
dk
calculated by Eq. (1).
The output of i-th position is
(9)
), f (·) is a residual nonlinear function defined by Eq. (6) and Q, K, V is
H = f (ΛV ),
l(cid:88)
hi = f (
j=1
λijvj),
(10)
where hi is the i-th row vector of H and vj is the j-th row vector of V . λij is the entry of Λ.
With this formulation, we can connect the self-attention layer to the fully-connected layer with
two differences. The first difference is the weight matrix Λ is dynamically generated. The second
difference is that the basic unit is a vector rather than a neuron.
Due to the similarity between fully-connected layer and self-attention layer, we can introduce the
popular dropout methods for FCN to self-attention mechanism. In detail, we propose two dropout
methods for the fully-connected self-attention layer: DropAttention(c) and DropAttention(e).
1) DropAttention(c) means to randomly drop "column" in attention weight matrix, which is a
simple method similar to the standard Dropout Srivastava et al. [2014]. We randomly drop the unit
vj, 1 ≤ j ≤ l. Note that vj here is a vector instead of a single neuron.
2) DropAttention(e) means to randomly drop "element" in attention weight matrix, which is a
more generalized method of the DropAttention(c). Similar to DropConnect Wan et al. [2013],
DropAttention(e) randomly drops elements in attention weights matrix Λ. DropAttention(c) can be
regarded as a special case of DropAttention(e) in which a whole column of Λ is dropped.
Besides the basic dropping strategies, we also augment the DropAttentions with two functions.
4.1 Dropping Contiguous Region
Inspired by DropBlock Ghiasi et al. [2018], we drop contiguous region of the attention weights matrix
instead of independent random units. The behind motivation is based on distributional hypothesis
Harris [1954]: words that are used and occur in the same contexts tend to purport similar meanings.
In Transformer Vaswani et al. [2017] where multi-layer structure is used, when dropping independent
random units, information correlated with the dropped input can still be restored in the next layer
through surrounding words, which may cause the networks overfitting. Dropping the whole semantic
unit consisting of several words can be a more effective way of dropping out.
Therefore, there are two hyperparameters in DropAttention: window size w and drop rate p. The
window size w is the length of contiguous region to be dropped, while p controls how many units to
4
Algorithm 1 DropAttention(e)
Require: Attention weight matrix Λ, window size w, drop rate p
1: if Inference then
2:
3: end if
4: γ = p/w;
5: Sample mask matrix M randomly, where Mij ∼ Bernoulli(γ);
6: For each zero position Mij, expand the mask with the span length of w, Mi,j : Mi,j+w−1, and
7: Apply mask: Λ = M (cid:12) Λ;
8: for all row vector of Λ: λj do
9:
10: end for
Normalized rescale: λj = λj/sum(λj)
return Λ
set all the values in the window to be 0;
Table 2: Classification dataset statistics, #classes denotes the number of classes, and #documents
represents the number of documents.
Dataset
#classes
#documents
CR
QC
SUBJ
MR
AG's News
Yelp2013
2
6
2
2
4
5
3,993
5,052
10,000
10,661
127,600
335,018
drop. In standard Dropout Srivastava et al. [2014], the binary mask is sampled from the Bernoulli
distribution with the probability of p. Since DropAttention will expand every zero entry in the binary
mask to be window with size w. Therefore, we just require to drop p/w windows.
4.2 Normalized Rescaling
To ensure that the sum of attention weights to remain 1 after applying DropAttention, we re-normalize
the attention weights after dropout operations. While traditional Dropout also has rescaling operation
where neuron weights are divided by 1 − p, there is no guarantee that the sum of attention weights
after rescaling remains 1. Experiments on classification task (see sec. 5.1) show that DropAttention
with normalized rescaling outperforms traditional dropout rescaling. And in practice with normalized
rescale, training process can be more steady compared to traditional rescaling.
Figure 1 shows two proposed DropAttention methods. The Pseudocode of DropAttention(e) is
described in Algorithm 1. DropAttention(c) is adopted in the similar way to DropAttention(e).
5 Experiment
We evaluate the effectiveness of DropAttentions on 4 different tasks: Text Classification, Sequence La-
beling, Textual Entailment and Machine Translation. We also conduct a set of analytical experiments
to validate properties of the networks.
5.1 Text Classification
We first evaluate the effectiveness of DropAttention on a couple of classification datasets ranging
from small, medium and large scale. Statistics of datasets are listed in Table 2. All datasets are split
into training, development and testing sets.
Yelp13 reviews: collected from the Yelp Dataset Challenge in 2013, which have 5 levels of ratings
from 1 to 5. We use the same Yelp datasets slitted and tokenized in Tang et al. [2015]. MR: Movie
5
Table 3: Text classification, in percentage. p represents dropout rate, w represents window size. The
column of "Norm?" indicates the results of normalized rescaling or traditional rescaling 1 − p. We
only represents the best results in the table and their corresponding hyperparameters.
Model
w/o DropAttention
Norm?
CR
80.00
SUBJ
93.30
MR
76.92
QC
88.40
AG's News
88.13
Yelp13
61.49
DropAttention(c)
DropAttention(e)
p=0.4,w=2 p=0.2,w=3 p=0.3,w=2 p=0.3 w=1
p=0.4 w=1
p=0.4 w=1
82.75
78.25
94.10
93.10
78.80
77.30
90.80
89.60
88.87
88.49
62.34
62.27
p=0.2,w=3 p=0.3,w=2 p=0.3,w=2 p=0.3,w=2
p=0.2,w=2
p=0.2 w=1
81.25
81.25
93.50
93.50
78.51
75.33
89.60
88.80
88.66
88.47
61.79
61.46
Y
N
Y
N
Table 4: The sizes of the sequence labeling datasets in our experiments, in terms of the number of
tokens.
Train
Dev.
Task
Dataset
CoNLL 2000 Chunking 211,727 -
CoNLL 2003 NER
POS
PTB
Test
47,377
46,666
204,567 51,578
912,344 131,768 129,654
reviews with two classes Pang and Lee [2005]. SUBJ: Subjectivity dataset containing subjective
and objective instance. It is also a 2 classes dataset Pang and Lee [2004]. CR: Customer reviews
of various products with positive and negative sentiments. AG's News: A news topic classification
with 4 classes created by Zhang et al. [2015]. QC: The TREC questions dataset involves six different
question types Li and Roth [2002].
Detail model configurations are given in Appendix. We use accuracy as evaluation metrics. Results of
all datasets are listed in Table 3. It shows that DropAttentions can significantly improve performance
on a wide range of datasets of small, medium and large scale. Besides, note that when comparing
normalized rescaling with traditional rescaling under the same DropAttention hyperparameters, Table
3 shows that normalized rescaling can generally obtain better performance.
For classification tasks, we find that larger dropout rate and smaller window size are preferred for
DropAttention(c) while smaller dropout rate and larger window size are preferred for DropAtten-
tion(e). And DropAttention(c) can generally obtain higher performances than DropAttention(e) in
classification tasks.
5.2 Sequence Labeling
We also evaluate the effectiveness of DropAttention on sequence labeling. We conducted experiments
by following the same settings as Yang et al. [2016]. We use the following benchmark datasets in
our experiments: Penn Treebank (PTB) POS tagging, CoNLL 2000 chunking, CoNLL 2003 English
NER. The statistics of the datasets are described in Table 4.
We process sentences with Transformer encoder. After encoding, we feed the output vector into a
fully-connected layer. Detail model hyperparameters are given in Appendix.
Results are shown in Table 5. In Table 5, all best results are under the hyperparameters of p =
0.3, w = 3 except for DropAttention(e) in POS task with p = 0.2, w = 2. It shows that both
DropAttention(c) and DropAttention(e) can obtain significant improvements. Our model achieve
0.29 accuracy, 0.40 F1 score, 1.76 F1 score improvements in POS, NER and Chunking respectively.
And we find that larger dropout rate and larger window size are generally preferred.
6
Table 5: Sequence labeling results. p means dropout
rate, w means window size. NER and Chunking
are evaluated by F1 score while POS is evaluated
by accuracy. Table shows the best results and their
corresponding hyperparameters.
Transformer
w/o DropAttention
POS
95.92
NER
87.23
Chunking
89.09
p=0.3 w=3 p=0.3 w=3 p=0.3 w=3
DropAttention(c)
96.21
88.51
90.56
p=0.2,w=2 p=0.3,w=3 p=0.3,w=3
DropAttention(e)
96.17
88.63
90.85
Table 6: Machine Translation performances
of our models under different dropping set-
tings. p stands for drop rate and w represents
window size.
Model
HyperParam BLEU
p
w/o DropAttention 0
w
0
0.1 1
0.1 2
0.1 3
0.2 1
0.2 2
0.2 3
0.1 1
0.1 2
0.1 3
0.2 1
0.2 2
0.2 3
27.30
27.96
27.87
27.98
27.87
28.04
27.95
28.16
28.03
28.07
27.92
28.32
27.87
DropAttention(c)
DropAttention(e)
5.3 Textual Entailment
We use the biggest textual entailment dataset, SNLI Bowman et al. [2015] corpus to evaluate the
effectiveness of DropAttention on this task. SNLI is a collection of sentence pairs labeled for
entailment, contradiction, and semantic independence. A pair of sentences called premise and
hypothesis will be fed to the model, and the model will be asked to tell the relation of two sentences.
It is also a classification task, and we measure the performance by accuracy.
We process the hypothesis and premise with the same Transformer encoder, which means that the
hypothesis encoder and the premise encoder share the same parameters. We use max pooling to
create a simple vector representation from the output of transformer encoder. After processing two
sentences respectively, we use the two outputs to construct the final feature vector, which consisting
of the concatenation of two sentence vectors, their difference, and their elementwise product Bowman
et al. [2016]. We then feed the final feature vector into a 2-layer ReLU MLP to map the hidden
representation into classification result. Detail model hyperparameters are given in Appendix.
Results are listed in Table 7. For full results with different hyperparameters please refer to Ap-
pendix. Experiments show that DropAttention(c) and DropAttention(e) can significantly improve
performances.
5.4 Machine Translation
We further demonstrate the effectiveness of DropAttention on translation tasks. We conduct exper-
iments on WMT' 16 En-De dataset which consists of 4.5M sentence pairs. We follow Ott et al.
[2018] by reusing the preprocessed data, where Ott et al. [2018] validates on newstest13 and tests
on newstest14, and uses a vocabulary of 32K symbols based on a joint source and target byte pair
encoding (BPE; Sennrich et al. [2015]). We measure case-sensitive tokenized BLEU. We use the
fairseq-py toolkit 4 re-implementation of Transformer Vaswani et al. [2017] model. We follow the
configuration of original Transformer base model Vaswani et al. [2017]. See detail configuration in
Appendix. DropAttention with different hyperparameters is applied to attention weights.
Table 6 shows the BLEU score for DropAttention with different hyperparameters. The results
show that DropAttention can generally obtain higher performance compared with baseline without
DropAttention. With DropAttention(e) of p = 0.2, w = 2, the model can outperform the baseline by
a large margin, reaching a BLEU score of 28.32. For DropAttention(c), the model also reaches the
best BLEU score with p = 0.2, w = 2.
4https://github.com/pytorch/fairseq
7
Table 7: SNLI best results and the
corresponding hyperparameters.
Transformer
w/o DropAttention
SNLI
83.36
p=0.2 w=3
DropAttention(c)
84.38
DropAttention(e)
p=0.5,w=1
84.48
Table 8: Classification and Machine Translation perfor-
mances. Classification performances are evaluated by ac-
curacy while Machine Translation by BLEU. Baseline is
the model without any Dropout techniques.
Transformer
baseline
+ Standard Dropout
+ DropAttention
+ Dropout+DropAttention
Classification MT
25.42
27.3
26.3
28.32
88.13
88.43
88.50
88.70
y
p
o
r
t
n
E
1.82
1.82
1.81
t
n
e
m
e
e
r
g
a
s
i
D
0.75
0.75
0.75
0.74
·10−2
v
i
D
3.34
3.33
3.33
3.32
p=0.3 w=2
p=0.3 w=3
p=0.3 w=1
p=0.2 w=2
p=0.2 w=1
p=0.2 w=3
w/o
p=0.3 w=2
p=0.3 w=3
p=0.3 w=1
p=0.2 w=2
p=0.2 w=1
p=0.2 w=3
w/o
p=0.3 w=2
p=0.3 w=3
p=0.3 w=1
p=0.2 w=2
p=0.2 w=1
p=0.2 w=3
w/o
(a) Entropy
(b) Disagreement
(c) Div
Figure 2: The histogram Disagreement, and Div. With the drop rate and window size increasing, both
metrics increase accordingly. Note that if the value of Div and Disagreement gets large, it means that
the difference of attention weights between heads is small.
There are two insights from this experiment. The first is that a regularization of self-attention works to
improve the generalization ability even for the large-scale data. The second is that the DropAttention
is complementary to the standard dropout.
5.5 Complementarity to stardard Dropout
We also explore the effect of DropAttention combining with standard Dropout. We conduct experi-
ments on classification tasks and machine translation tasks. We choose AG's News as classification
dataset and WMT' 16 En-De as Machine Translation dataset. Same hyperparameters as 5.1 and
5.4 are used. Table 8 shows that when combining DropAttention with Dropout, models can obtain
higher performances compared to implementing Dropout or DropAttention alone. It implys that
DropAttention is complementary to stardard Dropout.
6 Analysis
In this section, we study the impact of DropAttention on the behavior of model quantitatively. We use
three metrics to evaluate the model based on the attention weights: Div, Disagreement and Entropy.
Div Suppose A is the attention weights matrix, where every row i corresponds to the attention weights
vector produced by the ith attention head. Div is defined as,
(11)
where (cid:107) · (cid:107)F represents the Frobenius norm of a matrix and I stands for identity matrix. It was
first introduced by Lin et al. [2017] as a penalization term which encourages the diversity of weight
vectors across different heads of attention. If Div gets large, it means multi-heads attention weights
distributions have large overlap.
F ,
Div =(cid:13)(cid:13)(cid:0)AAT − I(cid:1)(cid:13)(cid:13)2
8
Disagreement We use the same notations above. Ai stands for the ith row of the attention matrix,
then the Disagreement is expressed as,
h(cid:88)
h(cid:88)
Ai · Aj
(cid:107)Ai(cid:107)(cid:107)Aj(cid:107) ,
(12)
Disagreement =
1
h2
i=1
j=1
Ei = −(cid:88)
where h denotes the number of heads. It was proposed by Li et al. [2018], which also expects to
encourage the diversity of the model. The Disagreement is defined as calculating the cosine similarity
cos(·) between the attention weights vector pair produced by two different heads. The smaller score
is, the more diverse different attention heads are.
Entropy is used to evaluate the diversity within one head. Ai
weights vector produced by ith head. Entropy of attention weights is defined as,
j is the jth element of the attention
Ai
j log Ai
j.
(13)
If entropy gets small, it represents that the head focus on a small fraction of words.
j
6.1 Effect on Intra-Diversity
We first observe the impact of DropAttention on intra-diversity, namely attention distribution within
one head. Figure 2a shows the multi-head entropy of models for classification task. When the drop
rate and window size increasing, the entropy increase accordingly. This suggests DropAttention can
effectively smoothen the attention distribution, making the model utilize more context. This can
subsequently increase robustness of the model.
6.2 Effect on Inter-Diversity
We further study the impact of DropAttention on inter-diversity, namely the difference between multi
heads. Figure 2b and 2c show the Disagreement and Diveristy of multi heads, respectively. It shows
that with larger drop rate and window size, Div and Disagreement are larger accordingly. Note that
large Diversity and Disagreement means that the difference of attention distribution between heads is
small. This is due to the smoother attention distribution within one head. With less sharply different
multi-heads, the model does not have to rely on a single head to make predictions, which means that
all heads have a smoother contribution to the final predictions. This can increase robustness of the
model.
6.3 Effect on Sparsity
Similar to Srivastava et al. [2014], we also observe the effect of DropAttention on sparsity. Since
the attention weights are summed up to 1, we only collect the largest attention weights of all heads.
To eliminate the effect of sentence length, attention weights are multiplied by the sentence length.
Figure 3 shows the distribution of largest attention weights, where model with DropAttention has
smaller attention weights compared to model without DropAttention. This phenomenon is consistent
with Srivastava et al. [2014] where model with dropout tends to allocate smaller activation weights
compared to model without dropout.
7 Conclusion and Discussion
In this paper, we introduce DropAttention, a variant of Dropout designed for fully-connected self-
attention network. Experiments on a wide range of tasks demonstrate that DropAttention is an
effective technique for improving generalization and reducing overfitting of self-attention networks.
Several analytical statistics give the intuitive impacts of DropAttention, which show that applying
DropAttention can help model utilize more context, subsequently increasing robustness.
References
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint
arXiv:1607.06450, 2016.
9
Figure 3: The histogram of largest attention weights distribution. x-axis represents the attention
weights value multiplied by the sentence length, y-axis represents the number of corresponding
attention weights. Model with DropAttention tends to allocate smaller attention weights compared to
model without DropAttention.
Samuel R Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. A large annotated
corpus for learning natural language inference. arXiv preprint arXiv:1508.05326, 2015.
Samuel R Bowman, Jon Gauthier, Abhinav Rastogi, Raghav Gupta, Christopher D Manning, and
Christopher Potts. A fast unified model for parsing and sentence understanding. arXiv preprint
arXiv:1603.06021, 2016.
Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks
with cutout. arXiv preprint arXiv:1708.04552, 2017.
Yarin Gal and Zoubin Ghahramani. A theoretically grounded application of dropout in recurrent
neural networks. In Advances in neural information processing systems, pages 1019 -- 1027, 2016.
Xavier Gastaldi. Shake-shake regularization. arXiv preprint arXiv:1705.07485, 2017.
Golnaz Ghiasi, Tsung-Yi Lin, and Quoc V Le. Dropblock: A regularization method for convolutional
networks. In Advances in Neural Information Processing Systems, pages 10750 -- 10760, 2018.
Zellig S Harris. Distributional structure. Word, 10(2-3):146 -- 162, 1954.
Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with
stochastic depth. In European conference on computer vision, pages 646 -- 661. Springer, 2016.
Nal Kalchbrenner, Edward Grefenstette, and Phil Blunsom. A convolutional neural network for
modelling sentences. In Proceedings of ACL, 2014.
David Krueger, Tegan Maharaj, János Kramár, Mohammad Pezeshki, Nicolas Ballas, Nan Rosemary
Ke, Anirudh Goyal, Yoshua Bengio, Aaron Courville, and Chris Pal. Zoneout: Regularizing rnns
by randomly preserving hidden activations. arXiv preprint arXiv:1606.01305, 2016.
Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Fractalnet: Ultra-deep neural networks
without residuals. arXiv preprint arXiv:1605.07648, 2016.
Xin Li and Dan Roth. Learning question classifiers.
In Proceedings of the 19th international
conference on Computational linguistics-Volume 1, pages 1 -- 7. Association for Computational
Linguistics, 2002.
Jian Li, Zhaopeng Tu, Baosong Yang, Michael R Lyu, and Tong Zhang. Multi-head attention with
disagreement regularization. arXiv preprint arXiv:1810.10183, 2018.
Zhouhan Lin, Mo Feng, Yu, Bing Xiang, Bowen Zhou, and Yoshua Bengio. A structured self-attentive
sentence embedding. arXiv preprint arXiv:1703.03130, 2017.
Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation.
CoRR, abs/1806.00187, 2018.
Bo Pang and Lillian Lee. A sentimental education: Sentiment analysis using subjectivity summa-
rization based on minimum cuts. In Proceedings of the 42nd annual meeting on Association for
Computational Linguistics, page 271. Association for Computational Linguistics, 2004.
10
Bo Pang and Lillian Lee. Seeing stars: Exploiting class relationships for sentiment categorization
In Proceedings of the 43rd annual meeting on association for
with respect to rating scales.
computational linguistics, pages 115 -- 124. Association for Computational Linguistics, 2005.
Stanislau Semeniuta, Aliaksei Severyn, and Erhardt Barth. Recurrent dropout without memory loss.
arXiv preprint arXiv:1603.05118, 2016.
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with
subword units. arXiv preprint arXiv:1508.07909, 2015.
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov.
Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine
Learning Research, 15(1):1929 -- 1958, 2014.
Duyu Tang, Bing Qin, and Ting Liu. Document modeling with gated recurrent neural network for
sentiment classification. In Proceedings of the 2015 conference on empirical methods in natural
language processing, pages 1422 -- 1432, 2015.
Jonathan Tompson, Ross Goroshin, Arjun Jain, Yann LeCun, and Christoph Bregler. Efficient object
localization using convolutional networks. In Proceedings of the IEEE Conference on Computer
Vision and Pattern Recognition, pages 648 -- 656, 2015.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz
In Advances in Neural Information
Kaiser, and Illia Polosukhin. Attention is all you need.
Processing Systems, pages 6000 -- 6010, 2017.
Li Wan, Matthew Zeiler, Sixin Zhang, Yann Le Cun, and Rob Fergus. Regularization of neural
networks using dropconnect. In International Conference on Machine Learning, pages 1058 -- 1066,
2013.
Yoshihiro Yamada, Masakazu Iwamura, Takuya Akiba, and Koichi Kise. Shakedrop regularization
for deep residual learning. arXiv preprint arXiv:1802.02375, 2018.
Zhilin Yang, Ruslan Salakhutdinov, and William Cohen. Multi-task cross-lingual sequence tagging
from scratch. arXiv preprint arXiv:1603.06270, 2016.
Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text
classification. In Advances in neural information processing systems, pages 649 -- 657, 2015.
Barret Zoph, Vijay VasudSentiment analysis using subjectivity summarizationevan, Jonathon Shlens,
and Quoc V Le. Learning transferable architectures for scalable image recognition. In Proceedings
of the IEEE conference on computer vision and pattern recognition, pages 8697 -- 8710, 2018.
11
|
1902.07248 | 1 | 1902 | 2019-02-13T05:43:00 | Sentence Compression via DC Programming Approach | [
"cs.CL",
"math.OC"
] | Sentence compression is an important problem in natural language processing. In this paper, we firstly establish a new sentence compression model based on the probability model and the parse tree model. Our sentence compression model is equivalent to an integer linear program (ILP) which can both guarantee the syntax correctness of the compression and save the main meaning. We propose using a DC (Difference of convex) programming approach (DCA) for finding local optimal solution of our model. Combing DCA with a parallel-branch-and-bound framework, we can find global optimal solution. Numerical results demonstrate the good quality of our sentence compression model and the excellent performance of our proposed solution algorithm. | cs.CL | cs |
Sentence Compression via DC Programming
Approach(cid:63)
Yi-Shuai Niu1,2[0000−0002−9993−3681], Xi-Wei Hu2, Yu You1
Faouzi Mohamed Benammour1, and Hu Zhang1
1 School of Mathematical Sciences, Shanghai Jiao Tong University, Shanghai, China
2 SJTU-Paristech Elite Institute of Technology, Shanghai Jiao Tong University,
[email protected]
Shanghai, China
Abstract. Sentence compression is an important problem in natural
language processing. In this paper, we firstly establish a new sentence
compression model based on the probability model and the parse tree
model. Our sentence compression model is equivalent to an integer lin-
ear program (ILP) which can both guarantee the syntax correctness of
the compression and save the main meaning. We propose using a DC
(Difference of convex) programming approach (DCA) for finding local
optimal solution of our model. Combing DCA with a parallel-branch-
and-bound framework, we can find global optimal solution. Numerical
results demonstrate the good quality of our sentence compression model
and the excellent performance of our proposed solution algorithm.
Keywords: Sentence Compression · Probability Model · Parse Tree
Model · DCA · Parallel-Branch-and-Bound
1
Introduction
The recent years have been known by the quick evolution of the artificial intel-
ligence (AI) technologies, and the sentence compression problems attracted the
attention of researchers due to the necessity of dealing with a huge amount of
natural language information in a very short response time. The general idea of
sentence compression is to make a summary with shorter sentences containing
the most important information while maintaining grammatical rules. Nowadays,
there are various technologies involving sentence compression as: text summa-
rization, search engine and question answering etc. Sentence compression will be
a key technology in future human-AI interaction systems.
There are various models proposed for sentence compression. The paper of
Jing [3] could be one of the first works addressed on this topic with many rewrit-
ing operations as deletion, reordering, substitution, and insertion. This approach
(cid:63) The research is partially funded by the Natural Science Foundation of China (Grant
No: 11601327) and by the Key Construction National "985" Program of China
(Grant No: WF220426001).
2
Y.S. Niu et al.
is realized based on multiple knowledge resources (such as WordNet and parallel
corpora) to find the pats that can not be removed if they are detected to be
grammatically necessary by using some simple rules. Later, Knight and Marcu
investigated discriminative models[4]. They proposed a decision-tree model to
find the intended words through a tree rewriting process, and a noisy-channel
model to construct a compressed sentence from some scrambled words based on
the probability of mistakes. MacDonald [12] presented a sentence compression
model using a discriminative large margin algorithm. He ranks each candidate
compression using a scoring function based on the Ziff-Davis corpus using a
Viterbi-like algorithm. The model has a rich feature set defined over compres-
sion bigrams including parts of speech, parse trees, and dependency information,
without using a synchronous grammar. Clarke and Lapata [1] reformulated Mc-
Donald's model in the context of integer linear programming (ILP) and extended
with constraints ensuring that the compressed output is grammatically and se-
mantically well formed. The corresponding ILP model is solving in using the
branch-and-bound algorithm.
In this paper, we will propose a new sentence compression model to both
guarantee the grammatical rules and preserve main meaning. The main contri-
butions in this work are: (1) Taking advantages of Parse tree model and Proba-
bility model, we hybridize them to build a new model that can be formulated as
an ILP. Using the Parse tree model, we can extract the sentence truck, then fix
the corresponding integer variables in the Probability model to derive a simpli-
fied ILP with improved quality of the compressed result. (2) We propose to use
a DC programming approach called PDCABB (an hybrid algorithm combing
DCA with a parallel branch-and-bound framework) developed by Niu in [17] for
solving our sentence compression model. This approach can often provide a high
quality optimal solution in a very short time.
The paper is organized as follows: The Section 2 is dedicated to establish
hybrid sentence compression model. In Section 3, we will present DC program-
ming approach for solving ILP. The numerical simulations and the experimental
setup will be reported in Section 4. Some conclusions and future works will be
discussed in the last section.
2 Hybrid Sentence Compression Model
Our sentence compression model is based on an Integer Linear Programming
(ILP) probability model [1], and a parsing tree model. In this section, we will
give a brief introduction of the two models, and propose our new hybrid model.
2.1 ILP Probability Model
Let x = {x1, x2, . . . , xn} be a sentence with n ≥ 2 words.3 We add x0='start' as
the start token and xn+1='end' as the end token.
3 Punctuation is also deemed as word.
Sentence Compression via DC Programming Approach
3
The sentence compression is to choose a subset of words in x for maximizing
its probability to be a sentence under some restrictions to the allowable trigram
combinations. This probability model can be described as an ILP as follows:
Decision variables: We introduce the binary decision variables δi, i ∈ [[1, n]]4
for each word xi as: δi = 1 if xi is in a compression and 0 otherwise. In order to
take context information into consideration, we introduce the context variables
(α, β, γ) such that: ∀i ∈ [[1, n]], we set αi = 1 if xi starts a compression and 0
otherwise; ∀i ∈ [[0, n − 1]] , j ∈ [[i + 1, n]], we set βij = 1 if the sequence xi, xj
ends a compression and 0 otherwise; and ∀i ∈ [[0, n − 2]] , j ∈ [[i + 1, n − 1]] , k ∈
[[j + 1, n]], we set γijk = 1 if sequence xi, xj, xk is in a compression and 0
otherwise. There are totally n3+3n2+14n
Objective function: The objective function is to maximize the probability of
the compression computed by:
binary variables for (δ, α, β, γ).
6
f (α, β, γ) =
αiP (xistart) +
γijkP (xkxi, xj)
n(cid:88)
n−1(cid:88)
i=1
+
n(cid:88)
i=0
j=i+1
n−2(cid:88)
n−1(cid:88)
n(cid:88)
i=1
j=i+1
k=j+1
βijP (endxi, xj)
where P (xistart) stands for the probability of a sentence starting with xi,
P (xkxi, xj) denotes the probability that xi, xj, xk successively occurs in a sen-
tence, and P (endxi, xj) means the probability that xi, xj ends a sentence. The
probability P (xistart) is computed by bigram model, and the others are com-
puted by trigram model based on some corpora.
Constraints: The following sequential constraints will be introduced to restrict
the possible trigram combinations:
Constraint 1 Exactly one word can begin a sentence.
αi = 1.
(1)
n(cid:88)
i=1
δk − αk − k−2(cid:88)
k−1(cid:88)
i=0
j=1
Constraint 2 If a word is included in a compression, it must either start the
sentence, or be preceded by two other words, or be preceded by the 'start' token
and one other word.
γijk = 0,∀k ∈ [[1, n]] .
(2)
Constraint 3 If a word is included in a compression, it must either be preceded
by one word and followed by another, or be preceded by one word and end the
sentence.
δj − j−1(cid:88)
n(cid:88)
γijk − j−1(cid:88)
βij = 0,∀j ∈ [[1, n]] .
(3)
4 [[m, n]] with m ≤ n stands for the set of integers between m and n.
i=0
k=j+1
i=0
4
Y.S. Niu et al.
Constraint 4 If a word is in a compression, it must either be followed by two
words, or be followed by one word and end the sentence.
(4)
(5)
(6)
δi − n−1(cid:88)
n(cid:88)
j=i+1
k=j+1
γijk − n(cid:88)
βij − i−1(cid:88)
n−1(cid:88)
n(cid:88)
j=i+1
h=0
βij = 1.
βhi = 0,∀i ∈ [[1, n]] .
Constraint 5 Exactly one word pair can end the sentence.
Constraint 6 The length of a compression should be bounded.
i=1
j=i+1
l ≤ n(cid:88)
i=1
δi ≤ ¯l.
with given lower and upper bounds of the compression l and ¯l.
Constraint 7 The introducing term for preposition phrase (PP) or subordinate
clause (SBAR) must be included in the compression if any word of the phrase
is included. Otherwise, the phrase should be entirely removed. Let us denote
Ii = {j : xj ∈ PP/SBAR, j (cid:54)= i} the index set of the words included in PP/SBAR
leading by the introducing term xi, then
δj ≥ δi, δi ≥ δj,∀j ∈ Ii.
(7)
(cid:88)
j∈Ii
ILP probability model: The optimization model for sentence compression is
summarized as a binary linear program as:
max{f (α, β, γ) : (1) − (7), (α, β, γ, δ) ∈ {0, 1} n3+3n2+14n
6
}.
(8)
with O(n3) binary variables and O(n) linear constraints.
The advantage of this model is that its solution will provide a compression
with maximal probability based on the trigram model. However, there is no
information about syntactic structures of the target sentence, so it is possible to
generate ungrammatical sentences. In order to overcome this disadvantage, we
propose to combine it with the parse tree model presented below.
2.2 Parse Tree Model
A parse tree is an ordered, rooted tree which reflects the syntax of the input lan-
guage based on some grammar rules (e.g. using CFG syntax-free grammar). For
constructing a parse tree in practice, we can use a nature language processing
toolkit NLTK [18] in Python. Based on NLTK, we have developed a CFG gram-
mar generator which helps to generate automatically a CFG grammar based on
a target sentence. A recursive descent parser can help to build a parse tree.
Sentence Compression via DC Programming Approach
5
For example, the sentence "The man saw the dog with the telescope." can
be parsed as in Figure 1. It is observed that a higher level node in the parse tree
indicates more important sentence components (e.g., the sentence S consists of
a noun phrase NP, a verb phrase VP, and a symbol SYM), whereas a lower
node tends to carry more semantic contents (e.g., the proposition phrase PP is
consists of a preposition 'with', and a noun phrase 'the telescope'). Therefore, a
parse tree presents the clear structure of a sentence in a logical way.
Fig. 1. Parse tree example
Sentence compression can be also considered as finding a subtree which re-
mains grammatically correct and containing main meaning of the original sen-
tence. Therefore, we can propose a procedure to delete some nodes in the parse
tree. For instance, the sentence above can be compressed as "The man saw the
dog." by deleting the node PP.
2.3 New Hybrid Model: ILP-Parse Tree Model
Our proposed model for sentence compression, called ILP-Parse Tree Model
(ILP-PT), is based on the combination of the two models described above. The
ILP model will provide some candidates for compression with maximal proba-
bility, while the parse tree model helps to guarantee the grammar rules and keep
the main meaning of the sentence. This combination is described as follows:
Step 1 (Build ILP probability model): Building the ILP model as in for-
mulation (8) for the target sentence.
Step 2 (Parse Sentence): Building a parse tree as described in subsection 2.2.
Step 3 (Fix variables for sentence trunk): Identifying the sentence trunk in
the parse tree and fixing the corresponding integer variables to be 1 in ILP model.
This step helps to extract the sentence trunk by keeping the main meaning of
the original sentence while reducing the number of binary decision variables.
More precisely, we will introduce for each node Ni of the parse tree a label
sNi taking the values in {0, 1, 2}. A value 0 represents the deletion of the node;
1 represents the reservation of the node; whereas 2 indicates that the node can
either be deleted or be reserved. We set these labels as compression rules for
each CFG grammar to support any sentence type of any language.
For the word xi, we go through all its parent nodes till the root S. If the
traversal path contains 0, then δi = 0; else if the traversal path contains only 1,
6
Y.S. Niu et al.
then δi = 1; otherwise δi will be further determined by solving the ILP model.
The sentence truck is composed by the words xi whose δi are fixed to 1. Using
this method, we can extract the sentence trunk and reduce the number of binary
variables in ILP model.
Step 4 (Solve ILP): Applying an ILP solution algorithm to solve the simplified
ILP model derived in Step 3 and generate a compression. In the next section,
we will introduce a DC programming approach for solving ILP.
3 DC Programming approach for solving ILP
Solving an ILP is in general NP-hard. A classical and most frequently used
method is branch-and-bound algorithm as in [1]. Gurobi [2] is currently one
of the best ILP solvers, which is an efficient implementation of branch-and-
bound combing various techniques such as presolve, cutting planes, heuristics
and parallelism etc.
In this section, we will present a Difference of Convex (DC) programming
approach, called DCA-Branch-and-Bound (DCABB), for solving this model.
DCABB is initially designed for solving mixed-integer linear programming (MILP)
proposed in [13], and extended for solving mixed-integer nonlinear programming
[14,15] with various applications including scheduling [8], network optimization
[20], cryptography [10] and finance [9,19] etc. This algorithm is based on con-
tinuous representation techniques for integer set, exact penalty theorem, DCA
and Branch-and-Bound algorithms. Recently, the author developed a parallel
branch-and-bound framework (called PDCABB) [17] in order to use the power
of multiple CPU and GPU for improving the performance of DCABB.
The ILP model can be stated in standard matrix form as:
min{f (x) := c(cid:62)x : x ∈ S}
(P )
where S = {x ∈ {0, 1}n : Ax = b}, c ∈ Rn, b ∈ Rm and A ∈ Rm×n. Let us
denote K the linear relaxation of S defined by K = {x ∈ [0, 1]n : Ax = b}. Thus,
we have the relationship between S and K as S = K ∩ {0, 1}n.
The linear relaxation of (P ) denoted by R(P ) is
min{f (x) : x ∈ K},
The continuous representation technique for integer set {0, 1}n consists of
whose optimal value denoted by l(P ) is a lower bound of (P ).
finding a continuous DC function5 p : Rn → R such that
{0, 1}n ≡ {x : p(x) ≤ 0}.
We often use the following functions for p with their DC components:
function type
piecewise linear(cid:80)n
(cid:80)n
expression of p
i=1 min{xi, 1 − xi}
trigonometric (cid:80)n
i=1 xi(1 − xi)
i=1 sin2(πxi)
quadratic
DC components of p
g(x) = 0, h(x) = −p(x)
g(x) = π2(cid:107)x(cid:107)2, h(x) = g(x) − p(x)
5 A function f : Rn → R is called DC if there exist two convex functions g and h
(called DC components) such that f = g − h.
Sentence Compression via DC Programming Approach
7
Based on the exact penalty theorem [6,11], there exists a large enough pa-
rameter t ≥ 0 such that the problem (P ) is equivalent to the problem (P t):
min{Ft(x) := f (x) + tp(x) : x ∈ K}.
(P t)
The objective function Ft : Rn → R in (P t) is also DC with DC components
gt and ht defined as gt(x) = tg(x), ht(x) = th(x) − f (x) where g and h are DC
components of p. Thus the problem (P t) is a DC program which can be solved
by DCA described in Algorithm 1.
Algorithm 1: DCA for (P t)
Input: Initial point x0 ∈ Rn; large enough penalty parameter t > 0;
Output: Optimal solution x∗ and optimal value f∗;
tolerance ε1, ε2 > 0.
1 Initialization: Set i = 0.
2 Step 1: Compute yi ∈ ∂h(xi);
3 Step 2: Solve xi+1 ∈ arg min{g(x) − (cid:104)x, yi(cid:105) : x ∈ K};
4 Step 3: Stopping check:
5 if (cid:107)xi+1 − xi(cid:107) ≤ ε1 or Ft(xi+1) − Ft(xi) ≤ ε2 then
x∗ ← xi+1; f∗ ← Ft(xi+1); return;
i ← i + 1; Goto Step 1.
6
7 else
8
9 end
The symbol ∂h(xi) denotes the subdifferential of h at xi which is fundamental
in convex analysis. The subdifferential generalizes the derivative in the sense that
h is differentiable at xi if and only if ∂h(xi) reduces to the singleton {∇h(xi)}.
Concerning on the choice of the penalty parameter t, we suggest using the
following two methods: the first method is to take arbitrarily a large value for t;
the second one is to increase t by some ways in iterations of DCA (e.g., [14,19]).
Note that a smaller parameter t yields a better DC decomposition [16].
Concerning on the numerical results given by DCA, it is often observed that
DCA provides an integer solution which is also an upper bound solution for the
problem (P ). Therefore, DCA is often proposed for upper bound algorithm in
nonconvex optimization. More details about DCA and its convergence theorem
can be found in [7,5]. Combing DCA with a parallel-branch-and-bound algorithm
(PDCABB) proposed in [17], we can globally solve ILP. The PDCABB algorithm
is described in Algorithm 2. More details about this algorithm as the convergence
theorem, branching strategies, parallel node selection strategies will be discussed
in full-length paper.
4 Experimental Results
In this section, we present our experimental results for assessing the performance
of the sentence compression model described above.
8
Y.S. Niu et al.
Algorithm 2: PDCABB
Input: Problem (P ); number of parallel workers s; tolerance ε > 0;
Output: Optimal solution xopt and optimal value fopt;
1 Initialization: xopt = null; fopt = +∞.
2 Step 1: Root Operations
3 Solve R(P ) to obtain its optimal solution x∗ and set LB ← l(P );
4 if R(P ) is infeasible then
5
6 else if x∗ ∈ S then
return;
xopt ← x∗; fopt ← LB; return;
7
8 end
9 Run DCA for (P t) from x∗ to get ¯x∗;
10 if ¯x∗ ∈ S then
fopt ← f (¯x∗);
L ← {P};
11
12 else
13
14 end
15 Step 2: Node Operations (Parallel B&B)
16 while L (cid:54)= ∅ do
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Select a sublist Ls of L with at most s nodes in Ls;
Update L ← L \ Ls;
parallelfor Pi ∈ Ls do
Solve R(Pi) and get its solution x∗ and lower bound l(Pi);
if R(Pi) is feasible and l(Pi) < fopt then
if x∗ ∈ S then
xopt ← x∗; fopt ← l(Pi);
if fopt − l(Pi) > ε then
else
i ) from x∗ to get its solution x∗;
Run DCA for (P t
if x∗ ∈ S and fopt > f (x∗) then
xopt ← x∗; fopt ← f (x∗);
else
Branch Pi into two new problems P u
Update L ← {P u
i };
i , P d
i and P d
i ;
end
end
32
33
34
35 end
end
Our sentence compression model is implemented in Python as a Natural
Language Processing package, called 'NLPTOOL' (actually supporting multi-
language tokenization, tagging, parsing, automatic CFG grammar generation,
and sentence compression), which implants NLTK 3.2.5[18] for creating parsing
trees and Gurobi 7.5.2[2] for solving the linear relaxation problems R(Pi) and the
convex optimization subproblems in Step 2 of DCA. The PDCABB algorithm
is implemented in C++ and invoked in python. The parallel computing part in
PDCABB is realized by OpenMP.
4.1 F-score evaluation
Sentence Compression via DC Programming Approach
9
We use a statistical approach called F-score to evaluate the similarity between
the compression computed by our algorithm and a standard compression pro-
vided by human. F-score is defined by :
Fµ = (µ2 + 1) × P × R
µ2 × P + R
where P and R represent for precision rate and recall rate as:
P =
A
A + C
, R =
A
A + B
in which A denotes for the number of words both in the compressed result and the
standard result; B is the number of words in the standard result but not in the
compressed result; and C counts the number of words in the compressed result
but not in the standard result. The parameter µ, called preference parameter,
stands for the preference between precision rate and recall rate for evaluating
the quality of the results. Fµ is a strictly monotonic function defined on [0, +∞[
with lim
µ→+∞ Fµ = R. In our tests, we will use F1 as F-score.
µ→0
Fµ = P and lim
Clearly, a bigger F-score indicates a better compression.
4.2 Numerical Results
Table 1 illustrates the compression result of 100 sentences obtained by two ILP
compression models: our new hybrid model (H) v.s. the probability model (P).
Penn Treebank corpus (Treebank) provided in NLTK and CLwritten corpus
(Clarke) provided in [1] are used for sentence compression. We applied Kneser-
Ney Smoothing for computing trigram probabilities. The compression rates 6
are given by 50%, 70% and 90%. We compare the average solution time and the
average F-score for these models solved by Gurobi and PDCABB. The experi-
ments are performed on a laptop equipped with 2 Intel i5-6200U 2.30GHz CPU
(4 cores) and 8 GB RAM.
Table 1. Compression results
Corpus+Model
Solver
50% compression rate 70% compression rate 90% compression rate
F-score (%) Time (s) F-score (%) Time (s) F-score (%) Time (s)
Treebank+P
Treebank+H
Clarke+P
Clarke+H
Gurobi
PDCABB
Gurobi
PDCABB
Gurobi
PDCABB
Gurobi
PDCABB
56.5
59.1
79.0
79.9
70.6
81.4
77.8
79.9
0.099
0.194
0.064
0.096
0.087
0.132
0.046
0.081
72.1
76.2
82.6
82.7
80.2
80.0
85.5
85.2
0.099
0.152
0.070
0.171
0.087
0.128
0.052
0.116
79.4
80.0
81.3
82.1
80.0
81.2
82.4
82.3
0.081
0.122
0.065
0.121
0.071
0.087
0.041
0.082
It can be observed that our hybrid model often provides better F-scores in
average for all compression rates, while the computing time for both Gurobi and
6 The compression rate is computed by the length of compression over the length of
original sentence.
10
Y.S. Niu et al.
PDCABB are all very short within less than 0.2 seconds. We can also see that
Gurobi and PDCABB provided different solutions since F-scores are different.
This is due to the fact that branch-and-bound algorithm find only approximate
global solutions when the gap between upper and lower bounds is small enough.
Even both of the solvers provide global optimal solutions, these solutions could
be also different since the global optimal solution for ILP could be not unique.
However, the reliability of our judgment can be still guaranteed since these two
algorithms provided very similar F-score results.
The box-plots given in Figure 2 demonstrates the variations of F-scores for
different models with different corpora. We observed that our hybrid model
(Treebank+H and Clarke+H) provided better F-scores in average and is more
stable in variation, while the quality of the compressions given by probability
model is worse and varies a lot. Moreover, the choice of corpora will affect the
compression quality since the trigram probability depends on corpora. Therefore,
in order to provide more reliable compressions, we have to choose the most
related corpora to compute the trigram probabilities.
Fig. 2. Box-plots for different models v.s. F-scores
5 Conclusion and Perspectives
We have proposed a hybrid sentence compression model ILP-PT based on the
probability model and the parse tree model to guarantee the syntax correctness
of the compressed sentence and save the main meaning. We use a DC program-
ming approach PDCABB to solve our sentence compression model. Experimental
results show that our new model and the solution algorithm can produce high
quality compressed results within a short compression time.
Concerning on future works, we are very interested in designing a suitable
recurrent neural network for sentence compression. With deep learning method,
it is possible to classify automatically the sentence types and fundamental struc-
tures, it is also possible to distinguish the fixed collocation in a sentence and
make these variables be remained or be deleted together. Researches in these
directions will be reported subsequently.
Sentence Compression via DC Programming Approach
11
References
1. Clarke J, Lapata M.: Global inference for sentence compression: An integer lin-
ear programming approach. Journal of Artificial Intelligence Research 31:399 -- 429
(2008).
2. Gurobi 7.5.2. http://www.gurobi.com.
3. Jing.: Sentence reduction for automatic text summarization. In Proceedings of the
6th Applied Natural Language Processing Conference, pp. 310 -- 315 (2000).
4. Knight K, Marcu D.: Summarization beyond sentence extraction : A probalistic
approach to sentence compression. Artificial Intelligence 139:91 -- 107 (2002).
5. Le Thi H.A.: https://www.lita.univ-lorraine.fr/~lethi/
6. Le Thi H.A., Pham D.T., and Muu L.D.: Exact penalty in dc programming. Vietnam
J. Math. 27(2) (1999).
7. Le Thi H.A., Pham D.T.: The dc (difference of convex functions) programming and
dca revisited with dc models of real world nonconvex optimization problems. Ann.
Oper. Res. 133: 23 -- 46 (2005).
8. Le Thi H.A., Nguyen Q.T., Nguyen H.T., Pham D.T.: Solving the earliness tardiness
scheduling problem by DC programming and DCA. Math. Balk. 23(3 -- 4), 271 -- 288
(2009)
9. Le Thi H.A., Moeini M., Pham D.T.: Portfolio selection under downside risk mea-
sures and cardinality constraints based on DC programming and DCA. Comput.
Manag. Sci. 6(4), 459 -- 475 (2009)
10. Le Thi H.A., Le, H.M., Pham D.T., Bouvry P.: Solving the perceptron problem
by deterministic optimization approach based on DC programming and DCA. Pro-
ceeding in INDIN 2009, Cardiff. IEEE (2009)
11. Le Thi H.A., Pham D.T., and Huynh V.N.: Exact penalty and error bounds in dc
programming. J. Global Optim 52(3) (2012).
12. MacDonald D.: Discriminative sentence compression with soft syntactic con-
straints. In Proceedings of EACL, pp. 297 -- 304 (2006).
13. Niu Y.S, Pham D.T.: A DC Programming Approach for Mixed-Integer Linear Pro-
grams. Modelling, Computation and Optimization in Information Systems and Man-
agement Sciences, Communications in Computer and Information Science. 14:244 --
253 (2008).
14. Niu Y.S: Programmation DC & DCA en Optimisation Combinatoire et Optimi-
sation Polynomiale via les Techniques de SDP -- Codes et Simulations Num´eriques.
Ph.D. thesis, INSA-Rouen, France (2010).
15. Niu Y.S., Pham D.T.: Efficient DC programming approaches for mixed-integer
quadratic convex programs. Proceedings of the International Conference on Indus-
trial Engineering and Systems Management (IESM2011). pp. 222 -- 231 (2011).
16. Niu Y.S.: On Difference-of-SOS and Difference-of-Convex-SOS Decompositions for
Polynomials. (2018) arXiv:1803.09900.
17. Niu Y.S.: A Parallel Branch and Bound with DC Algorithm for Mixed Integer
Optimization, The 23rd International Symposium in Mathematical Programming
(ISMP2018), Bordeaux, France. (2018).
18. NLTK 3.2.5: The Natural Language Toolkit. http://www.nltk.org.
19. Pham D.T, Hoai An L.T, Pham V.N, Niu Y.S.: DC programming approaches for
discrete portfolio optimization under concave transaction costs. Optimization letters
10(2):261 -- 282 (2016).
20. Schleich J., Le Thi H.A., Bouvry P.: Solving the minimum m-dominating set prob-
lem by a continuous optimization approach based on DC programming and DCA.
J. Comb. Optim. 24(4), 397 -- 412 (2012)
|
1904.11610 | 1 | 1904 | 2019-04-25T22:12:43 | Look Who's Talking: Inferring Speaker Attributes from Personal Longitudinal Dialog | [
"cs.CL",
"cs.AI"
] | We examine a large dialog corpus obtained from the conversation history of a single individual with 104 conversation partners. The corpus consists of half a million instant messages, across several messaging platforms. We focus our analyses on seven speaker attributes, each of which partitions the set of speakers, namely: gender; relative age; family member; romantic partner; classmate; co-worker; and native to the same country. In addition to the content of the messages, we examine conversational aspects such as the time messages are sent, messaging frequency, psycholinguistic word categories, linguistic mirroring, and graph-based features reflecting how people in the corpus mention each other. We present two sets of experiments predicting each attribute using (1) short context windows; and (2) a larger set of messages. We find that using all features leads to gains of 9-14% over using message text only. | cs.CL | cs |
Look Who's Talking: Inferring Speaker
Attributes from Personal Longitudinal Dialog
Charles Welch, Ver´onica P´erez-Rosas,
Jonathan K. Kummerfeld, and Rada Mihalcea
{cfwelch,vrncapr,jkummerf,mihalcea}@umich.edu
University of Michigan
Abstract. We examine a large dialog corpus obtained from the conver-
sation history of a single individual with 104 conversation partners. The
corpus consists of half a million instant messages, across several messag-
ing platforms. We focus our analyses on seven speaker attributes, each of
which partitions the set of speakers, namely: gender; relative age; family
member; romantic partner; classmate; co-worker; and native to the same
country. In addition to the content of the messages, we examine conversa-
tional aspects such as the time messages are sent, messaging frequency,
psycholinguistic word categories, linguistic mirroring, and graph-based
features reflecting how people in the corpus mention each other. We
present two sets of experiments predicting each attribute using (1) short
context windows; and (2) a larger set of messages. We find that using all
features leads to gains of 9-14% over using message text only.
Keywords: longitudinal dialog analysis, natural language processing
1
Introduction
People spend a significant amount of time using social media services such as
instant messaging to communicate and keep in touch with others. Over time,
conversation history can grow quickly, thus becoming an abundant source of per-
sonal data that provides the opportunity to study an individual's communication
patterns and social preferences. Analyzing conversations from a single individ-
ual rather than conversations from multiple individuals can enable identification
of social behaviors that are specific to that individual. Moreover, longitudinal
analyses can help us better understand an individual's social interactions and
how they develop over time.
In this work we look at a collection of personal conversations of one of this
paper authors' over a five-year span, consisting of nearly half a million messages
shared with 104 conversation partners. To address data privacy issues, during the
experiments and analyses presented in this paper, the actual message content is
only accessible to its owner. We focus our analyses on seven speaker attributes:
a ternary attribute for relative age (younger, older, or same age); and six binary
attributes reflecting whether somebody is the same gender; a family member; a
romantic partner; a classmate; a co-worker; and a native of the same country.
We explore the classification of speaker attributes, i.e, the group(s) the speaker
belongs to, using a variety of linguistic features, message and time frequency
features, stylistic and psycholinguistic features, and graph-based features. In ad-
dition, we examine the performance increase gained by using six of the attributes
as features to try to classify the seventh.
We analyze linguistic variation in messages exchanged between the author
and the other speakers. We also conduct analyses that look at speaker interaction
behaviors, considering aspects such as time, messaging frequency, turn-taking,
and linguistic mirroring. Next, we apply graph-based methods to model how
people interact with each other by representing people as nodes and speaker
mentioning each other as directed edges. We then apply clustering methods to
identify groups that naturally occur in the graph. Finally, we conduct several
classification experiments to quantify the impact of features derived from these
analyses on our ability to determine who a speaker is.
Identifying speaker attributes has important applications within the areas
of personalization and recommendation [14,4]. While a large number of conver-
sations that occur online are short, such as interactions on Twitter, there are
also many social media platforms where personal dialog may span thousands of
utterances. For this reason, we conduct evaluations at the level of small context
windows, as well as at the speaker level using a large set of messages from each
speaker. To the best of our knowledge, this is the first study on speaker attribute
prediction using personal longitudinal dialog data that focuses on one person's
dialog interactions with many other speakers.
2 Related Work
Our work is related to three main directions of research: authorship attribution,
discourse analysis, and speaker attribute classification from social media.
On authorship attribution, there have been several studies focusing on in-
ferring author's characteristics from their writing, including their gender, age,
educational, cultural background, and native language [6,10]. This work has
considered linguistic features to capture lexical, syntactic, structural, and style
differences between individuals [10]. A recent study in this area analyzed lan-
guage use in social media to identify aspects such as gender, age, and personality
by looking at group differences on language usage in words, phrases, and topics
discussed by Facebook users [15].
Discourse analysis approaches have been used to examine language to re-
veal social behavior patterns. Holmer [7] applied discourse structure analysis to
chat communication to identify and visualize message content and interaction
structures. He focused on visualizing aspects such as conversation complexity,
overlapping turns, distance between messages, turn changes, patterns in message
production and references. In addition, he also proposed graph-based methods
for showing coherence and thread patterns during the messaging interaction. Tu-
ulos [17] inferred social structures in chat-room conversations, using heuristics
based on participants' references, message response time and dialog sequences
and represented social structure using graph-based methods. Similarly, Jing [9]
looked at extracting networks of biographical facts from speech transcripts that
characterize the relationships between people and organizations.
Work in classifying user attributes has used both message content and other
meta-features. Rao [14] looked at classifying gender, age (older or younger than
30), political leaning, and region of origin (north or south India) as binary vari-
ables using a few hundred or a few thousand tweets from each user. They used
the number of followers and following users as network information to look at
frequency of tweets, replies, and retweets as communication-based features but
found no differences between classes. Hutto [8] analyzed sentiment, topic focus,
and network structure in tweeting behavior to understand aspects such as so-
cial behavior, message content and following behavior. Other work has derived
useful information from Twitter profiles, such as Bergsma [2] who focused on
gender classification using features derived from usernames, and Argamon [1]
who found differences in part of speech and style when examining gender in the
British National Corpus.
3 Conversation Dataset
We use a corpus of text messages from one author's personal conversations on
Google Hangouts, Facebook Messenger, and SMS text messages. The message
set contains nearly half a million messages from conversations held between the
author and 104 individuals. Aggregate statistics describing the corpus are shown
in Table 1.
Table 1. Distribution of messages and tokens (words, punctuation, emoticons) in the
conversations between the author and other individuals.
Author
Others
All
Total Messages
Unique Messages
Total Tokens
Unique Tokens
Average Tokens / Message
237,300
165,536
1,370,916
38,937
5.78
216,766
168,041
1,602,607
48,005
7.39
454,066
326,243
2,973,523
68,985
6.55
We use seven attributes that describe the relationship between the author
and their conversation partner. Table 2 shows the distribution of people and
messages for each attribute in the dataset. They were annotated by the author
and interpreted as follows:
Family: This person is related to the author.
Romantic Relationship (Rom. Rel.): This person's relationship with the
author was at some point not platonic.
Table 2. Distribution of speakers and messages in the corpus by speaker attributes
(% of corpus). The values for Age represent 'younger', 'older', and 'same age', while
the values for the other attributes represent 'yes' and 'no'.
Family
Y/N
6/94
8/92
Rom.
Rel.
Rel.
Age
Child.
Co.
Gender
School Work
Y/N
Y/O/S
Y/N
Y/N
Y/N
Y/N
9/91
22/78
26/30/44
24/24/52
78/20
88/11
51/49
53/47
62/38
75/25
33/67
54/46
%Speakers
%Messages
Relative Age (Rel. Age): This person the same age (±1.5 years), is older, or
is younger than the author.
Childhood Country (Child. Co.): This person grew up in the same country
as the author.
Gender: This person has the same gender as the author.
School: This person and the author met attending school.
Work: This person and the author know each other because they worked to-
gether.
4 Message Content
We start by exploring linguistic differences in the messages exchanged between
the author and each of the groups defined by the seven attributes described
above. We obtain the most dominant semantic word classes [13] in messages
exchanged with people sharing each attribute using the LIWC [16] lexicon, which
contains psycholinguistic categories of words. The top ten dominant classes for
each attribute-value pair are shown in Table 3.
Not surprisingly, the 'Family=Yes' group talks more about family and home
than the 'Family=No' group. Interestingly, people who are not family members
seem to use more emotion related words. Word categories related to feelings are
also very dominant for the 'Romantic Relationship=Yes', 'Relative Age=Same',
'Childhood Country=Same' and 'Gender=No' groups; however they seem to fo-
cus on negative emotions such as anxiety and sadness. In fact, those two are in
the top three classes for conversations with romantic partners 'Romantic Rela-
tionship=Yes', which also includes death words (words related to death are often
used in hyperbole, e.g. "I didn't eat lunch and I'm dying"). This suggests that
more serious conversations occur between the author and this group as compared
to the 'Romantic Relationship=No' group.
Several of the attributes clearly separate the set of speakers into those who
speak about work and those who do not. People who talk the most about work are
those who grew up in other countries ('Childhood Country=Other'), people from
work ('Work=Yes'), people older than the author ('Relative Age=Older'), people
with the same gender ('Gender=Yes') and people from school ('School=Yes').
Table 3. Dominant LIWC word classes for each attribute/value pair. The top ten
classes are listed for each attribute in decreasing order.
Attribute
Top Classes
Family
Romantic
Relationship
Yes: Family, Money, Home, Swear, Death, Leisure, Filler, Anger,
Female, Health
No: Anxious, Insight, Feel, Risk, Sad, Positive Emotion, Non-
fluencies, Causality, Affect, Work
Yes: Anxious, Death, Sad, Feel, Body, Filler, You, Family, Percep-
tion, Health
No: Swear, Female, Money, Friend, Anger, She-He, Work, Leisure,
Informal, Male
Relative Age Younger: Netspeak, Ingest, Swear, Friend, Biological, Home,
Anger, Informal, Body, Leisure
Same: Female, Swear, Anger, She-He, Anxious, Negative Emotion,
Friend, Sad, Negate, Money
Older: See, We, Work, Number, Article, Home, Perception, Space,
Motion, Relativity
Same: Death, Family, Anger, Swear, Feel, Female, Negative Emo-
tion, Body, Anxious, Health
Other: We, Work, You, Male, Focus Future, Social, Affiliation,
Friend, Assent, Time
Yes: Money, Female, Swear, Work, Friend, Netspeak, She-He, Ar-
ticle, Power
No: Sad, Anxious, Family, Health, Death, Body, Biological, Nega-
tive Emotion, Ingest, Home
Yes: Work, Non-fluencies, Insight, Risk, Anxious, Quantify, Focus
Past, Causality, Tentative, Compare
No: Family, Money, Health, Home, Netspeak, Death, Swear,
Leisure, Biological, Anger
Yes: Work, Article, Number, We, Non-fluencies, Quantify, Com-
pare, Insight, Achievement, Assent
No: Family, Health, Money, Death, Anger, Swear, Anxious, Home,
Biological, Sad
Childhood
Country
Gender
School
Work
However, there are some differences between these groups which can be seen
mostly in the family, health, time, and gender specific words they use.
People from school use more words referring to the past, while people from
other countries focus more on the future. Interestingly, people not from work
('Work=No') and the people not from school ('School=No') are very similar,
and both use a lot of family, health, and money words. The similarity of these
two attributes is also interesting in that people from work ('Work=Yes') and/or
school ('School=Yes') use more quantifying words (e.g. sampling, percent, aver-
age) and disfluencies (e.g. umm, hmm, sigh). We also see that those who grew
up in other countries use more male words, while speakers that are the same
age, from the same country, or of the same gender use more female words.
5 Groups Over Time
To understand the role that time has in the author's interactions with different
groups we look at patterns in message volume over different intervals. Most
notably, we find interaction differences given the day of the week, and the hour
of the day. In Figure 1 we plot the attribute/value pairs that differ the most
from the trend over all people, marked 'All'. The difference was calculated as
the sum of differences on each of the seven days of the week and each of the 24
hours of the day.
0.16
0.14
0.12
8
6
4
2
0
s
e
g
a
s
s
e
M
f
o
e
g
a
t
n
e
c
r
e
P
All
Family=Yes
Work=No
Child Country=No
M
·10−2
Tu
W
Th
F
Sa
Su
All
Family=Yes
Child Country=No
Romantic=Yes
3
6
9
12
15
18
21
24
Fig. 1. Distribution of messages over time. The top shows the distribution over the
day of the week and the bottom shows hour of the day. The groups shown are those
that vary the most from the aggregate trend over all speakers.
We see that the overall trend for the day-of-week plot (top) is that there
are more conversations during the first days of the week. The number of con-
versations drops until Sunday where it jumps back up and peaks on Monday.
Throughout the week, most of the conversations occur between family members
and people that grew up in other countries (co-workers mainly). In contrast,
there are many more conversations with people outside of work on the weekend.
The hour-of-day plot (bottom) indicates that most of the interactions happen
between 9AM and 6PM. Though this is a trend aggregated over all days in the
corpus it shows that the author is least likely to be talking to people in the 7-8AM
range. The author tends to speak more to people later in the day, with a peak at
midnight. People who grew up in other countries converse more with the author
during the day. The dominant 'Work' category for 'Childhood Country=Other'
in Table 3 shows this trend, as this group may converse with the author more
about work during work hours. We also find that family members speak to the
author more during the day and romantic partners speak to the author more
after midnight but before noon.
6 Conversation Interaction
Linguistic mirroring is a behavior in which one person subconsciously imitates
the linguistic patterns of their conversation partner. Increased linguistic mirror-
ing can be an indicator of an individual building rapport with others and thus
forming better interpersonal relationships. We study linguistic mirroring in our
dataset to analyze how relationships change over time. We calculate linguistic
style matching (LSM) as the similarity of the normalized counts of nine types
of function words [5], as the main metric for our analyses. In Figure 2 we show
style matching over the first 5,000 messages with people in five specific groups.
We see that although the general trend is to match language style more over
time, this trend levels off after 3k messages, potentially because at this point
relationships start to consolidate.
g
n
i
h
c
t
a
M
e
l
y
t
S
c
i
t
s
i
u
g
n
L
i
90
88
86
84
82
80
78
Relative Age=Same
School=Yes
Childhood Country=Same
Family=Yes
Romantic=Yes
0
1,000
2,000
3,000
4,000
5,000
Number of Messages
Fig. 2. Language mirroring as a function of the number of messages exchanged within
groups. Mirroring is shown over the first 5,000 messages averaged over people in each
of the listed groups.
Next, we examine interactions between groups of people by constructing a
graph where nodes represent speakers and edges between nodes represent speak-
ers mentioning each other. Speakers who mention each other also tend to know
each other. They might mention another person when planning to meet up with
others or when talking about an interaction they had with this person in the
past. We clustered the graph of people using Louvain clustering [3] to maximize
Cluster 2
Cluster 1
Cluster 3
Fig. 3. Speaker references for the top 20 conversation partners. The graph shows inter-
actions with people from different groups: high school (rectangles), college (triangles),
graduate school (rounded rectangles), family members (circles), and other people (el-
lipses). Shading is proportional to how long ago the author met the person. Edges
below a threshold of 25 mentions are removed. Note that the clustering uses all 104
people, but only 20 are shown here.
the modularity of the network. This gave four clusters, one of which only con-
tained two people. The remaining clusters roughly evenly split the set of people.
The top twenty most frequent conversation partners are shown in Figure 3. In-
terestingly, the clusters resemble groups of speakers that the author spoke most
to at three periods of time contained in the corpus i.e, conversations before at-
tending graduate school (Cluster 3), the beginning of graduate school (Cluster
2), and later in graduate school (Cluster 1). We also see that people who spoke
to the author more at a particular time were also more likely to know each other.
Table 4. Two examples of five-message context windows (ctx1 and ctx2) taken from
the data.
Message Number Time
Message
ctx1msg0
ctx1msg1
ctx1msg2
ctx1msg3
ctx1msg4
ctx2msg0
ctx2msg1
ctx2msg2
ctx2msg3
ctx2msg4
15:45:06 Participant: Wanna grab coffee?
15:45:20 Author: yeah
15:45:25 Participant: Sweet!!!!
15:45:29 Participant: Meet in the lobby?
15:45:52 Author: okay
12:21:00 Participant: Perfect!!
15:56:22 Participant: Wanna go to get Thai?
16:01:18 Participant: I'll take it you're sleeping lol
16:19:59 Author: Yeah
16:20:08 Author: I mean yeah I was sleeping
7 Model
Using the messages in a conversation between two speakers, we wish to be able
to identify the value of each of the speaker attributes of whom the author is
conversing with. In order to do this, we can encode part of the conversation and
additional features and output the value of an attribute. In text messaging, it is
often not clear what a conversation is about by just examining individual mes-
sages. Thus, we decide to conduct our analysis on small sequences of message
exchanges between speakers. Throughout the rest of the paper, we will refer to
each of these sequences as a context window, which consists of five messages ex-
changed between the author and another speaker1. Two sample context windows
are shown in Table 4.
During our experiments, we use a bidirectional long-short term memory net-
work (BiLSTM) as our baseline model. The input for this model is a dialog
context window, in which all utterances are concatenated but one token is used
to represent the beginning of an author utterance and another token is used
to represent the beginning of any other speaker's utterance. We use the same
implementation to incorporate additional features.
The model architecture is shown in Figure 4. As shown, the context encoder
takes the concatenated window of length n and generates the encoding ρ1. In
the baseline case the feature encoders are not used and the context encoding is
passed directly to an attribute decoder. A separate attribute decoder is used for
each speaker attribute and has k outputs, where k is two for every case except
'relative age', which has three possible values.
When using additional features, we take the BiLSTM output, representing
the encoded context window, and append it to a normalized vector representation
of each additional feature set, ρi. A feed-forward layer is then used to encode
each feature set separately. The hidden size s for both the feature encoders and
attribute decoders were manually tuned in preliminary experiments.
We use a hidden size of 64 for experiments in this paper. In our models
that use one or more feature encoders, the concatenated ρ vector is used for
decoding. The feature encoder sizes t will vary depending on which feature set
is being encoded. The word embedding inputs to the context encoder are 300
dimensional.
8 Features
Word Embeddings: We obtain word vector representations for each message
using the GloVe Common Crawl pre-trained model [12]. We chose GloVe over
other frequently used embeddings because its training data is more similar
to our data and we observed a higher token coverage rate than embeddings
such as word2vec trained on GoogleNews [11].
1 Context window size is fixed in our experiments but future work could explore pre-
diction accuracy as a function of this variable.
Context Encoder
w1
w2
...
wn
B1
B2
...
Bn
F1
F2
...
Fn
ρ1
Feature Encoders
f1
...
ft
h1
h2
...
hs
ρiρi
ρi
Attribute
Decoders
c1
c2
...
cs
a1
...
ak
Fig. 4. The model architecture encodes a context window as a sequence of tokens
w1 to wn using a BiLSTM which is represented with forward and backward cells.
The encoding is then used in combination with our other feature sets for decoding. A
separate decoder is used for each speaker attribute.
LIWC: To calculate these features, we obtain the normalized counts of 73 LIWC
categories. The feature set includes the vectors obtained from messages of
individual conversation participants, the cosine similarity between them, and
the vector sum of both speakers.
Time: These features include the time elapsed during the context window, the
number of seconds between each of the messages, and the day, month, year,
season (winter, fall, summer, spring), and hour of the day of the last message.
Messaging frequency: This set of features includes the number of messages
exchanged between conversation participants in the past day, week, month,
and from all time. The vector also includes a list of binary values representing
the turn change sequence in the context window.
Style Matching: Looks at the similarity of the ratios of function word usage
between the two speakers. This set of features includes the LSM score for
the last hundred messages exchanged by the conversation participants, as
well as the change in style matching over the context window by subtracting
the final and initial LSM scores.
Graph-based: Uses the training set of messages to generate a graph where
nodes represent people and weighted, directed edges represent how often that
person mentions another person when speaking to the author. This graph is
used to generate features by finding the shortest path between users where
edge weights are smaller when they have more mentions. We then use the
adjacency matrix to find the shortest paths between nodes and use each row
as a feature set, representing a speaker i conversing with this person. Given
a graph of mentions, where Mi,j represents how often person i mentions
person j, we compute weights using the following equation:
Wi,j = 1 − wmax − Mi,j
wmax − wmin
Speaker Attributes: When we are predicting one of the seven speaker at-
tributes this feature set represents the values of the other six attributes.
Note that we cannot use this feature when training joint models.
9 Experiments
Using the features described in Section 8 we run experiments using leave-one-
speaker-out cross validation. We take the 104 speakers in our dataset and hold
out all context windows containing dialog with one of the speakers as a test set
and use the rest for training and validation with a 90% and 10% split. This
means that we train and tune parameters on context windows from all 103
other speakers and update the model based on its predictions on each individual
context window. During test time we examine the context-level and speaker-level
accuracy. Context-level accuracy is calculated by macro-averaging the context
window accuracy over all speakers. To calculate accuracy at speaker level, we first
obtain the attribute prediction at context-window level for the held-out speaker
and assign the attribute value most frequently predicted by the classifier.
We run experiments using a baseline model which only uses word embeddings
and compare it to a model that uses all of our features. Additionally, we perform
an ablation to examine the effectiveness of each feature set for predicting each
speaker attribute by running the model using the word embeddings plus one of
the other feature sets at a time. While we vary the number of feature encoders
we use (see Figure 4), each model always uses one attribute decoder. The loss
for each model is calculated as the cross-entropy loss for that model's attribute
decoder.
Since this evaluation is computationally expensive we run our experiments
on a subset of the original corpus. Thus, we obtain a sample of 27,316 context
windows, distributed as evenly as possible, from each speaker in the dataset
to ensure that all people and attributes are represented. Experiments using this
dataset took 3-4 days to run on a cluster with 12 NVIDIA GeForce GTX TITAN
X GPUs.
During our experiments we consider single attribute models, which use only
one attribute decoder, and joint models, which learn to predict all attributes
at the same time using all decoders. In the single attribute setting we train a
separate model for each attribute and calculate the cross-entropy loss for the
decoder, while in the joint case we take the sum of the losses for all decoders.
10 Results
The results obtained for each attribute, when using different combinations of fea-
tures are shown in Table 5 and Table 6. The first table shows accuracies at the
person-level while the latter shows performance macro-averaged over context-
windows. Overall, the combination of all features improves the prediction per-
formance for all the attributes over a baseline model that only uses word embed-
dings, with the exception of the gender attribute. The largest context-window
Table 5. Results are shown for the accuracy per person using leave-one-speaker-out
cross validation. Individual models learn to classify each attribute in all cases except
for the two 'Joint' rows, which jointly classify attributes. Feature ablations are shown
for each of the single feature types, and compared to the model that uses all features, as
well as the baselines obtained using the majority class or message embeddings (Emb)
only. Additional improvements are shown when training single attribute classifiers and
using the other six attributes as features.
Family
Rom. Rel.
Rel.
Age
Child.
Co.
Gender
School Work
Baselines
Majority Class
Emb
94.2
94.2
91.3
91.3
44.2
45.2
77.9
79.8
51.0
86.5
Single Attribute Decoder Ablation
Emb + Time
Emb + LIWC
Emb + Style
Emb + Frequency
Emb + Graph
94.2
94.2
94.2
94.2
93.3
91.3
91.3
91.3
91.3
91.3
44.2
46.2
49.0
44.2
43.3
79.8
80.8
78.8
80.8
77.9
85.6
82.7
86.5
83.7
80.8
61.5
73.1
76.0
73.1
76.0
75.0
76.0
Single Attribute Decoder All Features vs Joint Decoder Models
All Features
Joint + Emb
Joint + All
92.3
94.2
92.3
91.3
91.3
91.3
45.2
48.1
51.9
81.7
78.8
84.6
76.0
85.6
77.9
76.9
71.2
75.0
67.3
80.8
85.6
84.6
85.6
86.5
87.5
83.7
83.7
84.6
Single Attribute Decoder with Attribute Features
Emb + Attributes
All + Attributes
94.2
93.3
91.3
91.3
48.1
50.0
87.5
88.5
83.7
78.8
73.1
78.8
84.6
85.6
level improvements are obtained for the Relative age, Childhood country, Gender
and Work attributes. The largest speaker-level improvements are similar with
the addition of School and without Gender.
Although in some cases the accuracy of attribute prediction at speaker-level
is not improved by the different set of features, we still observe an improvement
on the prediction accuracy at the context window level. For instance, the Family
and Romantic attributes improve by 2.1% and 6% respectively. We also see that
the Gender attribute improves up to 6.8% by this metric.
Using the other six speaker attributes as features to classify the seventh
proved to be beneficial in all cases. The graph features also proved useful for all
attributes showing gains of up to 6.7% in speaker-level performance and up to 7%
in context-window level performance. The frequency features gave the biggest
performance increase to the Romantic, Childhood country, and Work attributes.
Time features improve performance most on Romantic, Gender, School, Work.
The overall trend we found in Section 6 showed that the most distinct groups
when looking at language mirroring were 'Family=Yes' and 'Romantic=Yes'.
Table 6. Accuracy on context windows macro-averaged over speakers. The individual,
joint, single attribute, and baseline models are defined the same way as in Table 5.
Family
Rom. Rel.
Rel.
Age
Child.
Co.
Gender
School Work
Baselines
Majority Class
Emb
94.2
92.0
91.3
86.0
44.2
39.2
77.9
75.7
51.0
63.7
Single Attribute Decoder Ablation
Emb + Time
Emb + LIWC
Emb + Style
Emb + Frequency
Emb + Graph
91.7
91.9
92.0
91.3
92.1
86.8
86.4
86.0
87.9
86.2
40.5
39.6
38.9
39.2
41.7
77.4
76.7
76.2
76.0
76.9
63.4
62.6
62.8
62.4
61.4
61.5
64.6
64.4
63.8
65.1
65.5
67.2
67.3
69.5
73.1
69.4
69.2
71.3
73.3
Single Attribute Decoder All Features vs Joint Decoder Models
All Features
Joint + Emb
Joint + All
92.0
93.9
92.1
88.1
90.9
90.2
42.7
43.4
47.2
78.9
78.0
80.8
61.2
64.2
61.8
67.0
65.5
68.7
76.0
69.3
78.4
Single Attribute Decoder with Attribute Features
Emb + Attributes
All + Attributes
92.6
92.0
86.4
88.2
41.5
44.3
84.1
85.7
68.6
67.1
72.7
74.3
78.4
83.4
However, we found that the language mirroring features that we used, which use
a sliding window, were most useful for Relative age, School, and Work. Similarly,
LIWC features help for Relative age and Work, but they also improve prediction
performance for Childhood country and Gender.
At the speaker level, classification is more difficult and we do not see im-
provement for all attributes when using the additional features or joint decoders.
However, at the context-window level we found that joint decoders improved over
single attribute decoders in all cases, though using the additional features did
not help for Romantic, Family, and Gender. When using single attribute decod-
ing with the other attributes as features we found even higher performance for
four of the attributes. Interestingly, Gender still does not benefit from using ex-
tra features and simply knowing the values of the other speaker attributes gives
the best result. The lowest accuracy overall is obtained for relative age, this can
be partly explained by the lower baseline as compared to the other attributes,
which is influenced by the fact that it has three possible values instead of two.
11 Conclusion
In this paper, we addressed the task of classifying the attributes of an individ-
ual based on their conversations in a longitudinal dataset. We conducted anal-
yses of several interaction aspects, including message content, speaker groups
over time, and interaction during the conversation. We developed a bidirectional
LSTM architecture that, in addition to message content, includes a variety of
features derived from our analyses, covering the time-stamp of the messages,
messaging frequency, psycholinguistic word categories, linguistic mirroring, and
graph-based representations of interactions between people. Additionally, to ac-
count for scenarios where some attributes are known, we present experiments
that evaluate the use of the other six speaker attributes when classifying the
seventh.
Our experiments evaluate the accuracy of predictions at the context-window
level, which uses only a sequence of five messages for message content, as well as
at the speaker level using a larger set of context windows from each speaker. We
observed improvements in speaker level accuracy up to 8.7% and up to 13.9%
accuracy on context windows. We explore the usefulness of each feature with
an ablative study and compare two different methods of decoding. For the case
of predicting someone's relative age or whether or not they are a co-worker,
classmate, or native from the same country, we see improvement at both levels.
Our evaluations show improvement over a system that only uses one of these
features at a time, as well as over a baseline system that relies exclusively on
message content.
To the best of our knowledge, this is the first study on speaker attribute
prediction using personal longitudinal dialog data that focuses on one persons'
interactions with many users. The code used to extract the conversations from
social media, to interactively annotate speakers, and to perform the experiments
presented in this paper is publicly available2, so others can conduct analyses on
their own data.
Acknowledgments
This material is based in part upon work supported by the Michigan Insti-
tute for Data Science, by the National Science Foundation (grant #1815291),
by the John Templeton Foundation (grant #61156), and by DARPA (grant
#HR001117S0026-AIDA-FP-045). Any opinions, findings, and conclusions or
recommendations expressed in this material are those of the author and do not
necessarily reflect the views of the Michigan Institute for Data Science, the Na-
tional Science Foundation, the John Templeton Foundation, or DARPA.
References
1. Argamon, S., Koppel, M., Fine, J., Shimoni, A.R.: Gender, genre, and writing style
in formal written texts. Text-Interdisciplinary Journal for the Study of Discourse
23(3), 321 -- 346 (2003)
2. Bergsma, S., Dredze, M., Van Durme, B., Wilson, T., Yarowsky, D.: Broadly im-
proving user classification via communication-based name and location clustering
2 https://github.com/cfwelch/longitudinal_dialog
on twitter. In: Proceedings of the 2013 Conference of the North American Chapter
of the Association for Computational Linguistics: Human Language Technologies.
pp. 1010 -- 1019 (2013)
3. Blondel, V.D., Guillaume, J.L., Lambiotte, R., Lefebvre, E.: Fast unfolding of com-
munities in large networks. Journal of statistical mechanics: theory and experiment
2008(10), P10008 (2008)
4. Garera, N., Yarowsky, D.: Modeling latent biographic attributes in conversational
genres. In: Proceedings of the Joint Conference of the 47th Annual Meeting of the
ACL and the 4th International Joint Conference on Natural Language Processing
of the AFNLP: Volume 2-Volume 2. pp. 710 -- 718. Association for Computational
Linguistics (2009)
5. Gonzales, A.L., Hancock, J.T., Pennebaker, J.W.: Language style matching as a
predictor of social dynamics in small groups. Communication Research (2009)
6. Hirst, G., Feiguina, O.: Bigrams of syntactic labels for authorship discrimination
of short texts. Literary and Linguistic Computing 22(4), 405 -- 417 (2007)
7. Holmer, T.: Discourse structure analysis of chat communication. Language@ In-
ternet 5(10) (2008)
8. Hutto, C.J., Yardi, S., Gilbert, E.: A longitudinal study of follow predictors on
twitter. In: Proceedings of the SIGCHI conference on human factors in computing
systems. pp. 821 -- 830. ACM (2013)
9. Jing, H., Kambhatla, N., Roukos, S.: Extracting social networks and biographical
facts from conversational speech transcripts. In: Proceedings of the 45th Annual
Meeting of the Association of Computational Linguistics. pp. 1040 -- 1047 (2007)
10. Koppel, M., Schler, J., Argamon, S.: Computational methods in authorship attri-
bution. Journal of the Association for Information Science and Technology 60(1),
9 -- 26 (2009)
11. Mikolov, T., Sutskever, I., Chen, K., Corrado, G.S., Dean, J.: Distributed repre-
sentations of words and phrases and their compositionality. In: Advances in neural
information processing systems. pp. 3111 -- 3119 (2013)
12. Pennington, J., Socher, R., Manning, C.D.: Glove: Global vectors for word repre-
sentation. In: Empirical Methods in Natural Language Processing (EMNLP). pp.
1532 -- 1543 (2014), http://www.aclweb.org/anthology/D14-1162
13. Pulman, S., Mihalcea, R.: Linguistic ethnography: Identifying dominant word
classes in text pp. 595 -- 602 (2009)
14. Rao, D., Yarowsky, D., Shreevats, A., Gupta, M.: Classifying latent user attributes
in twitter. In: Proceedings of the 2nd international workshop on Search and mining
user-generated contents. pp. 37 -- 44. ACM (2010)
15. Schwartz, H.A., Eichstaedt, J.C., Kern, M.L., Dziurzynski, L., Ramones, S.M.,
Agrawal, M., Shah, A., Kosinski, M., Stillwell, D., Seligman, M.E., et al.: Per-
sonality, gender, and age in the language of social media: The open-vocabulary
approach. PloS one 8(9), e73791 (2013)
16. Tausczik, Y.R., Pennebaker, J.W.: The psychological meaning of words: Liwc and
computerized text analysis methods. Journal of language and social psychology
29(1), 24 -- 54 (2010)
17. Tuulos, V.H., Tirri, H.: Combining topic models and social networks for chat data
mining. In: Proceedings of the 2004 IEEE/WIC/ACM international Conference on
Web intelligence. pp. 206 -- 213. IEEE Computer Society (2004)
|
1809.08927 | 1 | 1809 | 2018-09-21T08:27:01 | Adversarial Training in Affective Computing and Sentiment Analysis: Recent Advances and Perspectives | [
"cs.CL",
"cs.AI",
"cs.HC"
] | Over the past few years, adversarial training has become an extremely active research topic and has been successfully applied to various Artificial Intelligence (AI) domains. As a potentially crucial technique for the development of the next generation of emotional AI systems, we herein provide a comprehensive overview of the application of adversarial training to affective computing and sentiment analysis. Various representative adversarial training algorithms are explained and discussed accordingly, aimed at tackling diverse challenges associated with emotional AI systems. Further, we highlight a range of potential future research directions. We expect that this overview will help facilitate the development of adversarial training for affective computing and sentiment analysis in both the academic and industrial communities. | cs.CL | cs | Adversarial Training in Affective Computing
and Sentiment Analysis:
Recent Advances and Perspectives
Jing Han, Zixing Zhang, Nicholas Cummins, and Bjorn Schuller
1
8
1
0
2
p
e
S
1
2
]
L
C
.
s
c
[
1
v
7
2
9
8
0
.
9
0
8
1
:
v
i
X
r
a
Abstract -- Over the past few years, adversarial training has
become an extremely active research topic and has been suc-
cessfully applied to various Artificial Intelligence (AI) domains.
As a potentially crucial technique for the development of the
next generation of emotional AI systems, we herein provide a
comprehensive overview of the application of adversarial training
to affective computing and sentiment analysis. Various represen-
tative adversarial training algorithms are explained and discussed
accordingly, aimed at tackling diverse challenges associated with
emotional AI systems. Further, we highlight a range of potential
future research directions. We expect that this overview will help
facilitate the development of adversarial training for affective
computing and sentiment analysis in both the academic and
industrial communities.
Index Terms -- overview, adversarial training, sentiment anal-
ysis, affective computing, emotion synthesis, emotion conversion,
emotion perception and understanding
I. INTRODUCTION
Affective computing and sentiment analysis currently play a
vital role in transforming current Artificial Intelligent (AI)
systems into the next generation of emotional AI devices [1],
[2]. It is a highly interdisciplinary research field spanning
psychology, cognitive, and computer science. Its motivations
include endowing machines with the ability to detect and
understand the emotional states of humans and, in turn, re-
spond accordingly [1]. Both the terms affective computing and
sentiment analysis relate to the computational interpretation
and generation of human emotion or affect. Whereas the
former mainly relates to instantaneous emotional expressions
and is more commonly associated with speech or image/video
processing, the later mainly relates to longer-term opinions
or attitudes and is more commonly associated with natural
language processing.
A plethora of applications can benefit from the development
of affective computing and sentiment analysis [3] -- [8]; exam-
ples include natural and friendly human -- machine interaction
systems, intelligent business and customer service systems,
and remote health care systems. Thus, affective computing
and sentiment analysis attract considerable research attention
in both the academic and industrial communities.
J. Han and N. Cummins are with the ZD.B Chair of Embedded Intelligence
for Health Care and Wellbeing, University of Augsburg, Germany.
Z. Zhang is with GLAM -- Group on Language, Audio & Mu-
Imperial College London, UK (corresponding author, email: zix-
sic,
[email protected]).
B. Schuller is with the ZD.B Chair of Embedded Intelligence for Health
Care and Wellbeing, University of Augsburg, Germany, and also with GLAM
-- Group on Language, Audio & Music, Imperial College London, UK.
From a technical point of view, affective computing and
sentiment analysis are associated with a wide range of ad-
vancements in machine learning, especially in relation to
deep learning technologies. For example, deep Convolutional
Neural Networks (CNNs) have been reported to considerably
outperform conventional models and non-deep neural networks
on two benchmark databases for sentiment analysis [9]. Fur-
ther, an end-to-end deep learning framework which automat-
ically learns high-level representations from raw audio and
video signals has been shown to be effective for emotion
recognition [10].
However, when deployed in real-life applications, affective
computing and sentiment analysis systems face many chal-
lenges. These include the sparsity and unbalance problems of
the training data [11], the instability of the emotion recognition
models [12], [13], and the poor quality of the generated
emotional samples [14], [15]. Despite promising research
efforts and advances in leveraging techniques, such as semi-
supervised learning and transfer learning [11], finding robust
solutions to these challenges is an open and ongoing research
challenge.
In 2014, a novel learning algorithm called adversarial train-
ing (or adversarial learning) was proposed by Goodfellow et
al. [16], and has attracted widespread research interests across
a range of machine learning domains [17], [18], including
affective computing and sentiment analysis [19] -- [21]. The
initial adversarial training framework, Generative Adversarial
Networks (GANs), consists of two neural networks -- a gen-
erator and a discriminator, which contest with each other in
a two-player zero-sum game. The generator aims to capture
the potential distribution of real samples and generates new
samples to 'cheat' the discriminator as far as possible, whereas
the discriminator, often a binary classifier, distinguishes the
sources (i. e., real samples or generated samples) of the inputs
as accurately as possible. Since its inception, adversarial
training has been frequently demonstrated to be effective in
improving the robustness of recognition models and the quality
of the simulated samples [16] -- [18].
Thus, adversarial training is emerging as an efficient tool to
help overcome the aforementioned challenges when building
affective computing and sentiment analysis systems. More
specifically, on the one hand, GANs have the potential to
produce an unlimited amount of realistic emotional samples;
on the other hand, various GAN variants have been proposed
to learn robust high-level representations. Both of the aspects
can improve the performance of emotion recognition systems.
Accordingly, over the past three years, the number of related
papers has grown exponentially. Motived by the pronounced
improvement achieved by these works and by the belief that
adversarial training can further advance more works in the
community, we thus feel that, there is a necessity to summarise
recent studies, and draw attention to the emerging research
trends and directions of adversarial training in affective com-
puting and sentiment analysis.
A plethora of surveys can be found in the relevant lit-
erature either focusing on conventional approaches or (non-
adversarial) deep-learning approaches for both affective com-
puting [11], [22] -- [25] and sentiment analysis [6], [26] -- [32],
or offering more generic overviews of generative adversarial
networks [17], [18]. Differing from these surveys, the present
article:
• provides, for the first time, a comprehensive overview of
the adversarial training techniques developed for affective
computing and sentiment analysis applications;
• summarises the adversarial training technologies suitable,
not only for the emotion recognition and understanding
tasks, but more importantly, for the emotion synthesis
and conversion tasks, which are arguably far from being
regarded as mature;
• reviews a wide array of adversarial training technologies
covering the text, speech, image and video modalities;
• highlights an abundance of future research directions
for the application of adversarial training in affective
computing and sentiment analysis.
The remainder of this article is organised as follows. In
Section II, we first introduce the background of this overview,
which is then followed by a short description of adversarial
training in Section III. We then comprehensively summarise
the representative adversarial training approaches for emotion
synthesis in Section IV, the approaches for emotion conversion
in Section V, and the approaches for emotion perception and
understanding in Section VI, respectively. We further highlight
some promising research trends in Section VII, before drawing
the conclusions in Section VIII.
II. BACKGROUND
In this section, we first briefly describe three of the main
challenges associated with affective computing and sentiment
analysis, i. e., the naturalness of generated emotions, the spar-
sity of collected data, and the robustness of trained models.
Concurrently, we analyse the drawbacks and limitations of
conventional deep learning approaches, and introduce oppor-
tunities for the application of adversarial training. Then, we
give a short discussion about the challenge of performance
evaluation when generating or converting emotional data.
A typical emotional AI framework consists of two core com-
ponents: an emotion perception and understanding unit, and an
emotion synthesis and conversion unit (cf. Figure 1). The first
component (aka a recognition model) interprets human emo-
tions; whereas the second component (aka a generation model)
can generate emotionally nuanced linguistics cues, speech,
facial expressions, and even gestures. For the remainder of
this article, the term emotion synthesis refers to the artificial
2
emotion perception
and understanding
emotion synthesis
and conversion
Fig. 1: The broad framework of a typical emotional artificial
intelligence system.
generation of an emotional entity from scratch, whereas the
term emotion conversion refers to the transformation of an
entity from one emotional depiction to another. To build a
robust and stable emotional AI system, several challenges have
to be overcome as discussed in the following sub-sections.
A. Naturalness of Generated Emotions
Emotion synthesis and conversion go beyond the conventional
constructs of Natural Language Generation (NLP), Text-To-
Speech (TTS), and image/video transformation techniques.
This is due in part to the instinct complexity and uncertainty of
the emotions, thereby generating an emotional entity remains
an ongoing challenge.
Recently, research has shown the potential of deep-learning
based generative models for addressing this challenge. For
example, the WaveNet network developed by Oord et al. [33]
efficiently synthesises speech signals, and Pixel Recurrent
Neural Networks (PixelRNN) and Variational AutoEncoder
(VAE), proposed by Oord et al. [34] and Kingma et al. [35]
respectively, have been shown to be effective for generating
images.
To date, the majority of these studies have not considered
emotional information. A small handful of works have been
undertaken in this direction [36], [37], however, the generated
emotions are far from being considered natural. This is due in
part to the highly non-linear nature of emotional expression
changes and the variance of individuals [38], [39]. Generative
modelling with adversarial training, on the other hand, has
frequently been shown to be powerful in regard to generating
samples, which are more understandable to humans than
the examples simulated by other approaches [17], [18] (see
Section IV and Section V for more details).
B. Sparsity of Collected Data
Despite having the possibility to collect massive amounts of
unlabelled data through pervasive smart devices and social
media, reliably annotated data resources required for emotion
analysis are still comparatively scarce [11]. For example, most
of the databases currently available for speech emotion recog-
nition contain, at most 10 h of labelled data [25], [40], which
is insufficient for building highly robust models. This issue has
become even more pressing in the era of deep learning. The
data-sparsity problem mainly lies in the annotation process
which is prohibitively expensive and time-consuming [11].
This is especially true in relation to the subjective nature of
emotions which dictates the need for several annotators to label
the same samples in order to diminish the effect of personal
biases [41].
In tackling this challenge, Kim et al. [42] proposed an
unsupervised learning approach to learn the representations
across audiovisual modalities for emotion recognition without
any labelled data. Similarly, Cummins et al. [43] utilised CNNs
pre-trained on large amounts of image data to extract robust
feature representations for speech-based emotion recognition.
More recently, neural-network-based semi-supervised learn-
ing has been introduced to leverage large-scale unlabelled
data [13], [44].
Despite the effectiveness of such approaches that distil
shared high-level representations between labelled and unla-
belled samples, the limited number of labelled data samples
means that there is a lack of sufficient resources to extract
meaningful and salient representations specific to emotions.
In contrast, a generative model with adversarial training has
the potential to synthesise an infinite amount of labelled sam-
ples to overcome the shortage of conventional deep learning
approaches (see Section VI for more details).
C. Robustness of Trained Models
In many scenarios, samples from a target domain are not
sufficient or reliable enough to train a robust emotion recog-
nition model. This challenge has motivated researchers to
explore transfer learning solutions which leverage related
domain (source) samples to aid the target emotion recognition
task. This is a highly non-trivial task, the source and target
domains are often highly mismatched with respect
to the
domains in which the data are collected [45], such as different
recording environments or websites. For example, in sentiment
analysis, the word 'long' for evaluating battery life has a
positive connotation, whereas when assessing pain it tends to
be negative. Moreover, for speech emotion recognition, the
source and target samples might have been recorded in dis-
tinctive acoustic environments and by different speakers [11].
These mismatches have been shown to lead to a performance
degradation of models analysed in real-life settings [27], [45],
[46].
In addressing this challenge, Glorot et al. [46] presented
a deep neural network based approach to learn the robust
representations across different domains for sentiment anal-
ysis. Similar approaches have also been proposed by Deng et
al. [47] for emotion recognition from speech. Moreover, You et
al. [48] successfully transferred the sentiment knowledge from
text to predict the sentiment of images. However, it is still un-
clear if their learnt representations are truly domain-invariant
or not.
On the other hand,
the discriminator of an adversarial
training framework has the potential to distinguish from which
domain the so-called 'shared' representations come from. By
doing so, it can help alleviate the robustness problem of an
emotion recognition model (see Section VI for more details).
3
D
real
fake
latent
random
vector
z
G
x
real data
x
Fig. 2: Framework of Generative Adversarial Network (GAN).
affective computing and sentiment analysis. Currently, many of
the related works directly demonstrate a few appealing samples
and evaluate the performance by human judgement [38], [49],
[50]. Additionally, a range of metric-based approaches have
been proposed to quantitatively evaluate the adversarial train-
ing frameworks. For example, the authors in [51] compared
the intra-set and inter-set average Euclidean distances between
different sets of the generated faces.
Similarly,
to quantitatively evaluate models for emotion
conversion, other evaluation measurements raised in the liter-
ature include BiLingual Evaluation Understudy (BLEU) [52]
and Recall-Oriented Understudy for Gisting Evaluation
(ROUGE) [53] for text, and a signal-to-noise ratio test for
speech [15]. However, the quantitative performance evaluation
for emotion perception and understanding is more straight-
forward. In general, the improvement by implementing ad-
versarial training can be reported using evaluation metrics
such as unweighted accuracy, unweighted average recall, and
concordance correlation coefficient [12], [54], [55].
III. PRINCIPLE OF ADVERSARIAL TRAINING
In this section, we introduce the basic concepts of adversarial
training, so that the interested reader can better understand the
design and selection of adversarial networks for a specific task
in affective computing and sentiment analysis.
A. Terminology and Notation
With the aim of generating realistic 'fake' samples from a
complex and high-dimensional true data distribution, the 'clas-
sical' GAN, consists of two deep neural nets (as two players
in a game): a generator (denoted as G) and a discriminator
(denoted as D) (cf. Figure 2). During this two-player game, the
generator tries to turn input noises from a simple distribution
into realistic samples to fool
the discriminator, while the
discriminator tries to distinguish between true (or 'real') and
generated (or 'fake') data.
Normally, G and D are trained jointly in a minimax
fashion. Mathematically, the minimax objective function can
be formulated as:
min
θg
max
θd
V (D, G) =Ex∼pdata(x)[log Dθd (x)]+
Ez∼pz(z)[log(1 − Dθd (Gθg (z)))],
(1)
D. Performance Evaluation
Evaluating the performance of the generated or converted
emotional samples is essential but challenging in aspects of
where θg and θd denote the parameters of G and D, re-
spectively; x is a real data instance following the true data
distribution pdata(x); whilst z is a vector randomly sampled
following a simple distribution (e. g., Gaussian); Gθg (z) de-
notes a generated data given z as the input; and Dθd (·)
outputs the likelihood of real data given either x or Gθg (z)
as the input. Note that,
the likelihood is in the range of
(0,1), indicating to what extent the input is probably a real
data instance. Consequently, during training, θg is updated to
minimise the objective function such that Dθd (Gθg (z)) is close
to 1; conversely, θd is optimised to maximise the objective
such that log Dθd (x) is close to 1 and Dθd (Gθg (z)) is close to
0. In other words, G and D are trying to optimise a different
and opposing objective function, thus pushing against each
other in a zero-sum game. Hence, the strategy is named as
adversarial training.
Generally, the training of G and D is done in an iterative
manner, i. e., the corresponding neural weights θd, θg are up-
dated in turns. Once training is completed, the generator G is
able to generate more realistic samples, while the discriminator
D can distinguish authentic data from fake data. More details
of the basic GAN training process can be found in [16].
B. Category of Adversarial Networks
Since the first GAN paradigm was introduced in 2014, nu-
merous variants of the original GAN have been proposed
and successfully exploited in many real-life applications. It
is roughly estimated that to date, more than 350 variants
of GANs have been presented in the literature over the last
four years1, infiltrating into various domains including image,
music, speech, and text. For a comprehensive list and other
resources of all currently named GANs, interested readers are
referred to [56], [57]. Herein, we group these variants into four
main categories: optimisation-based, structure-based, network-
type-based, and task-oriented.
Optimisation-based: GANs in this category aim to opti-
mise the minimax objective function to improve the stability
and the speed of the adversarial training process. For instance,
in the original GAN, the Jensen-Shannon (JS) divergence of
the objective function can be a constant, particularly at the start
of the training procedure where there is no overlap between
the sampled real data and the generated data. To smooth the
training of GANs, the Wasserstein GAN (WGAN) has been
proposed by replacing the JS divergence with the earth-mover
distance to evaluate the distribution distance between the real
and generated data [58].
Other GAN variants in this direction include the Energy-
Based GAN (EBGAN) [59], the Least Squares GAN (LS-
GAN) [60], the Loss-Sensitive GAN (LS-GAN) [61], the Cor-
relational GAN (CorrGAN) [62], and the Mode Regularized
GAN (MDGAN) [63], to name but a few.
Structure-based: these GAN variants have been proposed
and developed to improve the structure of conventional GAN.
For example, the conditional GAN (cGAN) adds auxiliary
information to both the generator and discriminator to control
the modes of the data being generated [64], while the semi-
supervised cGAN (sc-GAN) exploits the labels of real data to
guide the learning procedure [65]. Other GAN variants in this
1https://github.com/hindupuravinash/the-gan-zoo/blob/master/gans.tsv
4
category include the BiGAN [66], the CycleGAN [67], the
DiscoGAN [68], the InfoGAN [69], and the Triple-GAN [70].
Network-type-based: in addition, several GAN variants
have been named after the network topology used in the
GAN configuration, such as the DCGAN based on deep
convolutional neural networks [19], the AEGAN based on
autoencoders [71], the C-RNN-GAN based on continuous re-
current neural networks [72], the AttnGAN based on attention
mechanisms [73], and the CapsuleGAN based on capsule
networks [74].
Task-oriented: lastly, there are also a large number of GAN
variants that have been designed for a given task, thus serve
their own specific interests. Examples, to name just a few,
include the Sketch-GAN proposed for sketch retrieval [75],
the ArtGAN for artwork synthesis [76], the SEGAN for speech
enhancement [77], the WaveGAN for raw audio synthesis [78],
and the VoiceGAN for voice impersonation [15].
IV. EMOTION SYNTHESIS
As discussed in Section II-A, the most promising generative
models, for synthesis, currently include PixelRNN/CNN [34],
[79], VAE [35], and GANs [16]. Works undertaken with these
models highlight their potential for creating realistic emotional
samples. The PixelRNN/CNN approach, for example, can
explicitly estimate the likelihood of real data with a tractable
density function in order to generate realistic samples. How-
ever, the generating procedure is quite slow, as it must be
processed sequentially. On the other hand, VAE defines an
intractable density function and optimises a lower bound of
the likelihood instead, resulting in a faster generating speed
compared with PixelRNN/CNN. However, it suffers from the
generation of low-quality samples.
In contrast to other generative models, GANs directly learn
to generate new samples through a two-player game without
estimating any explicit density function, and have been shown
to obtain state-of-the-art performance for a range of tasks no-
tably in image generation [16], [17], [80]. In particular, GAN-
based frameworks can help generate, in theory, an infinite
amount of realistic emotional data, including samples with
subtle changes which depict more nuanced emotional states.
A. Conditional-GAN-based Approaches in Image/Video
To synthesise emotions, the most frequently used GAN relates
to the conditional GAN (cGAN). In the original cGAN frame-
work, both the generator and discriminator are conditioned
on certain extra information c. This extra information can
be any kind of auxiliary information, such as the labels or
data from other modalities [64]. More specifically, the latent
input noise z is concatenated with the condition c as a joint
hidden representation for the generator G, in the meanwhile c
is combined with either the generated sample x or real data x
to be fed into the discriminator D, as demonstrated in Figure 3.
In this circumstance, the minimax objective function given in
Equation (1) is reformulated:
min
θg
max
θd
V (D, G) =Ex∼pdata(x)[log Dθd (xc)]+
Ez∼pz(z)[log(1 − Dθd (Gθg (zc)))].
(2)
condition
latent
random
vector
c
z
G
x
real data
x
D
real
fake
Fig. 3: Framework of conditional Generative Adversarial Net-
work (cGAN).
Recently, a collection of works have begun to explore which
facial expressions and representations can best be produced
via cGAN. The frameworks proposed within these works are
either conditioned on attribute vectors including emotion states
to generate an image for a given identity [49], or conditioned
on various emotions represented by values of features such
as facial action unit coefficients to produce dynamic video
from a static image [81], or conditioned on arbitrary speech
clips to create talking faces synchronised with the given audio
sequence [82]. While these approaches can produce faces with
convincing realism, they do not fully consider the interpersonal
behaviours that are common in social interactions such as
mimicry.
In tackling this problem, one novel application was pro-
posed in [51], in which the authors presented a cGAN-based
framework to generate valid facial expressions for a virtual
agent. The proposed framework consists of two stages: firstly,
a person's facial expressions (in eight emotion classes) are ap-
plied as conditions to generate expressive face sketches, then,
the generated sketches are leveraged as conditions to synthe-
sise complete face images of a virtual dyad partner. However,
this framework does not consider the temporal dependency
on faces across various frames, can yield non-smooth facial
expressions over time. In light of this, researchers in [50]
proposed Conditional Long Short-Term Memory networks (C-
LSTMs) to synthesise contextually smooth sequences of video
frames in dyadic interactions. Experimental results in [50]
demonstrate that the facial expressions in the generated virtual
faces reflect appropriate emotional reactions to a person's
behaviours.
B. Other GAN-based Approaches in Image/Video
In addition to the cGAN-based framework, other GAN variants
such as DCGAN [19] and InfoGAN [69] have been investi-
gated for emotional face synthesis. In [19], it is shown that,
vector arithmetic operations in the input latent space can yield
semantic changes to the image generations. For example, per-
forming vector arithmetic on mean vectors "smiling woman"
- "neutral woman" + "neutral man" can create a new image
with the visual concept of "smiling man". The InfoGAN
framework, on the other hand, aims to maximise the mutual
information between a small subset of the latent variables and
the observation, to learn interpretable latent representations
5
TABLE I: Generated samples on IMDB [21]
Positive: Follow the Good Earth movie linked Vacation is a
comedy that credited against the modern day era yarns which has
helpful something to the modern day s best It is an interesting
drama based on a story of the famed
Negative: I really can t understand what this movie falls like I
was seeing it I m sorry to say that the only reason I watched it
was because of the casting of the Emperor I was not expecting
anything as
Negative: That s about so much time in time a film that persevered
to become cast in a very good way I didn t realize that the book
was made during the 70s The story was Manhattan the Allies were
to
which reflect the structured semantic data distribution [69].
For instance, it has been demonstrated that by varying one
latent code, the emotions of the generated faces can change
from stern to happy [69].
C. Approaches in Other Modalities
As well as the generation of expressive human faces, adver-
sarial training has also been exploited to generate emotional
samples in a range of other modalities. For example, in [83]
modern artwork images have been automatically generated
from an emotion-conditioned GAN. Interestingly, it has been
observed that various features, such as colours and shapes,
within the artworks are commonly correlated with the emo-
tions which they are conditioned on. Similarly, in [84] plau-
sible motion sequences conditioned by a variety of contextual
information (e. g., activity, emotion), have been synthesised by
a so-called sequential adversarial autoencoder. More recently,
poems conditioned by various sentiment labels (estimated from
images) have been created via a multi-adversarial training
approach [85].
Correspondingly, adversarial training has also been inves-
tigated for both text generation [86], [87] and speech syn-
thesis [78]. In particular, sentence generation conditioned on
sentiment (either positive or negative) has been conducted
in [14] and [21], but both only on fixed-length sequences (11
words in [14] and 40 words in [21]). One example can be the
three generated samples with a fixed length (40 words) found
in [21] (also shown in Table I). Despite the promising nature
of these initial works, the performance of such networks are
far off when comparing with the quality and naturalness of
image generation.
To the best of our knowledge, emotion-integrated synthesis
frameworks based on adversarial training has yet to be imple-
mented in speech. Compared with image generation, one main
issue we confront in both speech and text is the varied length
to generate, which, however, could also be a learnt feature in
the future.
V. EMOTION CONVERSION
Emotion conversion is a specific style transformation task. In
computer vision and speech processing domains, it targets at
transforming a source emotion into a target emotion without
affecting the identity properties of the subject. Whereas for
NLP, sentiment transformation aims to alter the sentiment
expressed in the original text while preserving its content. In
6
Fig. 5: Framework of VoiceGAN. Source: [15]
perform the facial expression transformations appropriately
even for unseen facial expression characteristics.
Another related work is [91], in which the authors focused
on voice conversion in natural speech and proposed a varia-
tional autoencoding WGAN. Note that, data utilised in [91] are
not frame aligned, but still are in pairs. Emotion conversion
has not been considered in this work, however, this model
could be applied to emotion conversion.
B. Non-Paired-Data-based Approaches
The methods discussed in the previous section all require pair-
wise data of the same subjects in different facial expressions
during training. In contrast, Invertible conditional GAN (Ic-
GAN), which consists of a cGAN and two encoders, does not
have this constraint [92]. In the IcGAN framework, the en-
coders compress a real face image into a latent representation
z and a conditional representation c independently. Then, c
can be explicitly manipulated to modify the original face with
deterministic complex modifications.
Additionally, the ExprGAN framework is a more recent
advancement for expression transformation [88], in which the
expression intensity can be controlled in a continuous manner
from weak to strong. Furthermore, the identity and expression
representation learning are disentangled and there is no rigid
requirement of paired samples for training [88]. Finally, the
authors develop a three-stage incremental learning algorithm
to train the model on small datasets [88]. Figure 4 illustrates
some results obtained with ExprGAN [88].
Recently, inspired by the success of the DiscoGAN for style
transformation in images, Gao et al. [15] proposed a speech-
based style-transfer adversarial training framework, namely
VoiceGAN (cf. Figure 5). The VoiceGAN framework consists
of two generators/transformers (GAB and GBA) and three dis-
criminators (DA, DB, and Dstyle). Importantly, the linguistic
information in the speech signals is retained by considering the
reconstruction losses of the generated data, and parallel data
are not required. To contend with the varied lengths of speech
signals, the authors applied a channel-wise pooling to convert
variable-sized feature map into a vector of fixed size [15].
Experimental results demonstrate that VoiceGAN is able to
transfer the gender of a speaker's voice, and this technique
could be easily extended to other stylistic features such as
different emotions [15].
More recently, a cycleGAN-based model was proposed to
learn sentiment transformation from non-parallel text, with
Fig. 4: Face images transformed into new images with different
expression intensity levels. Source: [88]
conventional approaches, paired data are normally required to
learn a pairwise transformation function. In this case, the data
need to be perfectly time aligned to learn an effective model,
which is generally achieved by time-warping.
Adversarial training, on the other hand, does away with
the need to prepare the paired data as a precondition, as
the emotion transformation function can be estimated in an
indirect manner. In light of this, adversarial training reshapes
conventional emotion conversion procedures and makes the
conversion systems simpler to be implemented and used, as
time-alignment is not needed. Moreover, leveraging adversarial
training makes the emotion conversion procedure more robust
and accurate through the associated game-theoretic approach.
A. Paired-Data-based Approaches
Several adversarial training approaches based on paired train-
ing data have been investigated for emotion conversion. For
example, in [89], the authors proposed a conditional difference
adversarial autoencoder, to learn the difference between the
source and target facial expressions of one same person. In this
approach, a source face goes through an encoder to generate a
latent vector representation, which is then concatenated with
the target label to generate the target face through a decoder.
Concurrently, two discriminators (trained simultaneously) are
used to regularise the latent vector distribution and to help
improve the quality of generated faces through an adversarial
process.
Moreover, approaches based on facial geometry information
have been proposed to guide facial expression conversion [38],
[90]. In [90], a geometry guided GAN for facial expression
transformation was proposed, which is conditioned on facial
geometry rather than expression labels. In this way, the facial
geometry is directly manipulated, and thus the network ensures
a fine-grain control in face editing, which, in general, is not so
straightforward in other approaches. In [38], the researchers
further disentangled the face encoding and facial geometry
(in landmarks) encoding process, which allows the model to
DisgustWeakAngryDisgustFearHappySadSurpriseNeutralAngry Disgust Fear Happy Sad Surprise NeutralStrongcondition
c
latent
random
vector
z
G
x
real data
x
D
·
·
·
class-1
class-n
fake
Fig. 6: Framework of semi-supervised conditional Generative
Adversarial Network (scGAN).
an ultimate goal to automatically adjust the sentiment of a
chatbot response [93]. By combining seq2seq model with
cycleGAN, the authors developed a chatbot whose response
can be transformed from negative to positive.
Compared with the works of adversarial-training-based
emotion conversion in image, it is noticeable that to date, there
are only a few related works in video and speech, and only one
in text. We believe that the difficulty of applying adversarial
training in these domains is threefold: 1) the variable length of
corresponding sequential data; 2) the linguistic and language
content needed to be maintained during the conversion; and 3)
the lack of reliable measurement metrics to rapidly evaluate
the performance of such a transformation.
VI. EMOTION PERCEPTION AND UNDERSTANDING
This section summarises works which tackle the data-sparsity
challenge (see Section VI-A) and the robustness-of-the-
emotion-recogniser challenge (see Sections VI-B and VI-C).
A. Data Augmentation
As already discussed, the lack of large amounts of reliable
training data is a major issue in the fields of affective com-
puting and sentiment analysis. In this regard,
it has been
shown that emotion recognition performance can be improved
with various data augmentation paradigms [94], [95]. Data
augmentation is a family of techniques which artificially
generate more data to train a more efficient (deep) learning
model for a given task.
Conventional data augmentation methods focus on generat-
ing data through a series of transformations, such as scaling
and rotating an image, or adding noise to speech [95]. How-
ever, such perturbations directly on original data are still, to
some extent, not efficient to improve overall data distribution
estimation. In contrast, as GANs generate realistic data which
estimate the distribution of the real data, it is instinctive to
apply them to expand the training data required for emotion
recognition models. In this regard, some adversarial training
based data augmentation frameworks have been proposed in
the literature, which aim to supplement the data manifold to
approximate the true distribution [96].
For speech emotion recognition, researchers in [97] imple-
mented an adversarial autoencoder model. In this work, high-
dimensional feature vectors of real data are encoded into 2-
D dimensional representations, and a discriminator is learnt
7
to distinguish real 2-D vectors from generated 2-D vectors.
The experiments indicate that the 2-D representations of real
data can yield suitable margins between different emotion
categories. Additionally, when adding the generated data to
the original data for training, performance can be marginally
increased [97].
Similarly, a cycleGAN has been utilised for face-based
emotion recognition [96]. To tackle the data inadequacy and
unbalance problems, faces in different emotions have been
generated from non-emotion ones, particularly for emotions
like disgust and sad, which seemingly have less available
samples. Experimental results have demonstrated that, by
generating auxiliary data of minority classes for training, not
only did the recognition performance of the rare class improve,
the average performance over all classes also increased [96].
One ongoing research issue relating to GANs is how best
to label the generated data. In [97], they adopted a Gaussian
mixture model which is built on the original data, whereas the
authors in [96] took a set of class-specific GANs to generate
images, respectively, which requires no additional annotation
process.
In addition to these two approaches, cGAN in a semi-
supervised manner (scGAN) can be an interesting alternative
worthy of future investigations. The scGAN is an extension of
cGAN by forcing the discriminator D to output class labels
as well as distinguishing real data from fake data. In this
scenario, D acts as both a discriminator and a classifier. More
specifically, D classifies the real samples into the first n classes
and the generated samples into the n + 1-th class (fake), while
G tries to generate the conditioned samples and 'cheat' the
discriminator to be correctly classified into the first n classes,
as illustrated in Figure 6. By taking the class distribution into
the objective function, an overall improvement in the quality of
the generated samples was observed [65]. Hence, scGAN can
be easily adapted for data augmentation in emotion perception
and understanding tasks, which to date has yet to be reported
in the literature.
Finally, the quality of the generated data is largely over-
looked in the works discussed in this section. It is possible
that the generated data might be unreliable, and thus become
a form of noise in the training data. In this regard, data filtering
approaches should be considered.
B. Domain Adversarial Training
For emotion perception and understanding, numerous do-
main adaptation approaches have been proposed to date (cf.
Section II-C). These approaches seek to extract
the most
representative features from the mismatched data between the
training phase and the test phase, in order to improve the
robustness of recognition models (cf. Section II-C). However,
it is unclear if the learnt representations are truly domain-
generative or still domain-specific.
In [98], Ganin et al. first introduced domain adversarial
training to tackle this problem. Typically, a feature extractor
Gf (:, θf ) projects data from two separate domains into high-
level representations, which are discriminative for a label
predictor Gy(:, θy) and indistinguishable for a domain clas-
8
(a) before DANN
(b) after DANN
Fig. 8: Illustration of data distributions from source and target
before (a) and after (b) the DANN training. Source: [55]
Generally speaking, adversarial examples are the exam-
ples that are created by making small, but
intentionally,
perturbations to the input to incur large and significant per-
turbations in outputs (e. g., incorrect predictions with high
confidence) [104]. Adversarial training, however, addresses
this vulnerability in recognition models by introducing mech-
anisms to correctly handle the adversarial examples. In this
way, it improves not only robustness to adversarial examples,
but also overall generalisation for the original examples [104].
Mathematically, adversarial training adds the following term
as regularisation loss to the original loss function:
− log p(yx + radv; θ),
(3)
in which x denotes the input, θ denotes the parameters of a
classifier, and radv denotes a worst-case perturbation against
the current model p(yx; θ), which can be calculated with
radv = arg max
r,(cid:107)r(cid:107)≤
log p(yx + r; θ).
(4)
In the context of affective computing and sentiment analysis,
the authors in [105] utilised DCGAN and multi-task learning
strategies to leverage a large number of unlabelled samples,
where the unlabelled samples are considered as adversarial
examples. More specifically, the model explores unlabelled
data by feeding it through a vanilla DCGAN, in which a
discriminator only learns to classify the input as either real
or fake. Hence, no label information is demanded. Note that,
the discriminator shares layers with another two classifiers to
predict valence and activation simultaneously. This method has
been shown to improve generalisability across corpora [105].
A similar approach was conducted in [54] to learn robust rep-
resentations from emotional speech data for autism detection.
More recently, a cGAN-based framework was proposed for
continuous speech emotion recognition in [20], where a pre-
dictor and a discriminator are conditioned by acoustic features.
In particular, the discriminator is employed to distinguish the
joint probability distributions for acoustic features and their
corresponding predictions or real annotations. In this way,
the predictor is guided to modify the original predictions to
achieve a better performance level.
Rather
than the above mentioned adversarial
training
schemes that explicitly rely on the presence of a discriminator
network, adversarial
training can also be executed in an
implicit manner, namely, virtual adversarial training. Virtual
adversarial training is conducted by straightforwardly adding
an additional regularisation term, which is sensitive to the
adversarial examples, as a penalty in a loss function.
Fig. 7: Framework of Domain-Adversarial Neural Network
(DANN). Source: [98]
sifier Gd(:, θd). A typical Domain-Adversarial Neural Net-
work (DANN) is illustrated in Figure 7. Particular to the
DANN architecture, a gradient reversal layer is introduced
between the domain classifier and the feature extractor, which
during backward prop-
inverts the sign of the gradient ∂Ld
∂θd
agation. Moreover, a hype-parameter λ is utilised to tune
the trade-off between the two branches during the learning
process. In this manner, the network attempts to learn domain-
invariant feature representations. By this training strategy, the
representations learnt from different domains cannot be easily
distinguished, as demonstrated in Figure 8. Further details on
how to train DANN are given in [98].
Using a DANN, a common representation between data
from the source and target domains can potentially be learnt.
This is of relevance in the data mismatch scenario as knowl-
edge learnt from the source domain can be applied directly
to the target domain [55]. Accordingly, the original DANN
paradigm has been adapted to learn domain-invariant represen-
tations for sentiment classification. For example, in [95], [99],
attention mechanisms were introduced to give more attention
to relevant text when extracting features. In [12], [100], the
Wasserstein distance was estimated to guide the optimisa-
tion of the domain classifier. Moreover, instead of learning
common representations between two domains, other research
has broadened this concept to tackle the data mismatch issue
among multiple probability distributions. In this regard, DANN
variants have been proposed for multiple source domain
adaptation [101], multi-task learning [102], and multinomial
adversarial nets [103].
Finally, DANN has recently been utilised in speech emotion
recognition [55]. These experiments demonstrate that, by
aligning the data distributions of the source and target domains
(illustrated in Figure 8), an adversarial training approach can
yield a large performance gain in the target domain [55].
C. (Virtual) Adversarial Training
Beside factors relating to the quality of the training data, the
performance of an emotional AI system is also heavily depen-
dent on its robustness to unseen data. A trivial disturbance on
the sample (adversarial examples) might result in an opposite
prediction [104], which naturally has to be avoided for a robust
recognition model.
Input xfeatures ffeature extractor Gf∂ Ly∂ θf∂ Ld∂ θf-λ∂ Ly∂ θylabel predictor Gydomain predictor Gdgradient reversallayerclass label ydomain label d∂ Ld∂ θdloss Lyloss Ld∂ Ly∂ θfforwardprop backprop Source TargetxSource TargetxIn virtual adversarial
training, first proposed in [106],
the regularisation loss term of Equation (3) is reformulated
without the label y as follows:
KL[p(·x; θ)(cid:107)p(·x + radv; θ)],
(5)
where KL[·(cid:107)·] denotes the KL divergence between two distri-
butions and a worst-case perturbation radv can be computed
by
radv = arg max
r,(cid:107)r(cid:107)≤
KL[p(·x; θ)(cid:107)p(·x + r; θ)].
(6)
Inspired by these works, authors in [107] reported that,
state-of-the-art sentiment classification results can be achieved
when adopting (virtual) adversarial training approaches in the
text domain. In particular, the authors applied perturbations
to word embeddings in a recurrent neural network structure,
rather than to the original input itself [107]. Following this
success, (virtual) adversarial training has also been applied
to speech emotion recognition in [108]. Results in [108]
demonstrate that, the classification accuracy as well as the
system's overall generalisation capability can be improved.
VII. THE ROAD AHEAD
Considerable progress has been made in alleviating some of
the challenges related to affective computing and sentiment
analysis through the use of adversarial training, for example,
synthesising and transforming image-based emotions through
cycleGAN, augmenting data by artificially generating sam-
ples, extracting robust representations via domain adversarial
training. A detailed summary of these works can be found in
Table II. However, large scale breakthroughs are still required
in both the theorem of adversarial training and its applications
to fully realise the potential of this paradigm in affective
computing and sentiment analysis.
A. Limitations of Adversarial Training
Arguably, the two major open research challenges relating to
adversarial training are training instability and mode collapse.
Solving these fundamental concerns will help facilitate its
application to affective computing and sentiment analysis.
1) Training Instability: In the adversarial training process,
ensuring that there is balance and synchronization between the
two adversarial networks plays an important role in obtaining
reliable results [16]. That is, the goal optimisation of adver-
sarial training lies in finding a saddle point of, rather than
a local minimum between, the two adversarial components.
The inherent difficulty in controlling the synchronisation of
the two adversarial networks increases the risk of instability
in the training process.
To date, researchers have made several attempts to address
this problem. For example, the implementation of Wasserstein
distance rather than the conventional JS divergence partially
solves the vanishing gradient problem associated with im-
provements in the ability of the discriminator to separate the
real and generated samples [58]. Furthermore, the convergence
of the model and the existence of the equilibrium point have
yet to be theoretically proven [109]. Therefore, it remains an
open research direction to further optimise the training process.
9
2) Mode Collapse: Mode collapse occurs when the the
generator exhibits very limited diversity among generated
samples, thus reducing the usefulness of the learnt GANs.
This effect can be observed as the generated samples can
be integrated into a small subset of similar samples (partial
collapse), or even a single sample (complete collapse).
Novel approaches dedicated to solving the mode collapse
problem are continually emerging. For example,
the loss
function of the generator can be modified to factor in the
diversity of generated samples in batches [110]. Alternatively,
the unroll-GAN allows the generator to 'unroll' the updates
of the discriminator in a manner which is fully differen-
tiable [111], and the AdaGAN combines an ensemble of GANs
in a boosting framework to ensure diversity [112].
B. Other Ongoing Breakthroughs
In most conditional GAN frameworks, the emotional entity
is generated by utilising discrete emotional categories as the
condition controller. However, emotions are more than these
basic categories (e. g., Ekman's Six Basic Emotions), and to
date, more subtle emotional expressions have been largely
overlooked in the literature. While some studies have started
addressing this issue in image processing studies (cf. Sec-
tion IV), it is still one of the major research white spots
in speech and text processing. Therefore, using a more soft
condition to replace the controller remains an open research
direction.
To the best of our knowledge, GAN-based emotional speech
synthesis has yet to be addressed in the relevant literature.
This could be due in part to Speech Emotion Recognition
(SER) being a less mature field of research, which leads to
a limited capability to distinguish the emotions using speech
and thus provides deductible contributions to optimise the
generator. However, with the ongoing development of SER
and the already discussed success of GANs in conventional
speech synthesis [113] and image/video and text generation
(cf. Section IV), we strongly believe that major breakthroughs
will be made in this area sometime in the near future.
Similarly, current state-of-the-art emotion conversion sys-
tems are based on the transformation of static images. How-
ever, transforming emotions in the dynamic sequential signals,
such as speech, video, and text, remains challenging. This most
likely relates to the difficulties associated with sequence-based
discriminator and sequence generation. However, the state-of-
the-art performance achieved with generative models, such as
WaveGAN, indicate that adversarial training can play a key
role in helping to break through these barriers.
Additionally, when comparing the performance of different
GAN-based models, a fair comparison is vital but not straight-
forward. In [85], the authors demonstrated that their proposed
I2P-GAN outperforms SeqGAN when generating poetry from
given images, reporting higher scores on evaluation metrics
including BLEU, novelty, and relevance. Also, it has been
claimed that InfoGAN converges faster than a conventional
GAN framework [69]. However, it should be noted that, a
fair experimental comparison of various generative adver-
training models associated with affective computing
sarial
TABLE II: A summary of adversarial training studies in affective computing and sentiment analysis. These studies are listed
by their applied tasks (SYN: synthesis, CVS: conversion, DA: data augmentation, DAT: domain adversarial training, AT:
adversarial training, VAT: virtual adversarial training), modalities, and published years. GATH: generative adversarial talking
head, ASPD: adversarial shared-private model.
10
modality
image
model
DCGAN
paper
Radfod et al. [19]
Chen et al. [69]
Huang & Khan [51]
Melis & Amores [83]
Bao et al. [49]
Pham et al. [81]
Song et al. [82]
Nojavansghari et al. [50]
year
2016
2016
2017
2017
2018
2018
2018
2018
task
SYN
SYN
SYN
SYN
SYN
SYN
SYN
SYN
image
image/video
Image (art)
image
image/video
image/video
image
infoGAN
DyadGAN
cGAN
identity
GAN
GATH
cGAN
DyadGAN
RNN)
cGAN
preserving
(with
Wang & Arit`eres [84]
2018
SYN
motion
Rajeswar et al. [14]
Liu et al. [85]
Fedus et al. [21]
Perarnau et al. [92]
Zhou & Shi [89]
Song et al. [90]
Qiao et al. [38]
Ding et al. [88]
Lee et al. [93]
Gao et al. [15]
Zhu et al. [96]
Sahu et al. [97]
Ganin et al. [98]
Chen et al. [12]
Zhang et al. [95]
Li et al. [99]
Zhao et al. [101]
Shen et al. [100]
Liu et al. [102]
Chen & Cardie [103]
Mohammed & Busso [55]
Chang & Scherer [105]
Deng et al. [54]
Han et al. [20]
Miyato et al. [107]
Sahu et al. [108]
2017
2018
2018
2016
2017
2017
2018
2018
2018
2018
2018
SYN
SYN
SYN
CVS
CVS
CVS
CVS
CVS
CVS
CVS
DA
2017
DA
2016
2017
2017
2017
2018
2018
2018
2018
2018
2017
2017
2018
2017
2018
DAT
DAT
DAT
DAT
DAT
DAT
DAT
DAT
DAT
AT
AT
AT
VAT/AT
VAT/AT
text
text (poetry)
text
(W)GAN-GP
I2P-GAN
maskGAN
image
image
image
image
image
text
speech
image
speech
text
text
text
text
text
text
text
text
speech
speech
speech
speech
text
speech
IcGAN
cGAN
G2-GAN
GC-GAN
exprGAN
cycleGAN
voiceGAN
cycleGAN
adversarial AE
DANN
DANN
DANN
DANN
multisource DANN
DANN
ASPD
multinomial ASPD
DANN
DCGAN
GAN
cGAN
/
DNN
note
vector arithmetic can be done in latent vector space, e. g.,
smiling woman - neutral woman + neutral man = smiling man
latent code can be interpreted; support gradual transformation
interaction scenario; identity + attribute from the interviewee
generate emotional artwork
the identity and attributes of faces are separated
conditioned by AU; from static image to dynamic video
static image to dynamic video, conditioned by audio sequences
interaction scenario; smooth the video synthesis with context
information
to simulate a latent vector with seq2seq AE; controlled by
emotion
gradient penalty; generate sequences with fixed length
multi-adversarial training; generate poetry from images
based on actor-critic cGAN; generate sequences with fixed
length
interpretable latent code; support gradual transformation
learn the difference between the source and target emotions
by adversarial autoencoder
geometry-guided, similar to cycleGAN
geometry-contrastive learning; the attribute and identity fea-
tures are separated in the learning process
intensity can be controlled
no need of paired data; emotion scalable
no need of paired data
transfer data from A to B; require no further labelling process
on the transferred data
use GMM built on the original data to label generated data
->noisy data; sensitive to mode collapse
first work in domain adversarial training
semi-supervised supported; Wasserstein distance used for
smoothing training process
attention scoring network is added for document embedding
with attention mechanisms
extended for multiple sources
Wasserstein distance guided to optimise domain discriminator
for multi-task; semi-supervised friendly
multinomial discriminator for multi-domain
adapted for speech emotion recognition
spectrograms with fixed width are randomly selected and
chopped from a varied length of audio files
use hidden-layer representations from discriminator
regularisation: joint distribution
first work on virtual adversarial training
first work for speech emotion recognition
to be reported,
to answer
and sentiment analysis has yet
questions such as which model is faster, more accurate, or
easier to implement. This absence is mainly due to the lack
of benchmark datasets and thoughtfully designed metrics for
each specific application (i. e., emotion generation, emotion
conversion, and emotion perception and understanding).
Finally, we envisage that, GAN-based end-to-end emotional
dialogue systems can succeed the speech-to-text (i. e., ASR)
and the text-to-speech (i. e., TTS) processes currently used
in conventional dialogue systems. This is motivated by the
construct that humans generally do not consciously convert
speech into text during conversations [114]. The advantage
of this approach is that it avoids the risk of the possible
information loss during this internal process. Such an end-
to-end emotional framework would further facilitate the next
generation of more human-like dialogue systems.
VIII. CONCLUSION
Motivated by the ongoing success and achievements associated
with adversarial training in artificial intelligence, this article
summarised the most recent advances of adversarial training
in affective computing and sentiment analysis. Covering the
audio, image/video, and text modalities, this overview included
technologies and paradigms relating to both emotion synthesis
and conversion as well as emotion perception and understand-
ing. Generally speaking, not only have adversarial training
techniques made great contributions to the development of
corresponding generative models, but they are also helpful
and instructive for related discriminative models. We have
also drawn attention to further research efforts aimed at
leveraging the highlighted advantages of adversarial training.
If successfully implemented, such techniques will inspire and
foster the new generation of robust affective computing and
sentiment analysis technologies that are capable of widespread
in-the-wild deployment.
ACKNOWLEDGMENT
This work has been supported by the EU's Horizon 2020 Pro-
gramme through the Innovation Action No. 645094 (SEWA),
the EU's Horizon 2020 / EFPIA Innovative Medicines Initia-
tive through GA No. 115902 (RADAR-CNS), and the UK's
Economic & Social Research Council through the research
Grant No. HJ-253479 (ACLEW).
REFERENCES
[1] R. Picard, Affective computing. Cambridge, MA: MIT Press, 1997.
[2] M. Minsky, The emotion machine: Commonsense thinking, artificial
intelligence, and the future of the human mind. New York, NY: Simon
and Schuster, 2007.
[3] M. Pantic, N. Sebe, J. F. Cohn, and T. Huang, "Affective multimodal
human -- computer interaction," in Proc. 13th ACM International Con-
ference on Multimedia (MM), Singapore, 2005, pp. 669 -- 676.
[4] S. Poria, E. Cambria, A. Gelbukh, F. Bisio, and A. Hussain, "Sentiment
data flow analysis by means of dynamic linguistic patterns," IEEE
Computational Intelligence Magazine, vol. 10, no. 4, pp. 26 -- 36, Nov.
2015.
[5] S. Poria, E. Cambria, A. Hussain, and G.-B. Huang, "Towards an
intelligent framework for multimodal affective data analysis," Neural
Networks, vol. 63, pp. 104 -- 116, Mar. 2015.
[6] E. Cambria, "Affective computing and sentiment analysis," IEEE
Intelligent Systems, vol. 31, no. 2, pp. 102 -- 107, Mar. 2016.
[7] T. Chen, R. Xu, Y. He, Y. Xia, and X. Wang, "Learning user and prod-
uct distributed representations using a sequence model for sentiment
analysis," IEEE Computational Intelligence Magazine, vol. 11, no. 3,
pp. 34 -- 44, Aug. 2016.
[8] J. Han, Z. Zhang, N. Cummins, F. Ringeval, and B. Schuller, "Strength
modelling for real-world automatic continuous affect recognition from
audiovisual signals," Image and Vision Computing, vol. 65, pp. 76 -- 86,
Sep. 2017.
[9] C. N. dos Santos and M. Gatti, "Deep convolutional neural networks
texts," in Proc. 25th International
for sentiment analysis of short
Conference on Computational Linguistics (COLING), Dublin, Ireland,
2014, pp. 69 -- 78.
[10] P. Tzirakis, G. Trigeorgis, M. A. Nicolaou, B. Schuller, and
S. Zafeiriou, "End-to-end multimodal emotion recognition using deep
neural networks," IEEE Journal of Selected Topics in Signal Process-
ing, Special Issue on End-to-End Speech and Language Processing,
vol. 11, no. 8, pp. 1301 -- 1309, Dec. 2017.
[11] Z. Zhang, N. Cummins, and B. Schuller, "Advanced data exploitation
for speech analysis -- an overview," IEEE Signal Processing Magazine,
vol. 34, no. 4, pp. 107 -- 129, July 2017.
[12] X. Chen, Y. Sun, B. Athiwaratkun, C. Cardie, and K. Weinberger,
"Adversarial deep averaging networks for cross-lingual sentiment clas-
sification," arXiv preprint arXiv:1606.01614, Apr. 2017.
[13] J. Deng, X. Xu, Z. Zhang, S. Fruhholz, and B. Schuller, "Semisu-
pervised autoencoders for speech emotion recognition," IEEE/ACM
Transactions on Audio, Speech, and Language Processing, vol. 26,
no. 1, pp. 31 -- 43, Jan. 2018.
[14] S. Subramanian, S. Rajeswar, F. Dutil, C. Pal, and A. C. Courville,
"Adversarial generation of natural language," in Proc. 2nd Workshop
on Representation Learning for NLP (Rep4NLP@ACL), Vancouver,
Canada, 2017, pp. 241 -- 251.
[15] Y. Gao, R. Singh, and B. Raj, "Voice impersonation using generative
adversarial networks," in Proc. IEEE International Conference on
Acoustics, Speech and Signal Processing (ICASSP), Calgary, Canada,
2018, pp. 2506 -- 2510.
11
[16] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley,
S. Ozair, A. Courville, and Y. Bengio, "Generative adversarial nets,"
in Proc. Advances in Neural Information Processing Systems (NIPS),
Montreal, Canada, 2014, pp. 2672 -- 2680.
[17] K. Wang, C. Gou, Y. Duan, Y. Lin, X. Zheng, and F.-Y. Wang, "Gen-
erative adversarial networks: Introduction and outlook," IEEE/CAA
Journal of Automatica Sinica, vol. 4, no. 4, pp. 588 -- 598, Sep. 2017.
[18] A. Creswell, T. White, V. Dumoulin, K. Arulkumaran, B. Sengupta,
and A. A. Bharath, "Generative adversarial networks: An overview,"
IEEE Signal Processing Magazine, vol. 35, no. 1, pp. 53 -- 65, Jan. 2018.
[19] A. Radford, L. Metz, and S. Chintala, "Unsupervised representation
learning with deep convolutional generative adversarial networks," San
Juan, PR, 2016.
[20] J. Han, Z. Zhang, Z. Ren, F. Ringeval, and B. Schuller, "Towards
conditional adversarial training for predicting emotions from speech,"
in Proc. IEEE International Conference on Acoustics, Speech and
Signal Processing (ICASSP), Calgary, Canada, 2018, pp. 6822 -- 6826.
[21] W. Fedus, I. Goodfellow, and A. M. Dai, "MaskGAN: Better text
generation via filling in the ," in Proc. 6th International Conference
on Learning Representations (ICLR), Vancouver, Canada, 2018.
[22] Z. Zeng, M. Pantic, G. I. Roisman, and T. S. Huang, "A survey of affect
recognition methods: Audio, visual, and spontaneous expressions,"
IEEE Transactions on Pattern Analysis and Machine Intelligence,
vol. 31, no. 1, pp. 39 -- 58, Jan. 2009.
[23] R. A. Calvo and S. D'Mello, "Affect detection: An interdisciplinary
review of models, methods, and their applications," IEEE Transactions
on Affective Computing, vol. 1, no. 1, pp. 18 -- 37, Jan. 2010.
[24] H. Gunes, B. Schuller, M. Pantic, and R. Cowie, "Emotion repre-
sentation, analysis and synthesis in continuous space: A survey," in
Proc. IEEE International Conference on Automatic Face & Gesture
Recognition and Workshops (FG), Santa Barbara, CA, 2011, pp. 827 --
834.
[25] B. Schuller, "Speech emotion recognition: Two decades in a nut-
shell, benchmarks, and ongoing trends," Communications of the ACM,
vol. 61, no. 5, pp. 90 -- 99, Apr. 2018.
[26] B. Liu, Sentiment analysis and opinion mining.
San Rafael, CA:
Morgan & Claypool Publishers, 2012.
[27] W. Medhat, A. Hassan, and H. Korashy, "Sentiment analysis algorithms
and applications: A survey," Ain Shams Engineering Journal, vol. 5,
no. 4, pp. 1093 -- 1113, Dec. 2014.
[28] B. Liu, Sentiment analysis: Mining opinions, sentiments, and emotions.
Cambridge, United Kingdom: Cambridge University Press, June 2015.
[29] E. Cambria, S. Poria, A. Gelbukh, and M. Thelwall, "Sentiment
analysis is a big suitcase," IEEE Intelligent Systems, vol. 32, no. 6,
pp. 74 -- 80, Dec. 2017.
[30] S. Poria, E. Cambria, R. Bajpai, and A. Hussain, "A review of affective
computing: From unimodal analysis to multimodal fusion," Information
Fusion, vol. 37, pp. 98 -- 125, Sep. 2017.
[31] M. Soleymani, D. Garcia, B. Jou, B. Schuller, S.-F. Chang, and
M. Pantic, "A Survey of Multimodal Sentiment Analysis," Image and
Vision Computing, vol. 65, pp. 3 -- 14, Sep. 2017.
[32] L. Zhang, S. Wang, and B. Liu, "Deep learning for sentiment analysis:
A survey," Wiley Interdisciplinary Reviews: Data Mining and Knowl-
edge Discovery, Mar. 2018, 25 pages.
[33] A. van den Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals,
A. Graves, N. Kalchbrenner, A. W. Senior, and K. Kavukcuoglu,
raw audio," arXiv preprint
"WaveNet: A generative model
arXiv:1609.03499, Sep. 2016.
[34] A. van den Oord, N. Kalchbrenner, and K. Kavukcuoglu, "Pixel
recurrent neural networks," in Proc. 33rd International Conference on
Machine Learning (ICML), New York City, NY, 2016, pp. 1747 -- 1756.
[35] D. P. Kingma and M. Welling, "Auto-encoding variational Bayes,"
for
arXiv preprint arXiv:1312.6114, Dec. 2013.
[36] Y. Lee, A. Rabiee, and S.-Y. Lee, "Emotional end-to-end neural speech
synthesizer," arXiv preprint arXiv:1711.05447, Nov. 2017.
[37] K. Akuzawa, Y. Iwasawa, and Y. Matsuo, "Expressive speech synthe-
sis via modeling expressions with variational autoencoder," in Proc.
Annual Conference of the International Speech Communication Asso-
ciation (INTERSPEECH), Hyderabad, India.
[38] F. Qiao, N. Yao, Z. Jiao, Z. Li, H. Chen, and H. Wang, "Geometry-
contrastive generative adversarial network for facial expression synthe-
sis," arXiv preprint arXiv:1802.01822, Feb. 2018.
[39] H. Zhou, M. Huang, T. Zhang, X. Zhu, and B. Liu, "Emotional
chatting machine: Emotional conversation generation with internal and
external memory," in Proc. 32nd Conference on Association for the
Advancement of Artificial Intelligence (AAAI), New Orleans, LA, 2018,
pp. 730 -- 738.
[40] B. Schuller, B. Vlasenko, F. Eyben, M. Wollmer, A. Stuhlsatz, A. Wen-
demuth, and G. Rigoll, "Cross-corpus acoustic emotion recognition:
Variances and strategies," IEEE Transactions on Affective Computing,
vol. 1, no. 2, pp. 119 -- 131, July 2010.
[41] J. Han, Z. Zhang, M. Schmitt, M. Pantic, and B. Schuller, "From hard to
soft: Towards more human-like emotion recognition by modelling the
perception uncertainty," in Proc. 25th ACM International Conference
on Multimedia (MM), Mountain View, CA, 2017, pp. 890 -- 897.
[42] Y. Kim, H. Lee, and E. M. Provost, "Deep learning for robust
feature generation in audiovisual emotion recognition," in Proc. IEEE
International Conference on Acoustics, Speech and Signal Processing
(ICASSP), Vancouver, Canada, 2013, pp. 3687 -- 3691.
[43] N. Cummins, S. Amiriparian, G. Hagerer, A. Batliner, S. Steidl, and
B. Schuller, "An image-based deep spectrum feature representation for
the recognition of emotional speech," in Proc. 25th ACM International
Conference on Multimedia (MM), Mountain View, CA, 2017, pp. 478 --
484.
[44] Z. Zhang, J. Han, J. Deng, X. Xu, F. Ringeval, and B. Schuller,
"Leveraging unlabelled data for emotion recognition with enhanced
collaborative semi-supervised learning," IEEE Access, vol. 6, pp.
22 196 -- 22 209, Apr. 2018.
[45] S. J. Pan and Q. Yang, "A survey on transfer learning," IEEE Transac-
tions on Knowledge and Data Engineering, vol. 22, no. 10, pp. 1345 --
1359, Oct. 2010.
[46] X. Glorot, A. Bordes, and Y. Bengio, "Domain adaptation for large-
scale sentiment classification: A deep learning approach," in Proc. 28th
International Conference on Machine Learning (ICML), Bellevue, WA,
2011, pp. 513 -- 520.
[47] J. Deng, R. Xia, Z. Zhang, Y. Liu, and B. Schuller, "Introducing shared-
hidden-layer autoencoders for transfer learning and their application in
acoustic emotion recognition," in Proc. IEEE International Conference
on Acoustics, Speech and Signal Processing (ICASSP), Florence, Italy,
2014, pp. 4818 -- 4822.
[48] Q. You, J. Luo, H. Jin, and J. Yang, "Robust image sentiment analysis
using progressively trained and domain transferred deep networks," in
Proc. 29th Conference on Association for the Advancement of Artificial
Intelligence (AAAI), Austin, TX, 2015, pp. 381 -- 388.
[49] J. Bao, D. Chen, F. Wen, H. Li, and G. Hua, "Towards open-set identity
preserving face synthesis," in Proc. IEEE Conference on Computer
Vision and Pattern Recognition (CVPR), Salt Lake City, UT, 2018, pp.
6713 -- 6722.
[50] B. Nojavanasghari, Y. Huang, and S. Khan, "Interactive generative
adversarial networks for facial expression generation in dyadic inter-
actions," arXiv preprint arXiv:1801.09092, Jan. 2018.
[51] Y. Huang and S. M. Khan, "DyadGAN: Generating facial expressions
in dyadic interactions," in Proc. IEEE Conference on Computer Vision
and Pattern Recognition Workshops (CVPRW), Honolulu, HI, 2017, pp.
2259 -- 2266.
[52] K. Papineni, S. Roukos, T. Ward, and W.-J. Zhu, "BLEU: A method
for automatic evaluation of machine translation," in Proc. 40th Annual
Meeting of
the Association for Computational Linguistics (ACL),
Stroudsburg, PA, 2002, pp. 311 -- 318.
[53] C.-Y. LIN, "ROUGE: A package for automatic evaluation of sum-
maries," in Proc. Text Summarization Branches Out Workshop in ACL,
Barcelona, Spain, 2004, 8 pages.
[54] J. Deng, N. Cummins, M. Schmitt, K. Qian, F. Ringeval, and
B. Schuller, "Speech-based diagnosis of autism spectrum condition by
generative adversarial network representations," in Proc. International
Conference on Digital Health (DH), London, UK, 2017, pp. 53 -- 57.
[55] M. Abdelwahab and C. Busso, "Domain adversarial for acoustic
emotion recognition," IEEE/ACM Transactions on Audio, Speech, and
Language Processing, vol. 26, no. 12, pp. 2423 -- 2435, Dec. 2018.
[56] H. Caesar,
"Really-awesome-gan,"
https://github.com/nightrome/
[58] M. Arjovsky, S. Chintala, and L. Bottou, "Wasserstein GAN," arXiv
preprint arXiv:1701.07875, Mar. 2017.
[59] J. Zhao, M. Mathieu, and Y. LeCun, "Energy-based generative adver-
sarial network," in Proc. 5th International Conference on Learning
Representations (ICLR), Toulon, France, 2017.
[60] X. Mao, Q. Li, H. Xie, R. Y. Lau, Z. Wang, and S. Paul Smolley, "Least
squares generative adversarial networks," in Proc. IEEE International
Conference on Computer Vision (ICCV), Venice, Italy, 2017, pp. 2794 --
2802.
[61] G.-J. Qi, "Loss-sensitive generative adversarial networks on Lipschitz
densities," arXiv preprint arXiv:1701.06264, Jan. 2017.
[57] A. Hindupur,
"The-gan-zoo,"
https://github.com/hindupuravinash/
really-awesome-gan, 2017.
the-gan-zoo, 2018.
12
[62] S. Patel, A. Kakadiya, M. Mehta, R. Derasari, R. Patel, and R. Gandhi,
"Correlated discrete data generation using adversarial training," arXiv
preprint arXiv:1804.00925, 2018.
[63] T. Che, Y. Li, A. P. Jacob, Y. Bengio, and W. Li, "Mode regularized
generative adversarial networks," in Proc. 5th International Conference
on Learning Representations (ICLR), Toulon, France, 2017.
[64] M. Mirza and S. Osindero, "Conditional generative adversarial nets,"
arXiv preprint arXiv:1411.1784, June 2014.
[65] A. Odena, "Semi-supervised learning with generative adversarial net-
works," in Proc. Data-Efficient Machine Learning Workshop in ICML,
New York, NY, 2016.
[66] J. Donahue, P. Krahenbuhl, and T. Darrell, "Adversarial feature learn-
ing," in Proc. 5th International Conference on Learning Representa-
tions (ICLR), Toulon, France, 2017.
[67] J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros, "Unpaired image-to-
image translation using cycle-consistent adversarial networks," in Proc.
IEEE Conference on Computer Vision and Pattern Recognition (ICCV),
Venice, Italy, 2017, pp. 2223 -- 2232.
[68] T. Kim, M. Cha, H. Kim, J. K. Lee, and J. Kim, "Learning to discover
cross-domain relations with generative adversarial networks," in Proc.
34th International Conference on Machine Learning (ICML), Sydney,
Australia, 2017, pp. 1857 -- 1865.
[69] X. Chen, Y. Duan, R. Houthooft, J. Schulman, I. Sutskever, and
P. Abbeel, "InfoGAN: Interpretable representation learning by infor-
mation maximizing generative adversarial nets," in Proc. Advances
in Neural Information Processing Systems (NIPS), Barcelona, Spain,
2016, pp. 2172 -- 2180.
[70] L. Chongxuan, T. Xu, J. Zhu, and B. Zhang, "Triple generative
adversarial nets," in Proc. Advances in Neural Information Processing
Systems (NIPS), Long Beach, CA, 2017, pp. 4091 -- 4101.
[71] J. Luo, Y. Xu, C. Tang, and J. Lv, "Learning inverse mapping by
autoencoder based generative adversarial nets," in Proc. International
Conference on Neural Information Processing (ICONIP), Guangzhou,
China, 2017, pp. 207 -- 216.
[72] O. Mogren, "C-RNN-GAN: Continuous recurrent neural networks
with adversarial training," in Proc. Constructive Machine Learning
Workshop in NIPS, Barcelona, Spain, 2016, 6 pages.
[73] T. Xu, P. Zhang, Q. Huang, H. Zhang, Z. Gan, X. Huang, and X. He,
"AttnGAN: Fine-grained text to image generation with attentional gen-
erative adversarial networks," in Proc. IEEE Conference on Computer
Vision and Pattern Recognition (CVPR), Salt Lake City, UT, 2018, pp.
1316 -- 1324.
[74] A. Jaiswal, W. AbdAlmageed, and P. Natarajan, "CapsuleGAN: Gen-
erative adversarial capsule network," arXiv preprint arXiv:1802.06167,
Feb. 2018.
[75] A. Creswell and A. A. Bharath, "Adversarial
training for sketch
retrieval," in Proc. European Conference on Computer Vision (ECCV),
Amsterdam, Netherlands, 2016, pp. 798 -- 809.
[76] W. R. Tan, C. S. Chan, H. E. Aguirre, and K. Tanaka, "ArtGAN:
Artwork synthesis with conditional categorical GANs," in Proc. IEEE
International Conference on Image Processing (ICIP), Beijing, China,
2017, pp. 3760 -- 3764.
[77] S. Pascual, A. Bonafonte, and J. Serr`a, "SEGAN: Speech enhancement
generative adversarial network," in Proc. 18th Annual Conference of the
International Speech Communication Association (INTERSPEECH),
Stockholm, Sweden, 2017, pp. 3642 -- 3646.
[78] C. Donahue, J. McAuley, and M. Puckette, "Synthesizing audio with
generative adversarial networks," in Proc. Workshop in 6th Interna-
tional Conference on Learning Representations (ICLR), Vancouver,
Canada, 2018.
[79] A. van den Oord, N. Kalchbrenner, L. Espeholt, O. Vinyals, A. Graves,
and K. Kavukcuoglu, "Conditional image generation with PixelCNN
decoders," in Proc. Advances in Neural Information Processing Systems
(NIPS), Barcelona, Spain, 2016, pp. 4790 -- 4798.
[80] I. Caswell, O. Sen, and A. Nie, "Exploring adversarial learning on
neural network models for text classification," 2015.
[81] H. X. Pham, Y. Wang, and V. Pavlovic, "Generative adversarial talking
head: Bringing portraits to life with a weakly supervised neural
network," arXiv preprint arXiv:1803.07716, Mar. 2018.
[82] Y. Song, J. Zhu, X. Wang, and H. Qi, "Talking face genera-
tion by conditional recurrent adversarial network," arXiv preprint
arXiv:1804.04786, Apr. 2018.
[83] D. Alvarez-Melis and J. Amores, "The emotional GAN: Priming
adversarial generation of art with emotion," in Proc. Advances in
Neural Information Processing Systems (NIPS), Long Beach, CA,
2017, 4 pages.
[84] Q. Wang and T. Arti`eres, "Motion capture synthesis with adversarial
learning," in Proc. 17th International Conference on Intelligent Virtual
Agents (IVA), Stockholm, Sweden, 2017, pp. 467 -- 470.
[85] B. Liu, J. Fu, M. P. Kato, and M. Yoshikawa, "Beyond narrative
description: Generating poetry from images by multi-adversarial train-
ing," arXiv preprint arXiv:1804.08473, Apr. 2018.
[86] L. Yu, W. Zhang, J. Wang, and Y. Yu, "SeqGAN: Sequence generative
adversarial nets with policy gradient." in Proc. 31st Conference on
Association for the Advancement of Artificial Intelligence (AAAI), San
Francisco, CA, 2017, pp. 2852 -- 2858.
[87] J. Li, W. Monroe, T. Shi, S. Jean, A. Ritter, and D. Jurafsky, "Adver-
sarial learning for neural dialogue generation," in Proc. Conference
on Empirical Methods in Natural Language Processing (EMNLP),
Copenhagen, Denmark, 2017, pp. 2157 -- 2169.
[88] H. Ding, K. Sricharan, and R. Chellappa, "ExprGAN: Facial expression
editing with controllable expression intensity," in Proc. 32nd Con-
ference on Association for the Advancement of Artificial Intelligence
(AAAI), New Orleans, LA, 2018, pp. 6781 -- 6788.
[89] Y. Zhou and B. E. Shi, "Photorealistic facial expression synthesis by
the conditional difference adversarial autoencoder," in Proc. 7th Inter-
national Conference on Affective Computing and Intelligent Interaction
(ACII), San Antonio, TX, 2017, pp. 370 -- 376.
[90] L. Song, Z. Lu, R. He, Z. Sun, and T. Tan, "Geometry guided adversar-
ial facial expression synthesis," arXiv preprint arXiv:1712.03474, Dec.
2017.
[91] C. Hsu, H. Hwang, Y. Wu, Y. Tsao, and H. Wang, "Voice conversion
from unaligned corpora using variational autoencoding Wasserstein
generative adversarial networks," in Proc. 18th Annual Conference
of
the International Speech Communication Association (INTER-
SPEECH), Stockholm, Sweden, 2017, pp. 3364 -- 3368.
[92] G. Perarnau, J. van de Weijer, B. Raducanu, and J. M.
´Alvarez,
"Invertible conditional gans for image editing," in Proc. Adversarial
Training Workshop in NIPS, Barcelona, Spain, 2016.
[93] C. Lee, Y. Wang, T. Hsu, K. Chen, H. Lee, and L. Lee, "Scalable
sentiment for sequence-to-sequence chatbot response with performance
analysis," in Proc. IEEE International Conference on Acoustics, Speech
and Signal Processing (ICASSP), Calgary, Canada, 2018, pp. 6164 --
6168.
[94] B. Schuller, Z. Zhang, F. Weninger, and F. Burkhardt, "Synthesized
speech for model training in cross-corpus recognition of human emo-
tion," International Journal of Speech Technology, Special Issue on
New and Improved Advances in Speaker Recognition Technologies,
vol. 15, no. 3, pp. 313 -- 323, Sep. 2012.
[95] Y. Zhang, R. Barzilay, and T. S. Jaakkola, "Aspect-augmented adver-
sarial networks for domain adaptation," Transactions of the Association
for Computational Linguistics, vol. 5, pp. 515 -- 528, Dec. 2017.
[96] X. Zhu, Y. Liu, J. Li, T. Wan, and Z. Qin, "Emotion classification
with data augmentation using generative adversarial networks," in Proc.
Pacific-Asia Conference on Knowledge Discovery and Data Mining
(PAKDD), Melbourne, Australia, 2018, pp. 349 -- 360.
[97] S. Sahu, R. Gupta, G. Sivaraman, W. AbdAlmageed, and C. Y. Espy-
Wilson, "Adversarial auto-encoders for speech based emotion recogni-
tion," in Proc. 18th Annual Conference of the International Speech
Communication Association (INTERSPEECH), Stockholm, Sweden,
2017, pp. 1243 -- 1247.
[98] Y. Ganin, E. Ustinova, H. Ajakan, P. Germain, H. Larochelle, F. Lavio-
lette, M. Marchand, and V. S. Lempitsky, "Domain-adversarial training
of neural networks," Journal of Machine Learning Research, vol. 17,
no. 1, pp. 2096 -- 2030, Jan. 2016.
13
[99] Z. Li, Y. Zhang, Y. Wei, Y. Wu, and Q. Yang, "End-to-end adversarial
memory network for cross-domain sentiment classification," in Proc.
26th International Joint Conference on Artificial Intelligence (IJCAI),
Melbourne, Australia, 2017, pp. 2237 -- 2243.
[100] J. Shen, Y. Qu, W. Zhang, and Y. Yu, "Wasserstein distance guided rep-
resentation learning for domain adaptation," in Proc. 32nd Conference
on Association for the Advancement of Artificial Intelligence (AAAI),
New Orleans, LA, 2018, pp. 4058 -- 4065.
[101] H. Zhao, S. Zhang, G. Wu, J. Costeira, J. Moura, and G. Gordon,
"Multiple source domain adaptation with adversarial learning," in Proc.
Workshop in 6th International Conference on Learning Representations
(ICLR), Vancouver, Canada, 2018.
[102] P. Liu, X. Qiu, and X. Huang, "Adversarial multi-task learning for text
classification," in Proc. 55th Annual Meeting of the Association for
Computational Linguistics (ACL), Vancouver, Canada, 2017, pp. 1 -- 10.
[103] X. Chen and C. Cardie, "Multinomial adversarial networks for multi-
domain text classification," in Proc. 16th Annual Conference of the
North American Chapter of the Association for Computational Lin-
guistics (NAACL), New Orleans, LA, 2018, pp. 1226 -- 1240.
[104] I. Goodfellow, J. Shlens, and C. Szegedy, "Explaining and harness-
ing adversarial examples," in Proc. 3rd International Conference on
Learning Representations (ICLR), Vancouver, Canada, 2015.
[105] J. Chang and S. Scherer, "Learning representations of emotional
speech with deep convolutional generative adversarial networks," in
Proc. IEEE International Conference on Acoustics, Speech and Signal
Processing (ICASSP), New Orleans, LA, 2017, pp. 2746 -- 2750.
[106] T. Miyato, S.-i. Maeda, M. Koyama, K. Nakae, and S. Ishii, "Dis-
tributional smoothing with virtual adversarial training," in Proc. 4th
International Conference on Learning Representations (ICLR), San
Juan, PR, 2016.
[107] T. Miyato, A. M. Dai, and I. Goodfellow, "Adversarial training methods
for semi-supervised text classification," in Proc. 5th International
Conference on Learning Representations (ICLR), Toulon, France, 2017.
[108] S. Sahu, R. Gupta, G. Sivaraman, and C. Espy-Wilson, "Smoothing
model predictions using adversarial training procedures for speech
based emotion recognition," in Proc. IEEE International Conference on
Acoustics, Speech and Signal Processing (ICASSP), Calgary, Canada,
2018, pp. 4934 -- 4938.
[109] S. Arora, R. Ge, Y. Liang, T. Ma, and Y. Zhang, "Generalization
and equilibrium in Generative Adversarial Nets (GANs)," in Proc.
34th International Conference on Machine Learning (ICML), Sydney,
Australia, 2017, pp. 224 -- 232.
[110] T. Salimans, I. Goodfellow, W. Zaremba, V. Cheung, A. Radford, and
X. Chen, "Improved techniques for training GANs," in Proc. Advances
in Neural Information Processing Systems (NIPS), Barcelona, Spain,
2016, pp. 2226 -- 2234.
[111] L. Metz, B. Poole, D. Pfau, and J. Sohl-Dickstein, "Unrolled gener-
ative adversarial networks," in Proc. 5th International Conference on
Learning Representations (ICLR), Toulon, France, 2017.
[112] I. O. Tolstikhin, S. Gelly, O. Bousquet, C. Simon-Gabriel, and
B. Scholkopf, "AdaGAN: Boosting generative models," in Proc. Ad-
vances in Neural Information Processing Systems (NIPS), Long Beach,
CA, 2017, pp. 5430 -- 5439.
[113] S. Yang, L. Xie, X. Chen, X. Lou, X. Zhu, D. Huang, and H. Li,
"Statistical parametric speech synthesis using generative adversarial
networks under a multi-task learning framework," in Proc. IEEE
Automatic Speech Recognition and Understanding Workshop (ASRU),
Okinawa, Japan, 2017, pp. 685 -- 691.
[114] R. I. Dunbar, A. Marriott, and N. D. Duncan, "Human conversational
behavior," Human Nature, vol. 8, no. 3, pp. 231 -- 246, Sep. 1997.
|
1907.05084 | 1 | 1907 | 2019-07-11T10:06:20 | MeetUp! A Corpus of Joint Activity Dialogues in a Visual Environment | [
"cs.CL",
"cs.CV"
] | Building computer systems that can converse about their visual environment is one of the oldest concerns of research in Artificial Intelligence and Computational Linguistics (see, for example, Winograd's 1972 SHRDLU system). Only recently, however, have methods from computer vision and natural language processing become powerful enough to make this vision seem more attainable. Pushed especially by developments in computer vision, many data sets and collection environments have recently been published that bring together verbal interaction and visual processing. Here, we argue that these datasets tend to oversimplify the dialogue part, and we propose a task---MeetUp!---that requires both visual and conversational grounding, and that makes stronger demands on representations of the discourse. MeetUp! is a two-player coordination game where players move in a visual environment, with the objective of finding each other. To do so, they must talk about what they see, and achieve mutual understanding. We describe a data collection and show that the resulting dialogues indeed exhibit the dialogue phenomena of interest, while also challenging the language & vision aspect. | cs.CL | cs | Meet Up! A Corpus of Joint Activity
Dialogues in a Visual Environment
Nikolai Ilinykh Sina Zarriess David Schlangen(cid:63)
Dialogue Systems Group, Bielefeld University
(cid:63)Computational Linguistics, University of Potsdam
first.last@uni-{bielefeldpotsdam}.de
9
1
0
2
l
u
J
1
1
]
L
C
.
s
c
[
1
v
4
8
0
5
0
.
7
0
9
1
:
v
i
X
r
a
Abstract
Building computer systems that can converse
about their visual environment is one of the
oldest concerns of research in Artificial Intelli-
gence and Computational Linguistics (see, for
example, Winograd's 1972 SHRDLU system).
Only recently, however, have methods from
computer vision and natural language process-
ing become powerful enough to make this vi-
sion seem more attainable. Pushed especially
by developments in computer vision, many
data sets and collection environments have re-
cently been published that bring together ver-
bal interaction and visual processing. Here, we
argue that these datasets tend to oversimplify
the dialogue part, and we propose a task --
MeetUp! -- that requires both visual and con-
versational grounding, and that makes stronger
demands on representations of the discourse.
MeetUp! is a two-player coordination game
where players move in a visual environment,
with the objective of finding each other. To
do so, they must talk about what they see, and
achieve mutual understanding. We describe a
data collection and show that the resulting di-
alogues indeed exhibit the dialogue phenom-
ena of interest, while also challenging the lan-
guage & vision aspect.
Introduction
1
In recent years, there has been an explosion of in-
terest in language & vision in the NLP commu-
nity, leading to systems and models able to ground
the meaning of words and sentences in visual rep-
resentations of their corresponding referents, e.g.
work in object recognition (Szegedy et al., 2015),
image captioning (Fang et al., 2015; Devlin et al.,
2015; Chen and Lawrence Zitnick, 2015; Vinyals
et al., 2015; Bernardi et al., 2016), referring ex-
pression resolution and generation (Kazemzadeh
et al., 2014; Mao et al., 2015; Yu et al., 2016;
Schlangen et al., 2016), multi-modal distributional
semantics (Kiela and Bottou, 2014; Silberer and
Lapata, 2014; Lazaridou et al., 2015), and many
others.
While these approaches focus entirely on visual
grounding in a static setup, a range of recent ini-
tiatives have extended exisiting data sets and mod-
els to more interactive settings. Here, speakers
do not only describe a single image or object in
an isolated utterance, but engage in some type of
multi-turn interaction to solve a given task (Das
et al., 2017b; De Vries et al., 2017).
In theory,
these data sets should allow for more dynamic ap-
proaches to grounding in natural language interac-
tion, where words or phrases do not simply have
a static multi-modal meaning (as in existing mod-
els for distributional semantics, for instance), but,
instead, where the meaning of an utterance is ne-
gotiated and established during interaction. Thus,
ideally, these data sets should lead to models that
combine visual grounding in the sense of Harnard
(1990) and conversational grounding in the sense
of Clark et al. (1991).
In practice, however, it turns out to be surpris-
ingly difficult to come up with data collection set-
ups that lead to interesting studies of both these
aspects of grounding. Existing tasks still adopt
a very rigid interaction protocol, where e.g. an
asymmetric interaction between a question asker
and a question answerer produces uniform se-
quences of question-answer pairs (as in the "Vi-
sual Dialogue" setting of Das et al. (2017b) for in-
stance). Here, it is impossible to model e.g. turn-
taking, clarification, collaborative utterance con-
struction, which are typical phenomena of conver-
sational grounding in interaction (Clark, 1996b).
Others tasks follow the traditional idea of the re-
ference game (Rosenberg and Cohen, 1964; Clark
and Wilkes-Gibbs, 1986) in some way, but try to
set up the game such that the referent can only be
established in a sequence of turns (e.g. De Vries
et al., 2017). While this approach leads to goal-
oriented dialogue, the goal is still directly related
to reference and visual grounding. However, re-
alistic, every-day communication between human
speakers rarely centers entirely around establish-
ing reference.
It has been argued in the litera-
ture that reference production radically changes
if it is the primary goal of an interactive game,
rather than embedded in a dialogue that tries to
achieve a more high-level communicative goal
(Stent, 2011).
Another strand of recent work extends the en-
vironments about which the language can talk to
(simulated) 3D environments (Savva et al. (2019,
2017); see Byron et al. (2007) for an early precur-
sor). On the language side, however, the tasks that
have been proposed in these environments allow
only limited interactivity (navigation, e.g. Ander-
son et al. (2018); Ma et al. (2019); question an-
swering, Das et al. (2017a)).
Figure 1: The game interface
What is lacking in these tasks is a real sense of
the interaction being a joint task for which both
participants are equally responsible, and, phrased
more technically, any need for the participants to
jointly attempt to track the dialogue state. In this
paper, we propose a new task, MeetUp!, for visu-
ally grounded interaction, which is aimed at col-
lecting conversations about and within a visual
world, in a collaborative setting. (Figure 1 gives
a view of the game interface and an excerpt of an
ongoing interaction.)
Our setup extends recent efforts along three
main dimensions: 1) the task's main goal can be
defined independently of reference, in high-level
communicative terms (namely "try to meet up in
an unknown environment"), 2) the task is sym-
metric and does not need a rigid interaction proto-
col (there is no instruction giver/follower), 3) the
requirement to agree on the game state (see be-
low) ensures that the task is a true joint activity
(Clark, 1996a), which in turn brings out opportu-
nity for meta-semantic interaction and negotiation
about perceptual classifications ("there is a mir-
ror" -- "hm, could it be a picture?". This is an im-
portant phenomenon absent from all major current
language & vision datasets.
This brings our dataset closer to those of un-
restricted natural situated dialogue, e.g. (Ander-
son et al., 1991; Fern´andez and Schlangen, 2007;
Tokunaga et al., 2012; Zarriess et al., 2016), while
still affording us some control over the expected
range of phenomena, following our design goal
of creating a challenging, but not too challenging
modelling resource. The crowd-sourced nature of
the collection also allows us to create a resource
that is an order of magnitude larger than those just
mentioned.1
We present our data collection of over 400 di-
alogues in this domain, providing an overview
of the characteristics and an analysis of some
occuring phenomena.
Results indicate that
the task leads to rich, natural and varied di-
alogue where speakers use a range of strate-
gies to achieve communicative grounding. The
data is available from https://github.com/
clp-research/meetup .
2 The Meet Up Game
MeetUp! is a two-player coordination game.
In
the discrete version described here, it is played on
a gameboard that can be formalised as a connected
subgraph of a two-dimensional grid graph.2 See
Figure 2 for an example.
Players are located at vertices in the graph,
which we call "rooms". Players never see a rep-
1Haber et al. (2019) present a concurrently collected
dataset that followed very similar aims (and is even larger);
their setting however does not include any navigational as-
pects and concentrates on reaching agreement of whether im-
ages are shared between the participants or not.
2The game could also be realised in an environment that
allows for continuous movement and possibly interaction
with objects, for example as provided by the simulators dis-
cussed above. This would complicate the navigation and vi-
sual grounding aspects (bringing those more in line with the
"vision-and-language navigation task"; (e.g. Anderson et al.,
2018; Ma et al., 2019)), but not the coordination aspect. As
our focus for now is on the latter, we begin with the discrete
variant.
resentation of the whole gameboard, they only see
their current room (as an image). They also do
not see each other's location. The images rep-
resenting rooms are of different types; here, dif-
ferent types of real-world scenes, such as "bath-
room", "garage", etc., taken from the ADE20k
corpus collected by Zhou et al. (2017). Players
can move from room to room, if there is a con-
necting edge on the gameboard. On entering a
room, the player is (privately) informed about the
available exit directions as cardinal directions, e.g.
"north", "south", etc., and (privately) shown the
image that represents the room. Players move
by issuing commands to the game; these are not
shown to the other player.
Figure 2: An abstract layout with room types (left), and
a full gameboard with assigned images (right).
The goal of the players is to be in the same lo-
cation, which means they also have to be aware
of that fact. In the variant explored here, the goal
is constrained in advance in that the meetup room
has to be of a certain type previously announced
to the players; e.g., a kitchen. The players can
communicate via text messages. As they do not
see each other's location, they have to describe the
images they see to ascertain whether or not they
are currently in the same room, and move to a dif-
ferent room if they decide that they aren't. If they
have reached the conclusion that they are, they can
decide to end the game, which they do via a spe-
cial command. If they are then indeed in the the
same room, and it is of the target type, the game is
counted as a success, of which they are informed.
The gameboard can be arranged such that there is
type-level ambiguity; for example, there may be
more than one room of type "bedroom" (as in Fig-
ure 2).
The game as implemented does not impose
strict turn taking on the players; however, mes-
sages are only shown to the other player once they
are sent via pressing the return key, as is usual in
chat tools. There is thus no possibility for perceiv-
ably overlapping actions, but it may happen that
both players have been typing at the same time
and the message that is received second is not a
response to the first.
To make this more concrete, and to explain our
expectations with respect to phenomena and re-
quired capabilities, we show a realistic, but com-
pressed and constructed example of an interaction
in this domain in the following. We will discuss
attested examples from our data collection further
below.
(1)
a.
Game Master: You have to meet in a room of
type utility room.
A: Hi. I'm in a bedroom with pink walls.
B: I seem to be in a kitchen.
A: I'll go look for a utility room.
A (privately): north
A (privately): west
B (privately): east
A: Found a room with a washing machine. Is
that a utility room?
B: Was wondering as well. Probably that's
what it is.
B: I'm in the pink bedroom now. I'll come to
you.
B (privately): north
B (privately): west
B: Poster above washing machine?
A: Mine has a mirror on the wall.
B: yeah, could be mirror. Plastic chair?
A: And laundry basket.
A: done
B: Same
B: done
b.
c.
d.
e.
f.
g.
h.
i.
j.
k.
l.
m.
n.
o.
p.
q.
r.
s.
In (1-a), the Game Master (realised as a soft-
ware bot in the chat software) gives the type con-
straint for the meetup room, which sets up a clas-
sification task for the players, namely to identify
rooms of this type.
(1-b) and (1-c) illustrate a
common strategy (as we will see below), which is
to start the interaction by providing state informa-
tion that potentially synchronises the mutual rep-
resentations. This is done through the production
of high-level descriptions of the current room;
for which the agents must be capable of provid-
ing scene categorisations.
(1-d) and (1-j) show,
among other things, the coordination of strat-
egy, by announcing plans for action.
In (1-e) --
(1-g), private navigation actions are performed,
which here are both epistemic actions (chang-
ing the environment to change perceptual state)
as well as pragmatic actions (task level actions
that potentially advance towards the goal), in the
sense of Kirsh and Maglio (1994). (1-h) and (1-i),
kids' roomhallbedroom 1bathroombedroom 2homeofficegarageliving roomkitchenappartmentbuilding 2appartmentbuilding 1bedroom 1bathroombedroom 2where the classification decision itself and its ba-
sis is discussed ("what is a utility room?"); and
(1-m) -- (1-o), where a classification decision is re-
vised (poster to mirror), illustrate the potential
for meta-semantic interaction. This is an im-
portant type of dialogue move (Schlangen, 2016),
which is entirely absent from most other language
and vision datasets and hence outside of the scope
of models trained on them. (1-j), also illustrates
the need for discourse memory, through the co-
reference to the earlier mentioned room where A
was at the start. Finally, (1-p) as reply to (1-o)
shows how in conversational language, dialogue
acts can be performed indirectly.
As we have illustrated with this constructed ex-
ample, the expectation is that this domain chal-
lenges a wide range of capabilities; capabilities
which so far have been captured separately (e.g.,
visual question answering, scene categorisation,
navigation based on natural language commands,
discourse co-reference), or not at all (discussion
and revision of categorisation decisions). We will
see in the next section whether this is borne out by
the data.
3 Data Collection
To test our assumptions, and to later derive models
for these phenomena, we collected a larger num-
ber of dialogues in this domain (430, to be pre-
cise). We realised the MeetUp game within the
slurk chat-tool (Schlangen et al., 2018), deployed
via the Amazon Mechanical Turk platform.
We constructed maps for the game in three
steps. First, we create a graph through a random
walk over a grid graph, constrained to creating 10
nodes. The nodes are then assigned room types, to
form what we call a layout. We identified 48 cat-
egories from the ADE20k corpus that we deemed
plausible to appear in a residential house setting,
from which we designated 20 categories as possi-
ble (easy to name) target types and the remaining
28 as distractor types. Additionally, we identified
24 plausible outdoor scene types, from which we
sampled for the leaf nodes. The full set is given in
the Appendix. We designate one type per layout
to be the target type; this type will be assigned
to 4 nodes in the graph, to achieve type ambi-
guity and potentially trigger clarification phases.
We then sample actual images from the appropri-
ate ADE20k categories, to create the gameboards.
In a final step, we randomly draw separate start-
ing positions for the players, such that both of the
players start in rooms not of the target type. For
each run of the game, we randomly create a new
gameboard following this recipe.
We deployed the game as a web application, en-
listing workers via the Mechanical Turk platform.
After reading a short description of the game (sim-
ilar to that at the beginning of Section 2, but ex-
plaining the interface in more detail), workers who
accepted the task were transferred to a waiting
area in our chat tool. If no other worker appeared
within a set amount of time, they were dismissed
(and payed for their waiting time). Otherwise, the
pair of users was moved to another room in the
chat tool and the game begun. Player were payed
an amount of $0.15 per minute (for a maximum
of 5 minutes per game), with a bonus of $0.10 for
successfully finishing the game (as was explained
from the start in the instruction, to provide an ad-
ditional incentive).3
4 Results
4.1 Descriptive Statistics
Over a period of 4 weeks, we collected 547 plays
of the game. Of these, 117 (21%) had to be
discarded because one player left prematurely or
technical problems occurred, which left us with
430 completed dialogues. Of these, 87% ended
successfully (players indeed ending up in the same
room, of the correct type), 10% ended with the
players being in different rooms of the correct
type; the remaining 3% ended with at least one
player not even being in a room of the target type.
Overall, we spent around $700 on the data collec-
tion.
Figure 3: Histogram of number of turns per dialogue
The average length of a dialogue was 13.2 turns
3By the time of the conference, we will publish the code
required to run this environment, as well as the data that we
collected.
0510152025303540010203040(66.9 tokens),
taking 165 seconds to produce.
(The distribution of lengths is shown in Figure 3.)
Altogether, we collected 5,695 turns, of an av-
erage length of 5.1 tokens. Over all dialogues,
2,983 word form types were introduced, leading
to a type/token ratio of 0.10. The overlap of the
vocabularies of the two players (intersection over
union) ranged from none to 0.5, with a mean of
0.11.
On average,
in each dialogue 28.3 naviga-
tion actions were performed.
(Resulting in a
MOVE/SAY ratio of a little over 2 to 1). The me-
dian time spent in a room was 12.2 secs. On aver-
age, each player visited 5.9 rooms without saying
anything; when a player said something while in a
room, they produced on average 3.5 turns. It hence
seems that, as expected, players moved through
some rooms without commenting on them, while
spending more time in others.
We calculated the contribution ratio between the
more talkative player and the less talkative one in
each dialogue, which came out as 2.4 in terms of
tokens, and 1.7 in terms of turns. This indicates
that there was a tendency for one of the players to
take a more active role. To provide a comparison,
we calculated the same for the (role-asymmetric)
MapTask dialogues (Anderson et al., 1991),4 find-
ing a 2.8 token ratio and a 1.3 turn ratio.
Figure 4: Histogram of number of tokens per turn
Figure 5: Number of Games Played, by Worker
4Using the transcripts provided at http://groups.
inf.ed.ac.uk/maptask/maptasknxt.html.
Crosstalk occurs: On average, there are 1.4 in-
stances of one turn coming within two seconds or
less than the previous one (which we arbitrarily set
as the threshold for when a turn is likely not to be
a reaction to the previous one, but rather has been
concurrently prepared). The mean pause duration
between turns of different speakers is 11.2 secs --
with a high standard deviation of 9.46, however.
This is due to the structure of the dialogues with
phases of intense communicative activity, when a
matching decision is made, and phases of individ-
ual silent navigation.
If we only take transition
times within the first 3 quartiles, the average tran-
sition time is 5.04 secs.
As Figure 4 indicates, most turns are rather
short, but there is a substantial amount of turns that
contain 4 or more tokens.
Figure 5 shows a frequency distribution of num-
ber of games played, by crowdworker. Overall,
we had 126 distinct participants (as indicated by
AMT ID). Our most prolific worker participated
in 49 games, and the majority of workers played
in more than one game.
In only 22 games, two
novices played with each other. In 81 games, there
was one novice, and in 305 games, both players
had played before. (For a few games we could not
reconstruct the workerIDs for technical reasons, so
this does not sum up to 430.)
4.2 Examples
Figure 6 shows a full interaction from the cor-
pus. The public actions are represented in bold
font, private actions are marked with "privately",
and responses by the Game Master are shown in
italics. This example has many of the features il-
lustrated with the constructed example (1) shown
earlier.
In lines 20 and 22, the players begin
the game by providing high-level categorisations
of their current positions, in effect synchronising
their mutual game representations. Lines 22 and
23 then show coordination of game playing strat-
egy. After separately moving around, individually
solving the categorisation task -- by moving through
rooms that are not of the right type -- the players
resume interaction in lines 50ff. (with 50/51 show-
ing crosstalk). Line 54 provides a justification for
the negative conclusion from line 53, by provid-
ing information that contradicts l. 52. After more
coordination of strategy in l.s 55 & 56, player B
explicitly queries for more information. In line 75,
player A justifies their positive verdict by confirm-
05101520253035400200400600800100002040608010012001020304050Figure 6: One Example Dialogue (mux36), with Images Overlayed
ing details previously given by B, extending it with
even more details. B confirms explicitly in 78, be-
fore also chosing SOLVE.
The excerpt from another dialogue in (2) shows
an example of classification uncertainty being ne-
gotiated and dealt with.
(2)
(Excerpt from mux39)
A: i think i am in a basement
B: i think i might be too.
A: maybe not though
A: wood panel?
A: two doors?
B:
there's a tan couch,
and a tan
6500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599ACL2019Submission***.ConfidentialReviewCopy.DONOTDISTRIBUTE.timemain1000:03GM(toA):url:/b/bathroom/ADE-train-00002739.jpg1200:03GM(toA):Youcango:[/s]outh[/n]orth[/w]est1400:03GM(toA):Youhavetomeetin:b/basement1500:03GM(toB):url:/a/apartment-building/outdoor/ADE-train-00001414.jpg1700:04GM(toB):Youcango:[/s]outh1900:04GM(toB):Youhavetomeetin:b/basement2000:18A:iaminthebathroom2100:29A:whereareyouat?2200:33B:I'moutside.Let'smovearoundabit.2300:38A:k2400:40B(privately):n2500:41GM(toB):Nothinghappened.Youcango:[/s]outh2600:43A(privately):s2700:44GM(toA):url:/b/bedroom/ADE-train-00003553.jpg2900:44GM(toA):Youcango:[/s]outh[/n]orth[/w]est3000:45B(privately):s3100:45GM(toB):url:/b/basement/ADE-train-00002497.jpg3300:45GM(toB):Youcango:[/s]outh[/n]orth[/e]ast3400:50A(privately):s3500:50GM(toA):url:/c/corridor/ADE-train-00006285.jpg3700:51GM(toA):Youcango:[/n]orth[/e]ast3800:52B(privately):s3900:52GM(toB):url:/l/living-room/ADE-train-00000774.jpg4100:53GM(toB):Youcango:[/s]outh[/n]orth[/e]ast4200:57B(privately):s4300:57GM(toB):url:/b/basement/ADE-train-00002482.jpg4500:57GM(toB):Youcango:[/n]orth[/e]ast4601:01A(privately):e4701:01GM(toA):url:/b/basement/ADE-train-00002494.jpg4901:01GM(toA):Youcango:[/e]ast[/w]est5001:11A:Iaminthebasement5101:11B:I'minabasement.5201:23B:Minehasawhitestaircase5301:28A:no5401:37A:minehaswoodenstaircase5501:55B:Okay.ShouldItrytomovetowardsyou?5602:09A:Sure5702:11B:Wooden?Whatelse?5802:16B(privately):e5902:17GM(toB):url:/b/bedroom/ADE-train-00003553.jpg6102:17GM(toB):Youcango:[/s]outh[/n]orth[/w]est6202:25B(privately):s6302:25GM(toB):url:/c/corridor/ADE-train-00006285.jpg6502:25GM(toB):Youcango:[/n]orth[/e]ast6602:27A:waterheaterandwasheranddryer6702:35B(privately):s6802:35GM(toB):Nothinghappened.Youcango:[/n]orth[/e]ast6902:40B(privately):e7002:40GM(toB):url:/b/basement/ADE-train-00002494.jpg7202:41GM(toB):Youcango:[/e]ast[/w]est7302:42A:aplasticchairandascreendoor7403:01GM:Attention:youareinthegamefor3minutes!7503:18B:I'mthere!Iseethewaterheater,washeranddryer,sink,chairlayingontopofthescreendoor7603:26B(privately):done7703:27GM:The'/done'commandhasbeenissuedbyyouoryourpartner.Toendthegame,bothplayersneedtoenter'/done'7803:27A:yep7903:32A(privately):done8003:34GM:Welldone!Bothofyouareindeedinthesameroomoftype:b/basement!Figure5:OneExampleDialogue(mux36)AntonvandenHengel.2018.Vision-and-LanguageNavi-gation:Interpretingvisually-groundednavigationinstruc-tionsinrealenvironments.InCVPR2018.RaffaellaBernardi,RuketCakici,DesmondElliott,AykutErdem,ErkutErdem,NazliIkizler-Cinbis,FrankKeller,AdrianMuscat,andBarbaraPlank.2016.Automaticdescriptiongenerationfromimages:Asurveyofmod-els,datasets,andevaluationmeasures.J.Artif.Int.Res.,55(1):409 -- 442.SimonBrodeur,EthanPerez,AnkeshAnand,Floriantable.
brown coffee
loveseat/chair.
bar. tv
B: nope, different room
A: ok i am not there
B: want me to meet you, or do you want to
meet me?
A: i think mine is more basement like
B: okay. i'll try to find it.
4.3 Phases and Phenomena
Figure 8: Prefixes of final turns (before done)
there a"). Using the presence of a question mark at
the end of the turn as a very rough proxy, we find
615 questions over all dialogues, which works out
as 1.43 on average per dialogue. Taking only the
successfull dialogues into account, the number is
slightly higher, at 1.48. Figure 10 shows the be-
ginnings of these turns.
5 Modelling the Game
The main task of an agent playing this game can be
modelled in the usual way of modelling agents in
dynamic environments (Sutton and Barto, 1998),
that is, as computing the best possible next action,
given what has been experienced so far. The ques-
tions then are what the range of possible actions is,
what the agent needs to remember about its expe-
rience, and what the criteria might be for selecting
the best action.
In the action space, the clearest division is be-
tween actions that are directly observable by the
other player -- actions of type SAY -- and actions
that are targeted at changing the observable game
state for the agent itself: actions of type MOVE and
the END action. Since we did not restrict what the
players could say, there is an infinite number of
SAY actions (see Cot´e et al. (2018) for a formali-
sation of such an action space).
Figure 7: Prefixes of first turns
Figure 7 shows the most frequent beginnings of
the very first turn in each dialogue. As this in-
dicates, when not opening with a greeting, players
naturally start by locating themselves (as in the ex-
ample we showed in full). Figure 8 gives a similar
view of the final turn, before the first done was
issued. This shows that the game typically ends
with an explicit mutual confirmation that the goal
condition was reached, before this was indicated
to the game.
What happens inbetween? Figure 9 shows the
most frequent overall turn beginnings. As this
illustrates, besides the frequent positive replies
("yes", "ok"; indicating a substantial involvement
of VQA-like interactions), the most frequent con-
structions seem to locate the speaker ("I'm in a")
or talk about objects ("I found a", "there is a", "is
020406080100i f o u n d o n e .wh e y ! i ' m i ni ' m i n o n eh i t h e r e , i ' mh e l l o t h e r e : )i ' v e f o u n d ai ' v e f o u n d o n e .i t h i n k i. wni a m o u t s i d eo ki a m a ti s e e ah i t h e r ei ' m a t ah e l l o t h e r ei t h i n k i ' mh e yf o u n d o n e w i t hi ' m i n t h ei m i n ai f o u n d ao k i a mo k a y i ' m i ni ' m i n ai a m i nh ih e l l o020406080100o k f o u n d i tg r e a t !a w e s o m ea w e s o m e : )i f o u n d i ti a m i nt h e r e i s at h a t s i ti ' m h e r ey e s !kg r e a tw e a r e d o n eo k i a mi s t h e r e ai t h i n k iy e s .f o u n d i t !o k a yh e r ed o n ei a m h e r ey e a hg o t i tc o o li m t h e r ef o u n d i ty e po ky e sFigure 9: Most frequent turn beginnings
Figure 10: Prefixes of questions (utt.s ending in "?")
The total game state consists of the positions of
the players on the gameboard. Of this, however,
only a part is directly accessible for either agent,
which is their own current position. The topology
of the network must be remembered from expe-
rience, if deemed to be relevant.
(From observ-
ing the actions of the players in the recorded di-
alogues, it seems unlikely that they attempted to
learn the map; they are however able to purpose-
fully return to earlier visited rooms.) More impor-
tantly, the current position of the other player is
only indirectly observable, through what they re-
port about it. Finally, as we have seen in the exam-
ples above, the players often negotiate and agree
on a current strategy (e.g., "I find you", "you find
me", "we walk around"). As this guides mutual
expectations of the players, this is also something
that needs to be tracked. On the representation
side, we can then assume that an agent will need
to track a) their own history of walking through
the map (raising interesting questions of how de-
tailed such a representation needs to be or should
be made; an artificial agent could help itself by
storing the full image for later reference, which
would presumably be not enitirely plausible cog-
nitively); b) what has been publicly said and hence
could be antecedent to later co-references; c) what
they infer about the other player's position; and d)
what they assume the current agreed upon strategy
is. This clearly is a challenging task; we will in
future work first explore hybrid approaches that
combine techniques from task-oriented dialogue
modelling (Williams and Young, 2007; Buss and
Schlangen, 2010) with more recent end-to-end ap-
proaches (Cot´e et al., 2018; Urbanek et al., 2019).
6 Conclusions
We have presented a novel situated dialogue task
that brings together visual grounding (talking
about objects in a scene), conversational ground-
ing (reaching common ground), and discourse rep-
resentation (talking about objects that were intro-
duced into the discourse, but aren't currently visi-
ble). An agent mastering this task will thus have to
combine dialogue processing skills as well as lan-
guage and vision skills. We hence hope that this
task will lead to the further development of tech-
niques that combine both. Our next step is to scale
up the collection, to a size where modern machine
learning methods can be brought to the task. Be-
sides use in modelling, however, we also think that
the corpus can be a valuable resource for linguistic
investigations into the phenomenon of negotiating
situational grounding.
0255075100125150175ok let meeyeahi think i'mi think iheydoes it havedonei'm hereim therecoolfound iti see ayepkokay i'm indo you wantis there ait has aim in ai found athere is anookayi'm in thehellohioki'm in ayes0510152025w o o d f l o o r ?d o e s i t l o o kw h e r e a b o u t s a r e y o u ?i s t h i s t h ey o u w a n t t oi t h a s ad o y o u s e ei a m i nw h i c h d i r e c t i o n d i dc a n y o u d e s c r i b ew h a t d o e s y o u r si s i t as h o u l d i t r ya r e y o u s t i l ld i d y o u f i n dw h e r e a r e y o ud o y o u k n o wi t l o o k s l i k ew h a t c o l o r i ss h o u l d i m o v ea r e y o u t h e r e ?w h a t d o e s i tw h e r e a r e y o u ?w a n t m e t oa r e y o u i ny o u t h e r e ?d o e s i t h a v e?d o y o u w a n ti s t h e r e aliving room,
jacuzzi/indoor, doorway/indoor,
Distractor room types:
home theater, storage room, hotel room,
tearoom, art studio, kinder-
veranda,
patio,
restroom/indoor, workroom, corridor, game room, pool-
car-
A Room Types
1. Target room types: bathroom, bedroom, kitchen, basement, nurs-
ery, attic, childs room, playroom, dining room, home office, staircase,
utility room,
locker room,
wine cellar/bottle storage, reading room, waiting room, balcony/interior
2.
music studio, computer room, street, yard,
garden classroom,
shower,
garage/indoor,
room/home,
port/indoor, hunting lodge/indoor
3. Outdoor room types (nodes with a single entry point): garage/outdoor,
apartment building/outdoor,
re-
stroom/outdoor,
kiosk/outdoor,
apse/outdoor, carport/outdoor, flea market/outdoor, chicken farm/outdoor,
kennel/outdoor,
washhouse/outdoor,
park-
hunting lodge/outdoor,
ing garage/outdoor, convenience store/outdoor, bistro/outdoor,
inn/outdoor,
library/outdoor
swimming pool/outdoor,
cloakroom/room,
closet, parlor, hallway,
reception,
cloister/outdoor,
diner/outdoor,
cathedral/outdoor,
newsstand/outdoor,
sewing room,
breakroom,
jacuzzi/outdoor,
doorway/outdoor,
casino/outdoor,
References
Anne H Anderson, Miles Bader, Ellen Gurman Bard, Eliza-
beth Boyle, Gwyneth Doherty, Simon Garrod, Stephen Is-
ard, Jacqueline Kowtko, Jan McAllister, Jim Miller, et al.
1991. The hcrc map task corpus. Language and speech,
34(4):351 -- 366.
Peter Anderson, Qi Wu, Damien Teney, Jake Bruce, Mark
Johnson, Niko Sunderhauf, Ian Reid, Stephen Gould, and
Anton van den Hengel. 2018. Vision-and-Language Navi-
gation: Interpreting visually-grounded navigation instruc-
tions in real environments. In CVPR 2018.
Raffaella Bernardi, Ruket Cakici, Desmond Elliott, Aykut
Erdem, Erkut Erdem, Nazli Ikizler-Cinbis, Frank Keller,
Adrian Muscat, and Barbara Plank. 2016. Automatic
description generation from images: A survey of mod-
els, datasets, and evaluation measures. J. Artif. Int. Res.,
55(1):409 -- 442.
Okko Buss and David Schlangen. 2010. Modelling sub-
utterance phenomena in spoken dialogue systems.
In
Proceedings of the 14th International Workshop on the
Semantics and Pragmatics of Dialogue (Pozdial 2010),
pages 33 -- 41, Poznan, Poland.
Donna Byron, Alexander Koller, Jon Oberlander, Laura
Stoia, and Kristina Striegnitz. 2007. Generating instruc-
tions in virtual environments (give): A challenge and an
evaluation testbed for nlg. Position Papers, page 3.
Xinlei Chen and C Lawrence Zitnick. 2015. Mind's eye: A
recurrent visual representation for image caption genera-
tion. In Proceedings of the IEEE Conference on Computer
Vision and Pattern Recognition, pages 2422 -- 2431.
Herbert H. Clark. 1996a. Using Language. Cambridge Uni-
versity Press, Cambridge.
Herbert H Clark. 1996b. Using language. 1996. Cambridge
University Press: Cambridge, pages 274 -- 296.
Herbert H Clark, Susan E Brennan, et al. 1991. Grounding
in communication. Perspectives on socially shared cogni-
tion, 13(1991):127 -- 149.
Herbert H. Clark and Deanna Wilkes-Gibbs. 1986. Referring
as a collaborative process. Cognition, 22:1 -- 39.
Marc-Alexandre Cot´e, ´Akos K´ad´ar, Xingdi Yuan, Ben Kybar-
tas, Tavian Barnes, Emery Fine, James Moore, Matthew
Hausknecht, Layla El Asri, Mahmoud Adada, Wendy Tay,
and Adam Trischler. 2018. TextWorld: A Learning Envi-
ronment for Text-based Games. ArXiv.
Abhishek Das, Samyak Datta, Georgia Gkioxari, Stefan Lee,
Devi Parikh, and Dhruv Batra. 2017a. Embodied question
answering. CoRR, abs/1711.11543.
Abhishek Das, Satwik Kottur, Khushi Gupta, Avi Singh,
Deshraj Yadav, Jos´e MF Moura, Devi Parikh, and Dhruv
Batra. 2017b. Visual dialog. In Proceedings of the IEEE
Conference on Computer Vision and Pattern Recognition,
volume 2.
Harm De Vries, Florian Strub, Sarath Chandar, Olivier
Pietquin, Hugo Larochelle, and Aaron Courville. 2017.
Guesswhat?! visual object discovery through multi-modal
dialogue. In Proc. of CVPR.
Jacob Devlin, Hao Cheng, Hao Fang, Saurabh Gupta,
Li Deng, Xiaodong He, Geoffrey Zweig, and Margaret
Mitchell. 2015. Language models for image captioning:
The quirks and what works. In Proceedings of the 53rd
Annual Meeting of the Association for Computational Lin-
guistics and the 7th International Joint Conference on
Natural Language Processing (Volume 2: Short Papers),
pages 100 -- 105, Beijing, China. Association for Computa-
tional Linguistics.
Hao Fang, Saurabh Gupta, Forrest Iandola, Rupesh Srivas-
tava, Li Deng, Piotr Dollar, Jianfeng Gao, Xiaodong He,
Margaret Mitchell, John Platt, Lawrence Zitnick, and Ge-
offrey Zweig. 2015. From captions to visual concepts and
back. In Proceedings of CVPR, Boston, MA, USA. IEEE.
Raquel Fern´andez and David Schlangen. 2007. Referring
under restricted interactivity conditions.
In Proceedings
of the 8th SIGdial Workshop on Discourse and Dialogue,
pages 136 -- 139, Antwerp, Belgium.
Janosch Haber, Tim Baumgartner, Ece Takmaz, Lieke
Gelderloos, Elia Bruni, and Raquel Fern´andez. 2019. The
PhotoBook Dataset: Building Common Ground through
Visually-Grounded Dialogue. In Proceedings of the 2019
meeting of the Association for Computational Linguistics,
Florence, Italy.
Stevan Harnard. 1990. The symbol grounding problem.
Physica D, 42:335 -- 346.
Sahar Kazemzadeh, Vicente Ordonez, Mark Matten, and
Tamara L Berg. 2014. ReferItGame: Referring to Objects
in Photographs of Natural Scenes. In Proceedings of the
Conference on Empirical Methods in Natural Language
Processing (EMNLP 2014), pages 787 -- 798, Doha, Qatar.
Douwe Kiela and L´eon Bottou. 2014. Learning image em-
beddings using convolutional neural networks for im-
proved multi-modal semantics.
In Proceedings of the
2014 Conference on Empirical Methods in Natural Lan-
guage Processing (EMNLP), pages 36 -- 45, Doha, Qatar.
Association for Computational Linguistics.
David Kirsh and Paul Maglio. 1994. On Distinguishing
Epistemic from Pragmatic Action. Cognitive Science,
18(4):513 -- 549.
Angeliki Lazaridou, Nghia The Pham, and Marco Baroni.
2015. Combining language and vision with a multimodal
skip-gram model.
In Proceedings of the 2015 Confer-
ence of the North American Chapter of the Association
for Computational Linguistics: Human Language Tech-
nologies, pages 153 -- 163, Denver, Colorado. Association
for Computational Linguistics.
Chih-Yao Ma, Jiasen Lu, Zuxuan Wu, Ghassan AlRegib,
Zsolt Kira, Richard Socher, and Caiming Xiong. 2019.
Self-Monitoring Navigation Agent via Auxiliary Progress
Estimation. ArXiv, pages 1 -- 18.
Junhua Mao, Jonathan Huang, Alexander Toshev, Oana Cam-
buru, Alan L. Yuille, and Kevin Murphy. 2015. Genera-
Sina Zarriess, Julian Hough, Casey Kennington, Ramesh
Manuvinakurike, David DeVault, Raquel Fernandez, and
David Schlangen. 2016. Pentoref: A corpus of spoken ref-
erences in task-oriented dialogues. In 10th edition of the
Language Resources and Evaluation Conference.
Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela
Barriuso, and Antonio Torralba. 2017. Scene parsing
through ade20k dataset. In Proceedings of the IEEE Con-
ference on Computer Vision and Pattern Recognition.
tion and comprehension of unambiguous object descrip-
tions. CoRR, abs/1511.02283.
Seymour Rosenberg and Bertram D. Cohen. 1964. Speakers'
and Listeners' Processes in a Word-Communication Task.
Science, 145(3637):1201 -- 1204.
Manolis Savva, Angel X. Chang, Alexey Dosovitskiy,
Thomas Funkhouser, and Vladlen Koltun. 2017. MINOS:
Multimodal indoor simulator for navigation in complex
environments. arXiv:1712.03931.
Manolis Savva, Abhishek Kadian, Oleksandr Maksymets,
Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub,
Jia Liu, Vladlen Koltun, Jitendra Malik, Devi Parikh, and
Dhruv Batra. 2019. Habitat: A Platform for Embodied AI
Research. ArXiv.
David Schlangen. 2016. Grounding, Justification, Adapta-
tion: Towards Machines That Mean What They Say. In
Proceedings of the 20th Workshop on the Semantics and
Pragmatics of Dialogue (JerSem).
David Schlangen, Tim Diekmann, Nikolai Ilinykh, and Sina
Zarriess. 2018. slurk -- A Lightweight Interaction Server
For Dialogue Experiments and Data Collection. In Short
Paper Proceedings of the 22nd Workshop on the Semantics
and Pragmatics of Dialogue (AixDial / semdial 2018).
David Schlangen, Sina Zarriess, and Casey Kennington.
2016. Resolving references to objects in photographs
using the words-as-classifiers model.
In Proceedings of
the 54rd Annual Meeting of the Association for Computa-
tional Linguistics (ACL 2016).
Carina Silberer and Mirella Lapata. 2014. Learning grounded
meaning representations with autoencoders.
In Pro-
ceedings of the 52nd Annual Meeting of the Associa-
tion for Computational Linguistics (Volume 1: Long Pa-
pers), pages 721 -- 732, Baltimore, Maryland. Association
for Computational Linguistics.
Amanda J Stent. 2011. Computational approaches to the pro-
duction of referring expressions: Dialog changes (almost)
everything. In PRE-CogSci Workshop.
Richard S. Sutton and Andrew G. Barto. 1998. Reinforce-
ment Learning. MIT Press, Cambridge, USA.
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet,
Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent
Vanhoucke, and Andrew Rabinovich. 2015. Going deeper
with convolutions. In CVPR 2015, Boston, MA, USA.
Takenobu Tokunaga, Ryu Iida, Asuka Terai, and Naoko
Kuriyama. 2012. The rex corpora: A collection of mul-
timodal corpora of referring expressions in collabora-
tive problem solving dialogues.
In Proceedings of the
Eighth International Conference on Language Resources
and Evaluation (LREC 2012).
Jack Urbanek, Angela Fan, Siddharth Karamcheti, Saachi
Jain, Samuel Humeau, Emily Dinan, Tim Rocktaschel,
Douwe Kiela, Arthur Szlam, and Jason Weston. 2019.
Learning to Speak and Act in a Fantasy Text Adventure
Game. ArXiv.
Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru
Erhan. 2015. Show and tell: A neural image caption gen-
erator. In Computer Vision and Pattern Recognition.
Jason Williams and Steve Young. 2007. Partially observ-
able Markov decision processes for spoken dialog sys-
tems. Computer Speech and Language, 21(2):231 -- 422.
Licheng Yu, Patrick Poirson, Shan Yang, Alexander C. Berg,
and Tamara L. Berg. 2016. Modeling Context in Referring
Expressions, pages 69 -- 85. Springer International Publish-
ing, Cham.
|
1701.00066 | 1 | 1701 | 2016-12-31T07:09:52 | A POS Tagger for Code Mixed Indian Social Media Text - ICON-2016 NLP Tools Contest Entry from Surukam | [
"cs.CL"
] | Building Part-of-Speech (POS) taggers for code-mixed Indian languages is a particularly challenging problem in computational linguistics due to a dearth of accurately annotated training corpora. ICON, as part of its NLP tools contest has organized this challenge as a shared task for the second consecutive year to improve the state-of-the-art. This paper describes the POS tagger built at Surukam to predict the coarse-grained and fine-grained POS tags for three language pairs - Bengali-English, Telugu-English and Hindi-English, with the text spanning three popular social media platforms - Facebook, WhatsApp and Twitter. We employed Conditional Random Fields as the sequence tagging algorithm and used a library called sklearn-crfsuite - a thin wrapper around CRFsuite for training our model. Among the features we used include - character n-grams, language information and patterns for emoji, number, punctuation and web-address. Our submissions in the constrained environment,i.e., without making any use of monolingual POS taggers or the like, obtained an overall average F1-score of 76.45%, which is comparable to the 2015 winning score of 76.79%. | cs.CL | cs | A POS Tagger for Code Mixed Indian Social Media Text - ICON-2016
NLP Tools Contest Entry from Surukam
Sree Harsha Ramesh and Raveena R Kumar
Surukam Analytics, Chennai
{harsha,raveena}@surukam.com
6
1
0
2
c
e
D
1
3
]
L
C
.
s
c
[
1
v
6
6
0
0
0
.
1
0
7
1
:
v
i
X
r
a
Abstract
Building Part-of-Speech (POS) taggers for
code-mixed Indian languages is a partic-
ularly challenging problem in computa-
tional linguistics due to a dearth of accu-
rately annotated training corpora. ICON,
as part of its NLP tools contest has or-
ganized this challenge as a shared task
for the second consecutive year to im-
prove the state-of-the-art.
This paper
describes the POS tagger built at Su-
rukam to predict the coarse-grained and
fine-grained POS tags for three language
pairs - Bengali-English, Telugu-English
and Hindi-English, with the text spanning
three popular social media platforms -
Facebook, WhatsApp and Twitter. We
employed Conditional Random Fields as
the sequence tagging algorithm and used
a library called sklearn-crfsuite - a thin
wrapper around CRFsuite for training our
model. Among the features we used in-
clude - character n-grams, language in-
formation and patterns for emoji, number,
punctuation and web-address. Our sub-
missions in the constrained environment,
i.e., without making any use of mono-
lingual POS taggers or the like, obtained
an overall average F1-score of 76.45%,
which is comparable to the 2015 winning
score of 76.79%.
1 Introduction
The burgeoning popularity of social media in In-
dia has produced enormous amounts of user gen-
erated text content.
India's rich linguistic diver-
sity coupled with its affinity towards English -
India has the largest number of speakers of En-
glish as a Second Language (ESL) in the world
- has led to the online conversations being
rife with Code Switching (CS) and Code Mix-
ing (CM). Code Switching is the practice of al-
ternating between two or more languages or vari-
eties of a language in the course of a single utter-
ance (Gumperz, 1982). In Code Switching, unlike
Code Mixing where one or more linguistic units
of a language such as phrases, words and mor-
phemes are embedded into an utterance of another
language (Myers-Scotton, 1997), there is a distinct
boundary separating the chunks corresponding to
each language used in the discourse. So, a combi-
nation of language identification and monolingual
language taggers could be used for Code Switched
utterances. Solorio and Liu (2008) used a Span-
ish POS tagger and Vyas et al. (2014) used a Hindi
POS tagger in conjunction with English monolin-
gual taggers to handle Spanish-English and Hindi-
English code-switched discourses respectively.
tagging,
and
Part-of-speech (POS)
the process
of assigning each word its proper part of
is one of the most fundamental parts
speech,
of any natural
language processing pipeline
and it is also an integral part of any syntactic
analysis.
There are highly accurate monolin-
resource-rich
gual POS taggers available for
languages like English and French,
the state-
of-the-art being 97.6% (Choi, 2016) and 97.8%
(Denis and Sagot, 2009),
in large part due to
extensively annotated million word corpora such
as PennTreeBank (Santorini, 1990) and French
TreeBank
respectively.
Annotated data for code-mixed data is extremely
scarce and the efforts to build a POS tagger for
it have mostly advanced through the shared tasks
organized
at FIRE (Choudhury et al., 2014),
EMNLP(Barman et al., 2014;
ICON(Soman, 2015;
Solorio et al., 2014)
Pimpale and Patel, 2016) in the past 2 years.
In
this paper, we describe our POS tagger for three
widely spoken Indian languages (Hindi, Bengali,
and Telugu), mixed with English, which was sub-
(Abeill´e et al., 2003)
Language
(English+)
Telugu
Hindi
Bengali
CMI
all
31.94
11.78
23.76
mixed
39.10
20.06
24.77
Num
utt.
989
882
762
Mixed
(%)
81.70
58.73
95.93
Language
(English+)
Telugu
Hindi
Bengali
CMI
all
36.55
5.88
0.31
mixed
36.88
27.60
30.05
Num
utt.
690
981
1052
Mixed
(%)
99.13
21.30
1.05
Table 1: Code-Mixing-Index: Facebook Corpus
Table 3: Code-Mixing Index: WhatsApp Corpus
Language
(English+)
Telugu
Hindi
Bengali
CMI
all
34.94
25.66
29.45
mixed
35.37
28.13
29.50
Num
utt.
991
1206
585
Mixed
(%)
98.79
91.21
99.83
Language
(English+)
Telugu
Hindi
Bengali
CMI
all
11.62
18.76
3.71
mixed
32.60
23.37
24.72
Num
utt.
617
728
3718
Mixed
(%)
35.66
80.22
15.01
Table 2: Code-Mixing Index: Twitter Corpus
Table 4: Code-Mixing Index: ICON 2015
mitted to the shared task organized at ICON 2016.
The POS tagger was trained using Conditional
Random Fields
(Lafferty et al., 2001), which
is known to perform particularly well for this
task (Toutanova et al., 2003) among many other
applications in biomedical named entity recog-
nition (Settles, 2004) and information extraction
(Ramesh et al., 2016).
2 Dataset
The contest task was to predict the POS tags at
the word level for code-mixed utterances, col-
lected from WhatsApp, Facebook and Twitter ac-
cross three language pairs, English-Hindi (En-Hi),
English-Bengali (En-Bn) and English-Telugu (En-
Te).
The words were also annotated with certain lan-
guage tags - en for English, hi/bn/te for Hindi,
Bengali and Telugu respectively, univ for punctua-
tions, emoticons, symbols, @ mentions, hashtags,
mixed for intra-word language mixing for e.g., ju-
gaading 1, acro for acronyms like lol, rofl, ne for
named entities, and undef for undefined.
Our submission included models to predict
the coarse-grained (Petrov et al., 2011) and fine-
grained POS tags (Jamatia et al., 2015) and was
trained in a constrained environment,
thus pre-
cluding any use of external POS taggers.
2.1 Code-Mixing Index
In order
gers
necessary to have a measure of
to compare code-mixed POS tag-
is
the code-
data-sets,
it
trained
on
different
1The Hindi noun jugaad which means frugal innovation
is transformed into an English verb by adding the suffix ing.
mixing complexity. Code-Mixing Index(CMI)
(Gamback and Das, 2014) is one such metric that
describes the complexity of code-switched cor-
pora and it amounts to finding the most frequent
language in the utterance and then counting the
frequency of the words belonging to all other
languages present. Thus utterances that have only
a single language, have a CMI of 0.
Tables 1, 2, 3, and 4, show the following CMI
metrics that were calculated for Facebook, Twitter,
WhatsApp data of 2016 and the training data of
ICON 2015 respectively.
1. CMI all: average CMI for all sentences in a
corpus
2. CMI mixed: average CMI for the sentences
with non-zero CMI.
3. Mixed %: percentage of code-mixed sen-
tences in the corpus
4. Num utt.: total number of utterances in the
corpus.
We observed that the WhatsApp corpus for Ben-
gali has a very low fraction of code-mixed sen-
tences i.e., there are an extremely low number of
words tagged as en in the data-set. On closer in-
spection of the dataset, there were exactly 13 in-
stances of words that were tagged en and these
were actually words such as Kolkata and San An-
tonio, that should have been annotated as ne in-
stead. Effectively, CMI for WhatsApp-Bengali
corpus is 0.
3 Model and Results
POS tagging is considered to be a sequence la-
belling task, where each token of the sentence
needs to be assigned a label. These labels are usu-
ally interdependent, because the sentence follows
grammar rules inherent to the language.
We have used the CRF implementation of
is particularly well
sklearn-crfuite2 because it
suited for sequence labelling tasks.
3.1 Features
The feature-set consisted of character-case infor-
mation, character n-grams of gram size upto 3,
which would thereby also encompass all prefixes
and suffixes, patterns for email and web-site urls,
punctuations, emoticons, numbers, social media
specific characters like @,# and also the language
tag information.
We chose a CRF window size of two and per-
formed grid-search to choose the best optimization
algorithm and L1/L2 regularization parameters3.
There were a total of 18 models trained using this
pipeline, one for each case in the cross-product:
{bn-en, hi-en, te-en}
X
{WhatsApp, Twitter, Facebook}
X
{Fine-Grained, Coarse-Grained}
3.2 Results
The F1 measure of our model against the social
networks is depicted in Table 5 and the results with
respect to the POS granularity is shown in Table
6. These results were calculated on the private test
data-set shared by the organizers. With the system
described in the paper, we achieved an overall av-
erage score of 76.45%, across all 18 models. This
is only marginally lesser than 76.79%, which was
the the score of winning entry of ICON 2015, and
we are awaiting the results of ICON 2016.
4 Conclusion & Future Work
In this paper, we presented a CRF based POS
tagger for code-mixed social media text in the
constrained environment, without making use of
any external corpora or monolingual POS tag-
gers. We achieved an overall F1- Score of 76.45%.
2http://sklearn-crfsuite.readthedocs.io/en/latest
3Our
available
code
scientifique/code-mixing-social-media
is
at
https://github.com/le-
Language
(English +)
Telugu
Hindi
Bengali
WhatsApp Twitter Facebook
74.43
75.68
76.71
79.15
86.80
69.64
74.10
77.44
74.1
Table 5: Model Performance (F1-Score) w.r.t So-
cial Networks
Language
(English +)
Telugu
Hindi
Bengali
Fine-
Grained
73.50
83.40
73.28
Coarse-
Grained
78.30
76.60
76.39
Table 6: Model Performance (F1-Score) w.r.t POS
Granularity
We would like to evaluate the performance im-
provement or lack thereof upon training a POS
tagger in an unconstrained environment by uti-
lizing monolingual taggers trained on Indic lan-
guages. Multilingual tools are still a ways off from
matching the state-of-the-art of the tools avail-
able for monolingual linguistic analysis. There is
promising research in the field of developing tools
for resource poor languages by applying Trans-
fer Learning (Zoph et al., 2016), which could also
be evaluated in the future. Upon inspecting the
dataset, we observed a few inaccuracies in anno-
tation, which could be addressed by leveraging
crowd-sourcing platforms that can execute Human
Intelligence Tasks.
References
Anne Abeill´e, Lionel Cl´ement, and Franc¸ois Toussenel.
Building a treebank for French. Treebanks. Springer
Netherlands, 2003. 165-187.
Anupam Jamatia and Amitava Das TASK REPORT:
TOOL CONTEST ON POS TAGGING FOR CODE-
MIXED INDIAN SOCIAL MEDIA (FACEBOOK,
TWITTER, AND WHATSAPP) TEXT @ ICON 2016
In: Proceedings of ICON 2016. 2016
Anupam Jamatia, Bjorn Gamback, and Amitava Das.
Part-of-Speech Tagging for CodeMixed English-
Hindi Twitter and Facebook Chat Messages In: Pro-
ceedings of Recent Advances in Natural Language
Processing. 2015, pp. 239248
Arnav Sharma and Raveesh Motlani POS Tagging
For Code-Mixed Indian Social Media Text : Systems
from IIIT-H for ICON NLP Tools Contest 12th Inter-
Monojit Choudhury, Gokul Chittaranjan, Parth Gupta,
and Amitava Das Overview of FIRE 2014 Track on
Transliterated Search. FIRE (2014).
Slav Petrov, Dipanjan Das, and Ryan McDonald. A
In: The Interna-
Universal Part-of-Speech Tagset.
tional Conference on Language Resources and Eval-
uation. 2011
Sree Harsha Ramesh, Arnab Dhar, Raveena R. Kumar,
V. Anjaly, K. S. Sarath, Jason Pearce, and Krishna
R. Sundaresan. Automatically identify and label sec-
tions in scientific journals using conditional random
fields. In Semantic Web Evaluation Challenge, pp.
269-280. Springer International Publishing, 2016.
Thamar Solorio, Elizabeth Blair, Suraj Mahar-
jan, Steven Bethard, Mona Diab, Mahmoud
Ghoneim, Abdelati Hawwari, Fahad AlGhamdi, Ju-
lia Hirschberg, Alison Chang and Pascale Fung.
Overview for the First Shared Task on Language
Identification in Code-Switched Data. Proceedings
of EMNLP'14 Workshop on Code Switching, 2014.
Thamar Solorio and Yang Liu. In Proceedings of the
Conference on Empirical Methods in Natural Lan-
guage Processing, pp. 1051-1060. Association for
Computational Linguistics, 2008.
Utsab Barman, Amitava Das, Joachim Wagner, and
Jennifer Foster. Code mixing: A challenge for lan-
guage identification in the language of social media.
The 1st Workshop on Computational Approaches to
Code Switching, EMNLP 2014 , pages 1323, Octo-
ber, 2014, Doha, Qatar.
Yogarshi Vyas, Spandana Gella, Jatin Sharma, Ka-
lika Bali, and Monojit Choudhury. POS Tagging
of English-Hindi Code-Mixed Social Media Content.
In EMNLP, vol. 14, pp. 974-979. 2014.
national Conference on Natural Language Process-
ing
Barret Zoph, Deniz Yuret, Jonathan May, and Kevin
Knight. Transfer Learning for Low-Resource Neu-
In: Proceedings of the
ral Machine Translation.
2016 Conference on Empirical Methods in Natu-
ral Language Processing, pages 15681575, arXiv
preprint arXiv:1604.02201 (2016).
Beatrice Santorini Part-of-speech tagging guidelines
for the Penn Treebank Project (3rd revision). 1990
Bjorn Gamback, and Amitava Das. On Measuring the
Complexity of Code-Mixing. In Proceedings of the
11th International Conference on Natural Language
Processing, Goa, India, pp. 1-7. 2014.
Burr Settles Biomedical named entity recognition us-
ing conditional random fields and rich feature sets.
In Proceedings of the International Joint Workshop
on Natural Language Processing in Biomedicine and
its Applications, pp. 104-107. Association for Com-
putational Linguistics, 2004.
Carol Myers-Scotton Duelling languages: Grammat-
ical structure in codeswitching. Oxford University
Press, 1997.
Jinho D. Choi Dynamic feature induction: The last
gist to the state-of-the-art. Proceedings of NAACL-
HLT. 2016.
John J. Gumperz Discourse strategies. Vol. 1. Cam-
bridge University Press, 1982.
John Lafferty, Andrew McCallum, and Fernando
Pereira Conditional random fields: Probabilistic
models for segmenting and labeling sequence data.
In Proceedings of the eighteenth international con-
ference on machine learning, ICML, vol. 1, pp. 282-
289. 2001.
K. P. Soman AMRITA CEN @ ICON-2015: Part-of-
Speech Tagging on Indian Language Mixed Scripts
in Social Media. 12th International Conference on
Natural Language Processing
Kristina Toutanova, Dan Klein, Christopher D. Man-
ning, and Yoram Singer Feature-rich part-of-speech
In
tagging with a cyclic dependency network.
Proceedings of the 2003 Conference of the North
American Chapter of the Association for Computa-
tional Linguistics on Human Language Technology-
Volume 1, pp. 173-180. Association for Computa-
tional Linguistics, 2003.
Pascal Denis, and Benot Sagot. Coupling an Anno-
tated Corpus and a Morphosyntactic Lexicon for
State-of-the-Art POS Tagging with Less Human Ef-
fort. PACLIC. 2009.
Prakash B. Pimpale, and Raj Nath Patel. Experiments
with POS Tagging Code-mixed Indian Social Media
Text. 12th International Conference on Natural Lan-
guage Processing arXiv preprint arXiv:1610.09799
(2016).
|
1702.02640 | 1 | 1702 | 2017-02-08T22:24:14 | Character-level Deep Conflation for Business Data Analytics | [
"cs.CL",
"cs.LG"
] | Connecting different text attributes associated with the same entity (conflation) is important in business data analytics since it could help merge two different tables in a database to provide a more comprehensive profile of an entity. However, the conflation task is challenging because two text strings that describe the same entity could be quite different from each other for reasons such as misspelling. It is therefore critical to develop a conflation model that is able to truly understand the semantic meaning of the strings and match them at the semantic level. To this end, we develop a character-level deep conflation model that encodes the input text strings from character level into finite dimension feature vectors, which are then used to compute the cosine similarity between the text strings. The model is trained in an end-to-end manner using back propagation and stochastic gradient descent to maximize the likelihood of the correct association. Specifically, we propose two variants of the deep conflation model, based on long-short-term memory (LSTM) recurrent neural network (RNN) and convolutional neural network (CNN), respectively. Both models perform well on a real-world business analytics dataset and significantly outperform the baseline bag-of-character (BoC) model. | cs.CL | cs |
CHARACTER-LEVEL DEEP CONFLATION FOR BUSINESS DATA ANALYTICS
Zhe Gan†, P. D. Singh∗, Ameet Joshi(cid:63), Xiaodong He∗, Jianshu Chen∗, Jianfeng Gao∗, and Li Deng∗
†Department of Electrical and Computer Engineering, Duke University, Durham, NC
∗Microsoft Research, Redmond, WA
(cid:63)Microsoft Corporation, Redmond, WA
ABSTRACT
Table 1: Example text string pairs in the dataset.
Connecting different text attributes associated with the same en-
tity (conflation) is important in business data analytics since it could
help merge two different tables in a database to provide a more com-
prehensive profile of an entity. However, the conflation task is chal-
lenging because two text strings that describe the same entity could
be quite different from each other for reasons such as misspelling. It
is therefore critical to develop a conflation model that is able to truly
understand the semantic meaning of the strings and match them at
the semantic level. To this end, we develop a character-level deep
conflation model that encodes the input text strings from character
level into finite dimension feature vectors, which are then used to
compute the cosine similarity between the text strings. The model is
trained in an end-to-end manner using back propagation and stochas-
tic gradient descent to maximize the likelihood of the correct asso-
ciation. Specifically, we propose two variants of the deep conflation
model, based on long-short-term memory (LSTM) recurrent neural
network (RNN) and convolutional neural network (CNN), respec-
tively. Both models perform well on a real-world business analytics
dataset and significantly outperform the baseline bag-of-character
(BoC) model.
Index Terms- Deep conflation, character-level model, convo-
lutional neural network, long-short-term memory
1. INTRODUCTION
In business data analytics, different fields and attributes related to
the same entities (e.g., same person) are stored in different tables in
a database or across different databases. It is important to connect
these attributes so that we can get a more comprehensive and richer
profile of the entity. This is important because exploiting a more
comprehensive profile could lead to better prediction in business data
analytics.
Specifically, the conflation of data aims to connect two rows
from the same or different datasets that contain one or more com-
mon fields, when the values of the common fields match within a
predefined threshold. For example, in the business data considered
in this paper, we aim to detect whether two names refer to the same
person or not - see the example in Table 1. Row A and row B rep-
resent two name fields from different tables in a database, which is a
text string consisting of characters. The strings in the same column
of Table 1 represent the names of a same person. There are sev-
eral reasons for the strings in A and B being different: (i) possible
mis-spelling typos; (ii) the lack of suffix; (iii) the reverse of family
names and given names. Due to these variations and imperfection in
Emails: [email protected], {prabhs, ameetj, xiaohe, jianshuc, jfgao,
deng}@microsoft.com
A emilio yentsch
B
ydntsch emilip Mr. halner exrique
enrique hafner
javier creswell
Prof. crrxwell javzfr
data entries, plain keyword matching does not work well [1, 2], and
we need a data conflation model in the semantic level; that is, the
model should be able to identify two different character strings to be
associated with a same entity.
To address the aforementioned challenges, we propose character-
level deep conflation models that take the raw text strings as the input
and predict whether two data entries refer to the same entity. The
proposed model consists of two parts: (i) a deep feature extractor,
and (ii) a ranker. The feature extractor takes the raw text string at
the character level and produce a finite dimension representation
of the text. In particular, we constructed two different deep archi-
tectures of feature extractors: (i) long-short-term-memory (LSTM)
recurrent neural network (RNN) [3, 4] and (ii) deep convolutional
neural network (CNN) [5, 6]. Both deep architectures are able to
retain the order information in the input text and extract high-level
features from raw data, as shown their great success in different
machine learning tasks, including text classification [5, 7], machine
translation [8, 9, 10, 11] and information retrieval [12, 13, 14]. Fur-
thermore, extracting the features from the character-level is critical
in many of the recent success in applying deep learning to natural
language processing [15, 16, 17, 18, 19]. As we will show later,
our proposed deep conflation model achieves high prediction accu-
racy in the conflation task for business data, and greatly outperform
strong baselines.
2. CHARACTER-LEVEL DEEP CONFLATION MODELS
We formulate the deep conflation problem as a ranking problem.
That is, given a query string from field A, we rank all the target
strings in field B, with the hope that the most similar string in B is
ranked on the top of the list. The proposed deep conflation model
consists of two parts: (i) a deep feature extractor; (ii) a ranker. Fig.
1 shows the architecture of the deep conflation model. The deep fea-
ture extractors transform the input text strings from character-level
into finite dimension feature vectors. Then, the cosine similarity is
computed between the query string from field A and all the target
strings from field B. The cosine similarity value for each pair of
text strings measures the semantic relevance between each pair of
the text strings, according to which the target strings are ranked. The
entire model will be trained in an end-to-end manner so that the deep
feature extractors are encouraged to learn the proper feature vectors
Fig. 1: Character-level deep conflation model.
Fig. 3: CNN based deep feature extractor.
ot. The hidden units ht are updated as follows:
Fig. 2: LSTM based deep feature extractor.
that are measurable by cosine similarity. In the rest of this section,
we will explain these two components of the deep conflation model
with detail.
2.1. Deep Feature Extractors
The inputs into the system are text strings, which are sequences of
characters. Note that the order of the input characters and words is
critical to understand the text correctly. For this reason, we propose
to use two deep learning models that are able to retain the order in-
formation to extract features from the raw input character sequences.
The two deep models we use are: (i) Recurrent Neural Networks
(RNNs); (ii) Convolutional Neural Networks (CNNs).
RNN is a nonlinear dynamic system that can be used for se-
quence modeling. However, during the training of a regular RNN,
the components of the gradient vector can grow or decay exponen-
tially over long sequences. This problem with exploding or vanish-
ing gradients makes it difficult for the regular RNN model to learn
long-range dependencies in a sequence [20]. A useful architecture
of RNN that overcomes this problem is the Long Short-Term Mem-
ory (LSTM) structure. On the other hand, CNN is a deep feedfor-
ward neural network that first uses convolutional and max-pooling
layers to capture the local and global contextual information of the
input sequence, and then uses a fully-connected layer to produce a
fixed-length encoding of the sequence. In sequel, we first introduce
LSTM, and then CNN.
2.1.1. LSTM feature extractor
The LSTM architecture [3] addresses the problem of learning long-
term dependencies by introducing a memory cell, that is able to pre-
serve the state over long periods of time. Specifically, each LSTM
unit has a cell containing a state ct at time t. This cell can be viewed
as a memory unit. Reading or writing the memory unit is controlled
through sigmoid gates: input gate it, forget gate f t, and output gate
it = σ(Wixt + Uiht−1 + bi) ,
f t = σ(Wf xt + Uf ht−1 + bf ) ,
ot = σ(Woxt + Uoht−1 + bo) ,
ct = tanh(Wcxt + Ucht−1 + bc) ,
ct = f t (cid:12) ct−1 + it (cid:12) ct ,
ht = ot (cid:12) tanh(ct) ,
(1)
(2)
(3)
(4)
(5)
(6)
where σ(·) denotes the logistic sigmoid function, and (cid:12) represents
the element-wise multiply operator. Wi Wf , Wo, Wc, Ui, Uf ,
Uo, Uc, bi, bf , bo and bc are the free model parameters to be
learned from training data.
Given the text string q = [q1, . . . , qT ], where qt is the one-hot
vector representation of character at position t and T is the number
of characters, we first embed the characters into a vector space via a
linear transform xt = Weqt, where We is the embedding matrix.
Then for every time step, we feed the embedding vector of characters
in the text string to LSTM:
xt = Weqt, t ∈ {1, . . . , T} ,
ht = LSTM(xt), t ∈ {1, . . . , T} ,
(7)
(8)
where the operator LSTM(·) denotes the operations defined in (1)-
(6). For example, in Fig. 2, the string emilio yentsch is fed into the
LSTM. The final hidden vector is taken as the feature vector for the
string, i.e., y = hT . We repeat this process for the query text and all
the target texts so that we will have yQ and yDj
(j = 1, . . . J + 1),
which will be fed into the ranker to compute cosine similarity (see
Sec. 2.2).
In the experiments, we use a bidirectional LSTM to extract se-
quence features, which consists of two LSTMs that are run in par-
allel: one on the input sequence and the other on the reverse of the
input sequence. At each time step, the hidden state of the bidirec-
tional LSTM is the concatenation of the forward and backward hid-
den states.
2.1.2. CNN feature extractor
Next, we consider the CNN for string feature extraction. Similar to
the LSTM-based model, we first embed characters to vectors xt =
Weqt and then concatenating these vectors:
x1:T = [x1, . . . , xT ] .
(9)
Deep Feature Extractor Deep Feature Extractor Deep Feature Extractor …… Query string Target string 1 Target string J+1 Strings Deep features …… Cosine similarity LSTMLSTMLSTMWe…WeWe…em…hString:bigramtrigram4-gramembeddingconvolutionmax poolingover timeem il io … h String:Then we apply convolution operation on the character embedding
vectors. We use three different convolution filters, which have the
size of two (bigram), three (trigram) and four (4-gram), respectively.
These different convolution filters capture the context information of
different lengths. The t-th convolution output using window size c
is given by
cosine similarity between query Q and each j-th target string Dj.
More formally, it is defined as
R(Q, Dj) =
y(cid:62)
QyDj
yQ · yDj
,
(13)
hc,t = tanh(Wcxt:t+c−1 + bc) ,
(10)
where Dj denotes the j-th target string. At test time, given a query,
the candidates are ranked by this relevance scores.
where the notation xt:t+c−1 denotes the vector that is constructed
by concatenating xt to xt+c−1. That is, the filter is applied only to
window t : t + c − 1 of size c. Wc is the convolution weight and
bc is the bias. The feature map of the filter with convolution size c is
defined as
hc = [hc,1, hc,2, . . . , hc,T−c+1] .
(11)
2.3. Training of the deep conflation model
We now explain how the deep conflation model could be trained
in an end-to-end manner. Given that we have the relevance scores
between the query string and each of the target string Dj: R(Q, Dj),
we define the posterior probability of the correct candidate given the
query by the following softmax function
We apply max-pooling over the feature maps of the convolution size
c and denote it as
P (D+Q) =
hc = max{hc,1, hc,2, . . . , hc,T−c+1} ,
(12)
where the max is a coordinate-wise max operation. For convolu-
tion feature maps of different sizes c = 2, 3, 4, we concatenate them
to form the feature representation vector of the whole character se-
quence: h = [h2, h3, h4] . Observe that the convolution opera-
tions explicitly capture the local (short-term) context information in
the character strings, while the max-pooling operation aggregates
the information from different local filters into a global representa-
tion of the input sequence. These local and global operations enable
the model to encode different levels of dependency in the input se-
quence.
The above vector h is the final feature vector extracted by CNN
and will be fed into the ranker, i.e., y = h. We repeat this process
for the query text and all the target texts so that we will have yQ and
(j = 1, . . . J + 1). The above feature extraction process using
yDj
CNN is illustrated in Fig. 3.
There exist other CNN architectures in the literature [6, 21, 22].
We adopt the CNN model in [5, 23] due to its simplicity and excel-
lent performance on classification. Empirically, we found that it can
extract high-quality text string representations for ranking.
2.1.3. Comparison between the two deep feature extractors
Compared with the LSTM feature extractor, a CNN feature extrac-
tor may have the following advantages [24]. First, the sparse con-
nectivity of a CNN, which indicates fewer parameters are required,
typically improves its statistical efficiency as well as reduces mem-
ory requirements. Second, a CNN is able to encode regional (n-
gram) information containing rich linguistic patterns. Furthermore,
an LSTM encoder might be disproportionately influenced by char-
acters appearing later in the sequence, while the CNN gives largely
uniform importance to the signal coming from each of the charac-
ters in the sequence. This makes the LSTM excellent at language
modeling, but potentially suboptimal at encoding n-gram informa-
tion placed further back into the sequence.
2.2. Ranker
Now that we have extracted deep feature vectors yQ, yD1,..., yDJ+1
from the query and candidate strings, we can proceed to compute
their semantic relevance scores by computing their corresponding
(cid:80)
exp(γR(Q, D+))
D(cid:48)∈D exp(γR(Q, D(cid:48)))
,
(14)
(cid:89)
where D+ denotes the correct target string (the positive sign denotes
that it is a positive sample), γ is a tuning hyper-parameter in the soft-
max function (to be tuned empirically on a validation set). D denotes
the set of candidate strings to be ranked, which includes the positive
sample D+ and J randomly selected incorrect (negative) candidates
{D
j ; j = 1, . . . , J}. The model parameters are learned to maxi-
−
mize the likelihood of the correct candidates given the queries across
the training set. That is, we minimize the following loss function
L(θ) = − log
P (D+Q) ,
(15)
(Q,D+)
where the product is over all training samples, and θ denotes the
parameters (to be learned), including all the model parameters in the
deep feature extractors. The above cost function is minimized by
back propagation and (mini-batch) stochastic gradient descent.
3. EXPERIMENTAL RESULTS
3.1. Dataset
We evaluate the performance of our proposed deep conflation model
on a corporate proprietary business dataset. Since each string can be
considered as a sequence of characters, the vocabulary size is 32 (in-
cluding one period symbol and one space symbol), which includes
the following elements:
DMPSabcdefghijklmnopqrstuvwxyz.
Specifically, the dataset contains 10, 000 pairs of query and the asso-
ciated correct target string (manually annotated). The average length
of the string is 14.47 with standard deviation 2.89. The maximum
length of the strings is 26 and the minimum length is 6.
3.2. Setup
We provide the deep conflation results using LSTM and CNN for
feature extraction, respectively. Furthermore, we also implement a
baseline using Bag-of-Characters (BoC) representation of input text
string. This BoC vector is then sent into a two-hidden-layer (fully-
connected) feed-forward neural networks.
In our experiment, we
implement 10-fold cross validation, and in each fold, we randomly
select 80% of the samples as training, 10% as validation, and the
Table 2: 10-fold cross validation results using BoC, LSTM and CNN model, respectively. R@K denotes Recall@K (higher is better). Med
r, Mean r and Harmonic Mean r is the median rank, mean rank and harmonic mean rank, respectively (lower is better).
R@1
R@3
Model
R@10
Using correct names to query mis-spelled names
82.09± 1.59
BoC
LSTM 86.66± 0.90
98.90± 0.18
CNN
Using mis-spelled names to query correct names
83.56± 1.42
BoC
LSTM 87.63± 0.92
99.25± 0.43
CNN
92.30± 0.76
95.38± 0.53
99.97± 0.05
93.06± 0.80
95.50± 0.45
99.98± 0.06
96.83± 0.36
98.54± 0.20
100.00± 0.00
Med r
Mean r
Harmonic Mean r
1.0± 0.0
1.0± 0.0
1.0± 0.0
2.380± 0.218
1.609± 0.092
1.012± 0.003
1.0± 0.0
1.0± 0.0
1.0± 0.0
2.158± 0.128
1.584± 0.055
1.008± 0.005
1.138± 0.009
1.095± 0.007
1.006± 0.001
1.131± 0.011
1.088± 0.007
1.004± 0.002
97.35± 0.27
98.67± 0.21
100.00± 0.00
Table 3: Average scores for each of the top four retrieved items.
Table 4: An example of the mistakenly retrieved cases.
top 1
top 2
top 3
top 4
0.792± 0.086
0.448± 0.072
0.397±0.050
0.371±0.042
rest 10% as testing dataset. No specific hyper-parameter tuning is
implemented, other than early stopping on the validation set.
For the feed-forward neural network encoder based on the BoC
representation, we use two hidden layers, each layer contains 300
hidden units, hence each string is embedded as a 300-dimensional
vector. For LSTM and CNN encoder, we first embed each character
into a 128-dimensional vector. Based on this, for the bidirectional
LSTM encoder, we further use one hidden layer of 128 units for
sequence embedding, hence each text string is represented as a 256-
dimensional vector. For the CNN encoder, we employ filter windows
of sizes {2,3,4} with 100 feature maps each, hence each text string
is represented as a 300-dimensional vector.
For training, all weights in the CNN and non-recurrent weights
in the LSTM are initialized from a uniform distribution in [-
0.01,0.01]. Orthogonal initialization is employed on the recurrent
matrices in the LSTM [25]. All bias terms are initialized to zero.
It is observed that setting a high initial forget gate bias for LSTMs
can give slightly better results [26]. Hence, the initial forget gate
bias is set to 3 throughout the experiments. Gradients are clipped if
the norm of the parameter vector exceeds 5 [10]. The Adam algo-
rithm [27] with learning rate 2 × 10−4 is utilized for optimization.
For both the LSTM and CNN models, we use mini-batches of size
100. The hyper-parameter γ is set to 10. The number of negative
candidates J is set to 50, which are randomly sampled from the rest
of the candidate strings excluding the correct one. All experiments
are implemented in Theano [28] on a NVIDIA Tesla K40 GPU. For
reference, the training of a CNN model takes around 45 minutes to
go through the dataset 20 times.
3.3. Results
Performance is evaluated using Recall@K, which measures the av-
erage times a correct item is found within the top-K retrieved re-
sults. Results are summarized in Table 2. As can be seen, both
of the proposed deep conflation models with LSTM and CNN fea-
ture extractors achieve superior performance compared to the BoC
baseline. This is not surprising, since sequential order information
is utilized in LSTM and CNN. Furthermore, we observe that CNN
significantly outperforms LSTM on this task. We hypothesize that
palmer mehaffey
query string
ground truth Mr mehaffep paleer
1st result
2nd result
3rd result
4th result
paleer mehaffep
Mr mehaffep paleer
fendlasyn pdlmer
zalwzar sharley
score
0.882
0.877
0.427
0.420
this observation is due to the fact that the local (regional) sequen-
tial order information (captured by CNN) is more important than the
gloabl sequential order information (captured by LSTM) in match-
ing two names. For example, if we reverse the family name and
given name of a given query name, LSTM might be more prone to
mistakenly classifying these two names to be different, while in fact
they refer to the same person.
For further analysis, we checked the CNN results on one prede-
fined train/validation/test splits of the dataset. When CNN is used,
for Recall@1, out of 1,000 test samples, only 5 samples are mis-
takenly retrieved. In Table 4, we show an example of the mistaken
case. We can see that the mistakenly retrieved case is quite reason-
able. Even humans will make mistakes on these cases. Other four
mistakenly retrieved cases are similar and are omitted due to space
limit. The average scores for each of the top four retrieved items are
given in Table 3. This suggests that, when judging whether two text
strings have the same meaning, we can empirically set the thresh-
old to be (0.792 + 0.448)/2 = 0.62. That is, when the similarity
score between two strings is higher than 0.62, we can safely con-
clude that they refer to the same entity, and we can then conflate the
corresponding two rows accordingly.
4. CONCLUSION
We have proposed a deep conflation model for matching two text
fields in business data analytics, with two different variants of fea-
ture extractors, namely, long-short-term memory (LSTM) and con-
volutional neural networks (CNN). The model encodes the input
text from raw character-level into finite dimensional feature vectors,
which are used for computing the corresponding relevance scores.
The model is learned in an end-to-end manner by back propagation
and stochastic gradient descent. Since both LSTM and CNN feature
extractors retain the order information in the text, the deep confla-
tion model achieve superior performance compared to the bag-of-
character (BoC) baseline.
[19] Junyoung Chung, Kyunghyun Cho, and Yoshua Bengio, "A
character-level decoder without explicit segmentation for neu-
ral machine translation," arXiv:1603.06147, 2016.
[20] Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio, "On
the difficulty of training recurrent neural networks.," in ICML,
2013.
[21] B. Hu, Z. Lu, H. Li, and Q. Chen, "Convolutional neural net-
work architectures for matching natural language sentences,"
in NIPS, 2014.
[22] R. Johnson and T. Zhang, "Effective use of word order for text
categorization with convolutional neural networks," in NAACL
HLT, 2015.
[23] R. Collobert,
J. Weston,
K. Kavukcuoglu, and P. Kuksa,
cessing (almost) from scratch," in JMLR, 2011.
L. Bottou, M. Karlen,
"Natural language pro-
[24] Zhe Gan, Yunchen Pu, Ricardo Henao, Chunyuan Li, Xi-
aodong He, and Lawrence Carin, "Unsupervised learning of
sentence representations using convolutional neural networks,"
arXiv:1611.07897, 2016.
[25] A. M. Saxe, J. L. McClelland, and S. Ganguli, "Exact solutions
to the nonlinear dynamics of learning in deep linear neural net-
works," in ICLR, 2014.
[26] Q. V. Le, N. Jaitly, and G. E. Hinton,
"A simple way
to initialize recurrent networks of rectified linear units,"
arXiv:1504.00941, 2015.
[27] Diederik Kingma and Jimmy Ba,
"Adam: A method for
stochastic optimization," in ICLR, 2015.
[28] F. Bastien, P. Lamblin, R. Pascanu, J. Bergstra, I. Good-
fellow, A. Bergeron, N. Bouchard, D. Warde-Farley, and
Y. Bengio, "Theano: new features and speed improvements,"
arXiv:1211.5590, 2012.
5. REFERENCES
[1] Vetle I Torvik and Neil R Smalheiser, "Author name disam-
biguation in medline," TKDD, 2009.
[2] Stasa Milojevi´c,
"Accuracy of simple, initials-based meth-
ods for author name disambiguation," Journal of Informetrics,
2013.
[3] S. Hochreiter and J. Schmidhuber, "Long short-term memory,"
in Neural computation, 1997.
[4] T. Mikolov, M. Karafi´at, L. Burget, J. Cernock`y, and S. Khu-
danpur, "Recurrent neural network based language model," in
INTERSPEECH, 2010.
[5] Y. Kim, "Convolutional neural networks for sentence classifi-
cation," in EMNLP, 2014.
[6] N. Kalchbrenner, E. Grefenstette, and P. Blunsom, "A con-
volutional neural network for modelling sentences," in ACL,
2014.
[7] Andrew M Dai and Quoc V Le, "Semi-supervised sequence
learning," in Advances in Neural Information Processing Sys-
tems, 2015.
[8] N. Kalchbrenner and P. Blunsom, "Recurrent continuous trans-
lation models.," in EMNLP, 2013.
[9] K. Cho, B. Van Merrienboer, C. Gulcehre, D. Bahdanau,
F. Bougares, H. Schwenk, and Y. Bengio, "Learning phrase
representations using rnn encoder-decoder for statistical ma-
chine translation," in EMNLP, 2014.
[10] I. Sutskever, O. Vinyals, and Q. Le, "Sequence to sequence
learning with neural networks," in NIPS, 2014.
[11] F. Meng, Z. Lu, M. Wang, H. Li, W. Jiang, and Q. Liu, "En-
coding source language with convolutional neural network for
machine translation," in ACL, 2015.
[12] Po-Sen Huang, Xiaodong He, Jianfeng Gao, Li Deng, Alex
Acero, and Larry Heck, "Learning deep structured semantic
models for web search using clickthrough data," in CIKM,
2013.
[13] Yelong Shen, Xiaodong He, Jianfeng Gao, Li Deng, and
Gr´egoire Mesnil, "A latent semantic model with convolutional-
pooling structure for information retrieval," in CIKM, 2014.
[14] Hamid Palangi, Li Deng, Yelong Shen, Jianfeng Gao, Xi-
aodong He, Jianshu Chen, Xinying Song, and Rabab Ward,
"Deep sentence embedding using long short-term memory
networks: Analysis and application to information retrieval,"
IEEE/ACM Transactions on Audio, Speech, and Language
Processing, 2016.
[15] Yoon Kim, Yacine Jernite, David Sontag, and Alexander M
Rush, "Character-aware neural language models," AAAI, 2016.
[16] Wang Ling, Tiago Lu´ıs, Lu´ıs Marujo, Ram´on Fernandez As-
tudillo, Silvio Amir, Chris Dyer, Alan W Black, and Is-
abel Trancoso,
"Finding function in form: Compositional
character models for open vocabulary word representation,"
arXiv:1508.02096, 2015.
[17] Xiang Zhang, Junbo Zhao, and Yann LeCun, "Character-level
convolutional networks for text classification," in NIPS, 2015.
[18] David Golub and Xiaodong He, "Character-level question an-
swering with attention," EMNLP, 2016.
|
1606.00577 | 3 | 1606 | 2017-05-17T21:03:06 | Source-LDA: Enhancing probabilistic topic models using prior knowledge sources | [
"cs.CL",
"cs.IR",
"cs.LG"
] | A popular approach to topic modeling involves extracting co-occurring n-grams of a corpus into semantic themes. The set of n-grams in a theme represents an underlying topic, but most topic modeling approaches are not able to label these sets of words with a single n-gram. Such labels are useful for topic identification in summarization systems. This paper introduces a novel approach to labeling a group of n-grams comprising an individual topic. The approach taken is to complement the existing topic distributions over words with a known distribution based on a predefined set of topics. This is done by integrating existing labeled knowledge sources representing known potential topics into the probabilistic topic model. These knowledge sources are translated into a distribution and used to set the hyperparameters of the Dirichlet generated distribution over words. In the inference these modified distributions guide the convergence of the latent topics to conform with the complementary distributions. This approach ensures that the topic inference process is consistent with existing knowledge. The label assignment from the complementary knowledge sources are then transferred to the latent topics of the corpus. The results show both accurate label assignment to topics as well as improved topic generation than those obtained using various labeling approaches based off Latent Dirichlet allocation (LDA). | cs.CL | cs | Source-LDA: Enhancing probabilistic topic models
using prior knowledge sources
Justin Wood1,2, Patrick Tan1, Wei Wang1, Corey Arnold2
2Medical Imaging Informatics Group, University of California, Los Angeles, CA 90095, USA
1Department of Computer Science, University of California Los Angeles, CA 90095, USA
{juwood03, patrickptt, cwarnold}@ucla.edu, [email protected]
7
1
0
2
y
a
M
7
1
]
L
C
.
s
c
[
3
v
7
7
5
0
0
.
6
0
6
1
:
v
i
X
r
a
Abstract-Topic modeling has increasingly attracted interests
from researchers. Common methods of topic modeling usually
produce a collection of unlabeled topics where each topic is
depicted by a distribution of words. Associating semantic meaning
with these word distributions is not always straightforward.
Traditionally, this task is left to human interpretation. Manually
labeling the topics is unfortunately not always easy, as topics
generated by unsupervised learning methods do not necessarily
align well with our prior knowledge in the subject domains.
Currently, two approaches to solve this issue exist. The first is
a post-processing procedure that assigns each topic with a label
from the prior knowledge base that is semantically closest to
the word distribution of the topic. The second is a supervised
topic modeling approach that restricts the topics to a predefined
set whose word distributions are provided beforehand. Neither
approach is ideal, as the former may produce labels that do not
accurately describe the word distributions, and the latter lacks
the ability to detect unknown topics that are crucial to enrich our
knowledge base. Our goal in this paper is to introduce a semi-
supervised Latent Dirichlet allocation (LDA) model, Source-LDA,
which incorporates prior knowledge to guide the topic modeling
process to improve both the quality of the resulting topics and
of the topic labeling. We accomplish this by integrating existing
labeled knowledge sources representing known potential topics
into a probabilistic topic model. These knowledge sources are
translated into a distribution and used to set the hyperparameters
of the Dirichlet generated distribution over words. This approach
ensures that the topic inference process is consistent with existing
knowledge, and simultaneously, allows for discovery of new
topics. The results show improved topic generation and increased
accuracy in topic labeling when compared to those obtained using
various labeling approaches based off LDA.
I.
INTRODUCTION
Existing topic modeling is often based off Latent Dirichlet
allocation (LDA) [1] and involves analyzing a given corpus
to produce a distribution over words for each latent topic
and a distribution over latent topics for each document. The
distributions representing topics are often useful and generally
representative of a linguistic topic. Unfortunately, assigning
labels to these topics is often left to manual interpretation.
Identifying topic labels is useful in summarizing a set of
words with a single label. For example, words such as pencil,
laptop, ruler, eraser, and book can be mapped to the label
"School Supplies." Adding descriptive semantics to each topic
can help people, especially those without domain knowledge,
to understand topics obtained by topic modeling.
A motivating application of accurate topic labeling is to
develop summarization systems for primary care physicians,
who are faced with the challenges of being inundated with
too much data for a patient and too little time to comprehend
it all [2]. The labels can be used to more appropriately and
quickly give an overview, or a summary, of patient's medical
history, leading to better outcomes for the patient. This added
information can bring significant value to the field of clinical
informatics which already utilizes topic modeling without
labeling [3]–[5].
Existing approaches in labeling topics usually do their
fitting of labels to topics after completion of the unsupervised
topic modeling process. A topic produced by this approach
may not always match well with any semantic concepts and
would therefore be difficult to categorize with a single label.
These problems are best illustrated via a simple case study.
1) Case Study: Suppose a corpus of a news source that
consists of two articles is given by documents d1 and d2 each
with three words:
d1 - pencil, pencil, umpire
d2 - ruler, ruler, baseball
LDA (with the traditionally used collapsed Gibbs sampler,
standard hyperparameters and the number of topics (K) set
as two) would output different results for different runs due to
the inherent stochastic nature. It is very possible to obtain the
following result of topic assignments:
d1 - pencil1, pencil1, umpire2
d2 - ruler2, ruler2, baseball1
But these assignments to topics differs from the ideal solution
that involves knowing the context of the topics in which these
words come from. If the topic modeling was to incorporate
prior knowledge about the topics "School Supplies" and "Base-
ball", then a topic modeling process will more likely generate
the ideal topic assignments of:
d1 - pencil2, pencil2, umpire1
d2 - ruler2, ruler2, baseball1
and assign a label of "School Supplies" to topic 1 and
"Baseball" to topic 2. Furthermore it is advantageous to incor-
porate this prior knowledge during the topic modeling process.
Consider the following table displaying four different mapping
techniques of the first result using the Wikipedia articles of
"School Supplies" and "Baseball" as the prior knowledge:
Topic 1
Technique
Topic 2
JS Divergence Baseball Baseball
TF-IDF/CS
Counting
PMI
(same)
Baseball Baseball
(same)
(same)
(same)
Applying this labeling post topic modeling can lead to prob-
lems dealing with the topic themselves. This is not so much a
problem of the mapping techniques but of the topics used as
input. By separating the topics during inference this problem
of combining different semantic topics can be avoided.
To overcome this problem, one may take a supervised
approach that incorporates such prior knowledge into the topic
modeling process to improve the quality of topic assignments
and more effectively label topics. However, existing supervised
approaches [6]–[8] are either too lenient or too strict. For
example, in the Concept-topic model (CTM) [6], a multinomial
distribution is placed over known concepts with associated
word sets. This pioneering approach does integrate prior
knowledge, but does not take into account word distributions.
For example if a document is generated about the topic "School
Supplies" it is much more probable to see the word "pencil"
than the word "compass" even though both words may be as-
sociated with the topic "School Supplies". This technique also
requires some supervision which requires manually inputting
preexisting concepts and their bags of words.
Another approach given by Hansen et al. as explicit
Dirichlet allocation [7] incorporates a preexisting distribution
based off Wikipedia but does not allow for variance from
the Wikipedia distribution. This approach fulfills the goal
of incorporating prior knowledge with their distributions but
requires the topic in the generated corpus to strictly follow the
Wikipedia word distributions.
To address these limitations, we propose the Source-LDA
model which is a balance between these two approaches. The
goal is to allow for simultaneous discovery of both known and
unknown topics. Given a collection of known topics and their
word distributions, Source-LDA is able to identify the subset
of these topics that appear in a given corpus. It allows some
variance in word distributions to the extent that it optimizes
the topic modeling.
A summary of the contributions of this
work are:
1) We propose a novel
technique to topic modeling
in a semi-supervised fashion that takes into account
preexisting topic distributions.
2) We show how to find the appropriate topics in a
corpus given an input set that contains a subset of
the topics used to generate a corpus.
3) We explain how to make use of prior knowledge
sources. In particular, we show how to use Wikipedia
articles to form word distributions.
4) We introduce an approach that allows for variance
from an input topic to the latent topic discovered
during the topic modeling process.
The parameters are given as a vector denoted by α.
The probability density function for a given probability mass
function (PMF) θ and parameter vector α of length J is defined
as:
J(cid:89)
i
θαi−1
i
Γ((cid:80)J
(cid:81)J
i αi)
i Γ(αi)
f (θ, α) =
A sample from the Dirichlet distribution produces a PMF
that is parameterized by α. The choice of a particular set of α
values influences the outcome of the generated PMF. If all α
values are the same (symmetric parameter), as α approaches 0,
the probability will be concentrated on a smaller set of atoms.
As α approaches infinity, the PMF will become the uniform
distribution. If all αi are natural numbers then each individual
αi can be thought of as the "virtual" count for the ith value [9].
B. Latent Dirichlet Allocation
Latent Dirichlet Allocation (LDA) is the basis for many
existing probabilistic topic models, and the framework for the
approach presented by this paper. Since we enhance the LDA
model in our proposed approach it is worth giving a brief
overview of the algorithm and model of LDA.
LDA is a hierarchical Bayes model which utilizes Dirichlet
priors to estimate the intractable latent variables of the model.
At a high level, LDA is based on a generative model
in
which each word of an input document from a corpus is
chosen by first selecting a topic that corresponds to that word
and then selecting the word from a topic-to-word distribution.
Each topic-to-word distribution and word-to-topic distribution
is drawn from its respective Dirichlet distribution. The formal
definition of the generative algorithm over a corpus is:
1.
2.
3.
4.
5.
6.
7.
8.
For each of the K topics φk:
For each of the D documents d:
Choose φk ∼ Dir(β)
Choose Nd ∼ Poisson(ξ)
Choose θd ∼ Dir(α)
For each of the Nd words wn,d:
Choose zn,d ∼ Multinomial(θ)
Choose wn,d ∼ Multinomial(φzn,d)
The rest of this paper is organized as follows: In Section
2, we give a brief introduction to the LDA algorithm and
the Dirichlet distribution. A more detailed description of the
Source-LDA algorithm is presented in Section 3. In Section
4, the algorithm is used and evaluated under various metrics.
Related literature is highlighted in Section 5. Section 6 gives
the conclusions of this paper.
For reproducible research, we make all of our code avail-
able online.1
II. PRELIMINARIES
A. Dirichlet Distribution
The Dirichlet distribution is a distribution over probability
mass functions with a specific number of atoms and is com-
monly used in Bayesian models. A property of the Dirichlet
that is often used in inference of Bayesian models is conjugacy
to the multinomial distribution. This allows for the posterior
of a random variable with a multinomial likelihood and a
Dirichlet prior to also be a Dirichlet distribution.
1https://github.com/ucla-scai/Source-LDA
From the generative algorithm the resultant Bayes model
is shown by Figure 1(a).
Bayes' law is used to infer the latent θ distribution, φ
distribution, and z
P (θ, φ, zw, α, β) =
p(θ, φ, z, wα, β)
p(wα, β)
Unfortunately the exact computation of this equation is in-
tractable. Hence, it must be approximated with techniques such
as expectation-maximization [1], Gibbs sampling or collapsed
Gibbs sampling [10].
III. PROPOSED APPROACH
Source-LDA is an extension of the LDA generative model.
In Source-LDA, after a known set of topics are determined, an
initial word-to-topic distribution is generated from correspond-
ing Wikipedia articles. The desiderata is to enhance existing
LDA topic modeling by integrating prior knowledge into the
topic modeling process. The relevant terms and concepts used
in the following discussion are defined below.
α
φ
K
θ
z
w
Nd D
(a) LDA
µ
KS
X
σ
λ
β
δ
φm
B
θ
z
w
Nd
D
(b) Source-LDA
α
β
φk
K
Fig. 1: Plate notation for LDA (a), and the proposed Source-LDA (b).
Definition 1 (Knowledge source): A knowledge source is
a collection of documents that are focused on describing a set
of concepts. For example the knowledge source used in our
experiments are Wikipedia articles that describe the categories
we select from the Reuters dataset.
2.
3.
δk ← (Xk,1, Xk,2, . . . , Xk,V )
Choose φk ∼ Dir(δk)
Definition 2 (Source Distribution): The source distribu-
tion is a discrete probability distribution over the words of
a document describing a topic. The probability mass function
is given by
∀wi ∈ W, f (wi) =
nwi(cid:80)G
j nwj
where W is the set of all words in the document, G = W, and
nwi is the number of times word wi appears in the document.
Definition 3 (Source Hyperparameters): For a given doc-
ument in a knowledge source the knowledge source hyper-
parameters are defined by the vector (X1, X2, . . . , XV ) where
Xi = nwi + and is a very small positive number that allows
for non-zero probability draws from the Dirichlet distribution.
V is the size of the vocabulary of the corpus for which we are
topic modeling, and nwi is the number of times the word wi
from the corpus vocabulary appears in the knowledge source
document.
We detail three approaches to capture the intent of Source-
LDA. The first approach is a simple enhancement to the LDA
model that allows for the influencing of topic distributions,
but suffers from needing more user intervention. The second
approach allows for the mixing of unknown topics, and the
third approach combines the previous two approaches. It moves
toward a complete solution to topic modeling based off prior
knowledge sources.
A. Bijective Mapping
In the simplest approach, the Source-LDA model assumes
that there exists a 1-to-1 mapping between a known set of
topics and the topics used to generate a corpus. The generative
model then assumes that, instead of selecting topic-to-word
distributions from sampling from the Dirichlet distribution, a
set of K distributions are given as input and sampled from
after each topic assignment
is sampled for a given token
position. The generative process for a corpus adapted from
the traditional LDA generative model during the construction
of the φ distributions is as follows (for brevity only the relevant
parts of the existing LDA algorithm are shown):
1.
For each of the K topics φk:
represents
Where (Xk,1, Xk,2, . . . , Xk,V )
the knowledge
source hyperparameters for the kth knowledge source docu-
ment. The generative model only differs from the traditional
LDA model in how each φ is built. Therefore the derivation
for inference is a simple factor as well. To approximate the
distributions for θ and φ, a collapsed Gibbs sampler can
approximate the z assignments as follows:
P (wizi=j, z-i, wi) ∝ P (wizi=j, z-i, w-i)P (zi=jz-i)
From the Bayesian Model the following equations can be
easily be generated
P (wizi=j, z-i, w-i) =
P (wizi=j, φj)P (φjz-i, w-i)dφj
(cid:90)
with
P (φjz-i, w-i) ∝ P (w-iφj, z-i)P (φj)
P (φjz-i, w-i) = Dir(δi,j + nw-i,j )
(cid:90)
P (wizi=j, φj) = φwi,j
P (wizi=j, z-i, w-i) = Dir(δi,j + nw-i,j )
φwi,j dφj
P (wizi=j, z-i, w-i) =
nwi
-i,j + δi,j
-i,j +(cid:80)V
n(·)
a δa,j
nw and nd in this and the following equations represent a
count matrix for the number of times a word is assigned
to a topic and the number of times a topic is assigned to a
document respectively. For brevity since the prior probability
is unchanged in the "Bijective Mapping" model we will skip
the derivation which is well defined in other articles [10]–[12].
P (zi=jz-i) =
ndi
-i,j + α
n(di)
-i + Kα
Putting the two equations together gives the final Gibbs sam-
pling equation:
P (zi=jz-i, w) ∝ nwi
n(·)
-i,j + δi,j
-i,j +(cid:80)V
a δa,j
ndi
-i,j + α
n(di)
-i + Kα
prior can be used to guide a topic toward being a general
unknown topic or a known topic. The model changes as shown
below with a minor change to the generative algorithm and the
collapsed Gibbs sampling.
1.
2.
3.
4.
5.
6.
For each of the K topics φk:
Choose φk ∼ Dir(β)
δk ← (Xk,1, Xk,2, . . . , Xk,V )
Choose φk ∼ Dir(δk)
if k ≤ T then
else
Where T is the total number of non-source topics. The change
required to the collapsed Gibbs sampling is then:
P (zi=jz-i, w) ∝ nwi
-i,j + β
n(·)
-i,j + W β
ndi
-i,j + α
n(di)
-i + Kα
, ∀i ≤ T
and
P (zi=jz-i, w) ∝ nwi
n(·)
-i,j +(cid:80)V
-i,j + δi,j
ndi
-i,j + α
n(di)
-i + Kα
, ∀i > T (2)
a δa,j
This approach gives the benefit of allowing a mixture of known
topics and unknown topics, but problems still arise in that the
Dirichlet distributions for the source distribution may be too
restricting.
C. Source-LDA
By using the counts as hyperparameters, the resultant φ
distribution will take on the shape of the word distribution
derived from the knowledge source. However, this might be at
odds with the aim of enhancing existing topic modeling. With
the goal to influence the φ distribution, it is entirely plausible to
have divergence between the two distributions. In other words,
φ may not need to strictly follow the corresponding knowledge
source distribution.
1) Variance from the source distribution: To allow for
this relaxation, another parameter λ is introduced into the
model which is used to allow for a higher deviance from
the source distribution. To obtain this variance each source
hyperparameter will be raised to a power of λ. Thus as λ
approaches 0 each hyperparameter will approach 1 and the
subsequent Dirichlet draw will allow all discrete distributions
with equal probability. As λ approaches 1 the Dirichlet draw
will be tightly conformed to the source distribution.
The addition of λ changes the existing generative model
only slightly and allows for a variance for each individual
δi, which frees us from an overly restrictive binding to the
associated knowledge source distribution. The λ parameter acts
as a measure of how much divergence is allowed for a given
modeled topic from the knowledge source distribution. Figure
3 shows how the JS Divergence changes with changes to the
λ parameter.
5.
δk ← [(Xk,1)λ, (Xk,2)λ, . . . , (Xk,V )λ]
With the introduction of λ as an input parameter,
the
new topic model has the advantage of allowing variance and
also leaves the collapsed Gibbs sampling equation unchanged.
However this also requires a uniform variance from the
knowledge base distribution for all latent topics. This can
be a problem if the corpus was generated with some topics
influenced strongly while others less so. To solve this we can
introduce λ as a hidden parameter of the model.
Fig. 2: Box plots [13] showing the Jensen-Shannon divergence
(the JS divergence measures the distance or similarity between
probability distributions) of 1000 Dirichlet samples parame-
terized by source hyperparameters for a subset of knowledge
source topics. The topics were taken from Wikipedia pages.
Given the approximation to the topic assignments, the θ and
φ distributions are calculated as:
nt +(cid:80)V
nw,t + δw,t
a δa,t
φw,t =
θt,d =
nd,t + α
nd + Kα
(1)
In the case when all topics are known, this model has
the advantage of conforming the φ distributions to the source
distributions, but has three drawbacks. First, even though there
is some variability between the φ distribution and source
distribution, as illustrated by Figure 2, there may be cases
in which this constraint should be relaxed even further. This
is because it is entirely possible to generate a corpus about
a known topic without exactly following the frequencies at
which the topic is discussed in its respective article. This model
also requires the user to input the known topics, and other
possible supervised approaches may be better suited to the
task [14]–[16]. The third drawback is that we are not allowing
the possibility that the corpus was generated from a mixture
of known topics and unknown topics, which is a more realistic
scenario for an arbitrary document. The next model aims to
resolve this last deficiency.
B. Known Mixture of Topics
The next model assumes that in the topic model it is given
how many topics are known topics (as well as their word
distributions) and how many are unknown topics. The previous
approach works quite well in this situation in that an unknown
topic will have a symmetric beta parameter which will capture
assignments which were unallocated due to a low probability
in matching any known topic.
The resulting model helps to solve the existing problems
of the bijective model and only requires a minor input to the
existing generative model. The resulting model works quite
well with the bijective model in that the symmetric Dirichlet
lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllMoney SupplyUnemploymentBalance of PaymentsConsumer Price IndexCanadian DollarHong Kong DollarInventoriesJapanese YenAustralian DollarInterest RatesSwiss FrancSingapore DollarWholesale Price IndexNew Zealand DollarRetail SalesCapacity UtilisationTradeIndustrial Production IndexHousing StartsPersonal Income0.000.050.100.15Jensen−Shannon DivergenceUnfortunately closed form expressions for these integrals are
hard to obtain and so they must be approximated numerically
during sampling.
Another problem arises in that the change of λ is not in
par with the change of the Gaussian distribution, as can be
seen in Figure 3. To make the changes of λ more in line
with that expected from the Gaussian PDF, we must map each
individual λ value in the range 0 to 1 with a value which
produces a change in the JS divergence in a linear fashion. We
approximate a function, g(x) with a linear derivative, shown
in Figure 4. The approach taken to approximate g(x) is by
linear interpolation of an aggregated large number of samples
for each point taken in the range 0 to 1. Our collapsed Gibbs
sampling equations then becomes:
P (zi=jz-i, w) ∝
nwi
-i,j + (δi,j)g(λ)
N (µ, σ)dλ
(3)
(cid:90)
n(·)
nw,t + β
nt + V β
-i,j +(cid:80)V
(cid:90) nw,t + (δw,t)g(λ)
nt +(cid:80)V
φw,t =
a (δa,t)g(λ)
a (δa,j)g(λ)
, ∀t ≤ T
N (µ, σ)dλ, ∀t > T
(4)
and
φw,t =
3) Superset Topic Reduction: A third problem involves
knowing the right mixture of known topics and unknown
topics. It is also entirely possible that many known topics may
not be used by the generative model. Our desire to leave the
model as unsupervised as possible calls for input that is a
superset of the actual generative topic selection in order to
avoid manual topic selection. In the case of modeling only a
specific number of topics over the corpus, the problem then
becomes how to choose which knowledge source latent topics
to allow in the model vs. how many unlabeled topics to allow.
The goal then is to allow for a superset of knowledge
source topics as input and then during the inference to select
the best subset of these with a mixture of unknown topics
where the total number of unlabeled topics is given as input
K. The approach given is to use a mixture of K unlabeled
topics alongside the labeled knowledge source topics. The total
number of topics then becomes T . During the inference we
eliminate topics which are not assigned to any documents. At
the end of the sampling phase we then can use a clustering
algorithm (such as k-means, JS divergence) to further reduce
the modeled topics and give a total of K topics. As described
more in the experimental section, with the goal of capturing
topics that were frequently occurring in the corpus, topics not
appearing in a frequent enough of documents were eliminated.
The complete generative process is shown in Figure 1(b)
and described below:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
else
if t ≤ K then
For each of the T topics φt:
Choose φt ∼ Dir(β)
Choose λt ∼ N (µ, σ)
δt ← [(Xt,1)g(λt), (Xt,2)g(λt), . . . , (Xt,V )g(λt)]
Choose φt ∼ Dir(δt)
Choose Nd ∼ Poisson(ξ)
Choose θd ∼ Dir(α)
For each of the Nd words wn,d:
For each of the D documents d:
Fig. 3: Box plots showing how the JS divergence between a
source distribution and a Dirichlet sample parameterized by
source hyperparameters raised to λ changes with changes to λ
without smoothing.
Fig. 4: The JS divergence between a source distribution and
a Dirichlet sample parameterized by source hyperparameters
raised to λ with λ mapped to a linear smoothing function g.
2) Approximating λ: In the ideal situation λ will be as
close to 1 for most knowledge based latent topics, with the
flexibility to deviate as required by the data. For this we assume
a Gaussian prior over λ with mean set to µ. The variance
then becomes a modeled parameter that conceptually can be
thought of as how much variance from the knowledge source
distribution we wish to allow in our topic model. In assuming a
Gaussian prior for λ, we must integrate λ out of the collapsed
Gibbs sampling equations (only the probability of wi under
topic j is shown, the probability of topic j in document d is
unchanged and omitted).
P (zi=jz-i, w) ∝
nwi
-i,j + (δi,j)λ
N (µ, σ)dλ
n(·)
(cid:90)
-i,j +(cid:80)V
(cid:90) nw,t + (δw,t)λ
nt +(cid:80)V
a (δa,t)λ
a (δa,j)λ
N (µ, σ)dλ
φ then becomes
φw,t =
Jensen−Shannon Divergence00.10.20.30.40.50.60.70.80.910.10.20.30.40.50.6lJensen−Shannon Divergenceg(0)g(0.2)g(0.4)g(0.6)g(0.8)g(1)0.10.20.30.40.50.6lAlgorithm 1 Collapsed Gibbs
Input: Dirichlet hyperparameters α, β, a corpus C, vocabulary V , unlabeled topic
count K, total topic count T , a set of source topics S, mean µ, variance σ, and
iteration count I.
Output: θ, φ
procedure COLLAPSED GIBBS(α, β, C, V , T )
for t = K + 1 to T do
Calculate gt
end for
Initialize Ctopics to random topic assignments
Update nw and nd from Ctopics
for iter = 1 to I do
for i = 1 to C do
for j = 1 to Ci do
Ctopicsi,j ← Sample(i, j)
end for
end for
end for
Calculate θ according to Equation 1
Calculate φ according to Equation 4
return θ, φ
end procedure
procedure SAMPLE(i, j)
Decrement nw and nd accordingly
for t = 1 to K do
Calculate pt according to Equation 2
end for
for t = K + 1 to T do
Calculate pt according to Equation 3
end for
topic ∼ Multinomial(p)
Increment nw and nd accordingly
return topic
end procedure
12.
13.
Choose zn,d ∼ Multinomial(θ)
Choose wn,d ∼ Multinomial(φzn,d)
The full collapsed Gibbs sampling algorithm is given in
algorithm 1.
4) Analysis: By using a clustering algorithm or thresh-
olding the topic document frequency,
the collapsed Gibbs
algorithm is guaranteed to produce K topics. The running
time is a function of the number of iterations I, average
words per document Davg, number of documents D, number
of topics T and number of approximation steps A, and is
O(I×Davg×D×T ×A). This differs only from the traditional
collapsed Gibbs sampling in LDA by an increase of (T −K)A.
But since we have built the approach to potentially have a large
T −K this difference can have a significant impact on running
times.
Approaches exist that can parallelize the sampling proce-
dure, but these are often approximations or can potentially
have slower than baseline running times [17]–[19]. We present
two modifications to the original algorithm that allow for
inference while guaranteeing the exactness of the results to
the original Gibbs sampling. The first one makes use of prefix
sums rules [20] and guarantees a running time of:
O(I × Davg × D × A × M ax[T /P, P ])
with P being the number of parallel units. This algorithm is
given by Algorithm 2.
This algorithm is practical in situations where T − K is
large, but suffers from the limitations of the number of context
switches required for the threads to wait at their respective
barriers. A simpler implementation approach that reduces the
number of context switches is to add the sums for each thread
then wait for a barrier. When the barrier is released we add the
end values together and then in parallel we add the remaining
Algorithm 2 Prefix Sums Parallel Sampling
procedure SAMPLE(i, j)
Decrement nw and nd accordingly
for i from 0 to T − 1 in parallel do
if i ≤ K then
else
Calculate pi according to Equation 2
Calculate pi according to Equation 3
end if
pi ← pi−1 + pi
end for
for d from 0 to (ln T ) − 1 do
for i from 0 to T − 1 by 2d+1 in parallel do
p(i+2d+1−1) ← p(i+2d−1) + p(i+2d+1−1)
end for
end for
p(T −1) ← 0
for d from (ln T ) − 1 down to 0 do
for i from 0 to T − 1 by 2d+1 in parallel do
h ← p(i+2d−1)
p(i+2d+1−1) ← p(i+2d+1−1)
p(i+2d+1−1) ← h + p(i+2d+1−1)
end for
end for
topic ← Binary Search(p)
Increment nw and nd accordingly
return topic
end procedure
Algorithm 3 Simple Parallel Sampling
procedure SAMPLE(i, j)
Decrement nw and nd accordingly
for i from 0 to T − 1 in parallel do
if i ≤ K then
else
Calculate pi according to Equation 2
Calculate pi according to Equation 3
end if
pi ← pi−1 + pi
end for
for i from 0 to T − 1 by T /P do
pi ← p(i−T /P ) + pi
endsi ← pi
end for
for i from 0 to T − 1 in parallel do
dif f ← pend − endsi
pi ← dif f + pi
end for
topic ← Binary Search(p)
Increment nw and nd accordingly
return topic
end procedure
necessary items. This approach is given in Algorithm 3. The
running time is then:
O(I × Davg × D × A × M ax[T /P, P ])
These two algorithms allow for mitigation of the increase
in the number of topics and should approach times very similar
to those of standard LDA runs. They are also very extensible
and can be used in other optimization algorithms.
5) Input determination: Determining the necessary param-
eters and inputs into LDA is an established research area [21],
but since the proposed model
input
requirements a brief overview will be given about how to best
set the parameters and determine the knowledge source.
introduces additional
a) Parameter selection: To determine the appropriate
parameters, techniques utilizing log likelihood have previously
been established [10]. Since these approaches generally require
held out data and are a function of the φ, θ, and α variables the
introduction of λ and σ will not differentiate from their original
equations. For example the perplexity calculations used for
Source-LDA are based off of importance sampling [22], or
(a)
(b)
Fig. 5: A graphical representation of topics containing 1 word
for the cell locations of row and column vectors in a 5 x 5
picture (a) and their augmented topics after swapping a random
assigned word (pixel) with a random topic's assigned word (b).
latent variable estimation via Gibbs sampling [23]. Importance
sampling is only a function of φ given by Equation 4, and
estimation via Gibbs sampling can made using Equation 4
and by the following equation (z, w, and n represent the
corresponding variables in the test document set):
P ( zi=jz-i, w) ∝ nwi
j + nwi
n(·)
j + n(·)
ndi
-i,j + α
n(di)
-i + Kα
-i,j + β
-i,j + W β
, ∀i ≤ T
and
P ( zi=jz-i, w) ∝ nwi
j + nwi
n(·)
j + n(·)
-i,j +
-i,j + δi,j
V(cid:80)
a
δa,j
ndi
-i,j + α
n(di)
-i +Kα
,∀i > T
It is recommended to set the parameters so as to maximize
the log likelihood. Further analysis such as whether or not the
parameters can be learned a priori from the data are not the
focus of this paper and are thus left as an open research area.
b) Knowledge source selection: Source-LDA is de-
signed to be used only with a corpus which has a known super
set of topics which comprise a large portion of the tokens.
An example of such a case is that of a corpus consisting
of clinical patient notes. Since there are extensive knowledge
sources comprising essentially all medical topics, Source-LDA
can be useful in discovering and labeling these existing topics.
In cases where it is not so easy to collect a superset of topics
traditional approaches may be more useful.
To test the results of the Source-LDA algorithm we set
up experiments to test against competing models. The most
similar models to our proposed approach were used in com-
parison. These are:
latent Dirichlet allocation (LDA) [1],
explicit Dirichlet allocation (EDA) [7], and the Concept-
topic model (CTM) [6]. Other approaches such as supervised
latent Dirichlet allocation (sLDA) [14], discriminative LDA
(DiscLDA) [15], and labeled LDA (L-LDA) [16] are not used
since a main desiderata of Source-LDA is to require much less
supervision than what is needed by these methods. Likewise
hierarchical methods [24] are omitted because there is no
established hierarchy in the knowledge source data for this
model. We describe in more detail below the experimental
setups and metrics used to compare results.
A. A Graphical Example
Following a previously established experiment [10], we
show the utility of Source-LDA by visualizing topics created
with words that correspond to the pixel locations in a 5 × 5
picture; but we add a key difference. The original topics are
IV. EVALUATION
Ti =
Fig. 6: Results from running Source-LDA for a corpus gen-
erated from topics in Figure 5(b) using a knowledge source
of topics corresponding to Figure 5(a). Four separate runs are
plotted to show the similarity of the log-likelihood relation to
the iteration between the runs. The topics are shown visually
at iteration 1, 20, 50, 100, 150, 200, 300 and 500 for a single
run.
augmented, used to generate a corpus, and then hidden. Only
the non augmented topics are given as input with the goal of
discovering the augmented topics using the corpus and their
original topics.
1) Experimental Setup: We start by creating ten topics with
the vocabulary being the set of pixel locations in a 5×5 picture.
The vocabulary (V ) and bag of words representation of a topic
(Ti) are defined as:
V = {xy 0 ≤ x < 5 ∧ 0 ≤ y < 5}
(cid:26)xy y = i ∧ 0 ≤ x < 5,
yx y = i ∧ 0 ≤ x < 5, otherwise
if 0 ≤ i < 5
The topics are shown by Figure 5(a) with the intensity (I) of
a pixel corresponding to word w in topic t equal to:
I(w, t) = M ax[5 × P (wt), 1]
The representation of topics in this manner leads to a
total of 10 topics. These original topics are then augmented
by pairing each topic with a random different
topic and
swapping a random word (pixel) that
is assigned to each
topic given that the swapped words do not belong to their
original assignments. Figure 5(b) shows the augmented topics
which represent a 20% augmentation rate between the original
topics. From the set of augmented topics we generate a 2,000
document corpus using the generative model of LDA. Each
document consists of 25 words with topic assignments drawn
from a distribution sampled from the Dirichlet distribution
parameterized by α = 1. With the knowledge source consisting
solely of the original non augmented topics we run Source-
LDA on the corpus hoping to discover and properly label the
augmented topics. For comparative analysis we also run EDA
and CTM against the same data set.
allowing λ to deviate, the model can make up for incorrect
parameter assignments due to a misleading perplexity value.
As shown in Figure 7, classification accuracy is not perfectly
correlated with perplexity. This is shown by the baseline
method reporting a higher perplexity value than the fixed λ = 1
value while maintaining a higher classification accuracy. Even
though we still recommend perplexity or other log-likelihood
maximization approaches to set the parameters in any unknown
data set, maximizing log-likelihood has been shown to be a
less than perfect metric for evaluating topic models [25], [26].
In this experiment and the remaining experiments we take
classification accuracy to be a more appropriate measurement
for evaluating topic models.
C. Reuters Newswire Analysis
To show the type of topics discovered from Source-LDA
we run the model on an existing dataset. This collection
contains documents from the Reuters newswire from 1987.
The dataset contains 21,578 articles, among a large set of
categories. One important feature of the dataset are a set of
given categories that we can use for our topic labeling. These
include broad categories such as shipping, interest rates, and
trade, as well as more refined categories such as rubber, zinc,
and coffee. Our choice to apply our topic labeling method
to this dataset is due to the fact that the Reuters dataset is
widely used for information retrieval and text categorization
applications. Due to its widespread use, it can considerably
aid us in comparing our results to other studies. Additionally,
because it contains distinct categories that we can use as our
known set of topics, we can easily demonstrate the viability
of our model.
1) Experimental Setup: Source-LDA, LDA, and CTM were
run against the Reuters-21578 newswire collection. Since EDA
does not discover new topics, nor does it update the word
distributions of the input topics, we do not include EDA in
this experiment. From the original 21,578 document corpus
we select a subset of 2,000 documents. The Source-LDA
and CTM supplementary distributions were generated by first
obtaining a list of topics from the Reuters-21578 dataset.
Next, for each topic, the corresponding Wikipedia article was
crawled and the words in the topic were counted, forming
their respective distributions. Querying Wikipedia resulted in
80 distinct topics as our superset for the knowledge source. Out
of the 80 crawled available topics, only 49 topics appear in the
2,000 document corpus. This represents the ideal conditions in
which Source-LDA is to be applied; that of a corpus which
a significant portion of tokens are generated from a subset
of a larger and relatively easy to obtain topic set. For all
models, a symmetric Dirichlet parameter of 50/T (where T
is the number of topics) and 200/V (where V is the size
of the vocabulary) was used for α and β respectively. For
Source-LDA, µ and σ were determined by experimentally
finding a local minimum value of perplexity which resulted
from the parameter values of 0.7 for µ and 0.3 for σ. The
bag of words used in the CTM were taken from the top
10,000 words by frequency for each topic. The models showed
good convergence after 1,000 iterations. After sampling was
complete for LDA, the resulting topic-to-word distribution was
mapped using an information retrieval (IR) approach. The IR
approach was to use cosine similarity of documents mapped
to term frequency-inverse document frequency (TF-IDF) vec-
tors with TF-IDF weighted query vectors formed from the
top 10 words per topic.
2) Experimental Results: After the LDA model converged,
we label the topics using the IR approach described above
(we referred to this topic labeling method as IR-LDA). Given
similar labels from the models it is an intuitive approach to
compare the word assignments to each topic model. Example
Fig. 7: Classification accuracy and perplexity values for fixed
values of λ compared against the baseline values generated
from a dynamic λ with a normal prior. The baseline values
shown as lines represent the classification percentage of 25.7
and perplexity value of 1119.9
2) Experimental Results: As shown in Figure 6, Source-
LDA discovers the augmented topics given the set of original
topics. Not only is Source-LDA able to find the topics correctly
to the augmented distributions used in the generation of the
corpus, but it is also able to match them to their respective
non augmented source distributions. This simple experiment
highlights a big advantage of Source-LDA; which is the ability
to discover topics that differ from their respective supervised
input set. Other models such as EDA and CTM are unable
to label
the augmented topics correctly due to the topics
containing a word (pixel) not in the original distribution. The
comparative average JS divergence was 0.012, 0.138, and 0.43
for Source-LDA, EDA, and CTM respectively.
B. Integrating λ
A reasonable assumption to a corpus in which some topics
are generated from a knowledge source is that
the topics
used in the corpus are going to deviate (more or less similar)
from their respect source distributions and that each individual
topic is going to deviate at a different rate than other topics.
The introduction of λ to Source-LDA as a parameter to be
learned by the data allows the flexibility of different topics
to be influenced differently by λ, but comes at an increase in
computation cost. To show that in certain cases this flexibility
is needed to obtain more accurate results we derive an exper-
iment consisting of topics with different deviations from their
respective source distributions.
1) Experimental Setup: A synthetic 500 document corpus
is generated from a knowledge source of 100 randomly se-
lected Wikipedia topics. The corpus is generated using the
bijective model of Source-LDA as outlined in Section 3(A),
consisting of 100 topics, an average word count per document
of 100 words, µ = 0.5, σ = 1.0 and α = 0.5. Furthermore
even though for each topic λ was drawn from N (µ, σ2) we
bound the value drawn to the interval [0, 1] for comparative
analysis. We then run Source-LDA under the bijective model
for a baseline of µ = 0.5, σ = 1.0 against 10 runs of Source-
LDA with λ fixed. After each run we compare the classification
accuracy and perplexity values.
2) Experimental Results: For all fixed λ runs the base-
line approach of varying λ in accordance with the normal
distribution results in a higher classification accuracy. By
0.10.30.50.70.915101520251136.41209.31282.2Classification %PerplexitylClassification %PerplexitySRC-LDA
inventory
cost
stock
accounting
goods
management
time
costs
financial
process
Inventories
IR-LDA
systems
products
said
information
technology
company
data
network
kodak
available
CTM
sales
year
sold
retail
given
place
marketing
improved
passed
addition
SRC-LDA
gas
natural
used
water
oil
carbon
cubic
energy
fuel
million
Natural Gas
IR-LDA
corp
contract
company
services
unit
subsidiary
completed
work
dlr
received
CTM
gas
said
total
value
near
natural
properties
california
wells
future
SRC-LDA IR-LDA
account
surplus
deficit
current
balance
currency
trade
exchange
capital
foreign
said
public
state
private
planned
reduce
local
added
make
did
Balance of Payments
CTM
said
june
april
beginning
great
later
remain
reserve
equivalent
imported
TABLE I: Topics and their most probable word lists for Source-LDA, IR-LDA, and CTM.
comparisons are shown in Table I. The label assignments
generated from Source-LDA show a more accurate assignment
of labels to topics than both IR-LDA and CTM. IR-LDA
appears to suffer from mixing of different concepts into a
single topic, for example with the topic "Inventories," the topic
assignments could possibly be the combination of "Invento-
ries" and "Information Technology". The CTM seems to assign
more weight to less important words. One approach to rectify
this problem for CTM is to use a smaller number of words for
the bag of words, but this leads to significant dropout and no
labeled topics are passed through. Out of the total 100 returned
topics, CTM only discovered 6 labeled topics, with Source-
LDA discovering 15. Since the IR approach forces all topics
to a label regardless of the quality of the label, LDA required
all topics to be matched to a label. Out of the 6 labeled CTM
topics only 3 were overlapping with Source-LDA and IR-LDA
and are shown in Table I. The remaining 3 CTM topics were
bad matches for the label with an average of 86% of words not
appropriate for the label as determined by human judgment (we
acknowledge the potential for bias). Meanwhile Source-LDA
mismatched at a rate of 36%, with IR-LDA at a rate of 77%.
Source-LDA is more consistent with the meaning of the topic
as opposed to what words you may find when talking about
this topic, which can be generally applied to many concepts.
D. Wikipedia Corpus
A comparison of Source-LDA against EDA, and CTM is
made using a corpus generated using a known knowledge
source corresponding to medical topics extracted from Med-
linePlus (a consumer-friendly medical dictionary) [27]. We
evaluate the strength of Source-LDA under different models
proposed in Section 3 using the metrics of classification
accuracy, JS divergence and Pointwise mutual
information
(PMI).
PMI is an established evaluation of learned topics which
takes as input a subset of the most popular tokens comprising
a topic and determines the frequency of all pairs in the subset
occurring at a given input distance from each other in the
corpus. The more that these pairs occur close to each other
then the better the learned topics. PMI differs from the JS
divergence evaluation for this experiment in that PMI will tell
us how good our topics are where as the JS divergence will tell
us how good our distribution over topics for each document
is.
1) Experimental Setup: A corpus of Wikipedia vocabulary
articles was generated by following the steps of the generative
model for Source-LDA, where the chosen K topics are a subset
of a larger collection of Wikipedia topics. The topics consisted
of 578 Wikipedia articles representing the collection of topic
labels from MedlinePlus. The number of topics (K) was given
as 100, chosen from an entire collection of 578 topics (B), the
number of documents (D) was given as 2000 and the average
document word count (Davg) as 500, µ and σ were set to
5.0 and 2.0 for the bijective evaluation 0.7 and 0.3 for the
Source-LDA model respectively. After these 2000 documents
were generated the topic assignments were recorded and used
as the ground truth measurement. The word assignments were
used as the corpus and the different topic models were applied
to these documents. The first round of topic models consisted
of comparing Source-LDA, EDA, and CTM. For Source-
LDA µ and σ were set
to match that of the generative
model. For all models, a symmetric Dirichlet parameter of
50/T and 200/V was used for α and β respectively. After
convergence of the models they were evaluated against the
ground truth measurement. In the second round of experiments
each topic model was run under the bijective model, that is
they only considered topics which were used in the ground
truth assignments.
To compare Source-LDA against LDA using PMI, 5 cor-
pora were generated under the bijective model with the number
of topics K ranging from 100 to 200. B, D, Davg, µ, and σ
were set to 100, 578, 200, 300, 1.0 and 0.0 respectively. The
parameters for Source-LDA followed the generative model and
all other parameters are the same as the previous experiments.
After 1000 iterations the top 10 words given for each topic
were used in the PMI assessment.
2) Experimental Results: The topic assignments for each
token in the corpus were recorded for all models and the
results compared against each other. Since we know a priori
the correct topic assignment for each token we use the number
of correct topic assignments to be an appropriate measure
of classification accuracy. Note that in evaluations where the
ground truth is known, classification accuracy is a much better
determination of the goodness of a model than log likelihood
maximizations such as perplexity and therefore we do not
evaluate the model using perplexity. In Figure 8, all topic
models run under the full Source-LDA model are tagged with
an "Unk" label, and likewise topic models run under the
bijective model are tagged with "Exact". The overall number
of correct topic assignments for each model are shown in
Figure 8(a) for the mixed model and Figure 8(b) for the
bijective model. Since the LDA model has unknown topics,
JS divergence was used to map each LDA topic to its best
matching Wikipedia topic. As expected the Source-LDA model
(SRC-Unk and SRC-Exact) had the best results amongst all
other topic models for classification accuracy.
In the second analysis the topic to document distributions
were analyzed using sorted JS Divergence, and is irrespective
to any unknown mapping. The results again show the Source-
LDA model to be effective in accurately mapping topics to
(a)
(d)
(b)
(e)
(c)
(f)
Fig. 8: Results showing the number of correct topic assignments in the mixed model (a) and bijective model (b) and sum total
of the JS divergences of θ in the mixed (d) and bijective models (e). Sorted PMI analysis for a Wikipedia generated corpus
inferred by the exact bijective model and mixed model is shown by (c). Performance benchmarking is given in (f).
documents whether or not the topics used in the generative
model are unknown (Figure 8(d)) or a known set of topics as
shown in Figure 8(e). Even though an accurate alignment of θ
by itself does not lend much weight to any one model being
superior, we do find it important to demonstrate how θ is being
affected by the different algorithms.
The PMI analysis detailed by Figure 8(c) show that by
PMI, Source-LDA provides a better mapping of labels to topics
over the input corpora. This is an encouraging result, even
though the differences are not large, since LDA is a function
of topic proximity in a document and word frequency in a
topic, whereas Source-LDA is a function of the same plus the
likelihood of a word being in an augmented source distribution.
E. Performance Benchmarking
To show the performance gains used by the parallel sam-
pling algorithm and experiment was set up to generate topics
randomly from a given vocabulary. The corpus was generated
using the same parameters as in Section 4(B) but with B
ranging from 100 to 10000. The benchmarking is visualized
by Figure 8(d). It clearly demonstrates that Source-LDA is
linearly scalable and easily parallelized.
V. RELATED WORK
Much existing literature exists related to the proposed
approach in this paper. These methods are mainly extensions
of LDA, and add to the original model by introducing en-
hancements such as topic labeling, integration with contextual
information and hierarchical modeling.
A. Topic Labeling
In the early research stage, labels were often generated by
hand [28]–[31]. Though manual labeling may generate more
understandable and accurate semantics of a topic, it costs a
lot of human effort and it is prone to subjectivity [32]. For
example, in the most conventional LDA model, topics are in-
terpreted by selecting the top words in the distribution [1], [28],
[32], [33]. The Topics over Time (TOT) model implements
continuous time stamps with each topic [32]. The model has
been applied in three kinds of datasets, and results show more
accurate topics and better timestamp predictions. However, the
interpretation of topics is manual and post-hoc labeling can be
time-consuming and subjective.
Mei et al. proposed probabilistic approaches to automati-
cally interpreting multinomial topic models objectively. The
intuition of this algorithm was to minimize the semantic
distance between the topic model and the label. To this end,
they extracted candidate labels from noun phrases chunked
by an NLP Chunker and most significant 2-grams. Then they
ranked labels to minimize Kullback-Leibler divergence and
maximize mutual information between a topic model and a
label. The approach achieved the automatic interpretation of
topics, but available candidate labels were limited to phrases
inside documents.
Lau et al came up with an automatic topic label generation
method which obtains candidate labels from Wikipedia articles
containing the top-ranking topic terms, top-ranked document
titles, and sub-phrases. To rank those candidates topic labels,
they used different lexical measurements, such as point-wise
mutual information, Student's t-test, Dice's coefficient and the
log likelihood ratio [34]. Supervised methods like support vec-
tor regression were also applied in the ranking process. Results
Correct assignmentsSRC−UnkEDA−UnkCTM−UnkLDA−Unk233k466k700kCorrect assignmentsSRC−ExactEDA−ExactCTM−ExactLDA−Exact233k466k700klllll0.100.150.200.25100125150175200TopicsPointwise mutual informationlSRC−ExactSRC−UnkLDAJensen−Shannon divergenceSRC−UnkEDA−UnkCTM−UnkLDA81624Jensen−Shannon divergenceSRC−ExactEDA−ExactCTM−ExactLDA5.310.616llllllll050100150025005000750010000TopicsAverage iteration time (s)l1 thread3 threads6 threadsshowed that supervised algorithm outperforms unsupervised
baseline in all four corpora.
In previous approaches, topics were treated individually
and relation among topics was not considered. Mao et al
created hierarchical descriptor for topics, and results proved
that inner-topic relation could increase the accuracy of topic
labels [35]. Hulpus et al proposed a graph-based approach for
topic labeling [36]. In Yashar Mehdad's work, they built an
entailment graph over phrases. Based on that, they then aggre-
gated relevant phrases by generalization and merging [37].
Conceptual labeling is an approach to generate a minimum
sized set of labels that best describe a bag of words which
includes topics generated from topic modeling [38]. Concepts
used in the topic labeling are taken from a semantic network
and deemed appropriate using the metric Minimum Descrip-
tion Length. This approach is applied after topic modeling and
represents an effective way of labeling topics over existing
approaches.
B. Supervised Labeling
Supervised Latent Dirichlet Allocation (sLDA) is a super-
vised approach to labeling topics [14]. The approach includes
a response variable into the LDA model to obtain latent topics
that potentially provide an optimal prediction for the response
variable of a new unlabeled document. This approach requires,
during training, the manual input of individual topic labels and
is constrained to permitting one label per topic.
Similar to sLDA is Discriminative LDA (DiscLDA) which
attempts to solve the same problem as sLDA, but differs
in the approach [15]. The differing approach was centered
around introducing a class-dependent linear transformation on
the topic mixture proportions. This transformation matrix was
learned through a conditional likelihood criterion. This method
has the benefit of both reducing the dimension of documents
in the corpus and labeling the lower dimension documents.
Both sLDA and DiscLDA only allow for a supervised
input set that label a single topic. An approach that allows
for multiple labels in a topic is given by Labeled LDA (L-
LDA) [16]. This model differs in the generation of multinomial
distribution theta over the topics in the model. The scaling
parameter is then modified by a label projection matrix to
restrict the distribution to those topics considered most relevant
to the document.
C. Contextual Integration
An existing approach that
takes into account concepts
supplied by prior sources requires a manual
input set of
relevant terms [39]. In the topic model then these concepts are
applied to the assignment of topics to a token in a document.
Alongside this concept topic modeling a hierarchical method
can also be used to incorporate concepts into a hierarchical
structure. This work shows the utility of bringing in prior
knowledge into topic modeling.
An approach that integrates Wikipedia information into the
topic modeling differs than the supervised approach by only
requiring an existing Wikipedia article [7]. The assumption
in this work is that in the generative process the topics are
selected from the Wikipedia word distributions. The results
show that Wikipedia articles can be used as effective topics in
topic modeling.
Wikipedia again was shown as a basis for topic modeling,
albeit for a tangential approach, entity disambiguation [7].
The approach involved topic modeling as a way of annotating
entities in text. This involved the use of a large dataset of topics
so efficient methods were introduced. Experiments against a
public dataset resulted in a state of the art performance.
VI. CONCLUSION
We have described in this paper a novel methodology for
semi-supervised topic modeling with meaningful labels, as
well as provided parallel algorithms to speed up the inference
process. This methodology uses prior knowledge sources to
influence a topic model in order to allow the labels from these
external sources to be used for topics generated over a corpus
of interest. In addition, this approach results in more mean-
ingful topics generated based on the quality of the external
knowledge source. We have tested our methodology against
the Reuters-21578 newswire collection corpus for labeling and
Wikipedia as external knowledge sources. The analysis of the
quality of topic models using PMI show the ability of Source-
LDA to enhance existing topic models.
ACKNOWLEDGMENTS
This work was supported by NIH-NCI National Cancer
Institute T32CA201160 to JW, the NIH-National Library of
Medicine R21LM011937 to CA, and NIH U01HG008488,
NIH R01GM115833, NIH U54GM114833, and NSF IIS-
1313606 to WW. The content is solely the responsibility of the
authors and does not necessarily represent the official views of
the National Institutes of Health. We would also like to thank
Tianran Zhang, Jiayun Li, Karthik Sarma, Mahati Kumar, Sara
Melvin, Jie Yu, Nicholas Matiasz, Ariyam Das and all the
reviewers for their thoughtful input into different aspects of
this paper.
REFERENCES
[1] D. M. Blei et al., "Latent dirichlet allocation," Journal of Machine
Learning Research, vol. 3, pp. 993–1022, 2003.
[2] R. S. Margalit et al., "Electronic medical record use and physician-
patient communication: an observational study of Israeli primary care
encounters," Patient Education and Counseling, vol. 1, pp. 131–141,
2006.
[3] C. W. Arnold et al., "Clinical case-based retrieval using latent topic
analysis," AMIA Annual Symposium Proceedings, vol. 2010, p. 26, 2010.
[4] H. Bisgin et al., "Mining FDA drug labels using an unsupervised
learning technique - topic modeling," BMC Bioinformatics, vol. 12, no.
S-10, p. S11, 2011.
[5] W. Speier, M. K. Ong, and C. W. Arnold, "Using phrases and
document metadata to improve topic modeling of clinical reports,"
Journal of Biomedical
Informatics, vol. 61, pp. 260–266, 2016.
[Online]. Available: http://dx.doi.org/10.1016/j.jbi.2016.04.005
[6] C. C. others, "Text modeling using unsupervised topic models and
[7]
[8]
concept hierarchies," CoRR, vol. abs/0808.0973, 2008.
J. A. Hansen et al., "Probabilistic explicit
topic modeling using
wikipedia," in Language Processing and Knowledge in the Web -
25th International Conference, GSCL 2013, Darmstadt, Germany,
September 25-27, 2013. Proceedings, ser. Lecture Notes in Computer
Science, I. Gurevych, C. Biemann, and T. Zesch, Eds., vol. 8105.
Springer, 2013, pp. 69–82. [Online]. Available: http://dx.doi.org/10.
1007/978-3-642-40722-2
J. Jagarlamudi et al., "Incorporating lexical priors into topic models,"
in EACL 2012, 13th Conference of
the
Association for Computational Linguistics, Avignon, France, April
23-27, 2012, W. Daelemans, M. Lapata, and L. M`arquez, Eds. The
Association for Computer Linguistics, 2012, pp. 204–213. [Online].
Available: http://aclweb.org/anthology-new/E/E12/
the European Chapter of
[9] T. P. Minka, "Bayesian inference, entropy, and the multinomial distri-
bution," 2000.
[10] T. L. Griffiths and M. Steyvers, "Finding scientific topics," Proceedings
of the National Academy of Sciences, vol. 101, no. Suppl. 1, pp. 5228–
5235, Apr. 2004.
[11] W. M. Darling, "A theoretical and practical implementation tutorial
on topic modeling and gibbs sampling," in Proceedings of the 49th
annual meeting of the association for computational linguistics: Human
language technologies, 2011, pp. 642–647.
[12] T. Griffiths, "Gibbs sampling in the generative model of latent dirichlet
allocation," 2002.
[13] M. W. Beck, "Average dissertation and thesis length," https://github.
com/fawda123/diss proc, 2014.
in Neural
[14] D. M. Blei and J. D. McAuliffe, "Supervised topic models,"
20,
the Twenty-First Annual Conference on Neural
Systems, Vancouver, British Columbia,
Platt, D. Koller,
Inc.,
[Online]. Available: http://papers.nips.cc/book/
in Advances
Proceedings of
Information Processing
Canada, December
Y. Singer, and S. T. Roweis, Eds.
2007, pp. 121–128.
advances-in-neural-information-processing-systems-20-2007
Information Processing
Curran Associates,
Systems
3-6,
2007,
J. C.
[15] S. Lacoste-Julien et al., "Disclda: Discriminative learning for
dimensionality reduction and classification," in Advances in Neural
Information Processing Systems 21, Proceedings of
the Twenty-
Second Annual Conference on Neural Information Processing Systems,
Vancouver, British Columbia, Canada, December 8-11, 2008, D. Koller,
D. Schuurmans, Y. Bengio, and L. Bottou, Eds. Curran Associates,
Inc., 2008, pp. 897–904. [Online]. Available: http://papers.nips.cc/
book/advances-in-neural-information-processing-systems-21-2008
[16] D. Ramage et al., "Labeled LDA: A supervised topic model for
credit attribution in multi-labeled corpora," in Proceedings of the 2009
Conference on Empirical Methods in Natural Language Processing,
EMNLP 2009, 6-7 August 2009, Singapore, A meeting of SIGDAT, a
Special Interest Group of the ACL. ACL, 2009, pp. 248–256.
[17] Y. Wang et al., "PLDA: parallel
latent dirichlet allocation for
large-scale applications," in Algorithmic Aspects
in Information
and Management, 5th International Conference, AAIM 2009, San
Francisco, CA, USA, June 15-17, 2009. Proceedings, ser. Lecture
Notes in Computer Science, A. V. Goldberg and Y. Zhou, Eds.,
vol. 5564.
[Online]. Available:
http://dx.doi.org/10.1007/978-3-642-02158-9
Springer, 2009, pp. 301–314.
[18] D. Newman et al., "Distributed inference for
in Advances
latent dirichlet
in Neural
Information Processing
allocation,"
the Twenty-First Annual Conference
Systems 20, Proceedings of
on Neural
Information Processing Systems, Vancouver, British
Columbia, Canada, December 3-6, 2007, J. C. Platt, D. Koller,
Y. Singer, and S. T. Roweis, Eds.
Inc.,
2007, pp. 1081–1088. [Online]. Available: http://papers.nips.cc/book/
advances-in-neural-information-processing-systems-20-2007
I. Porteous et al., "Fast collapsed gibbs sampling for latent dirichlet
allocation," in Proceedings of the 14th ACM SIGKDD International
Conference on Knowledge Discovery and Data Mining, Las Vegas,
Nevada, USA, August 24-27, 2008, Y. Li, B. Liu, and S. Sarawagi,
Eds. ACM, 2008, pp. 569–577.
Curran Associates,
[19]
[20] G. E. Blelloch, "Prefix sums and their applications," Synthesis of
Parallel Algorithms, Tech. Rep., 1990.
[21] H. M. Wallach et al., "Rethinking LDA: why priors matter,"
in Advances in Neural Information Processing Systems 22: 23rd
Annual Conference on Neural Information Processing Systems 2009.
Proceedings of a meeting held 7-10 December 2009, Vancouver,
British Columbia, Canada., Y. Bengio, D. Schuurmans,
J. D.
Lafferty, C. K.
Curran
Associates,
[Online]. Available: http:
//papers.nips.cc/paper/3854-rethinking-lda-why-priors-matter
Inc., 2009, pp. 1973–1981.
and A. Culotta, Eds.
I. Williams,
[22] H. M. Wallach et al., "Evaluation methods for topic models," in
Proceedings of the 26th Annual International Conference on Machine
Learning, ICML 2009, Montreal, Quebec, Canada, June 14-18, 2009,
ser. ACM International Conference Proceeding Series, A. P. Danyluk,
L. Bottou, and M. L. Littman, Eds., vol. 382. ACM, 2009, pp. 1105–
1112. [Online]. Available: http://doi.acm.org/10.1145/1553374.1553515
[23] G. Heinrich, "Parameter estimation for text analysis," University of
[24]
[25]
Leipzig, Tech. Rep, 2008.
J. Kang et al., "Transfer topic modeling with ease and scalability,"
in Proceedings of
the Twelfth SIAM International Conference
on Data Mining, Anaheim, California, USA, April 26-28, 2012.
SIAM / Omnipress, 2012, pp. 564–575.
[Online]. Available:
http://dx.doi.org/10.1137/1.9781611972825.49
J. Chang et al., "Reading tea leaves: How humans interpret
topic
models," in Advances in Neural Information Processing Systems 22:
23rd Annual Conference on Neural Information Processing Systems
2009. Proceedings of a meeting held 7-10 December 2009, Vancouver,
British Columbia, Canada., Y. Bengio, D. Schuurmans, J. D. Lafferty,
C. K. I. Williams, and A. Culotta, Eds. Curran Associates, Inc.,
2009, pp. 288–296. [Online]. Available: http://papers.nips.cc/paper/
3700-reading-tea-leaves-how-humans-interpret-topic-models
[26] C. W. Arnold, A. Oh, S. Chen, and W. Speier, "Evaluating topic model
interpretability from a primary care physician perspective," Computer
Methods and Programs in Biomedicine, vol. 124, pp. 67–75, 2016.
[Online]. Available: http://dx.doi.org/10.1016/j.cmpb.2015.10.014
"Medlineplus [internet]," https://www.nlm.nih.gov/medlineplus/.
[27]
[28] Q. Mei et al., "Automatic labeling of multinomial topic models," in
Proceedings of the 13th ACM SIGKDD International Conference on
Knowledge Discovery and Data Mining, San Jose, California, USA,
August 12-15, 2007, P. Berkhin, R. Caruana, and X. Wu, Eds. ACM,
2007, pp. 490–499.
[29] Q. Mei et al., "A probabilistic approach to spatiotemporal theme pattern
mining on weblogs," in Proceedings of the 15th international conference
on World Wide Web, WWW 2006, Edinburgh, Scotland, UK, May 23-26,
2006, L. Carr, D. D. Roure, A. Iyengar, C. A. Goble, and M. Dahlin,
Eds. ACM, 2006, pp. 533–542.
[30] Q. Mei and C. Zhai, "Discovering evolutionary theme patterns from text:
an exploration of temporal text mining," in Proceedings of the Eleventh
ACM SIGKDD International Conference on Knowledge Discovery and
Data Mining, Chicago, Illinois, USA, August 21-24, 2005, R. Grossman,
R. J. Bayardo, and K. P. Bennett, Eds. ACM, 2005, pp. 198–207.
[31] Q. Mei and C. Zhai, "A mixture model for contextual text mining," in
Proceedings of the Twelfth ACM SIGKDD International Conference on
Knowledge Discovery and Data Mining, Philadelphia, PA, USA, August
20-23, 2006, T. Eliassi-Rad, L. H. Ungar, M. Craven, and D. Gunopulos,
Eds. ACM, 2006, pp. 649–655.
[32] X. Wang and A. McCallum, "Topics over
time: a non-Markov
continuous-time model of topical trends," in Proceedings of the Twelfth
ACM SIGKDD International Conference on Knowledge Discovery and
Data Mining, Philadelphia, PA, USA, August 20-23, 2006, T. Eliassi-
Rad, L. H. Ungar, M. Craven, and D. Gunopulos, Eds. ACM, 2006,
pp. 424–433.
J. H. Lau et al., "Automatic labelling of topic models," in The 49th
Annual Meeting of
the Association for Computational Linguistics:
Human Language Technologies, Proceedings of the Conference, 19-
24 June, 2011, Portland, Oregon, USA, D. Lin, Y. Matsumoto, and
R. Mihalcea, Eds. The Association for Computer Linguistics, 2011,
pp. 1536–1545.
[33]
[34] P. Pecina, "Lexical association measures and collocation extraction,"
Language Resources and Evaluation, vol. 44, no. 1-2, pp. 137–158,
2010.
[35] X. Mao et al., "Automatic labeling hierarchical topics," in 21st ACM
International Conference on Information and Knowledge Management,
CIKM'12, Maui, HI, USA, October 29 - November 02, 2012, X. Chen,
G. Lebanon, H. Wang, and M. J. Zaki, Eds. ACM, 2012, pp. 2383–
2386. [Online]. Available: http://dl.acm.org/citation.cfm?id=2396761
I. Hulpus et al., "Unsupervised graph-based topic labelling using
dbpedia," in Sixth ACM International Conference on Web Search
and Data Mining, WSDM 2013, Rome, Italy, February 4-8, 2013,
S. Leonardi, A. Panconesi, P. Ferragina, and A. Gionis, Eds. ACM,
2013, pp. 465–474. [Online]. Available: http://dl.acm.org/citation.cfm?
id=2433396
[36]
[37] Y. Mehdad et al., "Towards topic labeling with phrase entailment and
aggregation," in Human Language Technologies: Conference of the
North American Chapter of the Association of Computational Lin-
guistics, Proceedings, June 9-14, 2013, Westin Peachtree Plaza Hotel,
Atlanta, Georgia, USA, L. Vanderwende, H. D. III, and K. Kirchhoff,
Eds. The Association for Computational Linguistics, 2013, pp. 179–
189.
[38] X. Sun et al., "On conceptual
labeling of a bag of words," in
Proceedings of the Twenty-Fourth International Joint Conference on
Artificial
IJCAI 2015, Buenos Aires, Argentina, July
25-31, 2015, Q. Yang and M. Wooldridge, Eds. AAAI Press, 2015,
pp. 1326–1332. [Online]. Available: http://ijcai.org/Abstract/15/191
Intelligence,
[39] M. Steyvers et al., "Combining background knowledge and learned
topics," topiCS, vol. 3, no. 1, pp. 18–47, 2011.
[40] Y. Bengio, D. Schuurmans, J. D. Lafferty, C. K.
I. Williams,
and A. Culotta, Eds., Advances in Neural Information Processing
Systems 22: 23rd Annual Conference on Neural
Information
Processing Systems 2009. Proceedings of a meeting held 7-10
December 2009, Vancouver, British Columbia, Canada.
Curran
Associates, Inc., 2009. [Online]. Available: http://papers.nips.cc/book/
advances-in-neural-information-processing-systems-22-2009
J. C. Platt, D. Koller, Y. Singer, and S. T. Roweis, Eds., Advances
in Neural Information Processing Systems 20, Proceedings of
the
Twenty-First Annual Conference on Neural Information Processing
Systems, Vancouver, British Columbia, Canada, December 3-6, 2007.
Curran Associates, Inc., 2008. [Online]. Available: http://papers.nips.
cc/book/advances-in-neural-information-processing-systems-20-2007
[41]
[42] T. Eliassi-Rad, L. H. Ungar, M. Craven, and D. Gunopulos, Eds.,
Proceedings of the Twelfth ACM SIGKDD International Conference on
Knowledge Discovery and Data Mining, Philadelphia, PA, USA, August
20-23, 2006. ACM, 2006.
|
1303.2449 | 1 | 1303 | 2013-03-11T08:21:48 | Using qualia information to identify lexical semantic classes in an unsupervised clustering task | [
"cs.CL"
] | Acquiring lexical information is a complex problem, typically approached by relying on a number of contexts to contribute information for classification. One of the first issues to address in this domain is the determination of such contexts. The work presented here proposes the use of automatically obtained FORMAL role descriptors as features used to draw nouns from the same lexical semantic class together in an unsupervised clustering task. We have dealt with three lexical semantic classes (HUMAN, LOCATION and EVENT) in English. The results obtained show that it is possible to discriminate between elements from different lexical semantic classes using only FORMAL role information, hence validating our initial hypothesis. Also, iterating our method accurately accounts for fine-grained distinctions within lexical classes, namely distinctions involving ambiguous expressions. Moreover, a filtering and bootstrapping strategy employed in extracting FORMAL role descriptors proved to minimize effects of sparse data and noise in our task. | cs.CL | cs | Using qualia information to identify lexical semantic classes in
an unsupervised clustering task
Lauren ROMEO1 Sara MENDES1,2 Núria BEL1
(1) Universitat Pompeu Fabra
Roc Boronat, 138, Barcelona, Spain
(2) Centro de Lingu ística da Universidade de Lisboa
Avenida Professor Gama Pinto, 2, Lisboa, Portugal
{lauren.romeo,sara.mendes,nuria.bel}@upf.edu
ABSTRACT
Acquiring lexical information is a complex problem, typically approached by relying on a number of
contexts to contribute information for classification. One of the first issues to address in this domain
is the determination of such contexts. The work presented here proposes the use of automatically
obtained FORMAL role descriptors as features used to draw nouns from the same lexical semantic
class together in an unsupervised clustering task. We have dealt with three lexical semantic classes
(HUMAN, LOCATION and EVENT) in English. The results obtained show that it is possible to
discriminate between elements from different lexical semantic classes using only FORMAL role
information, hence validating our initial hypothesis. Also, iterating our method accurately accounts
for fine-grained distinctions within lexical classes, namely distinctions involving ambiguous
expressions. Moreover, a filtering and bootstrapping strategy employed in extracting FORMAL role
descriptors proved to minimize effects of sparse data and noise in our task.
KEYWORDS : lexical semantic classes, qualia roles, unsupervised clustering, automatic extraction
of lexical information
1
Introduction
Acquiring lexical information is a complex problem, typically approached by relying on a number of
contexts to contribute information for classification, following the Distributional Hypothesis (Harris,
1954) and the idea of distributional similarity. In this domain it is crucial to determine which
distributional information is significant to characterize lexical items. In line with Pustejovsky and Ježek
(2008), we will make apparent how focusing on occurrences indicative of the FORMAL role of the
Generative Lexicon (GL) theory (Pustejovsky, 1995) allows for identifying lexical semantic classes.
Lexical classes are linguistic generalizations regarding characteristics of meaning that correspond to sets
of properties shared by groups of words. Bybee and Hopper (2001) and Bybee (2010) state that words
are organized in lexical-semantic classes defined as emergent properties of words that recurrently occur
in a set of particular contexts. Though many NLP tasks rely on rich lexica annotated with lexical
semantic classes, reliable lexical resources including this type of lexical information are mostly manually
developed, which is unsustainable, costly and time-consuming, and makes conceiving methods to
automatically acquire such information crucial. An approach for acquiring lexical semantic classes
proposes to classify words according to their occurrences in contexts where other lexical items belonging
to a known class also occur. Yet, this approach has some limitations, such as data sparseness and noise
(see Section 2), which underline the importance of developing new strategies to improve its
effectiveness. Authors such as Pustejovsky and Ježe k (2008) have shown how distributional analysis and
theoretical modeling interact to account for rich variation in linguistic meaning. In line with this proposal,
we evaluate the significance of specific co-occurrences whose selection was motivated by aspects of GL.
This work attempts to evaluate whether information provided by qualia roles, in specific the FORMAL
role, is sufficient to discriminate lexical semantic classes of English nouns. With the experiments
depicted in this paper, we aim to empirically demonstrate to which extent these features draw together
nouns from the same lexical semantic class in an unsupervised clustering task. In this paper, Section 2
depicts background and motivation of this work. Section 3 presents relevant information on the GL and
dot-objects. Section 4 describes the methodology to automatically obtain and cluster FORMAL role
descriptors of nouns. Section 5 and 6, respectively, describe and discuss results. Section 7 reflects upon
lexical classes and logical polysemy and is followed by final remarks.
2 Background and Motivation
Mainstream approaches to lexical semantic class acquisition classify words according to occurrences, i.e.
they use the entire set of occurrences of a word to determine class membership. Yet, this approach has
some limitations. Blind-theory distributional approaches have been shown to fail to account for the wide
range of linguistic behavior displayed by words in language data (see Pustejovsky and Ježek (2008)),
while authors such as Bel et al. (2010) reported problems caused by sparse data, or lack of evidence, and
noise, or information obtained though not aimed at. Concerning sparse data in classification tasks, nouns
that appear only once or twice in a corpus, and not in sought contexts, can render ineffective any
classifier or clustering algorithm by not providing sufficient information for classification. We aim to
soften effects of sparse data in the context of a clustering task by using a bootstrapping technique reliant
on natural language inference properties (see Section 4.1). Noise, another pervasive issue in lexical
semantic class acquisition, can be due to different factors: the occurrence of very general nominal
expressions (e.g. “kind of”), which do not provide distinguishing lexical information; misleading corpus
features; and the use of low-level tools (see Bel et al. (2012)). We assume noise resulting from errors
generated by NLP tools to be typically characterized by unique occurrences and we employ a filtering
strategy to overcome its possible effects (see Section 4.1). Concerning misleading corpus features, these
are often caused by ambiguity of lexical items, resulting in nouns occurring in contexts not corresponding
to their assumed lexical class. This presents challenging problems in classification tasks, as most authors
do not distinguish among related senses of the same word, i.e. they either consider it as part of the class
or not (Hindle, 1990; Bullinaria, 2008; Bel et al., 2012). This is particularly problematic when words
allow for multiple selection, i.e. when different senses of the same lexical item can be simultaneously
selected for in one sentence (see (1)). Known as logical polysemy, this type of ambiguity has been shown
to have well-defined properties (see Pustejovsky (1995) and Buitelaar (1998)) and has been consistently
reported as a factor in lexical semantic acquisition tasks.
The newly constructed (LOCATION) bank offers special conditions (ORGANIZATION) to new clients.
(1)
Approaches in this domain have usually tried to distinguish and isolate each word sense. We address
this phenomenon differently, considering polysemous nouns as members of a given ambiguity class
(within a wider lexical semantic class) and making apparent the relation between members of different
classes by identifying shared properties beyond class limits. Given these considerations, we assume
lexical units are complex objects that display rich variations of meaning in language use, placing
ourselves within a theoretical framework that provides us the tools to account for this fact. Using the
levels of representation and generative mechanisms in GL, we attempt to soften the effects of the
aforementioned limitations in the automatic acquisition of lexical information.
3 Generative Lexicon theory
GL models the internal structure of lexical items in a computational perspective (Pustejovsky, 1995),
proposing various levels of representation to semantically represent words, while allowing for the
computation of meaning in context. Qualia Structure (QS) is one of these levels, consisting of 4 roles
(FORMAL: what an object is; CONSTITUTIVE: what it is composed of; TELIC: its purpose; AGENTIVE: its
origin), which model the predicative potential of lexical items. Here, we focus on the FORMAL role,
defined as the role that distinguishes a lexical object within a larger domain (Pustejovsky, 1991).
QS also models phenomena such as polysemy of lexical items inherently complex in their meaning.
These instances, dot objects, are the logical pairing of senses denoted by individual types in a complex
type (Pustejovsky, 1995), which can pick up distinct aspects of the object, as well as properties of more
than one class (Pustejovsky and Ježek, 2008), typic ally allowing for multiple selection (see (1)). Being
able to represent lexical items as complex objects is useful in the context of our work as it provides a
formal explanation for words belonging to more than one type, and essentially to more than one class.
Our experiment uses FORMAL role information as features for identifying lexical class membership.
However, as there are no lexica available annotated with such information, we needed to obtain it
automatically. Automatically extracting qualia roles with lexico-syntactic patterns has been receiving
considerable attention for its success: Hearst (1992) identified lexico-syntactic patterns to acquire noun
hyponyms, corresponding to the FORMAL role, whereas Cimiano and Wenderoth (2007) identified
lexico-syntactic patterns to obtain information regarding semantic relations that correspond to each qualia
role. As we needed information regarding the FORMAL role, not full lexical entries, in order for clusters to
emerge, following Celli and Nissim (2009), we bypassed the representation of the entire QS, assuming
semantic relations can be induced by matching lexico-syntactic patterns that convey a relation of interest.
4 Methodology
Given the unavailability of lexica annotated with FORMAL role information, and considering our basic
goal of evaluating whether this information is enough to cluster together nouns of the same class, we
extracted it from a corpus using lexico-syntactic patterns, following Cimiano and Wenderoth (2007),
and then used it as features for a clustering task. In the experiment performed, we employed two steps:
the extraction of FORMAL role descriptors from corpus data; and the clustering of this information. To
obtain FORMAL role descriptors for our unsupervised clustering task, we used a part of the UkWaC
Corpus (Baroni et al., 2009), consisting of 150 million tokens. We employed 60 seed nouns pertaining
to three lexical semantic classes: HUMAN, LOCATION, and EVENT. The seed nouns were said to belong
to a class if they contained a sense in WordNet (Miller et al., 1990) corresponding to one of the three
classes. Seed nouns were not contrasted with actual occurrences in the corpus.
4.1 Extraction of FORMAL role descriptors using lexico-syntactic patterns
Firstly, seed nouns were used in handcrafted lexico-syntactic patterns, adapted from Hearst (1992)
patterns and the list proposed by Cimiano and Wenderoth (2007), to extract FORMAL role descriptors.
These patterns were specified through regular expressions with PoS tags given after each token.
x_(or/and)_other_y
x_such_as_y
x_(is/are)_(a/an/the)_(kind(s)/type(s))_of_y
x_(is/are)_also_known_as_y
TABLE 1 – Clues on which patterns used to detect FORMAL role information in corpus data were built
The information obtained was stored in vectors representing co-occurrences with seed nouns in relevant
contexts (patterns), where each element corresponds to occurrences of a particular seed noun (x) with a
possible FORMAL role descriptor (y), following Katrenko and Adriaans (2008). Using the clues in Table
1, we obtained 185 FORMAL role descriptors for 55 of the 60 seed nouns in 353 occurrences.
Considering this, and given the properties of the clustering algorithm used (see Section 4.2) a random
value would be provided to nouns not sharing feature information with any other noun in our data set.
To avoid random cluster assignations and provide more significant information to the system, we
filtered out the features not shared between at least two seed nouns, without controlling which class the
shared features belonged to, thus maintaining an unsupervised environment. Though we employed a
large set of data, there were not enough shared FORMAL role descriptors for an important part of our
data set, leading us to devise a strategy to increase the information available to the clustering algorithm.
a. A mammal is a [type of] animal.
b. A zebra is a [type of] mammal.
c. Therefore, a zebra is a [type of] animal.
(2)
To increase the amount of FORMAL role descriptors, we employed a bootstrapping technique (Hearst,
1998) relying on monotonic patterns for natural language inference (Hoeksema, 1986; van Behthem,
1991; Valencia, 1991), illustrated in (2). This strategy is consistent with GL lexical inheritance structure
(Pustejovsky, 1995; 2001), which assumes lexical items obtain their semantic representation by
accessing a hierarchy of types and inheriting information according to their QS, meaning qualia
elements are viewed as categories hierarchically organized. To illustrate how this applies in our case,
the HUMAN noun treasurer obtained officer as a FORMAL role descriptor, whereas officer extracted
person and employee as its own FORMAL role descriptors. Assuming this lexical organization, we
consider FORMAL role descriptors extracted for officer to also be features of treasurer. Thus, we
gathered additional information regarding the nouns to cluster, using originally obtained FORMAL role
descriptors as “seed nouns” to extract more element
s in an attempt to overcome biases due to sparse
data (see Section 6), as well as to reinforce information already obtained. Employing the original
patterns and original extractions as seeds, we obtained information that was added to the vectors. We
conducted one iteration of the bootstrapping technique, going up one level of generalization to obtain
the final distribution of information below. Newly obtained information was unified with previously
extracted features, filtering out any additional noise attained. Table 2 presents the final distribution of
this information.
Class
Elements
Occurrences
HUMAN
61 elements
841 occurrences
LOCATION
43 elements
225 occurrences
EVENT
36 elements
216 occurrences
TABLE 2 – Distribution of FORMAL role descriptors extracted (after filtering and bootstrapping) per class of seed noun
4.1.1 Error Analysis
Basing our clustering experiment on automatically extracted FORMAL role descriptors, the accuracy of the
information obtained was a concern. To assess the accuracy of the information obtained, the FORMAL role
descriptors extracted were revised manually. Extractions were considered erroneous if they provided
information not in accordance with the class that the seed nouns pertained to. Table 3 presents the results
of this analysis. Erroneous extractions were due to faults of the extraction mechanism (i.e. problems
handling phenomena such as PP attachment), PoS tagging errors, lexical ambiguity or erroneous
statements in text (Katrenko and Adriaans, 2008), as well as errors due to logical polysemy (see Section
6). Note that although errors were identified, they were not filtered for the clustering task, i.e. all
information (erroneous or not) was included (on the impact of errors in results see Section 6).
Class
HUMAN
LOCATION
EVENT
% of accurate FORMAL role descriptors extracted
87.60%
63.54%
75.96%
TABLE 3 – Percentage (%) of accurate FORMAL role descriptors obtained per class
4.2 Clustering nouns using FORMAL role information
The second step of our experiment consisted in clustering nouns using the FORMAL role descriptors
extracted. Given the nature of our data, we selected the sIB clustering algorithm (see Slonim et al.
(2002) for a formal definition) for the manner it manages large data sets. This algorithm calculates
similarity between two vectors using the Jensen-Shannon divergence, which measures similarity
between probability distributions, rather than the Euclidean distance, which can bias the results when
the number of attributes representing the factors is unequal (Davidson, 2002). This was our case as our
feature spaces depend on the number of FORMAL role descriptors each seed noun occurred with in the
corpus. To empirically demonstrate to which extent FORMAL role descriptors draw together nouns from
the same class, we designed an experiment using the sIB algorithm in WEKA (Witten and Frank, 2005)
to cluster seed nouns into lexical semantic classes, based only on the FORMAL role information obtained.
5 Results
As mentioned, our goal was to cluster together nouns from the same lexical semantic class using only
FORMAL role descriptors. As the evaluation of unsupervised distributional clustering algorithms is
usually done by comparing results to manually constructed resources (see Rumshsiky et al. (2007),
among others), we employed our list of pre-classified seed-words to determine if nouns of the same
class clustered together. Tables 4 and 5 present clustering results. The distribution of nouns across each
cluster is given by the percentage of nouns pertaining to each lexical class included in it. The total
number of seed nouns in each cluster is also given.
Cluster 0 Cluster 1 Cluster 2 Class
0.5714
0.9285
HUMAN
0
LOCATION
0.1429
0.3913
0.0769
0.6087
EVENT
0.2857
0
23
14
7
TOTAL NUMBER OF SEED NOUNS PER CLUSTER
TABLE 4 – Distribution of nouns in a 3-way clustering so lution
We experimented with a 3-way and a 4-way clustering solution. In the first, the number of clusters was
defined by the number of known classes, and resulted in the clustering of HUMAN nouns (Cluster 0).
LOCATION and EVENT nouns grouped together in Cluster 1, the remaining cluster being composed of
nouns from all classes with very few features available (less than three), i.e. insufficient information for
classification. Considering this, we employed a 4-way solution to see whether LOCATION and EVENT
nouns could be discriminated. This solution distinguished between the three classes (Cluster 0, 1 and 3
in Table 5) with a fourth cluster containing the “s parse data” nouns also affecting the 3-way solution .
Cluster 0 Cluster 1 Cluster 2 Cluster 3 Class
0.9286
0.5714
HUMAN
0
0
0.9
0
0.1429
0.0769
LOCATION
1
EVENT
0
0.2857
0.1
13
10
7
14
TOTAL NUMBER OF SEED NOUNS PER CLUSTER
TABLE 5 – Distribution of nouns in a 4-way clustering so lution
The results show that even after filtering and bootstrapping the features extracted, sparse data still
affected the results. However, nouns whose most salient common trait was the lack of sufficient
information were consistently grouped together. Thus, the clustering is able to both discriminate
between lexical semantic classes and act as a filter to detect those nouns for which there is not sufficient
information using only FORMAL role information extracted from corpus data.
6 Discussion
As shown, the clustering algorithm discriminated between the three classes considered, using only the
FORMAL role descriptors extracted from corpora data as features. Leaving aside the nouns for which
there was not enough information available (12.7% of our data set), EVENT, HUMAN and LOCATION
nouns were discriminated in the 4-way clustering solution (Clusters 0, 1 and 3 in Table 5, respectively).
In this section we analyze misclassified nouns, to understand the reasons behind their misclassification,
aiming to evaluate to which extent they correspond to recurring phenomena in language, which can
possibly be accounted for by additional strategies.
Although their impact is not significant, noisy extractions (see Section 4.1.1) play a role in
misclassification. In the 4-way clustering results, for instance, an EVENT noun is included in the cluster
dominated by LOCATION nouns due to errors in extraction, specifically the incorrect identification as a
FORMAL role descriptor of the noun in a PP modifying the head noun of an NP, which should be the one
extracted. This type of noise is mostly generated by the use of low-level NLP tools. Overall, however,
the existence of some noise in the data did not significantly affect the clustering, as demonstrated by the
accuracy of the results presented in the previous section.
Concurrently, although general patterns can be identified in language use, one of the main
characteristics of language data is its heterogeneity, which means that elements of a given lexical class
do not necessarily share all their features or show perfectly matching linguistic behavior. Moreover,
considering lexical items are complex objects with different semantic dimensions, they may share
properties with elements of more than one lexical class. This type of phenomenon is behind some of the
misclassifications in our data, such as the inclusion of factory, whose expected lexical class was
LOCATION, in the HUMAN nouns cluster. This misclassification seems to be related to the fact that a part
of HUMAN class members tended to obtain FORMAL role descriptors typical of HUMAN nouns, as well as
of ORGANIZATION nouns, making apparent that nouns do not always occur in the sense considered in
our pre-classified list of seed nouns.
7 Lexical classes and logical polysemy
As aforementioned, some HUMAN nouns in our list of seed nouns obtain FORMAL role descriptors
typical of ORGANIZATION nouns. This is a type of polysemy that occurred in our data only with plural
HUMAN nouns, alluding to the work of Copestake (1995) and Caudal (1998), according to whom some
HUMAN nouns show a specific type of polysemy when heading definite plural NPs: the polysemy
between the individual HUMAN sense and the collection of HUMANs sense, which in turn is polysemous
between the HUMANGROUP and ORGANIZATION senses. In (3) we see how the definite plural NP the
doctors can select for the two senses typically denoted by collective nouns, while having also the
possibility to denote individual entities, which is not possible with collectives (see (4a)) that cannot
occur in contexts that force a distinct individual entity reading.
(3)
a. The doctors lay in the sun. (several individual HUMAN entities)
b. The doctors protested in front of the hospital. (HUMANGROUP)
c. The administration negotiated with the doctors. (ORGANIZATION)
a. # The staff lay in the sun. (several individual HUMAN entities)
b. The employees lay in the sun. (several individual HUMAN entities)
c. The staff protested in front of the hospital. (HUMANGROUP)
d. The administration negotiated with the staff. (ORGANIZATION)
(4)
As both collectives and definite plural NPs denote collections, Caudal (1998) states that it is desirable to
account for the polysemy of such items morpho-syntactically. This analysis is further strengthened by
the observation that, unlike pairs such as employee and staff, for nouns like doctor there is no
lexicalization for “group of doctors”
in English, the same being true for collective nouns like audience
or committee, whose individual members are not lexicalized. Given such lexical gaps, morpho-syntax is
the strategy available. However, though logically polysemous, plural definite NPs like the doctors do
not allow for multiple selection as is typical of complex types: once the individual HUMAN sense has
been selected for there is no access to the HUMANGROUP·ORGANIZATION sense, as suggested by (5)
(see Buitelaar (1998) and Rumshisky et al. (2007)).
The administration negotiated with the doctors, which later lay in the sun. (several individual HUMAN entities) (5)
Pustejovsky (1995:155) claims these patterns of linguistic behavior are due to the information in the QS.
In the case of expressions like the doctors, the dot element denoting the individual HUMAN entity and
the complex type HUMANGROUP·ORGANIZATION correspond to different qualia roles, as represented in
(6). Hence, the different senses of the expression cannot be selected at the same time.
Going back to the case of factory, which was clustered with HUMAN nouns (see Section 6), we will see
how the polysemy described above partially applies to this noun. Among the descriptors obtained for
factory we found, alongside descriptors typical of LOCATION nouns, nouns such as sector, organization
and profession, also extracted for HUMAN nouns showing the HUMANGROUP·ORGANIZATION logical
polysemy, indicating that nouns like factory are also complex objects, as illustrated below by (7):
(6)
a. The factory on the corner of Main Street is big and brown. (LOCATION)
b. The factory summoned a protest against the new government sanctions. (ORGANIZATION)
c. There was a protest organized (ORGANIZATION) by the factory that burned down (LOCATION) last week. (7)
In our data, factory shared features both with definite plural NPs headed by HUMAN nouns like teacher
and employee and LOCATION nouns such as kitchen and resort. The linguistic behavior of factory can,
therefore, be assumed to reflect the logical polysemy of ORGANIZATION·LOCATION·HUMANGROUP dot
types identified by Rumshisky et al. (2007), and represented as follows:
factory
ganization
or:y
human
]
[
z·y·x
QUALIA
FORMAL
For our work, the most relevant aspect of the behavior displayed by nouns like factory is that it makes
apparent how our strategy to extract FORMAL role descriptors reflects the ambiguity of nouns to be
ARGSTR
location
=
=
=
ARG3
ARG1
:x
:z
=
ARG2
=
=
(8)
clustered, which is often difficult to handle in NLP, particularly in classification tasks. The clustering
solutions we obtained (see Section 5) grouped together HUMAN nouns, both those that display the
ambiguity discussed in this section and those that do not, the same being true for LOCATION nouns. And
yet, polysemous nouns display features that clearly point towards the existence of finer-grained
distinctions, i.e. sub-classes within lexical semantic classes. This way, particularly given that these fine-
grained distinctions are mirrored in FORMAL role descriptors, we assume it should also be possible to
automatically recognize groups of nouns within the same ambiguity class, i.e. dot objects.
Hence, we expected the clustering algorithm to identify polysemous lexical items and distinguish them
from other members of the same class. To validate this hypothesis we performed an additional iteration of
the clustering using the same features and algorithm over previously identified clusters. The iteration was
run individually over Clusters 1 and 3 (LOCATION and HUMAN noun clusters, respectively) from our 4-way
clustering solution, as both clusters contained logically polysemous nouns. We obtained a 2-way clustering
solution for each class, aiming to discriminate nouns strictly containing the LOCATION sense and those
reflecting
the polysemy described above
for
factory, on one hand, and nouns
in
the
HUMAN·HUMANGROUP·ORGANIZATION ambiguity class from those strictly denoting human individuals
on the other. Cluster 1 split into 2 clusters distinguishing between polysemous LOCATION nouns and those
that are not, whereas for Cluster 3 the clustering algorithm arrived at a near perfect distinction of dot object
nouns and non-ambiguous HUMAN nouns. The noun factory clustered with polysemous HUMAN nouns,
once more confirming its semantic proximity with nouns of the HUMAN·HUMANGROUP·ORGANIZATION
type. Hence, a second iteration of the same clustering algorithm over the same feature vectors was able to
identify finer-grained distinctions within lexical classes, automatically recognizing groups of nouns in the
same ambiguity class. In doing this, we validate our analysis regarding the role of logical polysemy and
dot object types in the clustering solutions obtained, and further strengthen our original hypothesis.
Final remarks
In this paper, we proposed using automatically obtained FORMAL role descriptors as features to draw
together nouns from the same lexical semantic class in an unsupervised clustering task. As there were no
available lexica annotated with such information, we obtained it automatically and carried out clustering
experiments. In line with the results, our initial hypothesis was supported: in an unsupervised clustering
task using FORMAL role descriptors automatically extracted from corpora data as features, we showed it
was possible to discriminate between elements of different lexical semantic classes. The filtering and
bootstrapping strategy employed proved to minimize effects of sparse data and noise in our task. As shown
in the 4-way clustering solution (see Table 5), the clustering exercise, as we designed it, also discriminated
the nouns for which there was not sufficient information for a decision to be made on their membership to
a cluster corresponding to one of the classes considered. Finally, we explained misclassifications through
logical polysemy and showed how the method outlined in this paper allows for making finer-grained
distinctions within lexical classes, recognizing lexical items in the same ambiguity class.
The results depicted in this paper demonstrate the validity of our hypothesis, while simultaneously
showing that it is possible to incorporate the polysemous behavior of nouns in classification tasks
(Hindle, 1990; Bullinaria, 2008) by using an approach that minimizes the effects of sparse data and
noise (Bel et al., 2010; 2012). Considering these promising results, in future work we will address the
possibility of extending our experiments to other qualia roles, as well as to other lexical semantic
classes. At a more applied level, a further step consists in evaluating the feasibility of this approach to
automatically extract lexical semantic classes in the automatic acquisition of rich language resources.
Acknowledgments
This work was funded by the EU 7FP project 248064 PANACEA and the UPF-IULA PhD grant
program, with the support of DURSI, and by FCT post-doctoral fellowship SFRH/BPD/79900/2011.
References
Baroni, M., Bernardini, S., Ferraresi, A. and Zanchetta, E. (2009). The WaCky Wide Web: A
Collection of Very Large Linguistically Processed Web-Crawled Corpora. Language Resources
and Evaluation, 43(3), 209-226.
Bel, N., Coll, M. and Resnik, G. (2010). Automatic detection of non-deverbal event nouns for quick
lexicon production. In Proceedings of the 23rd International Conference on Computational
Linguistics, (COLING 2010), Beijing, China (pp. 46-52).
Bel, N., Romeo, L. and Padró, M. (2012). Automatic Lexical Semantic Classification of Nouns. In
Proceedings of the Language Resources and Evaluation Conference (LREC 2012), Istanbul,
Turkey.
Buitelaar,
(1998). CoreLex:
P.
Doctoral dissertation, Brandeis University.
Systematic
Polysemy
and Underspecification.
Bullinaria, J.A. (2008). Semantic Categorization Using Simple Word Co-occurrence Statistics. In
M. Baroni, S. Evert and A. Lenci (Eds.), Proceedings of the ESSLLI Workshop on Distributional
Lexical Semantics, 1-8. Hamburg, Germany.
Bybee, J. L. and Hopper, P. (2001). Frequency and the emergence of language structure.
Amsterdam: John Benjamins.
Bybee, J. (2010). Language, usage and cognition. Cambridge: Cambridge University Press.
Caudal, P. (1998). Using complex lexical types to model the polysemy of collective nouns within
the Generative Lexicon. In Proceedings of the Ninth International Workshop on Database and
Expert Systems Applications, Viena, Austria (pp.154-159).
Celli, F., Nissim, M., (2009) Automatic Identification of semantic relation in Italian complex
nominals, In Proceedings of the 8th International Conference on Computational Semantics (IWCS-
8), Tilburg, Netherlands.
Cimiano, P. and Wenderoth, J. (2007). Automatic Acquisition of Ranked Qualia Structures from the
Web. In Proceedings of the 45th Annual Meeting of the Association of Computational Linguistics,
Prague, Czech Republic (pp.888-895).
Copestake, A. (1995). The representation of group denoting nouns in a lexical knowledge base. In
P. Saint Dizier and E. Viegas (Eds.) Computation Lexical Semantics (pp. 207-230). Cambridge:
Cambridge University Press.
Davidson, I. (2002). Understanding K-means non-hierarchical clustering. (Tech. Rep. 02-2).
Albany: State University of New York.
Harris, Z. (1954). Structural Linguistics. Chicago: Chicago University Press.
Hearst, M. (1992). Automatic acquisition of hyponyms from large text data. In Proceedings of the
14th International Conference on Computational Linguistics (COLING 92), Nantes, France (pp.
539-545).
Hearst, M. (1998). Automated Discovery of Word-Net relations. In C. Fellbaum (Ed.), An
Electronic Lexical Database and Some of Its Applications (pp. 131-153). Cambridge: The MIT
Press.
Hindle, D. (1990). Noun classification from predicate-argument structures. In Proceedings of the
28th Annual Meeting of the Association for Computational Linguistics, Pittsburgh. Pennsylvania
(pp. 268-275).
Hoeksema J. (1986). Monotonicity Phenomena in Natural Language. Linguistic Analysis, 16, 25-40.
Katrenko, S. and Adriaans, P. (2008). Qualia Structures and their Impact on the Concrete Noun
Categorization Task. In Proceedings of the "Bridging the gap between semantic theory and
computational simulations" workshop ( ESSLLI 2008), Hamburg, Germany.
Miller, G.A., Beckwith, R., Fellbaum, C., Gross, D. and Miller, K.J. (1990). Introduction to
WordNet: An online lexical database. International Journal of Lexicography, 3(4), 235-44.
Pustejovsky, J. (1991). The Generative Lexicon. Computational Linguistics. 17(4), 409–41.
Pustejovsky, J. (1995). Generative Lexicon. Cambridge: The MIT Press.
Pustejovsky, J. (2001). Type Construction and the Logic of Concepts. In P. Bouillon and F. Busa
(Eds.), The Language of Word Meaning (pp. 91-123). Cambridge: Cambridge University Press.
Pustejovsky, J. and Ježek, E. (2008). Semantic coer cion in language. beyond distributional analysis.
Italian Journal of Linguistics, 20(1), 175-208.
Rumshisky, A., Grinberg, V. and Pustejovsky, J. (2007). Detecting Selectional Behavior of
Complex Types in Text. In 4th International Workshop on Generative Lexicon, Paris, France.
Slonim, N., Friedman, N. and Tishby, N. (2002). Unsupervised document classification using
sequential information maximization. In Proceedings of the 25th International ACM SIGIR
Conference on Research and Development in Information Retrieval, Tampere, Finland (pp.129-
136).
Valencia, V. (1991). Studies on Natural Logic and Categorial Grammar. Doctoral dissertation,
University of Amsterdam.
van Benthem, J. (1991). Language in Action: Categories Lambdas and Dynamic Logic. North
Holland: Elsevier Science Publishers.
Witten, I.H. and Frank, E. (2005). Data Mining: Practical machine learning tools and techniques
(2nd ed.). San Francisco: Morgan Kaufmann.
|
1803.00902 | 1 | 1803 | 2018-03-02T15:41:33 | DEMorphy, German Language Morphological Analyzer | [
"cs.CL"
] | DEMorphy is a morphological analyzer for German. It is built onto large, compactified lexicons from German Morphological Dictionary. A guesser based on German declension suffixed is also provided. For German, we provided a state-of-art morphological analyzer. DEMorphy is implemented in Python with ease of usability and accompanying documentation. The package is suitable for both academic and commercial purposes wit a permissive licence. | cs.CL | cs | DEMorphy, German Language Morphological Analyzer
Duygu Altinok
Berlin, Germany
Abstract. DEMorphy is a morphological analyzer for German. It is built onto large,
compactified lexicons from German Morphological Dictionary. A guesser based on
German declension suffixes is also provided. For German, we provided a state-of-art
morphological analyzer. DEMorphy is implemented in Python with ease of usability and
accompanying documentation. The package is suitable for both academic and commercial
purposes with a permissive licence.
Keywords: morphological analyzer, lemmatizer, German, German language, demorphy,
DEMorphy, German Morphological Dictionary, gmd
1.
INTRODUCTION
Morphological analysis is analysis of structure of the word forms. For morphologically complex
languages such as Turkish, Finnish, German; a full morphological analysis provides information
about word category (noun, verb, adjective etc.), word lemma, number, gender, person etc. In
these languages morphology derives syntax, word analysis also provides information about
possible POS tags (or vice versa, syntax determines feasible morphological forms. Here,
morphology↔syntax implication is always two-sided). Morphological analysis units, either
rule-based or unsupervised statistical, is an important step of modern NLP pipelines. From
statistical machine translation to sentiment analysis, training morphology aware NNs to semantic
search; morphological analysis keeps its importance in modern NLP pipelines.
Morphological generation is the process of creating word forms as appear in the language from a
base form and analysis. Roughly, given the lemma(s) and a list of inflections and derivations,
finding the correct word form is called generation.
DEMorphy is a morphological analyzer for German language. The package is available under
MIT Licence and itself uses another open source library.
DEMorphy is an efficient, DAFSA based Python implementation. Unlike other similar freely
available German analyzers SMOR and Morphisto , DEMorphy is implemented in native
Python and does not require any extra Python bindings or extra system calls at runtime.
DEMorphy is production-ready, brings predictable runtime quality and provides predictable
concurrency behaviour (following well-understood Python concurrency model).
Rest of the paper is organized as follows: Section 2 explains details about
the German
Morphological Dictionary . In section 3, software architecture and implementation details will be
given. Section 4 contains details of the morphological analysis process. Section 5 outlines a
roadmap for future improvements and new features.
4
1
2
3
1 https://github.com/DuyguA/DEMorphy
2 http://www.cis.uni-muenchen.de/~schmid/tools/SMOR/
3 http://www1.ids-mannheim.de/lexik/home/lexikprojekte/lexiktextgrid/morphisto.html
4 https://github.com/DuyguA/german-morph-dictionaries
2. GERMAN MORPHOLOGICAL DICTIONARY
6
5
gmd is a German lexicon and analysis dictionary, it contains lexicon words and list of their all
possible analysis. gmd is generated by running our in-house morphological analyzer on
Wikidumps corpus. Interjections, modular verbs, auxiliary verbs, particles, conjunctions,
determiners and articles (i.e. closed grammatical categories of the German language) is
processed with extra care and appears at the beginning of the text file. Dictionary format is plain
text, which is suitable for converting to other formats such as XML, for different purposes. gmd
consists of
(a) Word forms as they appear in written language, inflected, derived forms and compounds
included. Each word form is followed by list of its possible analysis.
(b) Experimental analysis dictionary
(c) List of all lemmas that occur in (a)
(d) List of all paradigms that occurs in (a)
A typical entry looks like:
gegangen
gegangen ADJ,pos,<pred>
gegangen ADJ,pos,<adv>
gehen V,ppast
Analysis lines are of the form (lemma, paradigm). A paradigm is a list of
- Grammatical category as first entry, always
- Gender, number, person, positive/comparative/superlative etc. list of inflections
separated by commas.
Our in-house analyzer can
-
-
-
-
split compounds i.e. list all possible splits of a compound,
show bounding morphemes between compound elements,
analyze derivation,
analyze inflection.
Also, our in-house analyzer is
-
-
-
FST based and compiled from marked lexicon,
compiled with OpenFST,
efficient, can be processed by Python via PyFST directly without needing external
Python binders; fully Python compatible and reliable for software production.
5 https://github.com/DuyguA/german-morph-dictionaries
6 https://dumps.wikimedia.org/dewiki/latest/
However, DEMorphy does not include all capabilities of our in-house analyzer. We currently
provide only the inflection analysis. Derivational analysis and compound splitting is not
included. Hence a typical compound analysis looks like:
Rohrohrzucker
Rohrohrzucker NN,masc,acc,plu
Rohrohrzucker NN,masc,acc,sing
Rohrohrzucker NN,masc,nom,sing
Rohrohrzucker NN,masc,gen,plu
Rohrohrzucker NN,masc,dat,sing
Rohrohrzucker NN,masc,nom,plu
whereas output of our in-house tool is:
Roh<#>rohr<#>zucker NN,masc,acc,plu
Roh<#>rohr<#>zucker NN,masc,acc,sing
Roh<#>rohr<#>zucker NN,masc,nom,sing
Roh<#>rohr<#>zucker NN,masc,gen,plu
Roh<#>rohr<#>zucker NN,masc,dat,sing
Roh<#>rohr<#>zucker NN,masc,nom,plu.
While preparing analysis of the compounds, first we took all possible splits, then filtered by (1)
feasible POS tag combinations (2) with a language model to eliminate "nonsense" analyses. For
instance, in the above example analysis rohr<#>ohr<#>zucker (pipe ear sugar) is eliminated by
(2).
The experimental word forms is the list of word analysis that is produced by our "guesser".
Basically we separated analysis that developers should use at their "own risk" into a separate list.
The dictionary size is 340MB, experimental forms dictionary is sized 15MB. An encoded form is
also available, lemma and paradigm strings are encoded to numbers pointing to the lemmas list
and the paradigms list. The encoded dictionary size is 135MB, list of all lemmas is 18MB and
paradigms list is 20KB. Number of all inflectional paradigms is 643 with a total number of
1.187.013 possible lemmas. Together with the experimental forms the morphological dictionary
contains 12.066.971 entries with a lexicon size 2.168.203 word forms.
3. SOFTWARE ARCHITECTURE
7
DEMorphy is implemented as a Python library. Both Python 2.x and Python 3.x are supported.
Documentation is available online.
The average parsing speed is around 15 000 - 20 000 words per second. Memory consumption of
the compacted dictionaries is about 100 MB, together with the Python interpreter 120 MB.
Users are provided with library code for obtaining word analysis, word lemma, possible POS
tags in both Stuttgart (STTS) and Penn Tree Bank (PTB) tags as well as iterators over the all
lexicon. All possible analysis of a given word is provided, choosing which one to use is to be
determined the user.
Cache implementations are also provided within the package. An LRU cache implementation
provides users obtaining analysis with cache lookup. The LRU cache proves efficiency on
average length German text, conjunctions, pronouns, auxiliary verbs, modal verbs, articles,
determiners and context words appear over and over again. Instead of computing same word's
analysis over and over, user can cache the analysis result. An unlimited cache implementation is
also provided, however not recommended; LRU cache would be enough and well-performing.
8
4. ANALYSIS
DEMorphy relies on a compacted form of German Morphological Dictionary as we remarked
before. End users do not have to compile the compacted dictionary themselves, we will deliver
precompiled dictionaries on updates.
Morphological analysis indeed is just dictionary lookup in DAFSA. Given a word, we fetch all
possible analysis strings. From the plain text dictionary file, one can build a Python dictionary (a
hashmap) and query the input words. However, this approach might have some problems:
- Memory-killer: Words belong to same paradigms usually have same endings, for instance
imfendem, informierendem, gehendem, abgehendem, umgehendem; especially
declensions. Also, inflections of the same lemma share long prefixes, for instance
kurieren, kurierend, kurierende, kurierender, kurierendes, kurierst. Common prefixes
such as um, ab also occurs frequently e.g. melden, anmelden, abmelden, nachmelden,
ummelden, vermelden, weitermelden, zurückmelden. It is not very storage friendly to
store the same substrings again and again.
(1)Θ
lookup, however hash function needs to go
- Time efficiency: Hashmap provides
over all characters of the input string 1-by-1. If one is interested in fuzzy lookup, then all
options need to be generated and looked up 1-by-1. For instance, if "u" can be both "u"
and "ü", then we need 2 lookups. This situation happens quite a lot with the German
umlauts.
7 http://www.ims.uni-stuttgart.de/forschung/ressourcen/lexika/TagSets/stts-table.html
8 https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html
To compactify the common substrings and enable fast access together with fast fuzzy lookup;
DEMorphy stores the words in a DAFSA using DAWG library. DAWG is a Cython based,
low-level, efficient, unicode supporting Python library. Information about lemma and paradigm
string is encoded as positive integers, pointing to real strings in lemma list and paradigm list.
DAFSA Directed acyclic graphs are widely used in NLP, computational morphology and IR
tasks. DEMorphy stores word forms in DAFSA as well, due to
9
- Memory efficiency
-
-
-
Fast lookup
Fast fuzzy lookup
Flexible iteration support
Here is an example how common endings are stored:
Figure 1: Common Endings Storage
DAFSA for German lexicon of 12.066.971 entries is about 100MB, whereas the plain text file is
135MB.
Fuzziness caused by the German umlaut characters are handled efficiently by DAFSA as well.
Take the example "grün". It is quite possible that it is written as "grun" by a non-German
keyboard. We provide DAFSA a character mapping, in which characters might represent more
than one character, a character set. DAWG allows 1-to-1 character mappings, hence we provided
u → ü, o → ö, a → ä mappings.
While scanning the input string "grun", at the second state, DAFSA permits possible u → ü
replacement and correctly reaches the acceptance state. DAWG allows only 1-to-1 mappings,
hence we dealt with ue → ü , oe → ö, ae → ä, ss → ß, ß → ss with another method.
9 https://pypi.python.org/pypi/DAWG
Figure 2: Input String "grun" scanning left to right
OOV OOV is handled by prefix and suffix analogies. Currently we support obvious verb
endings such as test, tet, tem, ten etc. by a suffix-prefix-infix analyzer. In the future, we plan to
expand recognition by a character level language model.
Compound Words As we remarked before, DEMorphy does not carry all capabilities of our
in-house analyzer. Our in-house analyzer analyzes compounds completely, exhibiting component
word boundaries, linking morphemes and then the derivations and the inflections. DEMorphy
does not provide a full analysis, rather provides the lemma and the inflections; just as rest of the
lexicon words. However, compound words processed carefully before shipped to the
morphological dictionary. Our in-house tool generated all possible splits, then we filtered by
impossible POS tag combinations (e.g. beiden is not bei<#>den) and a language model. We
already gave the example "Rohrohrzucker", has 2 possible splits rohr<#>ohr<#>zucker (pipe
ear sugar) and roh<#>rohr<#>zucker (raw cane sugar). The language model eliminated the first
form because "it does not make sense", i.e. it admits a very low probability. In general, we used
the heuristic that "less split is better than more splits". If a compound admits a 2 words split and
a 3 words split, we preferred the former.
Words with a Hyphen is processed by STTS notation, TRUNC. We included them into lemma,
rather than the analysis. For instance, lemma of "U-Bahn" is U-(TRUNC)Bahn and lemma of
"U-Bahn-Station" is U-(TRUNC)Bahn-(TRUNC)Station.
Other Types of Tokens For the tokens that are part of the written language but not German
language lexicon, for instance e-mails, date strings, url strings etc. DEMorphy contains a special
processing unit. This unit first evaluates if word belongs to one of these classes, if so do not ask
the analyzer and directly provide the token type as a result.
5. FUTURE WORK
New versions will include
- Better analogy analyzer
- Character level language model support
- Detailed support on the geographical names, proper nouns (first names, last names,
company names, brand names), abbreviations
- More work on the experimental dictionary
Though DEMorphy is fast enough, there is always room for further time efficiency
improvements.
6. REFERENCES
Python Software Foundation. Python Language Reference, version 2.7. Available at
http://www.python.org
Escart ın, C. P. (2014). Chasing the Perfect Splitter: A Comparison of Different Compound
Splitting Tools. In Proceedings of the Ninth International Conference on Language Resources
and Evaluation, pages 3340–3347, Reykjavik
Fabienne Fritzinger , Alexander Fraser, How to avoid burning ducks: combining linguistic
analysis and corpus statistics for German compound processing, Proceedings of the Joint Fifth
Workshop on Statistical Machine Translation and MetricsMATR, p.224-234, July 15-16, 2010,
Uppsala, Sweden
Helmut Schmid, Arne Fitschen and Ulrich Heid: SMOR: A German Computational Morphology
Covering Derivation, Composition, and Inflection, Proceedings of the IVth International
Conference on Language Resources and Evaluation (LREC 2004), p. 1263-1266, Lisbon,
Portugal
Koehn, P., Knight, K.: Empirical Methods for Compound Splitting. Proc. 10th Conf. of the
European Chapter of the Association for Computational Linguistics (EACL). Budapest, Hungary
(2003) 347–35
Korobov, Mikhail: Morphological Analyzer and Generator for Russian and Ukranian Languages,
CoRR, abs/1503.07283, 2015
Zielinski A., Simon C., Wittl T. (2009) Morphisto: Service-Oriented Open Source Morphology
for German. In: Mahlow C., Piotrowski M. (eds) State of the Art in Computational Morphology.
SFCM 2009. Communications in Computer and Information Science, vol 41. Springer, Berlin,
Heidelberg
|
1907.08948 | 1 | 1907 | 2019-07-21T10:00:28 | Hindi Visual Genome: A Dataset for Multimodal English-to-Hindi Machine Translation | [
"cs.CL"
] | Visual Genome is a dataset connecting structured image information with English language. We present ``Hindi Visual Genome'', a multimodal dataset consisting of text and images suitable for English-Hindi multimodal machine translation task and multimodal research. We have selected short English segments (captions) from Visual Genome along with associated images and automatically translated them to Hindi with manual post-editing which took the associated images into account. We prepared a set of 31525 segments, accompanied by a challenge test set of 1400 segments. This challenge test set was created by searching for (particularly) ambiguous English words based on the embedding similarity and manually selecting those where the image helps to resolve the ambiguity.
Our dataset is the first for multimodal English-Hindi machine translation, freely available for non-commercial research purposes. Our Hindi version of Visual Genome also allows to create Hindi image labelers or other practical tools.
Hindi Visual Genome also serves in Workshop on Asian Translation (WAT) 2019 Multi-Modal Translation Task. | cs.CL | cs |
HINDI VISUAL GENOME: A DATASET FOR MULTIMODAL
ENGLISH-TO-HINDI MACHINE TRANSLATION
A PREPRINT
Shantipriya Parida
Ondrej Bojar∗
Charles University, Faculty of Mathematics and Physics,
Institute of Formal and Applied Linguistics,
Malostranské namestí 25, 118 00
Prague, Czech Republic
{parida,bojar}@ufal.mff.cuni.cz
Satya Ranjan Dash
School of Compter Application,
KIIT University, Bhubaneswar-24,
Odisha, India
[email protected]
July 23, 2019
ABSTRACT
Visual Genome is a dataset connecting structured image information with English language. We
present "Hindi Visual Genome", a multimodal dataset consisting of text and images suitable for
English-Hindi multimodal machine translation task and multimodal research. We have selected short
English segments (captions) from Visual Genome along with associated images and automatically
translated them to Hindi with manual post-editing which took the associated images into account.
We prepared a set of 31525 segments, accompanied by a challenge test set of 1400 segments. This
challenge test set was created by searching for (particularly) ambiguous English words based on the
embedding similarity and manually selecting those where the image helps to resolve the ambiguity.
Our dataset is the first for multimodal English-Hindi machine translation, freely available for non-
commercial research purposes. Our Hindi version of Visual Genome also allows to create Hindi
image labelers or other practical tools.
Hindi Visual Genome also serves in Workshop on Asian Translation (WAT) 2019 Multi-Modal
Translation Task.
Keywords Visual Genome · Multimodal Corpus · Parallel Corpus · Word Embedding · Neural Machine Translation
(NMT) · Image Captioning
1
Introduction
Multimodal content is gaining popularity in machine translation (MT) community due to its appealing chances to
improve translation quality and its usage in commercial applications such as image caption translation for online news
articles or machine translation for e-commerce product listings [1, 2, 3, 4]. Although the general performance of neural
machine translation (NMT) models is very good given large amounts of parallel texts, some inputs can remain genuinely
ambiguous, especially if the input context is limited. One example is the word "mouse" in English (source) which can
be translated into different forms in Hindi based on the context (e.g. either a computer mouse or a small rodent).
There is a limited number of multimodal datasets available and even fewer of them are also multilingual. Our aim is
to extend the set of languages available for multimodal experiments by adding a Hindi variant of a subset of Visual
Genome.
Visual Genome (http://visualgenome.org/, [5]) is a large set of real-world images, each equipped with annotations
of various regions in the image. The annotations include a plain text description of the region (usually sentence parts
or short sentences, e.g. "a red ball in the air") and also several other formally captured types of information (objects,
∗Corresponding author
Table 1: Hindi Visual Genome corpus details. One item consists of an English source segment, its Hindi translation, the
image and a rectangular region in the image.
A PREPRINT - JULY 23, 2019
Data Set
Training Set
Development Test Set (D-Test)
Evaluation Test Set (E-Test)
Challenge Test Set (C-Test)
Items
28,932
998
1595
1,400
attributes, relationships, region graphs, scene graphs, and question-answer pairs). We focus only on the textual
descriptions of image regions and provide their translations into Hindi.
The main portion of our Hindi Visual Genome is intended for training purposes of tools like multimodal translation
systems or Hindi image labelers. Every item consists of an image, a rectangular region in the image, the original English
caption from Visual Genome and finally our Hindi translation. Additionally, we create a challenge test set with the same
structure but a different sampling that promotes the presence of ambiguous words in the English captions with respect to
their meaning and thus their Hindi translation. The final corpus statistics of the "Hindi Visual Genome" are in Table 1.
The paper is organized as follows: In Section 2, we survey related multimodal multilingual datasets. Section 3 describes
the way we selected and prepared the training set. Section 4 is devoted to the challenge test set: the method to find
ambiguous words and the steps taken when constructing the test set, its final statistics and a brief discussion of our
observations. We conclude in Section 5.
Creating such a dataset enables multimodal experimenting with Hindi for various applications and it can also facilitate
the exploration of how the language is grounded in vision.
2 Related Work
Multimodal neural machine translation is an emerging area where translation takes more than text as input. It also uses
features from image or sound for generating the translated text. Combining visual features with language modeling has
shown better result for image captioning and question answering [6, 7, 8].
Many experiments were carried out considering images to improve machine translation, i.a. for resolving ambiguity
due to different senses of words in different contexts. One of the starting points is "Flickr30k" [9], a multilingual
(English-German, English-French, and English-Czech) shared task based on multimodal translation was part of WMT
2018 [10]. [11] proposed a multimodal NMT system using image feature for Hindi-English language pair. Due to the
lack of English-Hindi multimodal data, they used a synthetic training dataset and manually curated development and
test sets for Hindi derived from the English part of Flickr30k corpus [12]. [13] proposed a probabilistic method using
pictures for word prediction constrained to a narrow set of choices, such as possible word senses. Their results suggest
that images can help word sense disambiguation.
Different techniques then followed, using various neural network architectures for extracting and using the contextual
information. One of the approaches was proposed by [1] for multimodal translation by replacing image embedding
with an estimated posterior probability prediction for image categories.
3 Training Set Preparations
To produce the main part of our corpus, we have automatically translated and manually post-edited the English captions
of "Visual Genome" corpus into Hindi.
The starting point were 31525 randomly selected images from Visual Genome. Of all the English-captioned regions
available for each of the images, we randomly select one. To obtain the Hindi translation, we have followed these steps:
1. We translated all 31525 captions into Hindi using the NMT model (Tensor-to-Tensor, [14]) specifically trained
for this purpose as described in [15].
2. We uploaded the image, the source English caption and its Hindi machine translation into a "Translation
Validation Website",2 which we designed as a simple interface for post-editing the translations. One important
2http://ufallab.ms.mff.cuni.cz/~parida/index.html
2
A PREPRINT - JULY 23, 2019
Figure 1: Overall pipeline for ambiguous word finding from input corpus.
feature was the use of a Hindi on-screen keyboard3 to enable proper text input even for users with limited
operating systems.
3. Our volunteers post-edited all the Hindi translations. The volunteers were selected based on their Hindi
language proficiency.
4. We manually verified and finalized the post-edited files to obtain the training and test data.
The split of the 31525 items into the training, development and test sets as listed in Table 1 was again random.
4 Challenge Test Set Preparations
In addition to the randomly selected 31525 items described above, we prepared a challenge test set of 1400 segments
which need images for word sense disambiguation. To achieve this targeted selection, we first found the most ambiguous
words from the whole "Visual Genome" corpus and then extracted segments containing the most ambiguous words.
The overall steps for obtaining the ambiguous words are shown in Figure 1.
The detailed sequence of processing steps was as follows:
1. Translate all English captions from the Visual Genome dataset (3.15 millions unique strings) using a baseline
machine translation systems into Hindi, obtaining a synthetic parallel corpus. In this step, we used Google
Translate.
2. Apply word alignment on the synthetic parallel corpus using GIZA++ [16], in a wrapper4 that automatically
symmetrizes two bidirectional alignments; we used the intersection alignment.
3. Extract all pairs of aligned words in the form of a "translation dictionary". The dictionary contains key/value
pairs of the English word (E) and all its Hindi translations (H1, H2, . . . Hn), i.e. it has the form of the mapping
E (cid:55)→ {H1, ..., Hn}.
4. Train Hindi word2vec (W2V) [17] word embeddings. We used the gensim5 [18] implementation and trained it
on IITB Hindi Monolingual Corpus6 which contains about 45 million Hindi sentences. Using such a large
collection of Hindi text improves the quality of the obtained embeddings.
5. For each English word from the translation dictionary (see Step 3), get all Hindi translation words and their
embeddings (Step 4).
6. Apply K-means clustering algorithm to the embedded Hindi words to organize them according to their word
similarity.
If we followed a solid definition of word senses and if we knew how many there are for a given source English
word and how they match the meanings of the Hindi words, the K would correspond to the number of Hindi
3https://hinkhoj.com/api/
4https://github.com/ufal/qtleap/blob/master/cuni_train/bin/gizawrapper.pl
5https://radimrehurek.com/gensim/tut1.html
6http://www.cfilt.iitb.ac.in/iitb_parallel/iitb_corpus_download/
3
Table 2: Challenge test set: distribution of the ambiguous words.
A PREPRINT - JULY 23, 2019
Word
Stand
1
Court
2
Players
3
Cross
4
Second
5
Block
6
Fast
7
Date
8
Characters
9
10
Stamp
11 English
Fair
12
Fine
13
Press
14
Forms
15
16
Springs
17 Models
Forces
18
Penalty
19
Total
Segment Count
180
179
137
137
117
116
73
56
70
60
42
41
45
35
44
30
25
9
4
1400
senses that the original English word expresses. We take the pragmatic approach and apply K-means for a
range of values (K from 2 to 6).
7. Evaluate the obtained clusters with the Silhouette Score, Davies-Bouldin Index (DBI), and Calinski-Harabaz
Index (CHI) [19, 20]. Each of the selected scores reflects in one way or another the cleanliness of the clusters,
their separation. For the final sorting (Step 8), we mix these scores using a simple average function.
The rationale behind using these scores is that if the word embeddings of the Hindi translations can be clearly
clustered into 2 or more senses, then the meaning distinctions are big enough to indicate that the original
English word was ambiguous. The exact number of different meanings is not too important for our purpose.
8. Sort the list in descending order to get the most ambiguous words (as approximated by the mean of clustering
measures) at the top of the list.
9. Manually check the list to validate that the selected ambiguous words indeed potentially need an image to
disambiguate them. Select a cutoff and extract the most ambiguous English words.
The result of this semi-automatic search and manual validation of most ambiguous words was a list of 19 English words.
For each of these words, we selected and extracted a number of items available in the original Visual Genome and
provided the same manual validation of the Hindi translation as for the training and regular test sets. Incidentally, 7
images and English captions occur in both the training set and the challenge test set.7 The overlap in images (but using
different regions) is larger: 359.
Table 2 lists the selected most ambiguous English words and the number of items in the final challenge test set with the
given word in the English side. We tried to make a balance and the frequencies of the ambiguous words in the challenge
test set roughly correspond to the original frequencies in Visual Genome.
Figure 2 illustrates two sample items selected for the word "penalty" (Hindi translation omitted here). We see that for
humans, the images are clearly disambiguating the meaning of the word: the fine to be paid for honking vs. the kick in
a soccer match.
Arguably, the surrounding English words in the source segments (e.g. "street" vs. "white lined") can be used by
machine translation systems to pick the correct translation even without access to the image. The size of the original
dataset of images with captions however did not allow us to further limit the selection to segments where the text alone
is not sufficient for the disambiguation.
7The English segments appearing in both the training data and the challenge test set are: A round concert block, Man stand in
crane, Street sign on a pole in english and chinese, a fast moving train, a professional tennis court, bird characters on top of a brown
cake, players name on his shirt.
4
A PREPRINT - JULY 23, 2019
(a) Street sign advising of penalty.
(b) The penalty box is white lined.
Figure 2: An illustration of two meanings of the word "penalty" exemplified with two images.
5 Conclusion and Future Work
We presented a multimodal English-to-Hindi dataset. To the best of our knowledge, this is the first such dataset that
includes an Indian language. The dataset can serve e.g. in Hindi image captioning but our primary intended use case
was research into the employment of images as additional input to improve machine translation quality.
To this end, we created also a dedicated challenge test set with text segments containing ambiguous words where
the image can help with the disambiguation. With this goal, the dataset also serves in WAT 20198 shared task on
multi-modal translation.9
We illustrated that the text-only information in the surrounding words could be sufficient for the disambiguation. One
interesting research direction would be thus to ignore all the surrounding words and simply ask: given the image, what
is the correct Hindi translation of this ambiguous English word. Another option we would like to pursue is to search
larger datasets for cases where even the whole segment does not give a clear indication of the meaning of an ambiguous
word.
Our "Hindi Visual Genome" is available for research and non-commercial use under a Creative Commons Attribution-
NonCommercial-ShareAlike 4.0 License10 at http://hdl.handle.net/11234/1-2997.
6 Acknowledgments
We are grateful to Vighnesh Chenthil Kumar, a summer intern from IIIT Hyderabad at Charles University for his help
with the semi-automatic search for the most ambiguous words. The work was carried out during Shantipriya Parida's
post-doc funded by Charles University.
This work has been supported by the grants 19-26934X (NEUREM3) of the Czech Science Foundation and "Progress"
Q18+Q48 of Charles University, and using language resources distributed by the LINDAT/CLARIN project of
the Ministry of Education, Youth and Sports of the Czech Republic (projects LM2015071 and OP VVV VI
CZ.02.1.01/0.0/0.0/16013/0001781).
References
[1] Chiraag Lala, Pranava Madhyastha, Josiah Wang, and Lucia Specia. Unraveling the contribution of image caption-
ing and neural machine translation for multimodal machine translation. The Prague Bulletin of Mathematical
Linguistics, 108(1):197 -- 208, 2017.
[2] Anya Belz, Erkut Erdem, Katerina Pastra, and Krystian Mikolajczyk, editors. Proceedings of the Sixth Workshop
on Vision and Language, VL@EACL 2017, Valencia, Spain, April 4, 2017. Association for Computational
Linguistics, 2017.
8http://lotus.kuee.kyoto-u.ac.jp/WAT/WAT2019/index.html
9https://ufal.mff.cuni.cz/hindi-visual-genome/wat-2019-multimodal-task
10https://creativecommons.org/licenses/by-nc-sa/4.0/
5
A PREPRINT - JULY 23, 2019
[3] Desmond Elliott and Ákos Kádár. Imagination improves multimodal translation. CoRR, abs/1705.04350, 2017.
[4] Mingyang Zhou, Runxiang Cheng, Yong Jae Lee, and Zhou Yu. A visual attention grounding neural model
for multimodal machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural
Language Processing, pages 3643 -- 3653, 2018.
[5] Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis
Kalantidis, Li-Jia Li, David A Shamma, et al. Visual genome: Connecting language and vision using crowdsourced
dense image annotations. International Journal of Computer Vision, 123(1):32 -- 73, 2017.
[6] Nasrin Mostafazadeh, Chris Brockett, Bill Dolan, Michel Galley, Jianfeng Gao, Georgios P. Spithourakis, and Lucy
Vanderwende. Image-grounded conversations: Multimodal context for natural question and response generation.
CoRR, abs/1701.08251, 2017.
[7] Linjie Yang, Kevin D. Tang, Jianchao Yang, and Li-Jia Li. Dense captioning with joint inference and visual
context. CoRR, abs/1611.06949, 2016.
[8] Chang Liu, Fuchun Sun, Changhu Wang, Feng Wang, and Alan L. Yuille. MAT: A multimodal attentive translator
for image captioning. CoRR, abs/1702.05658, 2017.
[9] Desmond Elliott, Stella Frank, Khalil Sima'an, and Lucia Specia. Multi30k: Multilingual english-german image
descriptions. arXiv preprint arXiv:1605.00459, 2016.
[10] Loïc Barrault, Fethi Bougares, Lucia Specia, Chiraag Lala, Desmond Elliott, and Stella Frank. Findings of
the third shared task on multimodal machine translation. In Proceedings of the Third Conference on Machine
Translation: Shared Task Papers, pages 304 -- 323, 2018.
[11] Koel Dutta Chowdhury, Mohammed Hasanuzzaman, and Qun Liu. Multimodal neural machine translation for
low-resource language pairs using synthetic data. ACL 2018, page 33, 2018.
[12] Bryan A Plummer, Liwei Wang, Chris M Cervantes, Juan C Caicedo, Julia Hockenmaier, and Svetlana Lazeb-
nik. Flickr30k entities: Collecting region-to-phrase correspondences for richer image-to-sentence models. In
Proceedings of the IEEE international conference on computer vision, pages 2641 -- 2649, 2015.
[13] Kobus Barnard and Matthew Johnson. Word sense disambiguation with pictures. Artificial Intelligence, 167(1-
2):13 -- 30, 2005.
[14] Ashish Vaswani, Samy Bengio, Eugene Brevdo, Francois Chollet, Aidan N. Gomez, Stephan Gouws, Llion Jones,
Łukasz Kaiser, Nal Kalchbrenner, Niki Parmar, Ryan Sepassi, Noam Shazeer, and Jakob Uszkoreit. Tensor2tensor
for neural machine translation. CoRR, abs/1803.07416, 2018.
[15] Shantipriya Parida and Ondrej Bojar. Translating Short Segments with NMT: A Case Study in English-to-Hindi.
In Proceedings of EAMT 2018, 2018.
[16] Franz Josef Och and Hermann Ney. A systematic comparison of various statistical alignment models. Computa-
tional Linguistics, 29(1):19 -- 51, 2003.
[17] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector
space. CoRR, abs/1301.3781, 2013.
[18] Radim Rehurek and Petr Sojka. Software Framework for Topic Modelling with Large Corpora. In Proceedings of
the LREC 2010 Workshop on New Challenges for NLP Frameworks, pages 45 -- 50, Valletta, Malta, May 2010.
ELRA. http://is.muni.cz/publication/884893/en.
[19] Renato Cordeiro de Amorim and Christian Hennig. Recovering the number of clusters in data sets with noise
features using feature rescaling factors. Information Sciences, 324:126 -- 145, 2015.
[20] D. L. Davies and D. W. Bouldin. A cluster separation measure. IEEE Transactions on Pattern Analysis and
Machine Intelligence, PAMI-1(2):224 -- 227, April 1979.
6
|
1811.07550 | 1 | 1811 | 2018-11-19T08:23:34 | Switch-based Active Deep Dyna-Q: Efficient Adaptive Planning for Task-Completion Dialogue Policy Learning | [
"cs.CL",
"cs.AI",
"cs.LG",
"cs.NE"
] | Training task-completion dialogue agents with reinforcement learning usually requires a large number of real user experiences. The Dyna-Q algorithm extends Q-learning by integrating a world model, and thus can effectively boost training efficiency using simulated experiences generated by the world model. The effectiveness of Dyna-Q, however, depends on the quality of the world model - or implicitly, the pre-specified ratio of real vs. simulated experiences used for Q-learning. To this end, we extend the recently proposed Deep Dyna-Q (DDQ) framework by integrating a switcher that automatically determines whether to use a real or simulated experience for Q-learning. Furthermore, we explore the use of active learning for improving sample efficiency, by encouraging the world model to generate simulated experiences in the state-action space where the agent has not (fully) explored. Our results show that by combining switcher and active learning, the new framework named as Switch-based Active Deep Dyna-Q (Switch-DDQ), leads to significant improvement over DDQ and Q-learning baselines in both simulation and human evaluations. | cs.CL | cs | Switch-based Active Deep Dyna-Q: Efficient Adaptive Planning for
Task-Completion Dialogue Policy Learning
Yuexin Wu(cid:63) Xiujun Li†‡
Jingjing Liu†
Jianfeng Gao† Yiming Yang(cid:63)
†Microsoft Research
(cid:63)Carnegie Mellon University
‡Paul G. Allen School of Computer Science & Engineering, University of Washington
(cid:63){yuexinw,yiming}@cs.cmu.edu
†{xiul,jingjl,jfgao}@microsoft.com
8
1
0
2
v
o
N
9
1
]
L
C
.
s
c
[
1
v
0
5
5
7
0
.
1
1
8
1
:
v
i
X
r
a
Abstract
Training task-completion dialogue agents with reinforcement
learning usually requires a large number of real user experi-
ences. The Dyna-Q algorithm extends Q-learning by integrat-
ing a world model, and thus can effectively boost training ef-
ficiency using simulated experiences generated by the world
model. The effectiveness of Dyna-Q, however, depends on the
quality of the world model - or implicitly, the pre-specified
ratio of real vs. simulated experiences used for Q-learning.
To this end, we extend the recently proposed Deep Dyna-Q
(DDQ) framework by integrating a switcher that automati-
cally determines whether to use a real or simulated experience
for Q-learning. Furthermore, we explore the use of active
learning for improving sample efficiency, by encouraging the
world model to generate simulated experiences in the state-
action space where the agent has not (fully) explored. Our re-
sults show that by combining switcher and active learning, the
new framework named as Switch-based Active Deep Dyna-Q
(Switch-DDQ), leads to significant improvement over DDQ
and Q-learning baselines in both simulation and human eval-
uations.1
Introduction
Thanks to the increasing popularity of virtual assistants such
as Apple's Siri and Microsoft's Cortana, there has been a
growing interest in both industry and research community
in developing task-completion dialogue systems (Gao, Gal-
ley, and Li 2018). Dialogue policies in task-completion dia-
logue agents, which control how agents respond to user in-
put, are typically trained in a reinforcement learning (RL)
setting (Young et al. 2013; Levin, Pieraccini, and Eckert
1997). RL, however, usually requires collecting experiences
via direct interaction with real users, which is a costly data
acquisition procedure, as real user experiences are much
more expensive to obtain in the dialogue setting than that
in simulation-based game settings (such as Go or Atari
games) (Mnih et al. 2015; Silver et al. 2016).
One common strategy is to train policies with user simu-
lators that are developed from pre-collected human-human
conversational data (Schatzmann et al. 2007; Li et al. 2016).
Dialogue agents interacting with such user simulators do not
Copyright c(cid:13) 2019, Association for the Advancement of Artificial
Intelligence (www.aaai.org). All rights reserved.
1Source code is at https://github.com/CrickWu/Switch-DDQ.
incur any real-world cost, and can in theory generate un-
limited amount of simulated experiences for policy train-
ing. The learned policy can then be further fine-tuned using
small amount of real user experiences (Dhingra et al. 2016;
Su et al. 2016; Lipton et al. 2016; Li et al. 2017).
Although simulated users provide an affordable alterna-
tive, they may not be a sufficiently truthful approximation to
human users. The discrepancy between simulated and real
experiences inevitably leads to strong bias. In addition, it
is very challenging to develop a high-quality user simula-
tor, because there is no widely accepted metric to assess the
quality of user simulators (Pietquin and Hastie 2013). It re-
mains a controversial research topic whether training agents
through user simulators is an effective solution to building
dialogue systems.
Recently, Peng et al. (2018) proposed Deep Dyna-Q
(DDQ), an extension of the Dyna-Q framework (Sut-
ton 1990), which integrates planning into RL for task-
completion dialogue policy learning. As illustrated in Fig-
ure 1a, DDQ incorporates a trainable user simulator, referred
to as the world model, which can mimic real user behav-
iors and generate simulated experience. The policy of the
dialogue agent can be improved through either (1) real user
experiences via direct RL; or (2) simulated experiences via
indirect RL or planning.
DDQ is proved to be sample-efficient in that a reasonable
policy can be obtained using a small number of real expe-
riences, an affordable training process thanks to the integra-
tion of planning into RL. However, the effectiveness of DDQ
depends, to a large degree, upon the way we control the ra-
tio of real vs. simulated experiences used in different stages
of training. For example, Peng et al. (2018) pointed out that
although aggressive planning (i.e., policy learning using a
large number of simulated experiences) often helps improve
the performance in the beginning stage of training when the
agent is not sensitive to the low-quality experiences, such
aggressive planning might hurt the performance in the later
stage when the agent is more susceptible to noise, as illus-
trated in Figure 2. Carefully designed heuristics are essen-
tial to set the ratio properly. For example, we might decrease
the number of simulated experiences during the course of
training. However, such heuristics can vary with different
settings, and thus significantly limits the wide application of
DDQ in developing real-world dialogue agents.
(a) DDQ framework
(b) Proposed Switch-DDQ framework
Figure 1: Designs of RL agents for dialogue policy learning in task-completion dialogue systems
improve DDQ's sample efficiency. As illustrated in Fig-
ure 1b, we incorporate a switcher to automatically determine
whether to use real or simulated experiences at different
stages of dialogue training, eliminating the dependency on
heuristics. The switcher is implemented based on an LSTM
model, and is jointly trained with the dialogue policy and the
world model. Moreover, instead of randomly sampling sim-
ulated experiences, the world model adopts an active sam-
pling strategy that generates simulated experiences from the
state-action space that has not been (fully) explored by the
dialogue agent. Experiments show that this active sampling
strategy can achieve a performance that is comparable to the
original DDQ method but by using a much smaller amount
of real experiences.
The work present in this paper contributes to the growing
family of model-based RL methods, and can potentially be
applied to other RL problems. To the best of our knowledge,
Switch-DDQ is the first learning framework that conducts
active learning in a task-completion dialogue setting. The
contributions of this work are two-fold:
• We propose a Switch-based Active Deep Dyna-Q frame-
work to incorporate active learning into the Dyna-Q
framework for dialogue policy learning, providing a
mechanism of automatically balancing the use of simu-
lated and real user experiences.
• We validate the superior performance of Switch-DDQ
by building dialogue agents for the movie-ticket booking
task. The effectiveness of active learning and switcher is
verified by simulation and human evaluations.
Model Architecture
We depict our Switch-DDQ pipeline in Figure 3. The agent
consists of six modules: (1) an LSTM-based natural lan-
guage understanding (NLU) module (Hakkani-Tur et al.
2016) for extracting user intents/goals and calculated their
associated slots; (2) a state tracker (Mrksi´c et al. 2016) for
tracking dialogue states; (3) a dialogue policy that makes
choice of the next action by using the information of the
current dialogue state; (4) a model-based natural language
generation (NLG) module which outputs natural language
Figure 2: The learning curves of DDQ(K) without heuristics
where (K − 1) denotes the number of planning steps. The
curves are sensitive to K values and may deteriorate in the
later phase due to the low-quality simulated experiences.
Another limitation of DDQ is that the world model gen-
erates simulated experiences by uniformly sampling user
goals. However, training samples in the state-action space
unexplored or less explored by the dialogue agent are usu-
ally more desirable in order to avoid bias. This is the prob-
lem that many active learning methods try to address. In this
paper, we present a new variant of DDQ that addresses these
two issues.
Our method is inspired by the recent study of Su et
al. (2018), which tries to balance the use of simulated and
real experience by measuring the quality of simulated ex-
periences using a machine-learned discriminator. The more
simulated experiences are used if their quality is higher.
Their approach demonstrates some limited success, and suf-
fers from two shortcomings. First, it does not take into ac-
count the fact that the agent in different training stages might
require simulated experiences of different qualities. Second,
it still uniformly samples user goals and is not as sample-
efficient as it should be (e.g., by using active learning).
In this paper, we propose a new framework, called Switch-
based Active Deep Dyna-Q (Switch-DDQ), to significantly
(s, a, r, au, s(cid:48)) is then stored into the user experience buffer
Bu or simulator experience buffer Bs respectively. Func-
tion Q(·) can be improved using experiences stored in the
buffers.
In the implementation, we optimize the parameter θQ
w.r.t. the mean-squared loss:
y = r + γ max
L(θQ) = E(s,a,r,s(cid:48))∼Bs∪Bu [(y − Q(s, a; θQ))]
(1)
(2)
where Q(cid:48)(·) is a copy of the previous version of Q(·) and is
only updated periodically and γ ∈ [0, 1] is the discount fac-
tor. Q(·) is updated using back-propagation and mini-batch
gradient descent.
a(cid:48) Q(cid:48)(s(cid:48), a(cid:48); θQ(cid:48))
Algorithm 1 Switch-based Active Deep Dyna-Q
1: procedure SWITCH-DDQ TRAININGPIPELINE
2:
3:
4:
user randomly picks a user goal gu
Generate real experience eu from user based on
for i ← 1 : max epoch do
gu into Bu
repeat
Actively select a user goal gs based on the
validation results # see Algorithm 2
Generate simulated experience es from sim-
ulator based on gs into Bs
Evaluate quality of es through switcher
until quality < threshold
Train simulator on Bu
Train switcher on Bu, Bs
Train agent on Bu, Bs
Evaluate simulator on validation set
5:
6:
7:
8:
9:
10:
11:
12:
13:
Figure 3: Switch-DDQ for dialogue policy learning.
responses (Wen et al. 2015); (5) a world model for generat-
ing simulated user actions and simulated rewards based on
active user goal selection; and (6) an RNN-based switcher
for selecting the source of data (simulated or real experi-
ences) for dialogue policy training. The solid lines in the
figure illustrate the iterative dialogue policy training loop,
while the dashed lines show the flow of data in training the
world model and switcher.
The optimization of Switch-DDQ comprises four steps:
(1) direct reinforcement learning: the agent conducts direct
interactions with a real user, where the generated real ex-
periences are directly used to improve the dialogue policy;
(2) active planning: the agent interacts with the simulator
and improves the policy using the simulated experiences;
(3) world model learning: the world model receives real ex-
periences and updates itself; and (4) switcher training: the
switcher is learned and refined using both real and simulated
experiences. Each step is detailed in the subsections below.
The iterative Switch-DDQ algorithm, described in pseudo-
code, is shown in Algorithm 1.
Direct Reinforcement Learning and Planning
Typically, dialogue policy learning can be formulated as
a Markov Decision Process in the RL setting, a task-
completion dialogue could be viewed as a sequence of (state,
action, reward) tuples. We employ the Deep Q-network
(DQN) (Mnih et al. 2015) for training the dialogue pol-
icy (line 12 in Algorithm 1). Both the direct reinforcement
learning and planning are accomplished using the same Q-
learning algorithm using the simulated and real experiences,
respectively.
Specifically, at each step, the agent receives the state s
and selects an action a to carry into the next dialogue turn.
The action a is chosen using the exploration policy based
on -greedy, where there is probability a random action
being executed or otherwise the action that maximizes the
Q(s, a; θQ) function. The function Q(·) is parameterized
by a Multi-Layer Perceptron (MLP) parameterized by θQ.
Afterwards, the agent observes a reward r from the envi-
ronment, and a corresponding response au from either a
real user or the simulator, updating the dialogue state to
s(cid:48) until reaching the end of a dialogue. The experience
Active Planning based on World Model
In a typical task-completion dialogue (Schatzmann et al.
2007), a user begins a conversation with a particular goal
in mind G which consists of multiple constraints. For ex-
ample, in the movie-ticket-booking scenario, the constraints
can be the place of the theater, the number of tickets to
buy, and the name of the movie. An example of a user
is request(theater;numberofpeople=2,
goal
moviename=mission impossible),
which
is presented in its natural
language form as "in
which theater can I buy two tickets for
mission impossible". Although there is no explicit
restriction for the range of user goals in real experiences,
in the stage of planning, the world model can selectively
generate the simulated experiences in the state-action space
that are not (fully) explored by the dialogue agent, based on
a specific set of user goals, to improve sample efficiency.
We call our planning active planning because it is a form of
active learning.
The world model for active planning consists of two parts:
(1) a user goal sampling module that samples a proper user
goal at the start of a dialogue; (2) a response generation mod-
ule that imitates real users' interaction with the agent to gen-
erate for each dialogue turn the user action, reward and the
user's decision whether to terminate the dialogue.
• Active user goal sampling module. Assume that we have
collected large amounts of user goals from human-human
conversational data. These user goals can be grouped
into different categories, each with different constraints,
amounting to different scales of difficulties. The key ob-
servation is that, during the training process, while mon-
itoring the performance of the agent policy on valida-
tion set, we can gather detailed information about the
impact of each category of user goals on the perfor-
mance improvement of the dialogue agent e.g., in terms
of the success rate (line 13 in Algorithm 1). The de-
tailed information can be used to measure the cost (or
gain) in the active learning setting (Russo et al. 2018;
Auer, Cesa-Bianchi, and Fischer 2002) and guide the
world model how to sample user goals.
Suppose there are k different categories of user goals. At
each epoch, the failure rate of each category estimated on
the validation set is denoted as fi and the number of sam-
ples for the estimation is ni. For simplicity, denote the
i ni. Then, the active sam-
pling routine (line 6 in Algorithm 1) can be expanded as
summation of ni as N = (cid:80)
Algorithm 2 Active Sampling Routine
1: procedure ACTIVE USER GOAL SAMPLING
2:
Draw a number pi for each category following pi ∼
fi,
Select the user goal i with the maximum pi value
(cid:113) k ln N
N(cid:16)
(cid:17)
ni
3:
(cid:113) k ln N
Here, N is the Gaussian distribution for introducing
randomness. The Thompson-Sampling-like (Russo et al.
2018) sub-routine of Algorithm 2 is motivated by two ob-
servations: (1) on average, categories with larger failure
rate fi are more preferable as they inject more difficult
cases (containing more useful information to be learned)
based on the current performance of the agent policy.
The generated data (simulated experiences) are generally
associated with the steepest learning direction and can
prospectively boost the training speed; (2) categories that
are estimated less reliably (due to a smaller value of ni
value) may have a large de facto failure rate, thus worth
being allocated with more training instances to reduce
is the measurement of the uncer-
the uncertainty.
tainty of fi, serving the role of variance in the Gaussian.
Thus, the categories with high uncertainty are still likely
to be selected even if the failure rate is small.
• Response generation module. We utilize the same design
of the world model in Peng et al. (2018). Specifically, we
parameterize it using a multi-task deep neural network
(Liu et al. 2015). Each time the world model observes the
dialogue state s and the last action from the agent a, it
passes the input pair (s, a) through an MLP M (s, a; θM )
generating a user action au, a regressed reward r and a bi-
nary terminating indicator signal t. The MLP has a com-
mon sharing representation in the first layer (referred to
as layer h). The computation for each term can be shown
ni
as below:
h = tanh(Wh(s, a) + bh)
au = softmax(Wah + ba)
r = tanh(Wrh + br)
t = sigmoid(Wth + bt)
(3)
(4)
(5)
(6)
Switcher
At every step of training, the switcher needs to decide
whether the dialogue agent should be trained using simu-
lated or real experience (lines 8-9 in Algorithm 1).
The switcher is based on a binary classifier implemented
using a Long Short-Term Memory (LSTM) model (Hochre-
iter and Schmidhuber 1997). Assume that a dialogue is
represented as a sequence of dialogue turns, denoted by
{(si, ai, ri)}, i = 1, ..., N, where N is the number of di-
alogue turns of the dialogue. Q-learning takes a tuple in the
form of (s, a, r, s(cid:48)) as a training sample, which can be ex-
tracted from two consecutive dialogue turns in a dialogue.
Now, the design choice of switcher is whether the classi-
fier is turn-based or dialogue-based. We choose the former,
though a bit anti-intuitive, for data efficiency. There is an
order of magnitude larger number of turns than that of dia-
logues. As a result, a turn-based classifier can be more re-
liably trained than a dialogue-based one. Then, given a dia-
logue, we score the quality of each of its dialogue turns, and
then averages these scores to measure the quality of the di-
alogue (line 6 in Algorithm 1). If the dialogue-level score is
below a certain threshold, the agent switches to interact with
real users.
Note that each dialogue turn is
scored by tak-
ing into account
its previous turns in the same dia-
logue. Given a dialogue turn (st, at, rt) and its history
h = ((s1, a1, r1), (s2, a2, r2), ..., (st−1, at−1, rt−1)) We
use LSTM to encode h using the hidden state vector, and
output a turn-level quality score via a sigmoid layer:
Score((s, a, r), h; θ) = sigmoid(LSTM((s, a, r), h; θ))
(7)
Since we store user experiences and simulated experi-
ences in the buffers Bu and Bs, respectively (lines 4, 7 in
Algorithm 1), the training of Score(.) follows a similar pro-
cess of minimizing the cross-entropy loss as in the common
domain adversarial training setting (Ganin et al. 2016) using
mini-batches:
E(s,a,r),h∼Bu log (Score ((s, a, r), h; θ))
min
θS
+ E(s,a,r),h∼Bs log (1 − Score((s, a, r), h; θ))
(8)
Since the experiences stored in Bs and Bu change dur-
ing the course of dialogue training, the score function of
the switcher is updated accordingly, thus automatically ad-
justing how much planning to perform at different stages of
training.
Experiments
We evaluate the proposed Switch-DDQ framework in the
movie-ticket booking domain, in two settings: simulation
and human evaluation.
Dataset
For experiments, we use a movie-ticket booking dataset
which contains raw conversational data collected via Ama-
zon Mechanical Turk. The dataset is manually labeled based
on a schema defined by domain experts. As shown in Table
1, the annotation schema consists of 11 intents and 16 slots.
In total, the dataset contains 280 labeled dialogues, the aver-
age length of which is 11 turns.
Annotations
Intent
Slot
request, inform, deny, confirm question,
confirm answer, greeting, closing, not sure,
multiple choice, thanks, welcome
city, closing, date, distanceconstraints,
greeting, moviename, numberofpeople,
price, starttime, state, taskcomplete, theater,
theater chain, ticket, video format, zip
Table 1: The data annotation schema
Baselines
We compare the effectiveness of the Switch-DDQ agent with
several baselines:
• DQN agent is implemented with only direct reinforce-
ment learning in each training epoch (without lines 5-9
in Algorithm 1).
• The DQN(K) has (K − 1) times more real experiences
than the DQN agent (repeat lines 3-4 in Algorithm 1 K
times). The performance of DQN(K) can be viewed as
the upper bound of DDQ (K), with the same number of
planning steps (K − 1) (they have the same training set-
ting and the same amount of training samples during the
entire learning process).
• The DDQ(K) agents are learned using a jointly-trained
world model initiated from human conversational data,
with (K − 1) planning steps (replace lines 5-9 in Algo-
rithm 1 with a (K − 1)-round loop).
• The proposed Switch-DDQ agents are updated as de-
scribed in Algorithm 1. Note that there is no parameter
K in the agent, as real/simulated ratio is automatically
controlled by the switcher module.
Implementation Details
Agent and Hyper-parameter Settings We use an MLP to
parameterize function Q(·) in all the agent variants (DQN,
DDQ and Switch-DDQ). The MLP has one hidden layer of
80 neurons with ReLU (Nair and Hinton 2010) activation
function. The -greedy policy is adopted to explore the ac-
tion space. The discount factor γ for future rewards is set to
0.9. For DDQ(K), as the number of real and simulated ex-
periences is different at each epoch, the buffer sizes of Bu
and Bs are generally set to 2000 and 2000×K, respectively.
For Switch-DDQ, we observed that the results are not sensi-
tive to the buffer size of Bs, so we set it to 2000 × 5 for all
settings.
We randomly initialize the parameters in all neural net-
works and empty both experience buffers Bu and Bs in the
beginning. The RMSProp (Hinton, Srivastava, and Swersky
2012) algorithm is used to perform optimization over all
the parameters where the learning rate is set to 0.001. We
also apply the gradient clipping trick to all parameters with
a maximum norm of 1 to prevent possible gradient explo-
sion issues. At the beginning of each epoch (line 2 in Algo-
rithm 1), the reference copy Q(cid:48)(·) is updated. Each simulated
dialogue contains less than 40 turns. Conversations exceed-
ing the maximum number of turns are counted as failed. In
order to train the agents more efficiently, we utilized the im-
itation learning method called Reply Buffer Spiking (RBS)
(Lipton et al. 2016) at the initial stage to build a simple rule-
based agent trained from human conversational data. The
trained agent is then used to pre-fill the real experience re-
play buffer Bu with a total of 50 complete dialogues before
training all the variants of the agent.
World Model We employ an MLP world model for DDQ
and Switch-DDQ. The shared hidden layer is set to have size
160 with hyperbolic tangent activation. The state and action
input are encoded through a linear layer of size 80. We pre-
fill each ni as 5 to prevent division by 0 error, during the
calculation of the Gaussian variance (line 2 in Algorithm 2).
Switcher The LSTM switcher has a hidden layer with 126
cells. Similar to the world model, states and actions are
passed through a linear layer of size 80 as inputs at each time
step. The switcher adopts an annealing threshold w.r.t. the
epoch number to decide the quality of each dialogue turn. If
the average dialogue episode score passes a certain thresh-
old, all the high-quality predictions are pushed into buffer
Bs.2
Simulation Evaluation
We train the dialogue agents by simulating interactions be-
tween the agents and well-programmed user simulators, in-
stead of real users. That is, we train the world model to imi-
tate the behaviors of the user simulator.
User Simulator We used an open-sourced task-oriented
user simulator (Li et al. 2016) in our simulated evaluation.
At each dialogue turn, the simulator will emit a simulated
user response to the agent. When the dialogue ends, a reward
signal will be provided. The dialogue is considered success-
ful, if and only if a movie ticket is booked successfully and
the information provided by the agent conform to all the con-
straint slots in the sampled user goal. Each completed dia-
logue shows either a positive reward 2 ∗ L for success, or
a negative reward −L for failure, where L is the maximum
number of turns in each dialogue and is set to 40 in our ex-
periments. Furthermore, in each turn, a negative reward −1
is provided to encourage shorter dialogue.
Main Results We summarize the main results in Table 2
and plot the learning curves in Figure 4. As illustrated in
Figure 2, DDQ(K) is highly susceptible to parameter K.
Therefore, we only keep the best performing DDQ(5) as
2See the code for specific hyper-parameters.
Agent
DQN
DQN(5)
DDQ(5)
DDQ(10)
DDQ(20)
Switch-DDQ
Epoch = 100
Success Reward Turns
25.51
0.2867
12.52
0.7667
19.96
0.6200
0.6800
16.36
29.76
0.3333
0.5200
15.84
-17.35
46.74
25.42
34.42
-13.88
15.48
Epoch = 200
Success Reward Turns
18.64
0.6733
11.88
0.7867
16.69
0.7733
0.6000
17.60
18.41
0.4467
0.8533
13.53
32.48
49.46
45.45
24.20
5.39
56.63
Epoch = 300
Success Reward Turns
12.27
0.7667
12.37
0.8000
14.76
0.7467
0.3733
15.81
16.69
0.3800
0.7800
12.21
46.87
50.81
43.22
-2.11
-1.75
48.49
Table 2: Results of different agents at training epoch = {100, 200, 300}. Each number is averaged over 3 runs, and each run
is tested on 50 dialogues. (Success: success rate) Switch-DDQ outperforms DQN and DDQ variants after Epoch 100, where
DQN(5) is shown as the upper bound as it uses more real experiences. Best scores are labeled in blue.
Figure 4: The learning curves of DQN, DQN(5), Switch-
DDQ, and DDQ(5) of each epoch.
Figure 5: The learning curves of DQN, DQN(5), Switch-
DDQ, and DDQ(5) on the scale of updating frequency.
the baseline in the following figures. DQN(5), which uses
4 times more real user experiences to this end, is the upper
bound for the corresponding DDQ(5) method. In Table 2, we
report success rate, average reward and average number of
turns over 3 different runs for each agent. As is shown, the
agent of Switch-DDQ after the first 100 epochs, consistently
achieves higher success rates with a smaller number of inter-
action turns. Again, DDQ(10) and DDQ(20) quickly deteri-
orate through the training process. In Figure 4, we can ob-
serve that in the first 130 epochs, DDQ(5) performs slightly
better than Switch-DDQ. However, after that, Switch-DDQ
surpasses DDQ(5) and achieves better performance. It only
takes Switch-DDQ 180 epochs to achieve comparable re-
sults to DQN(5), which utilizes 4 times more real experi-
ences, and DDQ(5) fails to reach similar performance within
300 epochs. This is expected, as the aggressive simulator
sampling policy adopted by DDQ(5), though helping up-
date the policy network more rapidly in the early stage of
training, hurts the performance due to the use of low-quality
training instances in the later stage. Note that except for
DQN(5), all the agents are trained using the same number of
real experiences in each epoch, differing only the amounts
of simulated experiences used (for planning) and how these
simulated experiences are generated (via active learning or
not). The result show that Switch-DDQ can utilize simula-
tors in a more effective and robust way than DDQ.
We also examine the performance of different agents with
an equal number of optimization operations. As shown in
Figure 5, we plot the success rate as a function of updat-
ing frequency, i.e., how many dialogue experiences (either
real or simulated) are used altogether to optimize the agent
policy network. Note that DQN(5) displays superior perfor-
mance over DQN as it generates more diverse dialogues at
the same updating frequency (DQN may refer to identical
experiences more frequently since Bu in DQN is refreshed
less often than that in DQN(5)). Furthermore, we observe
that DDQ(5) fails to obtain a similar performance to DQN,
due to the use of many low-quality simulated experiences.
However, this does not happen in Switch-DDQ, since it ac-
tively samples user goals by making diversified training di-
alogues and discreetly controlling the amount of simulated
experiences via the switcher.
Ablation Test To further examine the effectiveness of the
active learning module, we conduct an ablation test by re-
placing the user goal selection routine (Algorithm 2) with
the one based on uniform sampling, referred to as SU-DDQ.
The results in Figure 6 demonstrate that Switch-DDQ can
Figure 6: Learning curves of Switch-DDQ versus SU-DDQ
where SU-DDQ uses a uniform sampling strategy.
Figure 7: Success rate on 128 user goal categories for
Switch-DDQ and SU-DDQ, ranking in ascending order.
consistently outperform SU-DDQ, especially in the early
phase (before epoch 100). This is due to the fact that the
agent is more sensitive to the diversity of user goals in the
earlier stage since in the limited data setting, many repeated
cases introduce biases more easily. In Figure 7, we report the
success rate for different categories of user goals and rank
them in the increasing order. It is observed that for the cor-
responding rank of user goal category, especially the ones
with low success rate, the active version of Switch-DDQ al-
ways give a better score. These results demonstrate that the
use of the active module improves training efficiency.
Human Evaluation
Real users were recruited to interact with different agents,
while the identity of the agent system is hidden from the
users. At the beginning of the dialogue session, the user was
provided with a randomly sampled user goal, and one of the
agents was randomly picked to converse with the user. The
dialogue session can be terminated at any time, if the user
finds that the dialogue takes so many turns that it is unlikely
to reach a promising outcome. Such dialogues are consid-
ered as failed in our experiments.
Three agents (DQN, DDQ(5), and Switch-DDQ) trained
as previously described (Figure 4) at epoch 150 are selected
as for human evaluation.3 As illustrated in Figure 8, the re-
sults of human evaluation are consistent with those in the
simulation evaluation. We find that DQN is abandoned more
often by users as it takes so many dialogue turns (Table 2) re-
sulting in a much hefty performance drop, and the proposed
Switch-DDQ outperforms all the other agents.
Figure 8: Human evaluation results of DQN, DDQ(5), and
Switch-DDQ. The number of test dialogues is shown on
each bar, and the one-sided p-value is from a two-sample
permutation test over the success/fail lists.
Switch-DDQ is capable of adaptively choosing the proper
data source to use, either from real users or world model,
enhancing the efficiency and robustness of dialogue policy
learning. Furthermore, the active user goal sampling strategy
provides a better utilization of the world model than that of
previous DDQ, and boosts the performance of training. Val-
idating Switch-DDQ in the movie-ticket booking task with
simulation experiments and human evaluation, we show that
the Switch-DDQ agent outperforms the agents trained by
other state-of-the-art methods, including DQN and DDQ.
Switch-DDQ can be viewed as a generic model-based RL
approach, and is easily extensible to other RL problems.
Conclusion
Acknowledgement
This paper presents a new framework Switch-based Ac-
tive Deep Dyna-Q (Switch-DDQ) for task-completion dia-
logue policy learning. With the introduction of a switcher,
3Epoch 150 is picked since we are testing the effectiveness of
methods using a small number of real experiences.
We thank the reviewers for their helpful comments, and we
would like to acknowledge the volunteers for helping us with
the human experiments. This work was done in part when
Yuexin Wu was visiting Microsoft Research as an intern,
and is supported in part by the National Science Foundation
(NSF) under grant IIS-1546329.
References
[Auer, Cesa-Bianchi, and Fischer 2002] Auer,
P.; Cesa-
Bianchi, N.; and Fischer, P. 2002. Finite-time analysis
of the multiarmed bandit problem. Machine learning
47(2-3):235 -- 256.
[Dhingra et al. 2016] Dhingra, B.; Li, L.; Li, X.; Gao, J.;
Chen, Y.-N.; Ahmed, F.; and Deng, L. 2016. Towards end-
to-end reinforcement learning of dialogue agents for infor-
mation access. arXiv preprint arXiv:1609.00777.
[Ganin et al. 2016] Ganin, Y.; Ustinova, E.; Ajakan, H.; Ger-
main, P.; Larochelle, H.; Laviolette, F.; Marchand, M.; and
Lempitsky, V. 2016. Domain-adversarial training of neu-
ral networks. The Journal of Machine Learning Research
17(1):2096 -- 2030.
[Gao, Galley, and Li 2018] Gao, J.; Galley, M.; and Li, L.
2018. Neural approaches to conversational ai. arXiv preprint
arXiv:1809.08267.
[Hakkani-Tur et al. 2016] Hakkani-Tur, D.; Tur, G.; Celiky-
ilmaz, A.; Chen, Y.-N.; Gao, J.; Deng, L.; and Wang, Y.-Y.
2016. Multi-domain joint semantic frame parsing using bi-
directional rnn-lstm. In Interspeech, 715 -- 719.
[Hinton, Srivastava, and Swersky 2012] Hinton, G.; Srivas-
tava, N.; and Swersky, K. 2012. Rmsprop: Divide the gra-
dient by a running average of its recent magnitude. Neural
networks for machine learning, Coursera lecture 6e.
[Hochreiter and Schmidhuber 1997] Hochreiter,
and
S.,
Schmidhuber, J. 1997. Long short-term memory. Neural
computation 9(8):1735 -- 1780.
[Levin, Pieraccini, and Eckert 1997] Levin, E.; Pieraccini,
1997. Learning dialogue strategies
R.; and Eckert, W.
In Auto-
within the markov decision process framework.
matic Speech Recognition and Understanding, 1997. Pro-
ceedings., 1997 IEEE Workshop on, 72 -- 79. IEEE.
[Li et al. 2016] Li, X.; Lipton, Z. C.; Dhingra, B.; Li, L.;
Gao, J.; and Chen, Y.-N. 2016. A user simulator for task-
completion dialogues. arXiv preprint arXiv:1612.05688.
[Li et al. 2017] Li, X.; Chen, Y.-N.; Li, L.; Gao, J.; and Ce-
likyilmaz, A. 2017. End-to-end task-completion neural dia-
logue systems. arXiv preprint arXiv:1703.01008.
[Lipton et al. 2016] Lipton, Z. C.; Gao, J.; Li, L.; Li, X.;
Ahmed, F.; and Deng, L. 2016. Efficient exploration for
dialogue policy learning with bbq networks & replay buffer
spiking. arXiv preprint arXiv:1608.05081.
[Liu et al. 2015] Liu, X.; Gao, J.; He, X.; Deng, L.; Duh, K.;
and Wang, Y.-Y. 2015. Representation learning using multi-
task deep neural networks for semantic classification and in-
formation retrieval.
[Mnih et al. 2015] Mnih, V.; Kavukcuoglu, K.; Silver, D.;
Rusu, A. A.; Veness, J.; Bellemare, M. G.; Graves, A.; Ried-
miller, M. A.; Fidjeland, A.; Ostrovski, G.; Petersen, S.;
Beattie, C.; Sadik, A.; Antonoglou, I.; King, H.; Kumaran,
D.; Wierstra, D.; Legg, S.; and Hassabis, D. 2015. Human-
level control through deep reinforcement learning. Nature
518(7540):529 -- 533.
[Mrksi´c et al. 2016] Mrksi´c, N.; S´eaghdha, D. O.; Wen, T.-
H.; Thomson, B.; and Young, S.
2016. Neural belief
tracker: Data-driven dialogue state tracking. arXiv preprint
arXiv:1606.03777.
[Nair and Hinton 2010] Nair, V., and Hinton, G. E. 2010.
Rectified linear units improve restricted boltzmann ma-
chines. In Proceedings of the 27th international conference
on machine learning (ICML-10), 807 -- 814.
[Peng et al. 2018] Peng, B.; Li, X.; Gao, J.; Liu, J.; Wong,
K.-F.; and Su, S.-Y. 2018. Deep Dyna-Q: Integrating plan-
ning for task-completion dialogue policy learning. In ACL.
[Pietquin and Hastie 2013] Pietquin, O., and Hastie, H.
2013. A survey on metrics for the evaluation of user sim-
ulations. The knowledge engineering review 28(1):59 -- 73.
[Russo et al. 2018] Russo, D. J.; Van Roy, B.; Kazerouni, A.;
Osband, I.; Wen, Z.; et al. 2018. A tutorial on thompson
sampling. Foundations and Trends R(cid:13) in Machine Learning
11(1):1 -- 96.
[Schatzmann et al. 2007] Schatzmann,
J.; Thomson, B.;
Weilhammer, K.; Ye, H.; and Young, S. 2007. Agenda-
based user simulation for bootstrapping a pomdp dialogue
system. In Human Language Technologies 2007: The Con-
ference of the North American Chapter of the Association
for Computational Linguistics; Companion Volume, Short
Papers, 149 -- 152. Association for Computational Linguis-
tics.
[Silver et al. 2016] Silver, D.; Huang, A.; Maddison, C. J.;
Guez, A.; Sifre, L.; van den Driessche, G.; Schrittwieser, J.;
Antonoglou, I.; Panneershelvam, V.; Lanctot, M.; Dieleman,
S.; Grewe, D.; Nham, J.; Kalchbrenner, N.; Sutskever, I.; Lil-
licrap, T. P.; Leach, M.; Kavukcuoglu, K.; Graepel, T.; and
Hassabis, D. 2016. Mastering the game of go with deep neu-
ral networks and tree search. Nature 529(7587):484 -- 489.
[Su et al. 2016] Su, P.-H.; Gasic, M.; Mrksic, N.; Rojas-
Barahona, L.; Ultes, S.; Vandyke, D.; Wen, T.-H.; and
Young, S. 2016. Continuously learning neural dialogue
management. arXiv preprint arXiv:1606.02689.
[Su et al. 2018] Su, S.-Y.; Li, X.; Gao, J.; Liu, J.; and
Chen, Y.-N.
2018. Discriminative deep dyna-q: Ro-
bust planning for dialogue policy learning. arXiv preprint
arXiv:1808.09442.
[Sutton 1990] Sutton, R. S. 1990.
Integrated architectures
for learning, planning, and reacting based on approximating
dynamic programming. In Machine Learning Proceedings
1990. Elsevier. 216 -- 224.
[Wen et al. 2015] Wen, T.-H.; Gasic, M.; Mrksic, N.; Su, P.-
H.; Vandyke, D.; and Young, S. 2015. Semantically con-
ditioned lstm-based natural language generation for spoken
dialogue systems. arXiv preprint arXiv:1508.01745.
[Young et al. 2013] Young, S. J.; Gasic, M.; Thomson, B.;
and Williams, J. D. 2013. Pomdp-based statistical spo-
ken dialog systems: A review. Proceedings of the IEEE
101(5):1160 -- 1179.
|
1803.07204 | 1 | 1803 | 2018-03-20T00:44:18 | Why not be Versatile? Applications of the SGNMT Decoder for Machine Translation | [
"cs.CL"
] | SGNMT is a decoding platform for machine translation which allows paring various modern neural models of translation with different kinds of constraints and symbolic models. In this paper, we describe three use cases in which SGNMT is currently playing an active role: (1) teaching as SGNMT is being used for course work and student theses in the MPhil in Machine Learning, Speech and Language Technology at the University of Cambridge, (2) research as most of the research work of the Cambridge MT group is based on SGNMT, and (3) technology transfer as we show how SGNMT is helping to transfer research findings from the laboratory to the industry, eg. into a product of SDL plc. | cs.CL | cs | Why not be Versatile?
Applications of the SGNMT Decoder for Machine
Translation
8
1
0
2
r
a
M
0
2
]
L
C
.
s
c
[
1
v
4
0
2
7
0
.
3
0
8
1
:
v
i
X
r
a
Felix Stahlberg†
Danielle Saunders†
Gonzalo Iglesias‡
Bill Byrne‡†
†Department of Engineering, University of Cambridge, UK
‡SDL Research, Cambridge, UK
[email protected]
[email protected]
[email protected]
[email protected], [email protected]
Abstract
SGNMT is a decoding platform for machine translation which allows paring various modern
neural models of translation with different kinds of constraints and symbolic models. In this
paper, we describe three use cases in which SGNMT is currently playing an active role: (1)
teaching as SGNMT is being used for course work and student theses in the MPhil in Machine
Learning, Speech and Language Technology at the University of Cambridge, (2) research as
most of the research work of the Cambridge MT group is based on SGNMT, and (3) technology
transfer as we show how SGNMT is helping to transfer research findings from the laboratory
to the industry, eg. into a product of SDL plc.
Introduction
1
The rate of innovation in machine translation (MT) has gathered impressive momentum over
the recent years. The discovery and maturation of the neural machine translation (NMT)
paradigm (Sutskever et al., 2014; Bahdanau et al., 2015) has led to steady and substantial im-
provements of translation performance (Williams et al., 2014; Jean et al., 2015; Luong et al.,
2015; Chung et al., 2016; Wu et al., 2016; Gehring et al., 2017; Vaswani et al., 2017). Fig. 1
shows that this progress is often driven by significant changes in the network architecture. This
volatility poses major challenges in MT-related research, teaching, and industry. Researchers
potentially spend a lot of time implementing to keep their setups up-to-date with the latest
models, teaching needs to identify suitable material in a changing environment, and the in-
dustry faces demanding speed requirements on its deployment processes. Another practical
challenge many researchers are struggling with is the large number of available NMT tools (van
Merrienboer et al., 2015; Junczys-Dowmunt et al., 2016; Klein et al., 2017; Sennrich et al.,
2017; Helcl and Libovick´y, 2017; Bertoldi et al., 2017; Hieber et al., 2017).1 Committing to
one particular NMT tool bears the risk of being outdated soon, as keeping up with the pace of
research is especially costly for NMT software developers.
The open-source SGNMT (Syntactically Guided Neural Machine Translation) de-
coder2 (Stahlberg et al., 2017b) is our attempt to mediate the effects of the rapid progress in
1See https://github.com/jonsafari/nmt-list for a complete list of NMT software.
2Full documentation available at http://ucam-smt.github.io/sgnmt/html/.
Figure 1: Best systems on the English-German WMT news-test2014 test set over the years
(BLEU script: Moses' multi-bleu.pl).
MT and the diversity of available NMT software. SGNMT introduces the concept of predictors
as abstract scoring modules with left-to-right semantics. We can think of a predictor as an inter-
face to a particular neural model or NMT tool. However, the interface also allows to implement
constraints like in lattice or n-best list rescoring, and symbolic models such as n-gram language
models or counting models as predictors. Our software architecture is designed to facilitate the
implementation of new predictors. Therefore, SGNMT can be extended to a new model or tool
with very limited coding effort because rather than reimplementing models it is often enough to
access APIs within an adapter predictor.3 Software packages which are not written in Python
can be exposed in SGNMT if they have a Python interface.4 Once a new predictor is imple-
mented, it can be directly combined with all other predictors which are already available in
SGNMT. Therefore, general techniques like lattice and n-best list rescoring (Stahlberg et al.,
2016; Neubig et al., 2015), ensembling, MBR-based NMT (Stahlberg et al., 2017a), etc. only
need to be implemented once (as predictor), and are automatically available for all models. This
does not only speed up the transition to a new NMT toolkit, it also allows the combination of
different NMT implementations, eg. ensembling a Theano-based NMT model (van Merrienboer
et al., 2015) with a TensorFlow-based Tensor2Tensor (Google, 2017) model. Hasler et al. (2017)
demonstrated the versatility of SGNMT by combining five very different models (RNN LM,
feedforward NPLM, Kneser-Ney LM, bag-to-seq model, seq-to-seq model) and a bag-of-words
constraint using predictors.
Not only the way scores are assigned to translations is open for extension in SGNMT
(via predictors), but also the search strategy (decoder) itself. Decoders in SGNMT are defined
upon the predictor abstraction, which means that any search strategy is compatible with any
predictor constellation. Therefore, common search procedures like beam search do not need to
be reimplemented for every new model or toolkit.
Secs. 2 to 4 describe central concepts in SGNMT like predictors and decoders briefly and
outline some common use cases. Sec. 5 shows that the SGNMT software architecture has
proven to be very well suited for our research as new directions can be quickly prototyped, and
new NMT toolkits can be introduced without breaking old code. Sec. 6 and Sec. 7 discuss the
benefits of SGNMT in teaching and industry, respectively.
3Making all models of the T2T library (Google, 2017) available to SGNMT took less than 200 lines of code.
4For example, the neural language modeling software NPLM (Vaswani et al., 2013) is written in C++, but can be
accessed in SGNMT via its Python interface.
Figure 2: Greedy decoding with the predictor constellation nmt,fst for lattice rescoring.
2 The Predictor Interface
Predictors in SGNMT provide a uniform interface for models and constraints. Since predictors
are decoupled from each other, any predictor can be combined with any other predictor in a
linear model. One predictor usually has a single responsibility as it represents a single model or
type of constraint. Predictors need to implement the following methods:
• initialize(src sentence) Initialize the predictor state using the source sentence.
• get state() Get the internal predictor state.
• set state(state) Set the internal predictor state.
• predict next() Given the internal predictor state, produce the posterior over target
tokens for the next position.
• consume(token) Update the internal predictor state by adding token to the current
history.
The structure of the predictor state and the implementations of these methods differ sub-
stantially between predictors. Stahlberg et al. (2017b) provide a full list of available predictors.
Fig. 2 illustrates how the fst and the nmt predictors work together to carry out (greedy) lattice
rescoring with an NMT model. The predict next() method of the nmt predictor produces
a distribution over the complete NMT vocabulary {A, B, C, UNK, </s>} at each time step in
form of negative log probabilities. The fst predictor returns the scores of symbols with an out-
going arc from the current node in the FST in predict next(). The linear combination
of both scores is used to select the next word, which is then fed back to the predictors via
consume(). Words outside a predictor vocabulary are automatically matched with the UNK
score. For instance, 'D' in Fig. 2 is matched with the NMT 'UNK' token. Pseudo-code for the
predictors and the decoder is listed in Figs. 3 and 4, respectively.
c l a s s NMTPredictor ( P r e d i c t o r ) :
i n i t i a l i z e ( s r c s e n t e n c e ) :
def
c l a s s F S T P r e d i c t o r ( P r e d i c t o r ) :
i n i t i a l i z e ( s r c s e n t e n c e ) :
def
e n c s t a t e s = e n c c o m p u t a t i o n g r a p h (
s r c s e n t e n c e )
d e c i n p u t = [BOS]
def p r e d i c t n e x t ( ) :
s c o r e s , d e c s t a t e = \
d e c c o m p u t a t i o n g r a p h (
Load FST f i l e
c u r n o d e = s t a r t n o d e
def p r e d i c t n e x t ( ) :
return o u t g o i n g a r c s ( c u r n o d e )
d e c i n p u t ,
e n c s t a t e s )
def consume ( word ) :
return s c o r e s
def consume ( word ) :
d e c i n p u t = word
def g e t s t a t e ( ) :
return d e c s t a t e , d e c i n p u t
def
s e t
s t a t e ( s t a t e ) :
d e c s t a t e , d e c i n p u t = s t a t e
c u r n o d e = c u r n o d e . a r c s [ word ]
def g e t s t a t e ( ) :
return c u r n o d e
def
s e t
s t a t e ( s t a t e ) :
c u r n o d e = s t a t e
(a) The nmt predictor
(b) The fst predictor
Figure 3: Pseudo-code predictor implementations
c l a s s GreedyDecoder ( Decoder ) :
def decode ( s r c s e n t e n c e ) :
i n i t i a l i z e p r e d i c t o r s ( s r c s e n t e n c e )
t r g t s e n t e n c e = [ ]
t r g t w o r d = None
while t r g t w o r d != EOS :
t r g t w o r d = argmin ( combine ( p r e d i c t o r s . p r e d i c t n e x t ( ) ) )
t r g t s e n t e n c e . append ( t r g t w o r d )
p r e d i c t o r s . consume ( t r g t w o r d )
return t r g t s e n t e n c e
Figure 4: Pseudo-code implementation of greedy decoding
3 Search Strategies
Search strategies, called Decoders in SGNMT, search over the space spanned by the predictors.
We use different decoders for different predictor constellations, e.g. heuristic search for bag-
of-words problems (Hasler et al., 2017), or beam search for NMT. SGNMT can also be used
to analyze search errors. Tab. 1 compares five different search configurations for SMT lattice
rescoring with a Transformer model (Vaswani et al., 2017) on a subset5 of the Japanese-English
Kyoto Free Translation Task (KFTT) test set (Neubig, 2011). Following Stahlberg et al. (2016)
we measure time complexity in number of node expansions. Our depth-first search algorithm
stops when a partial hypothesis score is worse than the current best complete hypothesis score
(admissible pruning), but it is guaranteed to return the global best model score. Beam search
yields a significant amount of search errors, even with a large beam of 20.
Interestingly, a
reduction in search errors does not benefit the BLEU score in this setting.
5SMT lattices are lightly pruned by removing paths whose weight is more than five times the weight of the shortest
path. For the experiments in Tab. 1 we removed very long sentences from the original test set to keep the runtime under
control. Lattices have 271 nodes and 408 arcs on average.
Average number of node
expansions per sentence
Exhaustive enumeration
Depth-first search with admissible pruning
Beam search (beam=20)
Beam search (beam=4)
Greedy decoding
652.3K
3.0K
250.5
64.8
18.0
0%
0%
Sentences with BLEU
search errors
score
21.7
21.7
21.9
21.9
22.1
20.3%
41.9%
67.9%
Table 1: BPE-level SMT lattice rescoring with different search strategies. The BLEU score
does not benefit from less search errors due to modeling errors.
Pure NMT SMT lattice
rescoring
MBR-based
NMT-SMT hybrid
Theano: Blocks (van Merrienboer et al., 2015)
TensorFlow: seq2seq tutorial6
TensorFlow: NMT tutorial7
TensorFlow: T2T Transformer (Google, 2017)
18.4
17.5
18.8
21.7
18.9
19.3
19.1
19.3
19.0
19.2
20.0
22.5
Table 2: BLEU scores of SGNMT with different NMT back ends on the complete KFTT test
set (Neubig, 2011) computed with multi-bleu.pl. All neural systems are BPE-based (Sen-
nrich et al., 2016) with vocabulary sizes of 30K. The SMT baseline achieves 18.1 BLEU.
4 Output Formats
SGNMT supports five different output formats.
• text: Plain text file with first best translations.
• nbest: n-best list of translation hypotheses.
• sfst: Lattice generation in OpenFST (Allauzen et al., 2007) format with standard arcs.
• fst: Lattices with sparse tuple arcs (Iglesias et al., 2015) which keep predictor scores
separate.
• ngram: MBR-style n-gram posteriors (Kumar and Byrne, 2004; Tromble et al., 2008) as
used by Stahlberg et al. (2017a) for NMT.
5 SGNMT for Research
SGNMT is designed for environments in which implementation time is far more valuable than
computation time. This basic design decision is strongly reflected by the software architecture
which accepts degradations in runtime in favor of extendibility and flexibility. We designed
SGNMT that way because training models and coding usually take the most time in our day-to-
day work. Decoding, however, usually takes a small fraction of that time. Therefore, reducing
the implementation time has a much larger impact on the overall productivity of our research
group than improvements in runtime, especially since decoding can be easily parallelized on
multiple machines.
Another benefit of SGNMT's predictor framework is that it enables us to write code in-
dependently of any NMT package, and swap the NMT back end with more recent software if
6https://github.com/ehasler/tensorflow
7https://github.com/tensorflow/nmt, trained with Tensor2Tensor (Google, 2017)
needed. For example, our previous research work on lattice rescoring (Stahlberg et al., 2016)
and MBR-based NMT (Stahlberg et al., 2017a) used the NMT package Blocks (van Merrienboer
et al., 2015) which is based on Theano (Bastien et al., 2012). Since both Blocks and Theano have
been discontinued, we recently switched to a Tensor2Tensor (Google, 2017) back end based
on TensorFlow (Abadi et al., 2016). Without reimplementation, we could validate that MBR-
based NMT holds up even under a much stronger NMT model, the Transformer model (Vaswani
et al., 2017). Tab. 2 compares the performance of lattice rescoring and MBR-based combination
across four different NMT implementations using SGNMT.
6 SGNMT for Teaching
SGNMT is being used for teaching at the University of Cambridge in course work and student
research projects. In the 2015-16 academic year, two students on the Cambridge MPhil in Ma-
chine Learning, Speech and Language Technology used SGNMT for their dissertation projects.
The first project involved using SGNMT with OpenFST (Allauzen et al., 2007) for applying
subword models in SMT (Gao, 2016). The second project developed automatic music composi-
tion by LSTMs where WFSAs were used to define the space of allowable chord progressions in
'Bach' chorales (Tomczak, 2016). The LSTM provides the 'creativity' and the WFSA enforces
constraints that the chorales must obey. This year, SGNMT provides the decoder for a student
project about simultaneous neural machine translation.
SGNMT is also part of two practicals for MPhil students at Cambridge.8 The first practical
applies different kinds of language models to restore the correct casing in a lowercased sentence
using FSTs. Since SGNMT has good support for the OpenFST library (Allauzen et al., 2007)
and can both read and write FSTs, it is used to integrate neural models such as RNN LMs into
the exercise. The second practical focuses on decoding strategies for NMT and explores the
synergies of word- and subword-based models and the potential of combining SMT and NMT.
7 SGNMT in the Industry
SDL Research continuously balances the research and development of neural machine trans-
lation with a focus on bringing state-of-the-art MT products to the market9 while pushing the
boundaries of MT technology via innovation and quick experimental research.
In this context, it is highly desirable to use versatile tools that can be easily extended
to support and combine new models, allowing for quick and painless experimentation. SDL
Research chose SGNMT over all other existing tools for rapid prototyping and assessment of
new research avenues. Among other Neural MT innovations, SDL Research used SGNMT
to prototype and assess attention-based Neural MT (Bahdanau et al., 2015), Neural MT model
shrinking (Stahlberg and Byrne, 2017) and the recent Transformer model (Vaswani et al., 2017).
As described in Sec. 5, the Transformer model is trivially supported by the SGNMT decoder
through its predictor framework, and is easy to combine with other predictors. It is worth noting
that at the time of writing this paper, Transformer ensembles are not natively supported by the
Tensor2Tensor decoder (Google, 2017).
Although SDL Research's decoder is homegrown, the SGNMT decoder is still a valuable
reference tool for side-by-side comparison between state-of-the-art Neural MT research and the
Neural MT product.
8http://ucam-smt.github.io/sgnmt/html/kyoto_nmt.html
9http://www.sdl.com/software-and-services/translation-software/
References
Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C., Corrado, G. S., Davis, A., Dean,
J., Devin, M., et al. (2016). Tensorflow: Large-scale machine learning on heterogeneous distributed
systems. arXiv preprint arXiv:1603.04467.
Allauzen, C., Riley, M., Schalkwyk, J., Skut, W., and Mohri, M. (2007). OpenFST: A general and efficient
weighted finite-state transducer library. In Implementation and Application of Automata, pages 11–23.
Springer.
Bahdanau, D., Cho, K., and Bengio, Y. (2015). Neural machine translation by jointly learning to align and
translate. In ICLR, Toulon, France.
Bastien, F., Lamblin, P., Pascanu, R., Bergstra, J., Goodfellow, I., Bergeron, A., Bouchard, N., Warde-
Farley, D., and Bengio, Y. (2012). Theano: new features and speed improvements. In NIPS, South
Lake Tahoe, Nevada, USA.
Bertoldi, N., Cattoni, R., Cettolo, M., Farajian, M., Federico, M., Caroselli, D., Mastrostefano, L., Rossi,
A., Trombetti, M., Germann, U., et al. (2017). MMT: New open source MT for the translation industry.
In Proceedings of The 20th Annual Conference of the European Association for Machine Translation
(EAMT).
Chung, J., Cho, K., and Bengio, Y. (2016). A character-level decoder without explicit segmentation
In Proceedings of the 54th Annual Meeting of the Association for
for neural machine translation.
Computational Linguistics (Volume 1: Long Papers), pages 1693–1703. Association for Computational
Linguistics.
Gao, J. (2016). Variable length word encodings for neural translation models. MPhil dissertation, Univer-
sity of Cambridge.
Gehring, J., Auli, M., Grangier, D., Yarats, D., and Dauphin, Y. N. (2017). Convolutional sequence to
sequence learning. ArXiv e-prints.
Google (2017). Tensor2Tensor: A library for generalized sequence to sequence models. https://
github.com/tensorflow/tensor2tensor. Accessed: 2017-12-12, version 1.3.1.
Hasler, E., Stahlberg, F., Tomalin, M., de Gispert, A., and Byrne, B. (2017). A comparison of neural mod-
els for word ordering. In Proceedings of the International Natural Language Generation Conference,
Santiago de Compostela, Spain.
Helcl, J. and Libovick´y, J. (2017). Neural Monkey: An open-source tool for sequence learning. The
Prague Bulletin of Mathematical Linguistics, pages 5–17.
Hieber, F., Domhan, T., Denkowski, M., Vilar, D., Sokolov, A., Clifton, A., and Post, M. (2017). Sockeye:
A toolkit for neural machine translation. ArXiv e-prints.
Iglesias, G., de Gispert, A., and Byrne, B. (2015). Transducer disambiguation with sparse topological fea-
tures. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing,
pages 2275–2280. Association for Computational Linguistics.
Jean, S., Cho, K., Memisevic, R., and Bengio, Y. (2015). On using very large target vocabulary for neural
machine translation. In Proceedings of the 53rd Annual Meeting of the Association for Computational
Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1:
Long Papers), pages 1–10. Association for Computational Linguistics.
Junczys-Dowmunt, M., Dwojak, T., and Hoang, H. (2016). Is neural machine translation ready for de-
ployment? A case study on 30 translation directions. In Proceedings of the 9th International Workshop
on Spoken Language Translation (IWSLT), Seattle, WA.
Klein, G., Kim, Y., Deng, Y., Senellart, J., and Rush, A. (2017). OpenNMT: Open-source toolkit for neural
machine translation. In Proceedings of ACL 2017, System Demonstrations, pages 67–72. Association
for Computational Linguistics.
Kumar, S. and Byrne, W. (2004). Minimum Bayes-risk decoding for statistical machine translation. In
HLT-NAACL, pages 169–176, Boston, MA, USA.
Luong, T., Pham, H., and Manning, C. D. (2015). Effective approaches to attention-based neural ma-
chine translation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language
Processing, pages 1412–1421. Association for Computational Linguistics.
Neubig, G. (2011). The Kyoto free translation task. http://www.phontron.com/kftt.
Neubig, G., Morishita, M., and Nakamura, S. (2015). Neural reranking improves subjective quality of
machine translation: NAIST at WAT2015. In WAT, Kyoto, Japan.
Sennrich, R., Firat, O., Cho, K., Birch, A., Haddow, B., Hitschler, J., Junczys-Dowmunt, M., Laubli,
S., Miceli Barone, A. V., Mokry, J., and Nadejde, M. (2017). Nematus: a toolkit for neural machine
translation. In Proceedings of the Software Demonstrations of the 15th Conference of the European
Chapter of the Association for Computational Linguistics, pages 65–68. Association for Computational
Linguistics.
Sennrich, R., Haddow, B., and Birch, A. (2016). Neural machine translation of rare words with subword
In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics
units.
(Volume 1: Long Papers), pages 1715–1725. Association for Computational Linguistics.
Stahlberg, F. and Byrne, B. (2017). Unfolding and shrinking neural machine translation ensembles. In
Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages
1946–1956. Association for Computational Linguistics.
Stahlberg, F., de Gispert, A., Hasler, E., and Byrne, B. (2017a). Neural machine translation by minimising
the Bayes-risk with respect to syntactic translation lattices. In Proceedings of the 15th Conference of
the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pages
362–368. Association for Computational Linguistics.
Stahlberg, F., Hasler, E., Saunders, D., and Byrne, B. (2017b). SGNMT – A flexible NMT decod-
In Proceedings of the
ing platform for quick prototyping of new models and search strategies.
2017 Conference on Empirical Methods in Natural Language Processing: System Demonstrations,
pages 25–30. Association for Computational Linguistics. Full documentation available at http:
//ucam-smt.github.io/sgnmt/html/.
Stahlberg, F., Hasler, E., Waite, A., and Byrne, B. (2016). Syntactically guided neural machine translation.
In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume
2: Short Papers), pages 299–305. Association for Computational Linguistics.
Sutskever, I., Vinyals, O., and Le, Q. V. (2014). Sequence to sequence learning with neural networks. In
Ghahramani, Z., Welling, M., Cortes, C., Lawrence, N. D., and Weinberger, K. Q., editors, Advances in
Neural Information Processing Systems 27, pages 3104–3112. Curran Associates, Inc.
Tomczak, M. (2016). Bachbot. MPhil dissertation, University of Cambridge.
Tromble, R. W., Kumar, S., Och, F., and Macherey, W. (2008). Lattice minimum Bayes-risk decoding for
statistical machine translation. In EMNLP, pages 620–629, Honolulu, HI, USA.
van Merrienboer, B., Bahdanau, D., Dumoulin, V., Serdyuk, D., Warde-Farley, D., Chorowski, J., and
Bengio, Y. (2015). Blocks and fuel: Frameworks for deep learning. CoRR.
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L. u., and Polosukhin,
I. (2017). Attention is all you need. In Advances in Neural Information Processing Systems 30, pages
6000–6010. Curran Associates, Inc.
Vaswani, A., Zhao, Y., Fossum, V., and Chiang, D. (2013). Decoding with large-scale neural language
models improves translation. In Proceedings of the 2013 Conference on Empirical Methods in Natural
Language Processing, pages 1387–1392, Seattle, Washington, USA. Association for Computational
Linguistics.
Williams, P., Sennrich, R., Nadejde, M., Huck, M., Hasler, E., and Koehn, P. (2014). Edinburghs syntax-
based systems at WMT 2014. In Proceedings of the Ninth Workshop on Statistical Machine Translation,
pages 207–214, Baltimore, Maryland, USA. Association for Computational Linguistics.
Wu, Y., Schuster, M., Chen, Z., Le, Q. V., Norouzi, M., Macherey, W., Krikun, M., Cao, Y., Gao, Q.,
Macherey, K., et al. (2016). Google's neural machine translation system: Bridging the gap between
human and machine translation. arXiv preprint arXiv:1609.08144.
|
1609.02746 | 1 | 1609 | 2016-09-09T11:16:56 | INSIGHT-1 at SemEval-2016 Task 4: Convolutional Neural Networks for Sentiment Classification and Quantification | [
"cs.CL",
"cs.LG"
] | This paper describes our deep learning-based approach to sentiment analysis in Twitter as part of SemEval-2016 Task 4. We use a convolutional neural network to determine sentiment and participate in all subtasks, i.e. two-point, three-point, and five-point scale sentiment classification and two-point and five-point scale sentiment quantification. We achieve competitive results for two-point scale sentiment classification and quantification, ranking fifth and a close fourth (third and second by alternative metrics) respectively despite using only pre-trained embeddings that contain no sentiment information. We achieve good performance on three-point scale sentiment classification, ranking eighth out of 35, while performing poorly on five-point scale sentiment classification and quantification. An error analysis reveals that this is due to low expressiveness of the model to capture negative sentiment as well as an inability to take into account ordinal information. We propose improvements in order to address these and other issues. | cs.CL | cs |
INSIGHT-1 at SemEval-2016 Task 4: Convolutional Neural Networks for
Sentiment Classification and Quantification
Sebastian Ruder12
Parsa Ghaffari2
John G. Breslin1
1Insight Centre for Data Analytics
National University of Ireland, Galway
[email protected]
2Aylien Ltd.
Dublin, Ireland
[email protected]
Abstract
two-point,
This paper describes our deep learning-based
approach to sentiment analysis in Twitter as
part of SemEval-2016 Task 4. We use a
convolutional neural network to determine
sentiment and participate in all subtasks,
i.e.
three-point, and five-point
scale sentiment classification and two-point
and five-point scale sentiment quantification.
We achieve competitive results for two-point
scale sentiment classification and quantifica-
tion, ranking fifth and a close fourth (third
and second by alternative metrics) respec-
tively despite using only pre-trained embed-
dings that contain no sentiment information.
We achieve good performance on three-point
scale sentiment classification, ranking eighth
out of 35, while performing poorly on five-
point scale sentiment classification and quan-
tification. An error analysis reveals that this
is due to low expressiveness of the model to
capture negative sentiment as well as an in-
ability to take into account ordinal informa-
tion. We propose improvements in order to
address these and other issues.
1 Introduction
Social media allows hundreds of millions of people
to interact and engage with each other, while ex-
pressing their thoughts about the things that move
them. Sentiment analysis (Pang and Lee, 2008) al-
lows us to gain insights about opinions towards
persons, objects, and events in the public eye and
is used nowadays to gauge public opinion towards
companies or products, to analyze customer satis-
faction, and to detect trends.
Its immediacy allowed Twitter to become an im-
portant platform for expressing opinions and public
discourse, while the accessibility of large quantities
of data in turn made it the focal point of social media
sentiment analysis research.
Recently, deep learning-based approaches have
text clas-
(Kim, 2014)
phrase-level
classification
demonstrated remarkable results for
sification and sentiment
and
and message-level
(Severyn and Moschitti, 2015).
performed well
analysis
for
sentiment
have
in
Past
analysis
SemEval
competitions
Twitter
(Rosenthal et al., 2014;
sentiment
Rosenthal et al., 2015) have contributed to shape
research in this field.
SemEval-2016 Task 4
(Nakov et al., 2016) is no exception, as it introduces
both quantification and five-point-scale classifica-
tion tasks, neither of which have been tackled with
deep learning-based approaches before.
We apply our deep learning-based model for sen-
timent analysis to all subtasks of SemEval-2016
Task 4:
three-point scale message polarity classi-
fication (subtask A), two-point and five-point scale
topic sentiment classification (subtasks B and C re-
spectively), and two-point and five-point scale topic
sentiment quantification (subtasks D and E respec-
tively).
Our model achieves excellent results for subtasks
B and D, ranks competitively for subtask A, while
performing poorly for subtasks C and E. We perform
an error analysis of our model to obtain a better un-
derstanding of strengths and weaknesses of a deep
learning-based approach particularly for these new
tasks and subsequently propose improvements.
2 Related work
Deep-learning based approaches have recently dom-
inated the state-of-the-art in sentiment analysis. Kim
(2014) uses a one-layer convolutional neural net-
work to achieve top performance on various senti-
ment analysis datasets, demonstrating the utility of
pre-trained embeddings.
State-of-the-art models in Twitter sentiment anal-
ysis leverage large amounts of data accessible on
Twitter to further enhance their embeddings by treat-
ing smileys as noisy labels (Go et al., 2009): Tang
et al. (2014) learn sentiment-specific word embed-
dings from such distantly supervised data and use
these as features for supervised classification, while
Severyn and Moschitti (2015) use distantly super-
vised data to fine-tune the embeddings of a convolu-
tional neural network.
In contrast, we observe distantly supervised data
not to be as important for some tasks as long as suf-
ficient training data is available.
3 Model
The model architecture we use is an extension of the
CNN structure used by Collobert et al. (2011).
The model takes as input a text, which is padded
to length n. We represent the text as a concatentation
of its word embeddings x1:n where xi ∈ Rk is the
k-dimensional vector of the i-th word in the text.
The convolutional layer slides filters of different
window sizes over the word embeddings. Each filter
with weights w ∈ Rhk generates a new feature ci
for a window of h words according to the following
operation:
ci = f (w · xi:i+h−1 + b)
(1)
Note that b ∈ R is a bias term and f is a non-linear
function, ReLU (Nair and Hinton, 2010) in our case.
The application of the filter over each possible win-
dow of h words or characters in the sentence pro-
duces the following feature map:
c = [c1, c2, ..., cn−h+1]
(2)
Max-over-time pooling in turn condenses this fea-
ture vector to its most important feature by taking its
maximum value and naturally deals with variable in-
put lengths.
A final softmax layer takes the concatenation of
the maximum values of the feature maps produced
by all filters and outputs a probability distribution
over all output classes.
4 Methodology
4.1 Datasets
For every subtask, the organizers provide a training,
development, and development test set for training
and tuning. We use the concatentation of the training
and development test set for each subtask for train-
ing and use the development set for validation.
Additionally, the organizers make training and de-
velopment data from SemEval-2013 and trial data
from 2016 available that can be used for training
and tuning for subtask A and subtasks B, C, D, and
E respectively. We experiment with adding these
datasets to the respective subtask.
Interestingly,
adding them slightly increases loss on the validation
set, while providing a significant performance boost
on past development test sets, which we view as a
proxy for performance on the 2016 test set. For this
reason, we include these datasets for training of all
our models.
score, i.e.
We notably do not select the model that achieves
the lowest loss on the validation set, but choose the
the arith-
one that maximizes the F P N
metic mean of the F1 of positive and negative tweets,
which has historically been used to evaluate the Se-
mEval message polarity classification subtask. We
observe that the lowest loss does not necessarily lead
to the lowest F P N
, as it does not include F1 of neu-
tral tweets.
1
1
4.2 Pre-processing
For pre-processing, we use a script adapted from the
pre-processing script1 used for training GloVe vec-
tors (Pennington et al., 2014). Besides normalizing
urls and mentions, we notably normalize happy and
sad smileys, extract hashtags, and insert tags for re-
peated, elongated, and all caps characters.
4.3 Word embeddings
Past
research
Severyn and Moschitti, 2015)
(Kim, 2014;
good
a
found
1http://nlp.stanford.edu/projects/glove/
preprocess-twitter.rb
initialization of word embeddings to be crucial in
training an accurate sentiment model.
random initialization,
We thus evaluate the following evaluation
schemes:
initialization us-
ing pre-trained GloVe vectors, fine-tuning pre-
trained embeddings on a distantly supervised cor-
pus (Severyn and Moschitti, 2015), and fine-tuning
pre-trained embeddings on 40k tweets with crowd-
sourced Twitter annotations.
Perhaps counter-
intuitively, we find that fine-tuning embeddings on
a distantly supervised or crowd-sourced corpus does
not improve performance on past development test
sets when including the additionally provided data
for training. We hypothesize that additional training
data facilitates learning of the underlying semantics,
thereby reducing the need for sentiment-specific em-
beddings. Our scores partially echo this theory.
For this reason, we initialize our word embed-
dings simply with 200-dimensional GloVe vectors
trained on 2B tweets. Word embeddings for un-
known words are initialized randomly.
4.4 Hyperparameters and pre-processing
We tune hyperparameters over a wide range of val-
ues via random search on the validation set. We find
that the following hyperparameters, which are sim-
ilar to ones used by Kim (2014), yield the best per-
formance across all subtasks: mini-batch size of 10,
maximum sentence length of 50 tokens, word em-
bedding size of 200 dimensions, dropout rate of 0.3,
l2 regularization of 0.01, filter lengths of 3, 4, and 5
with 100 filter maps each.
We train for 15 epochs using mini-batch stochas-
the Adadelta update rule
tic gradient descent,
(Zeiler, 2012), and early stopping.
4.5 Task adaptation and quantification
To adapt our model to the different tasks, we simply
adjust the number of output neurons to conform to
the scale used in the task at hand (two-point scale
in subtasks B and D, three-point scale in subtask A,
five-point scale in subtasks C and E).
We perform a simple quantification for subtasks D
and E by aggregating the classified tweets for each
topic and reporting their distribution across senti-
ments. We would thus expect our results on sub-
tasks B and D and results on subtasks C and E to be
closely correlated.
Metric Our score Best score Rank
8/34
F P N
12/34
RP N
5/34
AccP N
0.593
0.616
0.635
0.633
0.670
0.646
1
Table 1: Our score and rank for subtask A for each metric com-
pared to the best team's score (results for official metric in bold).
2013
2014
TW SMS
TW TW LJ
2015
TW
/s
76.84
51.95
65.51
69.08
50.00
67.28
64.52
13.64
45.71
66.73
49.65
77.83
65.56
+ 72.49
-
53.00
47.97
65.23
= 67.53
Table 2: F1 scores of our model for positive, negative, and neu-
tral tweets for each progress dataset of subtask A. TW: Tweet.
/s: sarcasm. LJ: Live Journal. +: positive.
-: negative. =:
neutral.
5 Evaluation
We report results of our model in Tables 1 and 2
(subtask A), Table 3 (subtask B), Tables 5 and 6
(subtask C), Table 4 (subtask D), and Table 7 (sub-
task E). For some subtasks, the organizers make
available alternative metrics. We observe that the
choice of the scoring metric influences results con-
siderably, with our system always placing higher if
ranked by one of the alternative metrics.
Subtask A. We obtain competitive performance
on subtask A in Table 1. Analysis of results on the
progress test sets in Table 2 reveals that our sys-
tem achieves competitive F1 scores for positive and
neutral tweets, but only low F1 scores for negative
tweets due to low recall. This is mirrored in Table
1, where we rank higher for accuracy than for recall.
accentuates
The scoring metric for subtask A, F P OS
F1 for positive and negative tweets, thereby ignoring
our good performance on neutral tweets and leading
to only mediocre ranks on the progress test sets for
our system.
1
Subtasks B and D. We achieve a competitive fifth
rank for subtask B by the official recall metric in Ta-
ble 3. However, ranked by F1 (as in subtask A),
we place third – and second if ranked by accuracy.
Similarly, for subtask D, we rank fourth (with a dif-
ferential of 0.001 to the second rank) by KLD, but
second and first if ranked by AE and RAE respec-
tively. Jointly, these results demonstrate that classifi-
Metric Our score Best score Rank
5/19
3/19
2/19
0.767
0.786
0.864
0.797
0.799
0.870
R
F1
Acc
Table 3: Our score and rank for subtask B for each metric com-
pared to the best team's score (results for official metric in bold).
Metric Our score Best score Rank
4/14
KLD
2/14
AE
1/14
RAE
0.054
0.085
0.423
0.034
0.074
0.423
Table 4: Our score and rank for subtask D for each metric com-
pared to the best team's score (results for official metric in bold).
cation performance is a good indicator for quantifi-
cation without using any more sophisticated quan-
tification methods. These results are in line with
past research (Kim, 2014) showcasing that even a
conceptually simple neural network-based approach
can achieve excellent results given enough training
data per class. These results also highlight that em-
beddings trained using distant supervision, which
should be particularly helpful for this task as they
are fine-tuned using the same classes, i.e. positive
and negative, are not necessary given enough data.
Subtasks C and E. We achieve mediocre results
for subtask C in Table 5, only ranking sixth – how-
ever, placing third by the alternative metric. Simi-
larly, we only achieve an unsatisfactory eighth rank
for subtask E in Table 7. An error analysis for sub-
task C in Table 6 reveals that the model is able to
differentiate between neutral, positive, and very pos-
itive tweets with good accuracy. However, similarly
to results in subtask A, we find that it lacks expres-
siveness for negative sentiment and completely fails
to capture very negative tweets due to their low num-
ber in the training data. Additionally, it is unable to
take into account sentiment order to reduce error for
very positive and very negative tweets.
Metric Our score Best score Rank
6/11
M AEM
3/11
M AEµ
1.006
0.607
0.719
0.580
Table 5: Our score and rank for subtask C for each metric com-
pared to the best team's score (results for official metric in bold).
Sentiment
M AEM
-2
2.09
-1
1.29
0
1
2
0.78
0.17
0.71
Table 6: Macro-averaged mean absolute error (M AEM) of our
model for each sentiment class for subtask C. Lower error is
better.
Metric Our score Best score Rank
8/10
EM D
0.366
0.243
Table 7: Our score and rank for subtask E compared to the best
team's score.
Improvements
5.1
We propose different improvements to enable the
model to better deal with some of the encountered
challenges.
Negative sentiment. The easiest way to enable
our model to better capture negative sentiment is to
include more negative tweets in the training data.
Additionally, using distantly supervised data for
fine-tuning embeddings would likely have helped to
mitigate this deficit. In order to allow the model to
better differentiate between different sentiments on
a five-point scale, it would be interesting to evaluate
ways to create a more fine-grained distantly super-
vised corpus using e.g. a wider range of smileys and
emoticons or certain hashtags indicating a high de-
gree of elation or distress.
Ordinal classification.
Instead of treating all
classes as independent, we can enable the model
to take into account ordinal information by simply
modifying the labels as in (Cheng et al., 2008). A
more sophisticated approach would organically in-
tegrate label-dependence into the network.
Quantification.
Instead of deriving the topic-
level sentiment distribution by predicting tweet-
level sentiment, we can directly minimize the
Kullback-Leibler divergence for each topic. If the
feedback from optimizing this objective proves to
be too indirect to provide sufficient signals, we can
jointly optimize tweet-level as well as topic-level
sentiment as in (Kotzias, 2015).
6 Conclusion
In this paper, we have presented our deep learning-
based approach to Twitter sentiment analysis for
two-point,
three-point, and five-point scale sen-
timent classification and two-point and five-point
national Conference on Machine Learning, (3):807–
814.
[Nakov et al.2016] Preslav Nakov, Alan Ritter, Sara
Rosenthal, Veselin Stoyanov, and Fabrizio Sebastiani.
2016. SemEval-2016 Task 4: Sentiment Analysis
in Twitter.
In Proceedings of the 10th International
Workshop on Semantic Evaluation, San Diego, Cali-
fornia. Association for Computational Linguistics.
[Pang and Lee2008] Bo Pang and Lillian Lee.
2008.
Opinion Mining and Sentiment Analysis. Foundations
and trends in information retrieval, 2(1-2):1–135.
[Pennington et al.2014] Jeffrey
Pennington,
Richard
Socher, and Christopher D Manning. 2014. Glove:
Global Vectors for Word Representation. Proceedings
of the 2014 Conference on Empirical Methods in
Natural Language Processing, pages 1532–1543.
and Veselin Stoyanov.
[Rosenthal et al.2014] Sara Rosenthal, Alan Ritter,
Preslav Nakov,
2014.
SemEval-2014 Task 9: Sentiment Analysis in Twitter.
Proceedings of the 8th International Workshop on
Semantic Evaluation (SemEval 2014), (SemEval):73–
80.
[Rosenthal et al.2015] Sara Rosenthal, Preslav Nakov,
Svetlana Kiritchenko, Saif M Mohammad, Alan Ritter,
and Veselin Stoyanov. 2015. SemEval-2015 Task 10:
Sentiment Analysis in Twitter. Proceedings of the 9th
International Workshop on Semantic Evaluation (Se-
mEval 2015), (SemEval):451–463.
[Severyn and Moschitti2015] Aliaksei
and
Alessandro Moschitti. 2015. UNITN : Training Deep
Convolutional Neural Network for Twitter Sentiment
Classification. (SemEval):464–469.
Severyn
[Tang et al.2014] Duyu Tang, Furu Wei, Nan Yang, Ming
2014. Learning
Zhou, Ting Liu, and Bing Qin.
Sentiment-Specific Word Embedding. Proceedings of
the 52nd Annual Meeting of the Association for Com-
putational Linguistics, 1:1555–1565.
[Zeiler2012] Matthew D. Zeiler. 2012. ADADELTA: An
Adaptive Learning Rate Method.
scale sentiment quantification. We reviewed the dif-
ferent aspects we took into consideration in creat-
ing our model. We rank fifth and a close fourth
(third and second by alternative metrics) on two-
point scale classification and quantification despite
using only pre-trained embeddings that contain no
sentiment information. We analysed our weaker per-
formance on three-point scale sentiment classifica-
tion and five-point scale sentiment classification and
quantification and found that the model lacks ex-
pressiveness to capture negative sentiment and is un-
able to take into account class order. Finally, we pro-
posed improvements to resolve these deficits.
Acknowledgments
This project has emanated from research con-
ducted with the financial support of
the Irish
Research Council
(IRC) under Grant Number
EBPPG/2014/30 and with Aylien Ltd.
as Enter-
prise Partner. This publication has emanated from
research supported in part by a research grant from
Science Foundation Ireland (SFI) under Grant Num-
ber SFI/12/RC/2289.
References
[Cheng et al.2008] Jianlin Cheng Jianlin Cheng, Zheng
Wang Zheng Wang, and G. Pollastri. 2008. A neu-
ral network approach to ordinal regression.
2008
IEEE International Joint Conference on Neural Net-
works (IEEE World Congress on Computational Intel-
ligence).
[Collobert et al.2011] Ronan Collobert, Jason Weston,
Leon Bottou, Michael Karlen, Koray Kavukcuoglu,
and Pavel Kuksa. 2011. Natural Language Processing
(almost) from Scratch. Journal of Machine Learning
Research, 12(Aug):2493–2537.
[Go et al.2009] Alec Go, Richa Bhayani, and Lei Huang.
2009. Twitter Sentiment Classification using Distant
Supervision. Processing, 150(12):1–6.
[Kim2014] Yoon Kim. 2014. Convolutional Neural Net-
works for Sentence Classification. Proceedings of the
Conference on Empirical Methods in Natural Lan-
guage Processing, pages 1746–1751.
[Kotzias2015] Dimitrios Kotzias. 2015. From Group to
Individual Labels using Deep Features.
[Nair and Hinton2010] Vinod Nair and Geoffrey E Hin-
ton. 2010. Rectified Linear Units Improve Restricted
Boltzmann Machines. Proceedings of the 27th Inter-
|
1705.00753 | 1 | 1705 | 2017-05-02T01:14:06 | A Teacher-Student Framework for Zero-Resource Neural Machine Translation | [
"cs.CL"
] | While end-to-end neural machine translation (NMT) has made remarkable progress recently, it still suffers from the data scarcity problem for low-resource language pairs and domains. In this paper, we propose a method for zero-resource NMT by assuming that parallel sentences have close probabilities of generating a sentence in a third language. Based on this assumption, our method is able to train a source-to-target NMT model ("student") without parallel corpora available, guided by an existing pivot-to-target NMT model ("teacher") on a source-pivot parallel corpus. Experimental results show that the proposed method significantly improves over a baseline pivot-based model by +3.0 BLEU points across various language pairs. | cs.CL | cs | A Teacher-Student Framework for
Zero-Resource Neural Machine Translation
Yun Chen†, Yang Liu‡, Yong Cheng+, Victor O.K. Li†
†Department of Electrical and Electronic Engineering, The University of Hong Kong
‡State Key Laboratory of Intelligent Technology and Systems
Tsinghua National Laboratory for Information Science and Technology
Department of Computer Science and Technology, Tsinghua University, Beijing, China
Jiangsu Collaborative Innovation Center for Language Competence, Jiangsu, China
+Institute for Interdisciplinary Information Sciences, Tsinghua University, Beijing, China
7
1
0
2
y
a
M
2
]
L
C
.
s
c
[
1
v
3
5
7
0
0
.
5
0
7
1
:
v
i
X
r
a
[email protected]; [email protected];
[email protected]; [email protected]
Abstract
While end-to-end neural machine transla-
tion (NMT) has made remarkable progress
recently,
it still suffers from the data
scarcity problem for low-resource lan-
guage pairs and domains.
In this paper,
we propose a method for zero-resource
NMT by assuming that parallel sentences
have close probabilities of generating a
sentence in a third language. Based on
this assumption, our method is able to
train a source-to-target NMT model ("stu-
dent") without parallel corpora available,
guided by an existing pivot-to-target NMT
model ("teacher") on a source-pivot par-
allel corpus. Experimental results show
that the proposed method significantly im-
proves over a baseline pivot-based model
by +3.0 BLEU points across various lan-
guage pairs.
1
Introduction
Neural machine translation (NMT) (Kalchbren-
ner and Blunsom, 2013; Sutskever et al., 2014;
Bahdanau et al., 2015), which directly models
the translation process in an end-to-end way, has
attracted intensive attention from the commu-
nity. Although NMT has achieved state-of-the-art
translation performance on resource-rich language
pairs such as English-French and German-English
(Luong et al., 2015; Jean et al., 2015; Wu et al.,
2016; Johnson et al., 2016), it still suffers from
the unavailability of large-scale parallel corpora
for translating low-resource languages. Due to the
large parameter space, neural models usually learn
poorly from low-count events, resulting in a poor
choice for low-resource language pairs. Zoph et
al. (2016) indicate that NMT obtains much worse
translation quality than a statistical machine trans-
lation (SMT) system on low-resource languages.
As a result, a number of authors have endeav-
ored to explore methods for translating language
pairs without parallel corpora available. These
methods can be roughly divided into two broad
categories: multilingual and pivot-based. Firat
et al.
(2016b) present a multi-way, multilin-
gual model with shared attention to achieve zero-
resource translation. They fine-tune the attention
part using pseudo bilingual sentences for the zero-
resource language pair. Another direction is to
develop a universal NMT model in multilingual
scenarios (Johnson et al., 2016; Ha et al., 2016).
They use parallel corpora of multiple languages
to train one single model, which is then able to
translate a language pair without parallel corpora
available. Although these approaches prove to be
effective, the combination of multiple languages
in modeling and training leads to increased com-
plexity compared with standard NMT.
Another direction is to achieve source-to-target
NMT without parallel data via a pivot, which
is either text (Cheng et al., 2016a) or image
(Nakayama and Nishida, 2016). Cheng et al.
(2016a) propose a pivot-based method for zero-
resource NMT: it first translates the source lan-
guage to a pivot language, which is then translated
to the target language. Nakayama and Nishida
(2016) show that using multimedia information as
pivot also benefits zero-resource translation. How-
ever, pivot-based approaches usually need to di-
vide the decoding process into two steps, which
is not only more computationally expensive, but
also potentially suffers from the error propagation
problem (Zhu et al., 2013).
In this paper, we propose a new method for
zero-resource neural machine translation. Our
method assumes that parallel sentences should
Figure 1: (a) The pivot-based approach and (b) the teacher-student approach to zero-resource neural
machine translation. X, Y, and Z denote source, target, and pivot languages, respectively. We use a
dashed line to denote that there is a parallel corpus available for the connected language pair. Solid
lines with arrows represent translation directions. The pivot-based approach leverages a pivot to achieve
indirect source-to-target translation:
it first translates x into z, which is then translated into y. Our
training algorithm is based on the translation equivalence assumption: if x is a translation of z, then
P (yx; θx→y) should be close to P (yz; θz→y). Our approach directly trains the intended source-to-
target model P (yx; θx→y) ("student") on a source-pivot parallel corpus, with the guidance of an existing
pivot-to-target model P (yz; θz→y) ("teacher").
have close probabilities of generating a sentence
in a third language. To train a source-to-target
NMT model without parallel corpora available
("student"), we leverage an existing pivot-to-target
NMT model ("teacher") to guide the learning
process of the student model on a source-pivot
parallel corpus. Compared with pivot-based ap-
proaches (Cheng et al., 2016a), our method al-
lows direct parameter estimation of the intended
NMT model, without the need to divide decod-
ing into two steps. This strategy not only im-
proves efficiency but also avoids error propaga-
tion in decoding. Experiments on the Europarl and
WMT datasets show that our approach achieves
significant improvements in terms of both trans-
lation quality and decoding efficiency over a base-
line pivot-based approach to zero-resource NMT
on Spanish-French and German-French transla-
tion tasks.
2 Background
Neural machine translation (Sutskever et al., 2014;
Bahdanau et al., 2015) advocates the use of neu-
ral networks to model the translation process in
an end-to-end manner. As a data-driven approach,
NMT treats parallel corpora as the major source
for acquiring translation knowledge.
Let x be a source-language sentence and y be a
target-language sentence. We use P (yx; θx→y)
to denote a source-to-target neural
translation
model, where θx→y is a set of model parame-
ters. Given a source-target parallel corpus Dx,y,
which is a set of parallel source-target sentences,
the model parameters can be learned by maximiz-
ing the log-likelihood of the parallel corpus:
(cid:40) (cid:88)
(cid:104)x,y(cid:105)∈Dx,y
(cid:41)
(1)
θx→y = argmax
θx→y
log P (yx; θx→y)
.
Given learned model parameters θx→y, the de-
cision rule for finding the translation with the
highest probability for a source sentence x is given
by
(cid:40)
(cid:41)
P (yx; θx→y)
.
y = argmax
y
As a data-driven approach, NMT heavily relies
on the availability of large-scale parallel corpora
to deliver state-of-the-art translation performance
(Wu et al., 2016; Johnson et al., 2016). Zoph et
al.
(2016) report that NMT obtains much lower
BLEU scores than SMT if only small-scale par-
allel corpora are available. Therefore, the heavy
dependence on the quantity of training data poses
a severe challenge for NMT to translate zero-
resource language pairs.
Simple and easy-to-implement, pivot-based
methods have been widely used in SMT for
(a)(b)XYZZXYP(zx;✓x!z)P(yz;✓z!y)P(yz;✓z!y)P(yx;✓x!y)translating zero-resource language pairs (de Gis-
pert and Marino, 2006; Cohn and Lapata, 2007;
Utiyama and Isahara, 2007; Wu and Wang, 2007;
Bertoldi et al., 2008; Wu and Wang, 2009; Za-
habi et al., 2013; Kholy et al., 2013). As pivot-
based methods are agnostic to model structures,
they have been adapted to NMT recently (Cheng
et al., 2016a; Johnson et al., 2016).
Figure 1(a) illustrates the basic idea of pivot-
based approaches to zero-resource NMT (Cheng
et al., 2016a). Let X, Y, and Z denote source, tar-
get, and pivot languages. We use dashed lines to
denote language pairs with parallel corpora avail-
able and solid lines with arrows to denote transla-
tion directions.
Intuitively, the source-to-target translation can
be indirectly modeled by bridging two NMT mod-
els via a pivot:
(cid:88)
P (yx; θx→z, θz→y)
=
z
P (zx; θx→z)P (yz; θz→y).
(2)
θx→z = argmax
As shown in Figure 1(a), pivot-based ap-
proaches assume that the source-pivot parallel cor-
pus Dx,z and the pivot-target parallel corpus Dz,y
are available. As it is impractical to enumerate all
possible pivot sentences, the two NMT models are
trained separately in practice:
(cid:41)
(cid:41)
log P (zx; θx→z)
log P (yz; θz→y)
Due to the exponential search space of pivot
sentences, the decoding process of translating an
unseen source sentence x has to be divided into
two steps:
(cid:40) (cid:88)
(cid:40) (cid:88)
θz→y = argmax
(cid:104)x,z(cid:105)∈Dx,z
(cid:104)z,y(cid:105)∈Dz,y
θx→z
θz→y
,
.
(cid:110)
(cid:110)
P (zx; θx→z)
P (yz; θz→y)
(cid:111)
(cid:111)
,
.
z = argmax
z
y = argmax
y
(3)
(4)
3 Approach
3.1 Assumptions
In this work, we propose to directly model the in-
tended source-to-target neural translation based on
a teacher-student framework. The basic idea is to
use a pre-trained pivot-to-target model ("teacher")
to guide the learning process of a source-to-target
model ("student") without training data available
on a source-pivot parallel corpus. One advantage
of our approach is that Equation (1) can be used as
the decision rule for decoding, which avoids the
error propagation problem faced by two-step de-
coding in pivot-based approaches.
As shown in Figure 1(b), we still assume
that a source-pivot parallel corpus Dx,z and
a pivot-target parallel corpus Dz,y are avail-
able. Unlike pivot-based approaches, we first
use the pivot-target parallel corpus Dz,y to ob-
tain a teacher model P (yz; θz→y), where θz→y
is a set of learned model parameters.
Then,
the teacher model "teaches" the student model
P (yx; θx→y) on the source-pivot parallel corpus
Dx,z based on the following assumptions.
Assumption 1 If a source sentence x is a transla-
tion of a pivot sentence z, then the probability of
generating a target sentence y from x should be
close to that from its counterpart z.
We can further introduce a word-level assump-
tion:
Assumption 2 If a source sentence x is a transla-
tion of a pivot sentence z, then the probability of
generating a target word y from x should be close
to that from its counterpart z, given the already
obtained partial translation y<j.
The two assumptions are empirically verified in
our experiments (see Table 2).
In the following
subsections, we will introduce two approaches to
zero-resource neural machine translation based on
the two assumptions.
The above two-step decoding process potentially
suffers from the error propagation problem (Zhu
et al., 2013):
the translation errors made in the
first step (i.e., source-to-pivot translation) will af-
fect the second step (i.e., pivot-to-target transla-
tion).
Therefore, it is necessary to explore methods to
directly model source-to-target translation without
parallel corpora available.
3.2 Sentence-Level Teaching
Given a source-pivot parallel corpus Dx,z, our
training objective based on Assumption 1 is de-
fined as follows:
(cid:16)
(cid:88)
JSENT(θx→y)
KL
=
(cid:104)x,z(cid:105)∈Dx,z
P (yz; θz→y)
(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)P (yx; θx→y)
(cid:17)
, (5)
where the KL divergence sums over all possible
target sentences:
(cid:16)
(cid:88)
KL
y
=
(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)P (yx; θx→y)
(cid:17)
P (yz; θz→y)
P (yx; θx→y)
.(6)
P (yz; θz→y)
P (yz; θz→y) log
As the teacher model parameters are fixed, the
training objective can be equivalently written as
(cid:88)
JSENT(θx→y)
E
yz; θz→y
(cid:104)x,z(cid:105)∈Dx,z
= −
(cid:104)
(cid:105)
log P (yx; θx→y)
. (7)
In training, our goal is to find a set of source-to-
target model parameters that minimizes the train-
ing objective:
(cid:110)
(cid:111)
JSENT(θx→y)
.
(8)
θx→y = argmin
θx→y
With learned source-to-target model parameters
θx→y, we use the standard decision rule as shown
in Equation (1) to find the translation y for a
source sentence x.
However, a major difficulty faced by our ap-
proach is the intractability in calculating the gra-
dients because of the exponential search space of
target sentences. To address this problem, it is pos-
sible to construct a sub-space by either sampling
(Shen et al., 2016), generating a k-best list (Cheng
et al., 2016b) or mode approximation (Kim and
Rush, 2016). Then, standard stochastic gradient
descent algorithms can be used to optimize model
parameters.
3.3 Word-Level Teaching
Instead of minimizing the KL divergence between
the teacher and student models at the sentence
level, we further define a training objective at the
word level based on Assumption 2:
(cid:88)
JWORD(θx→y)
E
yz; θz→y
(cid:104)x,z(cid:105)∈Dx,z
=
(cid:104)
(cid:105)
, (9)
J(x, y, z, θz→y, θx→y)
where
=
(cid:16)
y(cid:88)
j=1
J(x, y, z, θz→y, θx→y)
KL
P (yz, y<j; θz→y)
(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)
(cid:17)
P (yx, y<j; θx→y)
.
(10)
KL
(cid:16)
(cid:88)
P (yz, y<j; θz→y)
P (yz, y<j; θz→y) log
Equation (9) suggests that the teacher model
P (yz, y<j; θz→y) "teaches" the student model
P (yx, y<j; θx→y) in a word-by-word way. Note
that the KL-divergence between the two models is
(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)P (yx, y<j; θx→y)
(cid:17)
defined at the word level:
P (yz, y<j; θz→y)
P (yx, y<j; θx→y)
where Vy is the target vocabulary. As the param-
eters of the teacher model are fixed, the training
objective can be equivalently written as:
(cid:105)
(cid:88)
JWORD(θx→y)
y∈Vy
(cid:104)
=
,
= −
(cid:104)x,z(cid:105)∈Dx,z
E
yz; θz→y
S(x, y, z, θz→y, θx→y)
, (11)
S(x, y, z, θz→y, θx→y)
where
=
y(cid:88)
(cid:88)
j=1
y∈Vy
(12)
P (yz, y<j; θz→y) ×
log P (yx, y<j; θx→y).
(cid:110)
(cid:111)
JWORD(θx→y)
Therefore, our goal is to find a set of source-to-
target model parameters that minimizes the train-
ing objective:
θx→y = argmin
θx→y
.
(13)
We use similar approaches as described in Sec-
tion 3.2 for approximating the full search space
with sentence-level
teaching. After obtaining
θx→y, the same decision rule as shown in Equa-
tion (1) can be utilized to find the most probable
target sentence y for a source sentence x.
4 Experiments
4.1 Setup
We evaluate our approach on the Europarl (Koehn,
2005) and WMT corpora. To compare with pivot-
based methods, we use the same dataset as (Cheng
et al., 2016a). All the sentences are tokenized by
the tokenize.perl script. All the experiments
treat English as the pivot language and French as
the target language.
For the Europarl corpus, we evaluate our pro-
posed methods on Spanish-French (Es-Fr) and
German-French (De-Fr) translation tasks in a
Corpus
Europarl
WMT
Direction
Es→ En
De→ En
En→ Fr
Es→ En
En→ Fr
Train
Dev.
850K 2,000
840K 2,000
900K 2,000
6.78M 3,003
9.29M 3,003
Test
2,000
2,000
2,000
3,003
3,003
Table 1: Data statistics. For the Europarl corpus,
we evaluate our approach on Spanish-French (Es-
Fr) and German-French (De-Fr) translation tasks.
For the WMT corpus, we evaluate our approach on
the Spanish-French (Es-Fr) translation task. En-
glish is used as a pivot language in all experiments.
zero-resource scenario. To avoid the trilingual
corpus constituted by the source-pivot and pivot-
target corpora, we split the overlapping pivot sen-
tences of the original source-pivot and pivot-target
corpora into two equal parts and merge them sepa-
rately with the non-overlapping parts for each lan-
guage pair. The development and test sets are from
WMT 2006 shared task.1 The evaluation metric is
case-insensitive BLEU (Papineni et al., 2002) as
calculated by the multi-bleu.perl script. To
deal with out-of-vocabulary words, we adopt byte
pair encoding (BPE) (Sennrich et al., 2016) to split
words into sub-words. The size of sub-words is set
to 30K for each language.
For the WMT corpus, we evaluate our approach
on a Spanish-French (Es-Fr) translation task with
a zero-resource setting. We combine the follow-
ing corpora to form the Es-En and En-Fr paral-
lel corpora: Common Crawl, News Commentary,
Europarl v7 and UN. All the sentences are tok-
enized by the tokenize.perl script. New-
stest2011 serves as the development set and New-
stest2012 and Newstest2013 serve as test sets. We
use case-sensitive BLEU to evaluate translation re-
sults. BPE is also used to reduce the vocabulary
size. The size of sub-words is set to 43K, 33K,
43K for Spanish, English and French, respectively.
See Table 1 for detailed statistics for the Europarl
and WMT corpora.
We leverage an open-source NMT toolkit dl4mt
implemented by Theano 2 for all the experiments
and compare our approach with state-of-the-art
multilingual methods (Firat et al., 2016b) and
pivot-based methods (Cheng et al., 2016a). Two
variations of our framework are used in the exper-
1http://www.statmt.org/wmt07/shared-task.html
2dl4mt-tutorial: https://github.com/nyu-dl
iments:
1. Sentence-Level Teaching: for simplicity, we
use the mode as suggested in (Kim and Rush,
2016) to approximate the target sentence
space in calculating the expected gradients
with respect to the expectation in Equation
(7). We run beam search on the pivot sen-
tence with the teacher model and choose the
highest-scoring target sentence as the mode.
Beam size with k = 1 (greedy decoding) and
k = 5 are investigated in our experiments,
denoted as sent-greedy and sent-beam, re-
spectively.3
2. Word-Level Teaching: we use the same mode
approximation approach as in sentence-level
teaching to approximate the expectation in
Equation 12, denoted as word-greedy (beam
search with k = 1) and word-beam (beam
search with k = 5), respectively. Besides,
Monte Carlo estimation by sampling from the
teacher model is also investigated since it in-
troduces more diverse data, denoted as word-
sampling.
4.2 Assumptions Verification
To verify the assumptions
in Section 3.1,
we train a source-to-target
translation model
P (yx; θx→y) and a pivot-to-target
translation
model P (yz; θz→y) using the trilingual Europarl
corpus. Then, we measure the sentence-level
and word-level KL divergence from the source-to-
target model P (yx; θx→y) at different iterations
to the trained pivot-to-target model P (yz; θz→y)
by caculating JSENT (Equation (5)) and JWORD
3We can also adopt sampling and k-best list for approxi-
mation. Random sampling brings a large variance (Sutskever
et al., 2014; Ranzato et al., 2015; He et al., 2016) for
sentence-level teaching. For k-best list, we renormalize the
probabilities
P (yz; θz→y) ∼
(cid:80)
P (yz; θz→y)α
y∈Yk
P (yz; θz→y)α
,
where Yk is the k-best list from beam search of the teacher
model and α is a hyperparameter controling the sharpness
of the distribution (Och, 2003). We set k = 5 and α =
5×10−3. The results on test set for Eureparl Corpus are 32.24
BLEU over Spanish-French translation and 24.91 BLEU over
German-French translation, which are slightly better than the
sent-beam method. However, considering the traing time and
the memory consumption, we believe mode approximation is
already a good way to approximate the target sentence space
for sentence-level teaching.
Approx.
greedy
beam
greedy
beam
sampling
0
313.0
323.5
274.0
288.7
268.6
Iterations
2w
73.1
73.1
51.5
52.7
53.8
4w
61.5
60.7
43.1
43.3
46.6
6w
56.8
55.4
39.4
39.2
42.8
8w
55.1
54.0
38.8
38.4
42.4
JSENT
JWORD
Table 2: Verification of sentence-level and word-level assumptions by evaluating approximated KL di-
vergence from the source-to-target model to the pivot-to-target model over training iterations of the
source-to-target model. The pivot-to-target model is trained and kept fixed.
Cheng et al. (2016a)
Ours
Method
pivot
hard
soft
likelihood
sent-beam
word-sampling
Es→ Fr De→ Fr
23.70
29.79
23.88
29.93
23.79
30.57
32.59
25.93
24.39
31.64
33.86
27.03
Table 3: Comparison with previous work on Spanish-French and German-French translation tasks from
the Europarl corpus. English is treated as the pivot language. The likelihood method uses 100K parallel
source-target sentences, which are not available for other methods.
(Equation (9)) on 2,000 parallel source-pivot sen-
tences from the development set of WMT 2006
shared task.
Table 2 shows the results. The source-to-target
model is randomly initialized at iteration 0. We
find that JSENT and JWORD decrease over time,
suggesting that the source-to-target and pivot-to-
target models do have small KL divergence at both
sentence and word levels.
4.3 Results on the Europarl Corpus
Table 3 gives BLEU scores on the Europarl
corpus of our best performing sentence-level
method (sent-beam) and word-level method
(word-sampling)
compared with pivot-based
methods (Cheng et al., 2016a). We use the same
data preprocessing as in (Cheng et al., 2016a). We
find that both the sent-beam and word-sampling
methods outperform the pivot-based approaches
in a zero-resource scenario across
language
pairs. Our word-sampling method improves over
the best performing zero-resource pivot-based
method (soft) on Spanish-French translation
by +3.29 BLEU points and German-French
translation by +3.24 BLEU points.
In addition,
the word-sampling mothod surprisingly obtains
improvement over the likelihood method, which
leverages a source-target parallel corpus. The
Method
sent-greedy
sent-beam
word-greedy
word-beam
word-sampling
Es→ Fr
test
dev
31.05
31.00
31.57
31.64
31.92
31.37
31.21
30.81
33.65
33.86
De→ Fr
test
dev
21.88
22.34
24.95
24.39
25.15
24.72
24.19
24.64
26.99
27.03
Table 4: Comparison of our proposed methods
on Spanish-French and German-French transla-
tion tasks from the Europarl corpus. English is
treated as the pivot language.
significant
improvements can be explained by
the error propagation problem of pivot-based
methods, which propagates translation error of
the source-to-pivot
translation process to the
pivot-to-target translation process.
Table 4 shows BLEU scores on the Europarl
corpus of our five proposed methods.
For
sentence-level approaches, the sent-beam method
outperforms the sent-greedy method by +0.59
BLEU points over Spanish-French translation and
+2.51 BLEU points over German-French transla-
tion on the test set. The results are in line with our
observation in Table 2 that sentence-level KL di-
vergence by beam approximation is smaller than
that by greedy approximation. However, as the
Figure 2: Validation loss and BLEU across iterations of our proposed methods.
Cheng et al. (2016a)†
Cheng et al. (2016a)†
Firat et al. (2016b)
Firat et al. (2016b)†
Method
Training
BLEU
Existing zero-resource NMT systems
-
Es→ En En→ Fr Es→ Fr Newstest2012 Newstest2013
6.78M 9.29M
6.78M 9.29M 100K
34.71M 65.77M
34.71M 65.77M
24.60
25.78
17.59
21.33
pivot
likelihood
one-to-one
many-to-one
-
-
17.61
21.19
-
-
Our zero-resource NMT system
word-sampling
6.78M 9.29M
-
28.06
27.03
Table 5: Comparison with previous work on Spanish-French translation in a zero-resource scenario over
the WMT corpus. The BLEU scores are case sensitive. †: the method depends on two-step decoding.
time complexity grows linearly with the number
of beams k, the better performance is achieved at
the expense of search time.
For word-level experiments, we observe that
the word-sampling method performs much bet-
ter than the other two methods: +1.94 BLEU
points on Spanish-French translation and +1.88
BLEU points on German-French translation over
the word-greedy method; +2.65 BLEU points
on Spanish-French translation and +2.84 BLEU
points on German-French translation over the
word-beam method. Although Table 2 shows that
word-level KL divergence approximated by sam-
pling is larger than that by greedy or beam, sam-
pling approximation introduces more data diver-
sity for training, which dominates the effect of KL
divergence difference.
We plot validation loss4 and BLEU scores over
iterations on the German-French translation task
in Figure 2. We observe that word-level models
4Validation loss:
the average negative log-likelihood of
sentence pairs on the validation set.
tend to have lower validation loss compared with
sentence-level methods. Generally, models with
lower validation loss tend to have higher BLEU.
Our results indicate that this is not necessarily the
case:
the sent-beam method converges to +0.31
BLEU points on the validation set with +13 vali-
dation loss compared with the word-beam method.
Kim and Rush (2016) claim a similar observation
in data distillation for NMT and provide an expla-
nation that student distributions are more peaked
for sentence-level methods. This is indeed the
case in our result: on German-French translation
task the argmax for the sent-beam student model
(on average) approximately accounts for 3.49% of
the total probability mass, while the correspond-
ing number is 1.25% for the word-beam student
model and 2.60% for the teacher model.
4.4 Results on the WMT Corpus
The word-sampling method obtains the best per-
formance in our five proposed approaches ac-
cording to experiments on the Europarl corpus.
To further verify this approach, we conduct ex-
0369121530609012015018021003691215051015202530ValidLossIterationssent-greedysent-beamword-greedyword-beamword-sampling·104·104BLEUIterationssent-greedysent-beamword-greedyword-beamword-samplinggroundtruth
pivot
likelihood
word-sampling
pivot
target
source Os sent´ais al volante en la costa oeste , en San Francisco , y vuestra misi´on es llegar los
primeros a Nueva York .
You get in the car on the west coast , in San Francisco , and your task is to be the first one
to reach New York .
Vous vous asseyez derri`ere le volant sur la cote ouest `a San Francisco et votre mission est
d' arriver le premier `a New York .
You 'll feel at the west coast in San Francisco , and your mission is to get the first to
New York . [BLEU: 33.93]
Vous vous sentirez comme chez vous `a San Francisco , et votre mission est d' obtenir
le premier `a New York . [BLEU: 44.52]
You feel at the west coast , in San Francisco , and your mission is to reach the first to New
York . [BLEU: 47.22]
Vous vous sentez `a la cote ouest , `a San Francisco , et votre mission est d' atteindre
le premier `a New York . [BLEU: 49.44]
Vous vous sentez au volant sur la cote ouest , `a San Francisco et votre mission est d'
arriver le premier `a New York . [BLEU: 78.78]
target
pivot
pivot
target
target
Table 6: Examples and corresponding sentence BLEU scores of translations using the pivot and likeli-
hood methods in (Cheng et al., 2016a) and the proposed word-sampling method. We observe that our
approach generates better translations than the methods in (Cheng et al., 2016a). We italicize correct
translation segments which are no short than 2-grams.
periments on the large scale WMT corpus for
Spanish-French translation. Table 5 shows the re-
sults of our word-sampling method in compari-
son with other state-of-the-art baselines. Cheng
et al. (2016a) use the same datasets and the same
preprocessing as ours. Firat et al.
(2016b) uti-
lize a much larger training set.5 Our method ob-
tains significant improvement over the pivot base-
line by +3.46 BLEU points on Newstest2012 and
over many-to-one by +5.84 BLEU points on New-
stest2013. Note that both methods depend on a
source-pivot-target decoding path. Table 6 shows
translation examples of the pivot and likelihood
methods proposed in (Cheng et al., 2016a) and our
proposed word-sampling method. For the pivot
and likelihood methods,
the Spainish sentence
segment 'sent´ais al volante' is lost when translated
to English. Therefore, both methods miss this in-
formation in the translated French sentence. How-
ever, the word-sampling method generates 'volant
sur', which partially translates 'sent´ais al volante',
resulting in improved translation quality of the
target-language sentence.
4.5 Results with Small Source-Pivot Data
The word-sampling method can also be applied
to zero-resource NMT with a small source-pivot
corpus. Specifically, the size of the source-pivot
corpus is orders of magnitude smaller than that of
the pivot-target corpus. This setting makes sense
in applications. For example, there are signifi-
cantly fewer Urdu-English corpora available than
5Their training set does not include the Common Crawl
corpus.
Method
MLE
transfer
pivot
Ours
Corpus
De-En De-Fr En-Fr
×
√
√
√
×
×
√
√
√
√
×
×
BLEU
19.30
22.39
17.32
22.95
Table 7: Comparison on German-French trans-
lation task from the Europarl corpus with 100K
German-English sentences. English is regarded as
the pivot language. Transfer represents the trans-
fer learning method in (Zoph et al., 2016). 100K
parallel German-French sentences are used for the
MLE and transfer methods.
English-French corpora.
To fulfill this task, we combine our best per-
forming word-sampling method with the initial-
ization and parameter freezing strategy proposed
in (Zoph et al., 2016). The Europarl corpus is used
in the experiments. We set the size of German-
English training data to 100K and use the same
teacher model trained with 900K English-French
sentences.
Table 7 gives the BLEU score of our method on
German-French translation compared with three
other methods. Note that our task is much harder
than transfer learning (Zoph et al., 2016) since
the latter depends on a parallel German-French
corpus. Surprisingly, our method outperforms all
other methods. We significantly improve the base-
line pivot method by +5.63 BLEU points and the
state-of-the-art transfer learning method by +0.56
BLEU points.
5 Related Work
Training NMT models in a zero-resource scenario
by leveraging other languages has attracted inten-
sive attention in recent years. Firat et al. (2016b)
proposed an approach which delivers the multi-
way, multilingual NMT model proposed by (Firat
et al., 2016a) for zero-resource translation. They
used the multi-way NMT model trained by other
language pairs to generate a pseudo parallel cor-
pus and fine-tuned the attention mechanism of the
multi-way NMT model to enable zero-resource
translation. Several authors proposed a universal
encoder-decoder network in multilingual scenar-
ios to perform zero-shot learning (Johnson et al.,
2016; Ha et al., 2016). This universal model ex-
tracts translation knowledge from multiple differ-
ent languages, making zero-resource translation
feasible without direct training.
Besides multilingual NMT, another important
line of research attempts to bridge source and tar-
get languages via a pivot language. This idea
is widely used in SMT (de Gispert and Marino,
2006; Cohn and Lapata, 2007; Utiyama and Isa-
hara, 2007; Wu and Wang, 2007; Bertoldi et al.,
2008; Wu and Wang, 2009; Zahabi et al., 2013;
Kholy et al., 2013). Cheng et al.
(2016a) pro-
pose pivot-based NMT by simultaneously improv-
ing source-to-pivot and pivot-to-target translation
quality in order to improve source-to-target trans-
lation quality. Nakayama and Nishida (2016)
achieve zero-resource machine translation by uti-
lizing image as a pivot and training multimodal en-
coders to share common semantic representation.
Our work is also related to knowledge distilla-
tion, which trains a compact model to approximate
the function learned by a larger, more complex
model or an ensemble of models (Bucila et al.,
2006; Ba and Caurana, 2014; Li et al., 2014; Hin-
ton et al., 2015). Kim and Rush (2016) first in-
troduce knowledge distillation in neural machine
translation. They suggest to generate a pseudo cor-
pus to train the student network. Compared with
their work, we focus on zero-resource learning in-
stead of model compression.
6 Conclusion
In this paper, we propose a novel framework to
train the student model without parallel corpora
available under the guidance of the pre-trained
teacher model on a source-pivot parallel corpus.
We introduce sentence-level and word-level teach-
ing to guide the learning process of the student
model. Experiments on the Europarl and WMT
corpora across languages show that our proposed
word-level sampling method can significantly out-
performs the state-of-the-art pivot-based methods
and multilingual methods in terms of translation
quality and decoding efficiency.
We also analyze zero-resource translation with
small source-pivot data, and combine our word-
level sampling method with initialization and pa-
rameter freezing suggested by (Zoph et al., 2016).
The experiments on the Europarl corpus show that
our approach obtains an significant improvement
over the pivot-based baseline.
In the future, we plan to test our approach on
more diverse language pairs, e.g., zero-resource
Uyghur-English translation using Chinese as a
pivot. It is also interesting to extend the teacher-
student framework to other cross-lingual NLP ap-
plications as our method is transparent to architec-
tures.
Acknowledgments
This work was done while Yun Chen is visiting
Tsinghua University. This work is partially sup-
ported by the National Natural Science Founda-
tion of China (No.61522204, No. 61331013) and
the 863 Program (2015AA015407).
References
Jimmy Ba and Rich Caurana. 2014. Do deep nets really
need to be deep? In NIPS.
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben-
gio. 2015. Neural machine translation by jointly
In Proceedings of
learning to align and translate.
ICLR .
Nicola Bertoldi, Madalina Barbaiani, Marcello Fed-
erico, and Roldano Cattoni. 2008. Phrase-based sta-
tistical machine translation with pivot languages. In
IWSLT.
Cristian Bucila, Rich Caruana,
Niculescu-Mizil. 2006. Model compression.
KDD.
and Alexandru
In
Yong Cheng, Yang Liu, Qian Yang, Maosong Sun, and
Wei Xu. 2016a. Neural machine translation with
pivot languages. CoRR abs/1611.04928.
Yong Cheng, Wei Xu, Zhongjun He, Wei He, Hua
Wu, Maosong Sun, and Yang Liu. 2016b. Semi-
supervised learning for neural machine translation
.
Trevor Cohn and Mirella Lapata. 2007. Machine trans-
lation by triangulation: Making effective use of
multi-parallel corpora. In ACL.
Adri`a de Gispert and Jos´e B. Marino. 2006. Catalan-
english statistical machine translation without paral-
In Proceed-
lel corpus: bridging through spanish.
ings of 5th International Conference on Language
Resources and Evaluation (LREC). Citeseer, pages
65–68.
Orhan Firat, Kyunghyun Cho, and Yoshua Bengio.
2016a. Multi-way, multilingual neural machine
translation with a shared attention mechanism.
In
HLT-NAACL.
Orhan Firat, Baskaran Sankaran, Yaser Al-Onaizan,
Fatos T. Yarman-Vural, and Kyunghyun Cho. 2016b.
Zero-resource translation with multi-lingual neural
machine translation. In EMNLP.
Thanh-Le Ha, Jan Niehues, and Alexander H. Waibel.
2016. Toward multilingual neural machine trans-
lation with universal encoder and decoder. CoRR
abs/1611.04798.
Thang Luong,
Ilya Sutskever, Quoc V. Le, Oriol
Vinyals, and Wojciech Zaremba. 2015. Addressing
the rare word problem in neural machine translation.
In ACL.
Hideki Nakayama and Noriki Nishida. 2016. Zero-
resource machine
by multimodal
encoder-decoder network with multimedia pivot.
CoRR abs/1611.04503.
translation
Franz Josef Och. 2003. Minimum error rate training in
statistical machine translation. In ACL.
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-
Jing Zhu. 2002. Bleu: a method for automatic eval-
uation of machine translation. In ACL.
Marc'Aurelio Ranzato, Sumit Chopra, Michael Auli,
and Wojciech Zaremba. 2015.
Sequence level
training with recurrent neural networks. CoRR
abs/1511.06732.
Rico Sennrich, Barry Haddow, and Alexandra Birch.
2016. Neural machine translation of rare words with
subword units .
Di He, Yingce Xia, Tao Qin, Liwei Wang, Nenghai Yu,
Tie-Yan Liu, and Wei-Ying Ma. 2016. Dual learning
for machine translation. In NIPS.
Shiqi Shen, Yong Cheng, Zhongjun He, Wei He, Hua
Wu, Maosong Sun, and Yang Liu. 2016. Minimum
risk training for neural machine translation .
Geoffrey E. Hinton, Oriol Vinyals, and Jeffrey Dean.
2015. Distilling the knowledge in a neural network.
CoRR abs/1503.02531.
Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. 2014.
Sequence to sequence learning with neural networks
.
S´ebastien Jean, Kyunghyun Cho, Roland Memisevic,
and Yoshua Bengio. 2015. On using very large tar-
get vocabulary for neural machine translation.
In
ACL.
Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim
Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Tho-
rat, Fernanda B. Vi´egas, Martin Wattenberg, Gre-
gory S. Corrado, Macduff Hughes, and Jeffrey Dean.
2016. Google's multilingual neural machine trans-
lation system: Enabling zero-shot translation. CoRR
abs/1611.04558.
Nal Kalchbrenner and Phil Blunsom. 2013. Recurrent
continuous translation models. In EMNLP.
Ahmed El Kholy, Nizar Habash, Gregor Leusch,
Evgeny Matusov, and Hassan Sawaf. 2013. Lan-
guage independent connectivity strength features for
phrase pivot statistical machine translation.
Yoon Kim and Alexander M. Rush. 2016. Sequence-
level knowledge distillation. In EMNLP.
Philipp Koehn. 2005. Europarl: a parallel corpus for
statistical machine translation.
Jinyu Li, Rui Zhao, Jui-Ting Huang, and Yifan
Gong. 2014. Learning small-size dnn with output-
distribution-based criteria. In INTERSPEECH.
Masao Utiyama and Hitoshi Isahara. 2007. A compari-
son of pivot methods for phrase-based statistical ma-
chine translation. In HLT-NAACL.
Hua Wu and Haifeng Wang. 2007. Pivot language ap-
proach for phrase-based statistical machine transla-
tion. Machine Translation 21:165–181.
Hua Wu and Haifeng Wang. 2009. Revisiting pivot
In
language approach for machine translation.
ACL/IJCNLP.
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V.
Le, Mohammad Norouzi, Wolfgang Macherey,
Maxim Krikun, Yuan Cao, Qin Gao, Klaus
Macherey, Jeff Klingner, Apurva Shah, Melvin
Johnson, Xiaobing Liu, Lukasz Kaiser, Stephan
Gouws, Yoshikiyo Kato, Taku Kudo, Hideto
Kazawa, Keith Stevens, George Kurian, Nishant
Patil, Wei Wang, Cliff Young, Jason Smith, Jason
Riesa, Alex Rudnick, Oriol Vinyals, Gregory S.
Corrado, Macduff Hughes, and Jeffrey Dean. 2016.
Google's neural machine translation system: Bridg-
ing the gap between human and machine translation.
CoRR abs/1609.08144.
Samira Tofighi Zahabi, Somayeh Bakhshaei, and
Shahram Khadivi. 2013. Using context vectors in
improving a machine translation system with bridge
language. In ACL.
Xiaoning Zhu, Zhongjun He, Hua Wu, Haifeng Wang,
Conghui Zhu, and Tiejun Zhao. 2013.
Improving
pivot-based statistical machine translation using ran-
dom walk. In EMNLP.
Barret Zoph, Deniz Yuret, Jonathan May, and Kevin
Knight. 2016. Transfer learning for low-resource
neural machine translation. In EMNLP.
|
1909.04315 | 1 | 1909 | 2019-09-10T06:31:09 | Fine-grained Knowledge Fusion for Sequence Labeling Domain Adaptation | [
"cs.CL"
] | In sequence labeling, previous domain adaptation methods focus on the adaptation from the source domain to the entire target domain without considering the diversity of individual target domain samples, which may lead to negative transfer results for certain samples. Besides, an important characteristic of sequence labeling tasks is that different elements within a given sample may also have diverse domain relevance, which requires further consideration. To take the multi-level domain relevance discrepancy into account, in this paper, we propose a fine-grained knowledge fusion model with the domain relevance modeling scheme to control the balance between learning from the target domain data and learning from the source domain model. Experiments on three sequence labeling tasks show that our fine-grained knowledge fusion model outperforms strong baselines and other state-of-the-art sequence labeling domain adaptation methods. | cs.CL | cs | Fine-grained Knowledge Fusion for Sequence Labeling Domain
Adaptation
Jiajun Chen1,2
Huiyun Yang1,2
National Key Laboratory for Novel Software Technology, Nanjing, China1
Shujian Huang1,2 Xinyu Dai1,2
Nanjing University, Nanjing, China2
[email protected]
{huangsj, daixinyu, chenjj}@nju.edu.cn
9
1
0
2
p
e
S
0
1
]
L
C
.
s
c
[
1
v
5
1
3
4
0
.
9
0
9
1
:
v
i
X
r
a
Abstract
In sequence labeling, previous domain adap-
tation methods focus on the adaptation from
the source domain to the entire target domain
without considering the diversity of individ-
ual target domain samples, which may lead
to negative transfer results for certain sam-
ples. Besides, an important characteristic of
sequence labeling tasks is that different ele-
ments within a given sample may also have di-
verse domain relevance, which requires further
consideration. To take the multi-level domain
relevance discrepancy into account, in this pa-
per, we propose a fine-grained knowledge fu-
sion model with the domain relevance mod-
eling scheme to control the balance between
learning from the target domain data and learn-
ing from the source domain model. Experi-
ments on three sequence labeling tasks show
that our fine-grained knowledge fusion model
outperforms strong baselines and other state-
of-the-art sequence labeling domain adapta-
tion methods.
Introduction
1
Sequence labeling tasks, such as Chinese word
segmentation (CWS), POS tagging (POS) and
named entity recognition (NER), are fundamen-
tal tasks in natural language processing. Recently,
with the development of deep learning, neural se-
quence labeling approaches have achieved pretty
high accuracy (Chen et al., 2017; Zhang and Yang,
2018), relying on large-scale annotated corpora.
However, most of the standard annotated corpora
belong to the news domain, and models trained
on these corpora will get sharp declines in per-
formance when applied to other domains like so-
cial media, forum, literature or patents (Daume III,
2007; Blitzer et al., 2007), which limits their ap-
plication in the real world. Domain adaptation
aims to exploit the abundant information of well-
studied source domains to improve the perfor-
Types
Strongly Ops Steve Jobs resigned as CEO of Apple.
Cases
Share prices are rising soooo fast!
Alas as time goes by, hair's gone.
Rock to 204 Section next week!
Weakly
Table 1: Tweets from the social media domain have
different degrees of relevance to the source domain
(news). Within each case, the bold part is strongly rel-
evant and the italic part is weakly relevant.
mance in target domains (Pan and Yang, 2010),
which is suitable to handle this issue. Following
Daume III (2007), we focus on the supervised do-
main adaptation setting, which utilizes large-scale
annotated data from the source domain and small-
scale annotated data from the target domain.
For sequence labeling tasks, each sample is usu-
ally a sentence, which consists of a sequence of
words/Chinese characters, denoted as the element.
We notice an interesting phenomenon: different
target domain samples may have varying degrees
of domain relevance to the source domain. As de-
picted in Table 1, there are some tweets similar to
the news domain (i.e. strongly relevant). But there
are also some tweets of their own style, which only
appear in the social media domain (i.e. weakly rel-
evant). The phenomenon can be more complicated
for the cases where the whole sample is strongly
relevant while contains some target domain spe-
cific elements, or vice versa, showing the diversity
of relevance at the element-level.
In the rest of
this paper, we use 'domain relevance' to refer to
the domain relevance to the source domain, unless
specified otherwise.
Conventional neural sequence labeling domain
adaptation methods (Liu and Zhang, 2012; Liu
et al., 2014; Zhang et al., 2014; Chen et al., 2017;
Peng and Dredze, 2017; Lin and Lu, 2018) mainly
focus on reducing the discrepancy between the
sets of source domain samples and target domain
(a) Previous methods
(b) Our method
Figure 1: Previous methods transfer knowledge by
the whole sample set, while our method consider di-
verse domain relevance within the target domain set
and within every target sample to transfer knowledge
respectively.
samples. However, they neglect the diverse do-
main relevance of individual target domain sam-
ples, let alone the element-level domain relevance.
As depicted in Figure 1, obviously, strongly rele-
vant samples/elements should learn more knowl-
edge from the source domain, while weakly rele-
vant samples/elements should learn less and keep
their characteristics.
In this paper, we propose a fine-grained knowl-
edge fusion model to control the balance between
learning from the target domain data and learn-
ing from the source model, inspired by the knowl-
edge distillation method (Bucila et al., 2006; Hin-
ton et al., 2015). With both the sample-level
and element-level domain relevance modeling and
incorporating, the fine-grained knowledge fusion
model can alleviate the negative transfer (Rosen-
stein et al., 2005) in sequence labeling domain
adaptation.
We verify the effectiveness of our method on six
domain adaptation experiments of three different
tasks, i.e. CWS, POS and NER, in two different
languages, i.e. Chinese and English, respectively.
Experiments show that our method achieves bet-
ter results than previous state-of-the-art methods
on all tasks. We also provide detailed analyses to
study the knowledge fusion process.
Contributions of our work are summarized as
follows:
• We propose a fine-grained knowledge fusion
model to balance the learning from the target
data and learning from the source model.
• We also propose multi-level relevance mod-
eling schemes to model both the sample-level
and element-level domain relevance.
Figure 2: The architecture of basicKD (with the red α,
see §2) or fine-grained knowledge fusion model (with
the blue α, see §4), where the green part belongs to
the source model, the orange part belongs to the target
model and the white part is common. Better viewed in
color.
• Empirical evidences and analyses are pro-
vided on three different tasks in two different
languages, which verify the effectiveness of
our method.
2 Knowledge Distillation for Adaptation
Knowledge distillation (KD), which distills the
knowledge from a sophisticated model to a simple
model, has been employed in domain adaptation
(Bao et al., 2017; Meng et al., 2018). Recently, on-
line knowledge distillation(Furlanello et al., 2018;
Zhou et al., 2018) is shown to be more effective,
which shares lower layers between the two models
and trains them simultaneously.
For sequence labeling domain adaptation, we
utilize the online knowledge distillation method
to distill knowledge from the source model to
improve the target model, denoted as basicKD,
which is depicted in Figure 2. We use the Bi-
LSTM-CRF architecture (Huang et al., 2015), for
both the source model and the target model, and
share the embedding layer between them.
Notations
For the rest of the paper, we use the
superscript S and T to denote the source domain
and the target domain, respectively. Source do-
main data is a set of m samples with gold la-
j=1. Simi-
bel sequences, denoted as (xS
larly, target domain data has n samples, denoted
j , yS
j )m
samesourcetargetsourcetargettransfertransfermoreless transferhigh domain relevancetarget sampleset-to-set knowledge transferset-to-sample knowledge transferequallysourcetargettargettransfera target sample(a) set-to-set KT(b) set-to-sample KTlow domain relevancesamplecharacter/wordsourcestrongly relevantweakly relevantsampleelementmore transferless transfersamesourcetargetsourcetargettransfertransfermoreless transferhigh domain relevancetarget sampleset-to-set knowledge transferset-to-sample knowledge transferequallysourcetargettargettransfera target sampleset-to-set knowledge transferset-to-sample knowledge transferlow domain relevancesamplecharacter/wordsourcehigh domain relevancelow domain relevancesampleelementmore transferless transfershared embedding layer!"!#Bi-LSTMBi-LSTMsoftmaxCRFsoftmaxCRFℒ",-#ℒ./#ℒ#⊕1"23"23#3#45678/4:;:</4<=;>?@#@"1#4as (xT
i , yT
i )n
The training loss of the source model is the
cross entropy between the predicted label distri-
bution y and the gold label y:
i=1, where n (cid:28) m.
m(cid:88)
LS = − 1
m
j=1
yS
j log yS
j
(1)
The training loss of the target model is com-
posed of two parts, namely the sequence label-
ing loss LT
SEQ and the knowledge distillation loss
LT
KD:
LT = (1 − α)LT
KD
SEQ + αLT
n(cid:88)
n(cid:88)
yT
i log yT
i
pS
i log pT
i
i=1
i=1
LT
SEQ = − 1
n
LT
KD = − 1
n
(2)
(3)
(4)
SEQ is similar to LS, while LT
where LT
KD is the
cross entropy between the probability distribu-
tions predicted by the source model and the tar-
get model. α is a hyper-parameter scalar, which
is used to balance the learning from the target do-
main data and the learning from the source model.
3 Relevance Modeling
BasicKD provides individual learning goals for
every sample and element of the target domain,
using a scalar α to weight. As a result, the source
model has the same influence on all target sam-
ples, in which the diversity of domain relevance is
neglected.
Here we present methods to model the domain
relevance of target samples and elements, which
could then be used to guide the knowledge fu-
sion process (see §4). The overall architecture is
shown in Figure 3. The relevance of each sam-
ple is a scalar, denoted as the sample-level rele-
vance weight, wsamp
for the ith sample, which can
be obtained by the sample-level domain classifi-
cation. The relevance of each element is also a
scalar, while the relevance weights of all elements
within a sample form a weight vector welem, which
can be obtained by the similarity calculation.
i
3.1 Element-level Relevance
To acquire the element-level relevance, we employ
the domain representation q ∈ R2dh (dh is the di-
mension of the Bi-LSTM) and calculate the simi-
larity between the element representation and the
Figure 3: The relevance modeling process (see §3),
where the block f denotes Eq.(10) and the block g de-
notes Eq.(14).
domain representation. We incorporate two meth-
ods to get q: (1) Domain-q: q is a trainable do-
main specific vector, where every element within
a domain share the same q; (2) Sample-q: q is the
domain relevant feature extracted from each sam-
ple, where every element within a sample share the
same q. Because of the superiority of the capsule
network modeling abstract features (Gong et al.,
2018; Yang et al., 2018), we use it to capture the
domain relevant features within a sample. We in-
corporate the same bottom-up aggregation process
as Gong et al. (2018) and the encoded vector is re-
garded as q:
q = Capsule(h)
(5)
where h is the hidden state matrix of a sample.
The similarity calculation formula is the matrix
dot 1:
j = q(cid:62)Bhj
welem
(6)
where hj is the hidden states of the jth element and
is the relevance weight of it. B ∈ R2dh×2dh
welem
is a trainable matrix.
j
3.2 Sample-level Relevance
To acquire the sample-level domain relevance, we
make use of the domain label to carry out sample-
level text classification (two class, source domain
or target domain). The weight welem is normalized
across the sample length using the softmax func-
tion, then the sample representation can be ob-
1We also try dot and MLP, while matrix dot get better
performance with fewer parameters.
S/T$%&%'(%&%'Domain classifier()*'+,$)*'+Similaritycalculation-Weighted sum('.&/0⨀fgCapsule layerℒ56rtained by the weighted sum of hidden states. The
process can be expressed as:
(cid:80)
L(cid:88)
welem
j =
exp(welem
)
k exp(welem
j
k
r =
elem · hj
wj
)
(7)
(8)
j=1
r ∈ R2dh is the sample representation and L is the
sample length.
Once the sample representation is obtained,
the multi-layer perceptron (MLP) and softmax do
sample classification next:
[wsamp, 1 − wsamp] = [softmax(MLP(r))]
where wsamp is the sample relevance weight.
4 Fine-grained Knowledge Fusion for
(cid:62) (9)
Adaptation
With the relevance modeling,
the fine-grained
knowledge fusion model is proposed to fuse the
knowledge from the source domain and the target
domain at different levels. The overall architecture
is shown in Figure 2.
4.1 Sample-level Knowledge Fusion
Different samples of target domain tend to show
different domain relevance, and as a result, they
need to acquire different amount of knowledge
from the source domain. Different α is assigned to
each target sample based on its domain relevance
to achieve the sample-level knowledge fusion. The
new α can be computed as:
= σ(τ · wsamp
αsamp
i
is the α of the ith sample and wsamp
(10)
where αsamp
is
the relevance weight of it; σ denotes the sigmoid
function; τ is temperature and γ is bias.
+ γ)
i
i
i
The loss functions of the target model can be
computed as:
LT = LT
SEQ + LT
KD
(11)
n(cid:88)
i=1
n(cid:88)
i=1
LT
SEQ = − 1
n
(1 − αsamp
i
)yT
i log yT
i
(12)
LT
KD = − 1
n
αsamp
i
pS
i log pT
i
(13)
The sample classification losses of the source
sc are both cross en-
sc and target model LT
model LS
tropy.
4.2 Element-level Knowledge Fusion
Besides the sample-level domain relevance, dif-
ferent elements within a sample tend to present
diverse domain relevance.
In this method, we
assign different α to each element based on its
domain relevance weight to achieve the element-
level knowledge fusion. The new α can be com-
puted as:
i + bα)]
i = σ(Wαwelem
αelem
∈ RL is a vector, in which αelem
where αelem
de-
notes the α of the jth element in the ith sample.
welem
is the relevance weight of the ith sample.
Wα and bα are trainable parameters.
(14)
ij
i
i
The loss functions of the target model can be
(1 − αelem
ij
)yT
ij log yT
ij
(15)
expressed as:
LT
SEQ = − 1
n
L(cid:88)
n(cid:88)
n(cid:88)
L(cid:88)
j=1
i=1
i=1
j=1
LT
KD = − 1
n
αelem
ij pS
ij log pT
ij
(16)
where ∗ij denotes the ∗ of the jth element in the
ith sample, and the final loss function is the same
with Eq.(11).
4.3 Multi-level Knowledge Fusion
In this method, we take both the sample-level and
element-level relevance diversities into account to
implement the multi-level knowledge fusion, and
the multi-level α can be computed as:
αmulti = αsamp (cid:12) αelem
(17)
where (cid:12) denotes the element-wise product.
αmulti ∈ Rn×L is a matrix as well.
The loss functions of the target model can be
in Eq.(15)
ij with αmulti
obtained by replacing αelem
and Eq.(16).
ij
4.4 Training Process
Both the source model and the target model can be
pre-trained on the source domain data (warm up,
optional).
In the fine-grained knowledge fusion
method, the source model and the target model
are trained alternately. Within an episode, we use
I steps to train the source model ahead, then the
soft target (pS) can be obtained and the target
model will be trained. During the training of the
Task
CWS
POS
NER
Language
Chinese
Chinese
Chinese
English
Chinese
English
Source
CTB6 (Xue et al., 2005)
CTB6 (Xue et al., 2005)
CTB6 (Xue et al., 2005)
PTB (Marcus et al., 1993)
MSRA (Levow, 2006)
Ontonotes (Ralph et al., 2013)
Target
Zhuxian (Zhang et al., 2014)
Weibo (Qiu et al., 2016)
Weibo (Qiu et al., 2016)
Twitter (Ritter et al., 2011)
WeiboNER (Peng and Dredze, 2015)
Twitter (Ritter et al., 2011)
Domain
news → novels
news → social media
Table 2: Datasets used in this paper.
for i = 1 to I do
Sample b samples from the source data
Compute LS, and update θS
Compute LS
sc, and update θS
Algorithm 1 Training Process of Knowledge Fusion
1. Input: source data, target data
2. Hyper − parameters: batch size b, teach step I
3. Initialize parameters of the source and target model
4. (optional) Use the source data to pre-train θS and θT
5. repeat
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
end while
20. until converge
Sample b samples from the target data
Use relevance modeling to get wsamp,welem
Compute αsamp/αelem/αmulti and LT
Use θT to predict pT , and compute LT
Compute LT , and update θT
Compute LT
sc, and update θT
end for
Use θS to test xT
while in an episode:
train and get pS
SEQ
KD
target model, the parameters of the source model
are fixed (gradient block). Every training step in-
cludes the sequence labeling training and the sam-
ple classification training. We conduct early stop-
ping according to the performance of the target
model. The whole training process is shown in
Algorithm 1.
5 Experiments
5.1 Datasets
We conduct three sequence labeling tasks: CWS,
POS and NER, and the latter two tasks contain-
ing both Chinese and English settings. Detailed
datasets are shown in Table 2. There are two kinds
of source-target domain pairs: news-novels and
news-social media. To be consistent with the set-
ting where there is only small-scale target domain
data, we use 5% training data of Weibo for both
CWS and POS. For the different NER tag sets,
we only focus on three types of entities: Person
(PER), Location (LOC) and Organization (ORG)
and regard other types as Other (O).
5.2 Settings
For each task, hyper-parameters are set via grid
search on the target domain development set. Em-
bedding size and the dimension of LSTM hidden
states is set to 100. Batch size is set to 64. Learn-
ing rate is set to 0.01. We employ the dropout
strategy on the embedding and MLP layer with
the rate of 0.2. The l2 regularization term is set
to 0.1. The gradient clip is set to 5. The teach step
I is set to 100. The routing iteration is set to 3
and the number of the output capsules is set to 60.
The temperature τ is initialized to 1 and the prob-
ability bias γ is initialized to 0.5. We set the α
of the basicKD method to 0.5 according to Hinton
et al. (2015). We randomly initialize the embed-
ding matrix without using extra data to pre-train,
unless specified otherwise.
5.3 Baselines
We implement several baseline methods, includ-
ing: source only (training with only source do-
main data), target only (training with only target
domain data) and basicKD (see §2).
We also re-implement state-of-the-art sequence
labeling domain adaptation methods, following
their settings except for unifying the embedding
size and the dimension of LSTM hidden states:
• Pre-trained methods: Pre-trained embed-
ding incorporates source domain data with
its gold label to pre-train context-aware char-
acter embedding (Zhou et al., 2017), which
is used to initialize the target model; Pre-
trained model trains the model on the source
domain and then finetune it on the target do-
main.
• Projection methods: Linear projection
(Peng and Dredze, 2017) uses the domain-
relevant matrix to transform the learned rep-
resentation from different domains into the
shared space; Domain mask (Peng and
Dredze, 2017) masks the hidden states of Bi-
LSTM to split the representations into private
Methods
Target only
BasicKD
Pre-trained embedding
Pre-trained model
Linear projection
Domain mask
NAL
AMCL
FGKF
+ Pre-trained embedding
CWS
Zhuxian
5% Weibo
F
F
92.80
94.23
93.70
94.43
94.14
94.30
94.47
94.62
95.01
95.09
ROOV
65.81
74.08
70.44
74.30
72.75
75.20
74.62
74.46
77.26
77.56
84.01
89.21
87.62
89.50
88.77
88.84
88.63
89.42
90.45
90.73
ROOV
64.12
76.26
72.27
76.27
75.85
75.03
75.77
76.16
77.27
77.87
POS
NER
zh
93.03
95.69
94.96
96.10
95.92
96.01
96.19
94.13
96.60
96.36
en
86.83
89.96
89.70
90.05
89.36
89.81
90.48
89.12
91.33
91.66
zh
46.49
49.92
52.53
54.25
52.71
54.12
54.70
51.47
55.60
57.57
en
59.58
62.15
61.36
62.88
62.27
62.64
63.32
61.57
63.81
65.51
Table 3: Results of domain adaptation on three tasks, where zh denotes the Weibo datasets (in Chinese), and en
denotes the Twitter dataset (in English).
and public regions to do the projection; Neu-
ral adaptation layer (NAL) (Lin and Lu,
2018) incorporates adaptation layers at the
input and output to conduct private-public-
private projections.
• Adversarial method: Adversarial multi-
criteria learning (AMCL)
(Chen et al.,
2017) uses the shared-private architecture
with the adversarial strategy to learn the
shared representations across domains.
5.4 Overall Results on CWS
We use the F1-score (F) and the recall of out-
of-vocabulary words (Roov) to evaluate the do-
main adaptation performance on CWS. We com-
pare methods with different relevance modeling
schemes and different levels of knowledge fusion,
without warm up. And we denote our final model
as FGKF, which is the multi-level knowledge fu-
sion with the sample-q relevance modeling and
warm up.
Methods
Source only
Target only
BasicKD
Domain-q αsamp
Domain-q αelem
Domain-q αmulti
Sample-q αsamp
Sample-q αelem
Sample-q αmulti
FGKF
Zhuxian
5% Weibo
F
F
83.86
92.80
94.23
94.55
94.81
94.75
94.57
94.78
94.91
95.01
ROOV
62.40
65.81
74.08
74.02
74.75
74.96
74.47
74.52
75.56
77.26
83.75
84.01
89.21
89.63
89.99
90.06
89.77
90.07
90.20
90.45
ROOV
70.74
64.12
76.26
75.93
77.59
77.25
76.81
76.94
77.46
77.27
Table 4: Results of baselines and fine-grained knowl-
edge fusion methods on CWS.
The results in Table 4 show that both the ba-
sicKD method and fine-grained methods achieve
basicKD on average), as it
performance improvements through domain adap-
tation. Compared with the basicKD method,
FGKF behaves better (+1.1% F and +2.8% Roov
v.s.
takes multi-
level relevance discrepancies into account. The
sample-q method performs better than the domain-
q method, which shows the domain feature is bet-
ter represented at the sample level, not at the do-
main level. As for the granularity of α, the per-
formances of αelem is better than αsamp, showing
the necessity of modeling element-level relevance.
And there isn't a distinct margin between αelem
and αmulti as most of the multi-level domain rel-
evance can be included by the element level. Re-
sults of FGKF with warm up indicate that starting
from sub-optimal point is better than starting from
scratch for the target model.
Among related works (Table 3), AMCL and
Pre-trained model methods have better perfor-
mances in CWS. Compared with other methods,
FGKF achieves the best results in both F and
ROOV. Results demonstrate the effectiveness of
our fine-grained knowledge fusion architecture for
domain adaptation, and also show the significance
of considering sample-level and element-level rel-
evance discrepancies.
5.5 Overall Results on POS and NER
To further verify the effectiveness of FGKF, we
conduct experiments on POS and NER tasks, us-
ing F1-score as the evaluation criterion. Detailed
results are shown in Table 3. In these tasks, FGKF
achieves better results than other adaptation meth-
ods. Extra gain could be obtained by using pre-
trained embedding. These results also verify the
generalization of our method over different tasks
and languages.
Figure 4: Two cases of the element-level relevance modeling visualization, where the upper one belongs to the
domain-q method and the lower one belongs to the sample-q method. The green dotted circle indicates the correct
domain relevant element and the red solid circle indicates the ignored or mistaken extracted element.
6 Analysis
In this section, we will display and discuss the
domain adaptation improvements provided by our
fine-grained knowledge fusion method.
6.1 Performances of Elements with Different
Relevance
To further probe into the experimental results of
the fine-grained knowledge fusion, we classify the
target test data (in element level) into two classes:
strongly relevant and weakly relevant, based on
their relevance degrees to the source domain. The
partition threshold is according to the average rel-
evance score of the target training data. Detailed
results on Twitter are depicted in Table 5.
Methods
Source only
Target only
BasicKD
FGKF
POS
Strong Weak
82.48
87.47
87.41
86.46
83.82
91.92
92.55
89.93
NER
Strong Weak
46.30
68.27
56.29
62.01
52.63
70.20
71.81
57.92
Table 5: Results of the strongly/weakly relevant ele-
ments on the Twitter test set.
It
is reasonable that both the basicKD and
FGKF enhance the performance of the strongly
relevant part, while FGKF get larger improve-
ments because it is able to enhance the knowledge
fusion by learning more from the source model.
For the weakly relevant part, the basicKD method
damages the performance on it (from 87.41 to
83.82 for POS and from 56.29 to 52.63 for NER),
which indicate the negative transfer. On the con-
trary, FGKF improves the performance of the
weakly relevant part compared with the target only
baseline with a large margin. It is shown that the
fine-grained domain adaptation method can reduce
the negative transfer on the weakly relevant part
and contribute to the transfer on the strongly rele-
vant one.
6.2 Relevance Weight Visualization
We carry out the visualization of the element-level
relevance weight to illustrate the effects of the
two relevance modeling schemes (domain-q and
sample-q). Figure 4 exhibits two cases of element-
level relevance modeling results, from which we
can explicitly observe that the two schemes cap-
ture different domain relevance within a sample.
In the first case, the sample-q method extracts
more domain relevant elments, like "Qingyun",
"Beast God" and "Zhuxian Old Sword", while the
domain-q method ignores the last one. In the sec-
ond case, the domain-q method extracts "front" in-
correctly. These results indicate that the sample-
q method can implement better relevance mod-
eling than the domain-q method to some extent,
and prove that the domain relevant feature is better
represented at the sample level, not at the domain
level.
6.3 Case Study
We take two samples in Twitter test set as exam-
ples to show how the element-level relevance af-
fects the adaptation. Results in Table 6 show that
both basicKD and FGKF can improve the perfor-
mance of strongly relevant elements, e.g. "got
(VBD)", "Lovis (B-PER)". However, only FGKF
reduces the transfer of source domain errors, e.g.
"u (NN)", "The (B-ORG) Sun (I-ORG)".
6.4 Ablation Study
We conduct the ablation study on Twitter dataset
(Table 7). Results show the gradient block and the
是日青云大战,兽神败在诛仙古剑之下是日青云大战,兽神败在诛仙古剑之下That day Qing Yun big battle , Beast God lose at Zhu Xian Old Sword under鬼厉一一记在心里,向面前的大巫师点了点头鬼厉一一记在心里,向面前的大巫师点了点头Ghostone one keep at mind in ,to face front big wizard nodnod headTasks
Sentence
Source only
Target only
BasicKD
FGKF
got
POS
u
I
PN VBD NN
PN VBZ
PN
PN VBD NN
PN VBD PN
next week
NN
JJ
NN
JJ
NN
JJ
JJ
NN
Louis
B-PER
O
B-PER
B-PER
NER
interview with
O
O
O
O
O
O
O
O
The
O
O
Sun
O
O
B-ORG I-ORG
B-ORG I-ORG
Table 6: Two cases of domain adaptation, where the underlined tags are wrong.
multi-level knowledge fusion are of vital impor-
tance to FGKF. The embedding sharing and warm
up also make contributions.
POS
NER
Methods
FGKF
w/o share embedding
w/o gradient block
w/o αsamp
w/o αelem
w/o αmulti
w/o warm up
F
91.33
90.75
88.48
90.94
90.23
90.12
90.89
∆
-
-0.58
-2.85
-0.39
-1.10
-1.21
-0.44
F
63.81
62.47
58.83
63.52
62.43
62.32
63.17
∆
-
-1.34
-4.98
-0.30
-1.38
-1.49
-0.64
Table 7: Ablation results of the Twitter test set.
Influence of Target Data Size
6.5
Here we investigate the impact of the target do-
main data size on FGKF. As is depicted in Figure
5, when the size is small (20%), the gap is pretty
huge between FGKF and basicKD, which verifies
the significance of fine-grained knowledge fusion
in the low-resource setting. Even with the size of
target data increasing, there are still stable margins
between the two methods.
Figure 5: Results of CWS target test set with vary-
ing target training data size. Only 10% training data
of Weibo is utilized.
7 Related Work
Besides the source domain data, some methods
utilize the target domain lexicons (Liu et al., 2014;
Zhang et al., 2014), unlabeled (Liu and Zhang,
2012) or partial-labeled target domain data (Liu
et al., 2014) to boost the sequence labeling adap-
tation performance, which belong to unsupervised
or semi-supervised domain adaptation. However,
we focus on supervised sequence labeling do-
main adaptation, where huge improvement can be
achieved by utilizing only small-scale annotated
data from the target domain.
Previous works in domain adaptation often try
to find a subset of source domain data to align
with the target domain data (Chopra et al., 2013;
Ruder and Plank, 2017) which realizes a kind of
source data sample or construct a common fea-
ture space, while those methods may wash out
informative characteristics of target domain sam-
ples. Instance-based domain adaptation (Jiang and
Zhai, 2007; Zhang and Xiong, 2018) implement
the source sample weighting by assigning higher
weights to source domain samples which are more
similar to the target domain. There are also some
methods (Guo et al., 2018; Kim et al., 2017; Zeng
et al., 2018) explicitly weighting multiple source
domain models for target samples in multi-source
domain adaptation. However, our work focuses on
the supervised single source domain adaptation,
which devote to implementing the knowledge fu-
sion between the source domain and the target do-
main, not within multiple source domains. More-
over, considering the important characteristics of
sequence labeling tasks, we put more attention to
the finer-grained adaptation, considering the do-
main relevance in sample level and element level.
8 Conclusion
In this paper, we propose a fine-grained knowl-
edge fusion model for sequence labeling domain
adaptation to take the domain relevance diversity
of target data into account. With the relevance
modeling on both the sample level and element
level, the knowledge of the source model and tar-
get data can achieve multi-level fusion. Experi-
mental results on different tasks demonstrate the
effectiveness of our approach, and show the poten-
tial of our approach in a broader range of domain
adaptation applications.
Acknowledgements
We would like to thank the anonymous review-
ers for their insightful comments. Shujian Huang
is the corresponding author. This work is sup-
ported by National Science Foundation of China
(No. U1836221, No. 61772261), National Key
R&D Program of China (No. 2019QY1806).
References
Zuyi Bao, Si Li, Weiran Xu, and Sheng Gao. 2017.
Neural regularized domain adaptation for Chinese
word segmentation. In AFNLP.
John Blitzer, Mark Dredze, and Fernando Pereira.
2007. Biographies, bollywood, boom-boxes and
blenders: Domain adaptation for sentiment classi-
fication. In ACL.
Cristian Bucila, Rich Caruana,
Niculescu-Mizil. 2006. Model compression.
SIGKDD.
and Alexandru
In
Gina-Anne Levow. 2006. The third international Chi-
nese language processing bakeoff: Word segmenta-
tion and named entity recognition. In AFNLP.
Bill Yuchen Lin and Wei Lu. 2018. Neural adapta-
tion layers for cross-domain named entity recogni-
tion. In EMNLP.
Yang Liu and Yue Zhang. 2012. Unsupervised domain
adaptation for joint segmentation and pos-tagging.
In COLING.
Yijia Liu, Yue Zhang, Wanxiang Che, Ting Liu, and
Fan Wu. 2014. Domain adaptation for CRF-based
Chinese word segmentation using free annotations.
In EMNLP.
Mitchell P. Marcus, Beatrice Santorini, and Mary Ann
Marcinkiewicz. 1993. Building a large annotated
corpus of English: The penn treebank. Computa-
tional Linguistics.
Zhong Meng, Jinyu Li, Yifan Gong, and Biing-Hwang
Juang. 2018. Adversarial teacher-student learning
for unsupervised domain adaptation. In ICASSP.
Sinno Jialin Pan and Qiang Yang. 2010. A survey on
transfer learning. IEEE Trans. Knowl. Data Eng.
Xinchi Chen, Zhan Shi, Xipeng Qiu, and Xuanjing
Huang. 2017. Adversarial multi-criteria learning for
Chinese word segmentation. In ACL.
Nanyun Peng and Mark Dredze. 2015. Named entity
recognition for Chinese social media with jointly
trained embeddings. In EMNLP.
Sumit Chopra, Suhrid Balakrishnan, and Raghuraman
Gopalan. 2013. Dlid: Deep learning for domain
adaptation by interpolating between domains.
In
ICML.
Hal Daume III. 2007. Frustratingly easy domain adap-
tation. In ACL.
Tommaso Furlanello, Zachary Chase Lipton, Michael
Tschannen, Laurent Itti, and Anima Anandkumar.
2018. Born-again neural networks. In ICML.
Jingjing Gong, Xipeng Qiu, Shaojing Wang, and Xuan-
jing Huang. 2018. Information aggregation via dy-
namic routing for sequence encoding. In COLING.
Jiang Guo, Darsh Shah, and Regina Barzilay. 2018.
Multi-source domain adaptation with mixture of ex-
perts. In EMNLP.
Geoffrey E. Hinton, Oriol Vinyals, and Jeffrey Dean.
2015. Distilling the knowledge in a neural network.
In NIPS.
Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidi-
rectional LSTM-CRF models for sequence tagging.
arXiv:1508.01991. Version 1.
Jing Jiang and ChengXiang Zhai. 2007.
Instance
weighting for domain adaptation in nlp. In ACL.
Young-Bum Kim, Karl Stratos, and Dongchan Kim.
2017. Domain attention with an ensemble of ex-
perts. In ACL.
Nanyun Peng and Mark Dredze. 2017. Multi-
In
task domain adaptation for sequence tagging.
Repl4NLP.
Xipeng Qiu, Peng Qian, and Zhan Shi. 2016. Overview
of the NLPCC-ICCPOL 2016 shared task: Chinese
In IC-
word segmentation for micro-blog texts.
CPOL.
Weischedel Ralph, Palmer Martha, and Marcus et al.
Mitchell. 2013. Ontonotes release 5.0 ldc2013t19.
In Linguistic Data Consortium.
Alan Ritter, Sam Clark, Mausam, and Oren Etzioni.
2011. Named entity recognition in tweets: An ex-
perimental study. In EMNLP.
Michael T Rosenstein, Zvika Marx, Leslie Pack Kael-
bling, and Thomas G Dietterich. 2005. To transfer
or not to transfer. NIPS.
Sebastian Ruder and Barbara Plank. 2017. Learning to
select data for transfer learning with bayesian opti-
mization. In EMNLP.
Naiwen Xue, Fei Xia, Fu-Dong Chiou, and Martha
Palmer. 2005. The Penn Chinese Treebank: Phrase
structure annotation of a large corpus. Natural Lan-
guage Engineering.
Min Yang, Wei Zhao, Jianbo Ye, Zeyang Lei, Zhou
Zhao, and Soufei Zhang. 2018.
Investigating cap-
sule networks with dynamic routing for text classifi-
cation. In EMNLP.
Jiali Zeng, Jinsong Su, Huating Wen, Yang Liu,
Jun Xie, Yongjing Yin, and Jianqiang Zhao. 2018.
Multi-domain neural machine translation with word-
level domain context discrimination. In EMNLP.
Meishan Zhang, Yue Zhang, Wanxiang Che, and Ting
Liu. 2014. Type-supervised domain adaptation for
joint segmentation and pos-tagging. In ACL.
Shiqi Zhang and Deyi Xiong. 2018. Sentence weight-
ing for neural machine translation domain adapta-
tion. In COLING.
Yue Zhang and Jie Yang. 2018. Chinese ner using lat-
tice lstm. In ACL.
Guorui Zhou, Ying Fan, Runpeng Cui, Weijie Bian, Xi-
aoqiang Zhu, and Kun Gai. 2018. Rocket launch-
ing: A universal and efficient framework for training
well-performing light net. In AAAI.
Hao Zhou, Zhenting Yu, Yue Zhang, Shujian Huang,
XIN-YU DAI, and Jiajun Chen. 2017. Word-context
character embeddings for Chinese word segmenta-
tion. In EMNLP.
|
1903.12008 | 1 | 1903 | 2019-03-28T14:33:50 | Handling Noisy Labels for Robustly Learning from Self-Training Data for Low-Resource Sequence Labeling | [
"cs.CL",
"cs.LG"
] | In this paper, we address the problem of effectively self-training neural networks in a low-resource setting. Self-training is frequently used to automatically increase the amount of training data. However, in a low-resource scenario, it is less effective due to unreliable annotations created using self-labeling of unlabeled data. We propose to combine self-training with noise handling on the self-labeled data. Directly estimating noise on the combined clean training set and self-labeled data can lead to corruption of the clean data and hence, performs worse. Thus, we propose the Clean and Noisy Label Neural Network which trains on clean and noisy self-labeled data simultaneously by explicitly modelling clean and noisy labels separately. In our experiments on Chunking and NER, this approach performs more robustly than the baselines. Complementary to this explicit approach, noise can also be handled implicitly with the help of an auxiliary learning task. To such a complementary approach, our method is more beneficial than other baseline methods and together provides the best performance overall. | cs.CL | cs | Handling Noisy Labels for Robustly Learning from Self-Training Data for
Low-Resource Sequence Labeling
Debjit Paul∗§, Mittul Singh†§, Michael A. Hedderich‡, Dietrich Klakow‡
∗Research Training Group AIPHES, Institute for Computational Linguistics,
†Department of Signal Processing and Acoustics, Aalto University, Finland
Heidelberg University, Germany
‡Spoken Language Systems (LSV), Saarland Informatics Campus,
Saarland University, Germany
9
1
0
2
r
a
M
8
2
]
L
C
.
s
c
[
1
v
8
0
0
2
1
.
3
0
9
1
:
v
i
X
r
a
[email protected], [email protected],
{mhedderich, dietrich.klakow}@lsv.uni-saarland.de
Abstract
In this paper, we address the problem of effec-
tively self-training neural networks in a low-
resource setting. Self-training is frequently
used to automatically increase the amount of
training data. However, in a low-resource sce-
nario, it is less effective due to unreliable anno-
tations created using self-labeling of unlabeled
data. We propose to combine self-training
with noise handling on the self-labeled data.
Directly estimating noise on the combined
clean training set and self-labeled data can lead
to corruption of the clean data and hence, per-
forms worse. Thus, we propose the Clean
and Noisy Label Neural Network which trains
on clean and noisy self-labeled data simul-
taneously by explicitly modelling clean and
noisy labels separately. In our experiments on
Chunking and NER, this approach performs
more robustly than the baselines. Complemen-
tary to this explicit approach, noise can also be
handled implicitly with the help of an auxil-
iary learning task. To such a complementary
approach, our method is more beneficial than
other baseline methods and together provides
the best performance overall.
Introduction
1
For many low-resource languages or domains,
only small amounts of labeled data exist. Raw or
unlabeled data, on the other hand, is usually avail-
able even in these scenarios. Automatic annota-
tion or distant supervision techniques are an option
to obtain labels for this raw data, but they often
require additional external resources like human-
generated lexica which might not be available in
a low-resource context. Self-training is a popu-
lar technique to automatically label additional text.
There, a classifier is trained on a small amount
of labeled data and then used to obtain labels for
§This work was started while the authors were at Saarland
University.
unlabeled instances. However, this can lead to
unreliable or noisy labels on the additional data
which impede the learning process (Pechenizkiy
et al., 2006; Nettleton et al., 2010).
In this pa-
per, we focus on overcoming this slowdown of
self-training. Hence, we propose to apply noise-
reduction techniques during self-training to clean
the self-labeled data and learn effectively in a low-
resource scenario.
Inspired by the improvements shown by the
Noisy Label Neural Network (NLNN, Bekker and
Goldberger (2016)), we can directly apply NLNN
to the combined set of the existing clean data and
the noisy self-labeled data. However, such an ap-
plication can be detrimental to the learning pro-
cess (Section 6). Thus, we introduce the Clean and
Noisy Label Neural Network (CNLNN) that treats
the clean and noisy data separately while training
on them simultaneously (Section 3).
This approach leads to two advantages over
NLNN (Section 6 and 7) when evaluating on two
sequence-labeling tasks, Chunking and Named
Entity Recognition. Firstly, when adding noisy
data, CNLNN is robust showing consistent im-
provements over
the regular neural network,
whereas NLNN can lead to degradation in per-
formance. Secondly, when combining with an
indirect-noise handling technique, i.e. with an
auxiliary target in a multi-task fashion, CNLNN
complements better than NLNN in the multi-task
setup and overall leads to the best performance.
2 Related Work
Self-training has been applied to various NLP
tasks, e.g. Steedman et al. (2003) and Sagae and
Tsujii (2007). While McClosky et al. (2006) are
able to leverage self-training for parsing, Charniak
(1997) and Clark et al. (2003) obtain only minimal
improvements at best on parsing and POS-tagging
respectively. In some cases, the results even dete-
riorate. Other successful approaches of automati-
cally labeling data include using a different classi-
fier trained on out-of-domain data (Petrov et al.,
2010) or leveraging external knowledge (Dem-
bowski et al., 2017).
A detailed review of learning in the presence
of noisy labels is given in (Fr´enay and Verleysen,
2014). Recently, several approaches have been
proposed for modeling the noise using a confu-
sion matrix in a neural network context. Many
works assume that all the data is noisy-labeled
(Bekker and Goldberger, 2016; Goldberger and
Ben-Reuven, 2017; Sukhbaatar et al., 2015). Hed-
derich and Klakow (2018) and Hendrycks et al.
(2018) propose a setting where a mix of clean
and unlabeled data is used. However, they require
external knowledge sources for labeling the data
or evaluate on synthetic noise. Alternatively, in-
stances with incorrect labels might be filtered out,
e.g. in the work by Guan et al. (2011) or Han et al.
(2018), but this involves the risk of also filtering
out difficult but correct instances. Another orthog-
onal approach is the use of noise-robust loss func-
tions (Zhang and Sabuncu, 2018).
3 Clean and Noisy Label Neural Network
The Noisy Label Neural Network (NLNN, Bekker
and Goldberger (2016)) assumes that all observed
labels in the training set pass through a noise
channel flipping some of them from a correct to
an incorrect label (see left part of Figure 1).
In
our scenario,
this means that both the human-
annotated and the additional automatically-labeled
(self-training) corpora are assumed to be noisy. In
our experiments (Section 6 and 7), treating both
corpora in this fashion degrades the overall per-
formance. To remedy this effect, we propose to
treat the human-annotated data as clean data and
the self-training data as noisy.
We assume a similar setup as Bekker and Gold-
berger (2016), training a multi-class neural net-
work soft-max classifier
p(y = ix; w) =
(cid:80)k
exp(uT
i h)
j=1 exp(uT
j h)
Figure 1: A representation of NLNN (left) compared
to our proposed CNLNN model. The complementary
multi-task component (aux. task) is dashed.
through a noisy channel changing the correct la-
bels y to noisy ones (z ∈ N). A part of the training
set remains clean (z ∈ C) such that C + N n
where n is the total number of training examples.
The clean labels are a copy of the corresponding
correct labels. A schematic representation of this
model is shown on the right side of Figure 1. The
correct labels y and the noise distribution θ are
hidden for the noisy labels.
(cid:80)k
i
We define the probability of observing a label
z, which can either be noisy or clean and is, thus,
dependent on the label's membership to C or N:
jy i; θ)p(y ix; w)
if z ∈ N
if z ∈ C i.e. z y
Using this probability function and t to index
training instances, the log-likelihood of the model
parameters is defined as
p(y jx; w)
jx, w, θ)
1 p(z
p(z
(cid:88)
(cid:88)
zt∈C
zt∈N
L(w, θ) =
+
log p(ztxt, w)
k(cid:88)
i
1
log(
(p(ztyt
i; θ) · p(yt
ixt; w))
As in Bekker and Goldberger (2016) the model
parameters are computed using Expectation Max-
imization. In the E-step, θ and w are fixed and an
estimate c of the true labels y is obtained for the
noisy labels z:
cti p(yt
ixt, zt; w, θ)
i, θ)p(yt
(cid:80)
p(ztyt
j p(ztyt
j; θ)p(yt
ixt; w)
jxt, w)
for zt ∈ N
where x is the feature vector, y is the label, w de-
notes the network weights, k is the number of pos-
sible labels, u are soft-max weights and h = h(x)
denotes the multi-layer neural network applied to
x. In contrast to Bekker and Goldberger (2016),
we assume that not all of the training data passes
Note that the estimate c is calculated only for
the noisy labels whereas the clean labels remain
unchanged. Similarly, the noise distribution θ is
calculated only for the noisy labels. The initializa-
tion of θ and the θ's update step in M-step remain
the same as in Bekker and Goldberger (2016), also
Figure 2: Micro-averaged F1-scores (averaged over five runs) on English Penn Treebank's Chunking and En-
glish CoNLL 2003's NER tasks of models from Section 5 are plotted (with error bars) against the amount of
automatically-labeled data. 0 on the x-axis represents models trained with only the clean training set (10k tokens).
shown below.
θ(i, j) =
(cid:80)
(cid:80)
t cti1{zt=j}
t cti
i, j ∈ {1, ..., k}, zt ∈ N
During the M-step, the neural network weights
w are estimated as well. The loss function, how-
ever, changes compared to the original approach
(Bekker and Goldberger, 2016) to (1) and thus,
changing the calculation of the gradient to (2):
S(w) =
log p(ztxt, w)+
cti log p(yt
ixt; w)
(cid:88)
zt∈C
∂S
∂ui
(cid:88)
zt∈C
(1{zt
(cid:88)
zt∈N
+
(cid:88)
k(cid:88)
zt∈N
i
1
i} − p(ztxt, w))h(xt)
(cti − p(ytxt, w))h(xt)
(1)
(2)
Interestingly, the gradient calculation (2) is a
summation of two parts: one to learn from the
clean labels and another to learn from the noisy
labels. We refer to this model as the Clean and
Noisy Label Neural Network (CNLNN).
4 Training with Noisy Labels in a
Multi-Task Setup
NLNN and CNLNN form explicit ways of handling
noise as the noise distribution is calculated dur-
ing training.
In contrast, we can apply a Deep
Multi-Task Learning (MTL) approach (Søgaard
and Goldberg, 2016), which, unlike NLNN and
CNLNN, does not estimate the noise directly and
thus, is an implicit noise-cleaning approach. The
MTL method leverages an auxiliary task that aug-
ments the data providing other reliable labels and
hence, ignoring noisy labels (Ruder, 2017). In our
experiments, we combine the implicit noise han-
dling of Deep MTL with the explicit noise han-
dling of NLNN and CNLNN to complement each
other and obtain a more powerful noise handling
model than the individual models. Schematic de-
piction of combining MTL and CNLNN is shown
in Figure 1. MTL and NLNN can also be combined
in a similar way.
5 Experimental Setup
We evaluate CNLNN and other methods on a
Chunking and a Named Entity Recognition (NER)
task with F1-score as the metric in each case. For
Chunking, we use the same data splits as (Søgaard
and Goldberg, 2016) based on the English Penn
Treebank dataset (Marcus et al., 1993). For NER,
the data splits of the English CoNLL 2003 task are
used (Sang and Buchholz, 2000). Note that in our
NER setup, we evaluate using BIO-2 labels, so F1-
scores reported below might not be comparable to
prior work.
To mimic a low resource setting, we limit each
training set to the first 10k tokens. The devel-
opment sets are randomly chosen sentences from
the original training set restricted to 1k tokens.
The test sets remain unchanged. For the rest of
the training data, the original labels are removed
and the words are automatically labeled using the
baseline model (NN described below). We add
variable amounts of this automatically-annotated
data for self-training in our experiments.
5.1 Models
We apply the following models to the above two
tasks: NN (the simple baseline) is an architec-
ture with bidirectional LSTMs (Hochreiter and
Schmidhuber, 1997). For Chunking, we use three
LSTM layers, for NER five. The NN model, only
010K40K90K190KSelf-trained Automatically-Labeled Data90.591.091.592.092.593.0F1-score91.190.891.391.391.391.191.191.491.591.291.191.391.591.792.091.291.591.591.891.991.291.191.291.392.191.291.991.892.192.5ChunkingNNNLNNCNLNNMTLMTL+NLNNMTL+CNLNN010K40K90K190KSelf-trained Automatically-Labeled Data4450556064F1-score45.947.153.054.754.945.948.153.154.254.545.949.157.057.157.451.557.358.958.858.451.558.358.559.958.151.559.160.061.562.0NERtrained on the clean data, is used for automatically
labeling the raw data (obtaining the noisy data).
NLNN combines the NN with the original noise
channel (Bekker and Goldberger, 2016), training
it both on clean and noisy instances. CNLNN
is our new approach of modeling noise, treating
clean and noisy labels separately (section 3).
In contrast to the explicit noise handling of
NLNN and CNLNN, we also apply MTL for im-
plicit noise handling. Here, we use NN as the base
architecture and POS-tagging as an auxiliary task.
We hypothesise that this low-level task helps the
model to generalise its representation and that the
POS-tags are helpful because e.g. many named
entities are proper nouns. The auxiliary task is
trained jointly with the first LSTM layer of NN
for Chunking and with the second LSTM layer for
NER. In our low-resource setting, we use the first
10k tokens of section 0 of Penn Treebank for the
auxiliary POS-tagging task for the MTL (Søgaard
and Goldberg, 2016). This data is disjunct from
the other datasets.
Additionally, we combine both the explicit and
implicit noise handling. In the low-resource set-
ting, in general, such a combination addresses the
data scarcity better than the individual models.
NLNN and CNLNN combinations with MTL are
labeled as MTL+NLNN and MTL+CNLNN re-
spectively.
Implementation Details
5.2
During training, we minimize the cross entropy
loss which sums over the entire sentence. The
networks are trained with Stochastic Gradient De-
scent (SGD). To determine the number of itera-
tions for both the NN model and the EM algo-
rithm we use the development data. All models
are trained with word embeddings of dimension-
ality 64 that are initialized with pre-trained Poly-
got embeddings (Al-Rfou et al., 2013). We add
Dropout (Srivastava et al., 2014) with p=0.1 in be-
tween the word embedding layer and the LSTM.
6 Results
In Figure 2, we present the F1 scores of the mod-
els introduced in the previous section. We per-
form experiments on Chunking and NER with
various amounts of added, automatically-labeled
data.
In general, adding additional, noisy data
tends to improve the performance for all mod-
Figure 3: NLNN confusion matrices on Chunking's
clean training set for 1. and 3. EM iteration. The colors
correspond to row-normalized values.
Figure 4: MTL+CNLNN vs MTL+NLNN: Difference
in precision between the combined models and MTL
for NER and Chunking test sets with 190K noisy data.
els. This includes the plain NN, showing that this
model is somewhat robust to noise. Especially
for the Chunking task, the possibility for improve-
ment seems limited for NN as the performance
converges after adding 40k noisy instances. In the
Chunking 10k case, the negative effect of the noisy
instances results in a score lower than if no data is
added.
The original NLNN model performs similarly to
the NN model without a noise-handling compo-
nent. In some cases, the score is even lower. In
contrast, CNLNN is able to consistently improve
over these scores. This demonstrates the impor-
tance of our proposed CNLNN which treats clean
and noisy data separately.
MTL is able to improve somewhat over NN
even without adding automatically-annotated data
thanks to the auxiliary task. Additionally, MTL
performs even better when noisy data is added
showing its implicit noise handling capabilities.
On their own, both CNLNN and MTL are able to
eliminate some of the negative effects of the noisy
data and to leverage the additional data effectively.
Combining MTL with NLNN results in small
improvements at best and can decrease perfor-
I-LOCI-PERI-MISCI-ORGOTHERI-LOCI-PERI-MISCI-ORGOTHER57542758376606310121128549743265274061271531. IterationI-LOCI-PERI-MISCI-ORGOTHERI-LOCI-PERI-MISCI-ORGOTHER540285614877450620618151161911091477172947671493. IterationPredicted LabelTrue Label-2.5-2-1.5-1-0.5 0 0.5i-advpb-prti-adjpb-adjpb-sbarb-advpi-vpb-vpb-ppb-npi-npΔPrecisionChunkingMTL+CNLNNMTL+NLNNMTL 0 0.5 1 1.5 2 2.5 3i-misci-loci-orgi-perClassesNERmance, especially on Chunking. The best results
are achieved with our combined MTL+CNLNN
model as it outperforms all other models. Even
when adding 19 times the amount of self-labeled
data, the model is still able to cope with the noise
and improve the performance.
7 Analysis
NLNN vs. CNLNN: In NLNN, we observed that
clean training tokens were subverted to become
noisy in subsequent EM iterations mostly due to
the influence of noisy labels from self-labeled data
and this effect leads to NLNN's worse perfor-
mance. Figure 3 presents one such case where
the corruption of the confusion matrix from 1.
iteration is displayed. CNLNN
iteration to 3.
treats clean and noise data separately and there-
fore avoids the corruption of clean labels.
MTL+CNLNN vs. MTL+NLNN: We noted that
MTL+CNLNN consistently outperforms MTL and
MTL+NLNN, whereas the MTL+NLNN combi-
nation can degrade MTL's performance.
For
nearly all predicted labels the improvements in
precision over MTL are higher for MTL+CNLNN
when compared to MTL+NLNN (Figure 4). This
shows that CNLNN complements MTL better than
NLNN.
8 Concluding Remarks
In this paper, we apply self-training to neural net-
works for Chunking and NER in a low-resource
setup. Adding automatically-labeled data, the per-
formance of the classifier can wane or can even
decline. We propose to mitigate this effect by ap-
plying noisy label handling techniques.
However, we found that directly applying an
off-the-shelf noise-handling technique as NLNN
leads to corruption of the clean training set and
worse performance. Thus, we propose the Clean
and Noisy Label Neural Network to work sep-
arately on the automatically-labeled data. Our
model improves the performance faster for a lesser
amount of additional data. Moreover, combing
the training with auxiliary information can further
help handle noise in a complementary fashion.
Meanwhile, more complex neural network ar-
chitectures (Goldberger and Ben-Reuven, 2017;
Luo et al., 2017; Veit et al., 2017) are available for
handling noise and we look forward to working
with these to upgrade our approach in the future.
9 Acknowledgements
This work has been supported by the German Re-
search Foundation as part of the Research Training
Group Adaptive Preparation of Information from
Heterogeneous Sources (AIPHES) under grant
No. GRK 1994/1. We also thank the anonymous
reviewers whose comments helped improve this
paper.
References
Rami Al-Rfou, Bryan Perozzi, and Steven Skiena.
2013. Polyglot: Distributed word representations
for multilingual NLP. In Proceedings of the Seven-
teenth Conference on Computational Natural Lan-
guage Learning, CoNLL 2013, Sofia, Bulgaria, Au-
gust 8-9, 2013, pages 183 -- 192.
Alan Joseph Bekker and Jacob Goldberger. 2016.
Training deep neural-networks based on unreliable
In Proceedings of the 2016 IEEE Interna-
labels.
tional Conference on Acoustics, Speech and Signal
Processing, pages 2682 -- 2686.
Eugene Charniak. 1997.
Statistical parsing with a
In Pro-
context-free grammar and word statistics.
ceedings of
the Fourteenth National Conference
on Artificial Intelligence and Ninth Conference on
Innovative Applications of Artificial Intelligence,
AAAI'97/IAAI'97, pages 598 -- 603.
Stephen Clark, James R. Curran, and Miles Osborne.
2003. Bootstrapping pos taggers using unlabelled
data. In Proceedings of the Seventh Conference on
Natural Language Learning at HLT-NAACL 2003 -
Volume 4, CONLL '03, pages 49 -- 55.
Julia Dembowski, Michael Wiegand, and Dietrich
Klakow. 2017. Language independent named en-
In Pro-
tity recognition using distant supervision.
ceedings of Language and Technology Conference
(LTC).
Benoıt Fr´enay and Michel Verleysen. 2014. Classifica-
tion in the presence of label noise: A survey. IEEE
Transactions on Neural Networks and Learning Sys-
tems, 25(5):845 -- 869.
Jacob Goldberger and Ehud Ben-Reuven. 2017. Train-
ing deep neural-networks using a noise adaptation
layer. In International Conference on Learning Rep-
resentations (ICLR).
Donghai Guan, Weiwei Yuan, Young-Koo Lee, and
Sungyoung Lee. 2011. Identifying mislabeled train-
ing data with the aid of unlabeled data. Applied In-
telligence, 35(3):345 -- 358.
Bo Han, Quanming Yao, Xingrui Yu, Gang Niu,
Miao Xu, Weihua Hu, Ivor W. Tsang, and Masashi
Sugiyama. 2018. Co-teaching: Robust training of
deep neural networks with extremely noisy labels.
In Advances in Neural Information Processing Sys-
tems 31: Annual Conference on Neural Informa-
tion Processing Systems 2018, NeurIPS 2018, 3-8
December 2018, Montr´eal, Canada., pages 8536 --
8546.
Michael A. Hedderich and Dietrich Klakow. 2018.
Training a neural network in a low-resource setting
on automatically annotated noisy data. In Proceed-
ings of the Workshop on Deep Learning Approaches
for Low-Resource NLP, pages 12 -- 18. Association
for Computational Linguistics.
Dan Hendrycks, Mantas Mazeika, Duncan Wilson, and
Kevin Gimpel. 2018. Using trusted data to train
deep networks on labels corrupted by severe noise.
In Advances in Neural Information Processing Sys-
tems 31: Annual Conference on Neural Informa-
tion Processing Systems 2018, NeurIPS 2018, 3-8
December 2018, Montr´eal, Canada., pages 10477 --
10486. Curran Associates, Inc.
Sepp Hochreiter and Jurgen Schmidhuber. 1997.
Neural computation,
Long short-term memory.
9(8):1735 -- 1780.
Bingfeng Luo, Yansong Feng, Zheng Wang, Zhanxing
Zhu, Songfang Huang, Rui Yan, and Dongyan Zhao.
2017. Learning with noise: Enhance distantly su-
pervised relation extraction with dynamic transition
In Proceedings of the 55th Annual Meet-
matrix.
ing of the Association for Computational Linguistics
(Volume 1: Long Papers).
Mitchell P. Marcus, Mary Ann Marcinkiewicz, and
Beatrice Santorini. 1993. Building a large annotated
corpus of english: The penn treebank. Computa-
tional Linguistics, 19(2):313 -- 330.
David McClosky, Eugene Charniak, and Mark John-
son. 2006. Effective self-training for parsing.
In
Proceedings of the main conference on human lan-
guage technology conference of the North American
Chapter of the Association of Computational Lin-
guistics, pages 152 -- 159. Association for Computa-
tional Linguistics.
David F. Nettleton, Albert Orriols-Puig, and Albert
Fornells. 2010. A study of the effect of differ-
ent types of noise on the precision of supervised
learning techniques. Artificial Intelligence Review,
33(4):275 -- 306.
Mykola Pechenizkiy, Alexey Tsymbal, Seppo Puuro-
nen, and Oleksandr Pechenizkiy. 2006. Class noise
and supervised learning in medical domains: The ef-
fect of feature extraction. In 19th IEEE Symposium
on Computer-Based Medical Systems, pages 708 --
713.
Slav Petrov, Pi-Chuan Chang, Michael Ringgaard, and
Hiyan Alshawi. 2010. Uptraining for accurate de-
terministic question parsing. In Proceedings of the
2010 Conference on Empirical Methods in Natural
Language Processing, EMNLP '10, pages 705 -- 713.
Sebastian Ruder. 2017. An overview of multi-task
learning in deep neural networks. arXiv e-prints,
page arXiv:1706.05098.
Kenji Sagae and Jun'ichi Tsujii. 2007. Dependency
parsing and domain adaptation with lr models and
parser ensembles. In Proceedings of the 2007 Joint
Conference on Empirical Methods in Natural Lan-
guage Processing and Computational Natural Lan-
guage Learning.
Erik F. Tjong Kim Sang and Sabine Buchholz. 2000.
Introduction to the conll-2000 shared task: Chunk-
ing. In Proceedings of the 2nd workshop on Learn-
ing language in logic and the 4th conference on
Computational natural language learning-Volume 7,
pages 127 -- 132. Association for Computational Lin-
guistics.
Anders Søgaard and Yoav Goldberg. 2016. Deep
multi-task learning with low level tasks supervised
at lower layers. In Proceedings of the 54th Annual
Meeting of the Association for Computational Lin-
guistics (Volume 2: Short Papers).
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky,
Ilya Sutskever, and Ruslan Salakhutdinov. 2014.
Dropout: A simple way to prevent neural networks
from overfitting. Journal of Machine Learning Re-
search, 15:1929 -- 1958.
Mark Steedman, Miles Osborne, Anoop Sarkar,
Stephen Clark, Rebecca Hwa, Julia Hockenmaier,
Paul Ruhlen, Steven Baker, and Jeremiah Crim.
2003. Bootstrapping statistical parsers from small
In Proceedings of the Tenth Conference
datasets.
on European Chapter of the Association for Com-
putational Linguistics - Volume 1, EACL '03, pages
331 -- 338.
Sainbayar Sukhbaatar, Joan Bruna, Manohar Paluri,
Lubomir Bourdev, and Rob Fergus. 2015. Learn-
ing from noisy labels with deep neural networks. In
ICLR Workshop track.
Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin,
Abhinav Gupta, and Serge Belongie. 2017. Learn-
ing from noisy large-scale datasets with minimal su-
pervision. In Proceedings of the IEEE Conference
on Computer Vision and Pattern Recognition, pages
839 -- 847.
Zhilu Zhang and Mert R. Sabuncu. 2018. General-
ized cross entropy loss for training deep neural net-
In Advances in Neural
works with noisy labels.
Information Processing Systems 31: Annual Con-
ference on Neural Information Processing Systems
2018, NeurIPS 2018, 3-8 December 2018, Montr´eal,
Canada., pages 8792 -- 8802.
|
1803.11326 | 4 | 1803 | 2019-05-06T11:50:54 | Deep Cascade Multi-task Learning for Slot Filling in Online Shopping Assistant | [
"cs.CL"
] | Slot filling is a critical task in natural language understanding (NLU) for dialog systems. State-of-the-art approaches treat it as a sequence labeling problem and adopt such models as BiLSTM-CRF. While these models work relatively well on standard benchmark datasets, they face challenges in the context of E-commerce where the slot labels are more informative and carry richer expressions. In this work, inspired by the unique structure of E-commerce knowledge base, we propose a novel multi-task model with cascade and residual connections, which jointly learns segment tagging, named entity tagging and slot filling. Experiments show the effectiveness of the proposed cascade and residual structures. Our model has a 14.6% advantage in F1 score over the strong baseline methods on a new Chinese E-commerce shopping assistant dataset, while achieving competitive accuracies on a standard dataset. Furthermore, online test deployed on such dominant E-commerce platform shows 130% improvement on accuracy of understanding user utterances. Our model has already gone into production in the E-commerce platform. | cs.CL | cs | Deep Cascade Multi-task Learning for Slot Filling in Online Shopping Assistant
Yu Gong,1∗ Xusheng Luo,1∗ Yu Zhu,1 Wenwu Ou,1 Zhao Li,1 Muhua Zhu,1
Kenny Q. Zhu,2 Lu Duan,3 Xi Chen1
1Search Algorithm Team, Alibaba Group
2Shanghai Jiao Tong University
3Artificial Intelligence Department, Zhejiang Cainiao Supply Chain Management Co.
{santong.oww, gongda.cx}@taobao.com, [email protected], [email protected]
{gongyu.gy, lxs140564, zy143829, lizhao.lz, muhua.zmh}@alibaba-inc.com,
9
1
0
2
y
a
M
6
]
L
C
.
s
c
[
4
v
6
2
3
1
1
.
3
0
8
1
:
v
i
X
r
a
Abstract
Slot filling is a critical task in natural language understanding
(NLU) for dialog systems. State-of-the-art approaches treat
it as a sequence labeling problem and adopt such models as
BiLSTM-CRF. While these models work relatively well on
standard benchmark datasets, they face challenges in the con-
text of E-commerce where the slot labels are more informa-
tive and carry richer expressions. In this work, inspired by
the unique structure of E-commerce knowledge base, we pro-
pose a novel multi-task model with cascade and residual con-
nections, which jointly learns segment tagging, named entity
tagging and slot filling. Experiments show the effectiveness
of the proposed cascade and residual structures. Our model
has a 14.6% advantage in F1 score over the strong baseline
methods on a new Chinese E-commerce shopping assistant
dataset, while achieving competitive accuracies on a standard
dataset. Furthermore, online test deployed on such dominant
E-commerce platform shows 130% improvement on accuracy
of understanding user utterances. Our model has already gone
into production in the E-commerce platform.
1
Introduction
An intelligent online shopping assistant offers services such
as pre-sale and after-sale inquiries, product recommenda-
tions, and user complaints processing, all of which seek to
give the customers better shopping experience. The core of
such assistant is a task-oriented dialog system which has
the ability to understand natural language utterances from
a user and then give natural language responses (Yan et al.
2017). Natural Language Understanding (NLU), which aims
to interpret the semantic meanings conveyed by input utter-
ances, is a main component in task-oriented dialog systems.
Slot filling, a sub-problem of NLU, extracts semantic con-
stituents by using the words of input utterance to fill in pre-
defined slots in a semantic frame (Mesnil et al. 2015).
In the case of E-commerce shopping, there are three
named entity types: Category, Property Key and Property
Value, according to typical E-commerce knowledge base
such as the one in Figure 1. We show a real example in
Table 1 with In/Out/Begin (I/O/B) scheme. In the named
entity level, "dress" is a Category (CG), while "brand" is
Copyright c(cid:13) 2019, Association for the Advancement of Artificial
Intelligence (www.aaai.org). All rights reserved.
∗Equal contribution.
labeled as Property Key (PK), which is the name of one
product property. "Nike" and "black" are labeled as Property
Value (PV) since they are concrete property values. How-
ever, merely labeling as Property Value is not sufficient as
the shopping assistant needs more fine-grained semantics.
Therefore, in the Slot Filling level, we further label "Nike"
as Brand Property (Brand), and "black" as Color Property
(Color). In Table 1, B-CG refers to Begin-Category (the
meaning of other labels can also be inferred). In the mean-
time, other words in the example utterance that carry no se-
mantic meaning are assigned O label.
Figure 1: Structure of E-commerce knowledge-base.
Traditionally, slot filling problem can be regarded as a se-
quence labeling task, which assigns an appropriate seman-
tic label to each word in the given input utterance. State-
of-the-art sequence labeling models are typically based on
BiLSTM-CRF (Huang, Xu, and Yu 2015; Reimers and
Gurevych 2017) and evaluated on a commonly used stan-
dard dataset ATIS (Price 1990) in the slot filling area. This
dataset is about airline travel in the United States. However,
the vocabulary size of ATIS is small (only 572) and slot la-
bels are not diverse enough (mostly related to only time and
location) since airline travel is a relatively small and specific
domain, such that recent deep learning models can achieve
very high F1 scores (nearly 0.96). Recently, a detailed quan-
titative and qualitative study of this dataset comes to the
same conclusion that slot filling models should be tested on a
much more real and complex dataset (B´echet and Raymond
2018).
In this paper, we try to tackle a real-world slot filling prob-
lem for one of the largest E-commerce platform in China.
The semantic slots are much more diverse and informative
CategoryT-shirtSkirt…Property KeyColorStyle…Property ValueBlack,Red,…Sexy,Cute,……Nike,Adidas,…DressBrandUtterance
Slot Label
Named Entity Label
Segment Label
I
O
O
O
want
buy
Nike
brand
O
O
O
O
O
O
B-Brand
I-Brand
B-PV
B
I-PV
I
B-PK
B-PK
B
I-PK
I-PK
I
\
O
O
O
black
B-Color
I-Color
B-PV
I-PV
B
I
B-CG
B-CG
B
dress
I-CG
I-CG
I
I-CG
I-CG
I
Table 1: A real example of slot filling in online shopping scenario.
than ATIS. For example, to describe different properties of a
product for the purpose of utterance understanding, we de-
fine large amount of informative slot labels such as color,
brand, style, season, gender and so on. In contrast, most se-
mantic labels of ATIS are related to only time and location.
Furthermore, the Chinese language used for e-commerce is
more complex and the semantically rich expressions make
it harder to understand. Whereas in ATIS, expression can be
simpler, and most expressions are standard locations or time.
Thus, large scale semantic slots and more complex expres-
sions bring problem such as data sparsity. Traditional end-
to-end sequence labeling model may not be able to handle
it.
tion 2.3).
• We develop a Chinese E-commerce shopping assistant
dataset ECSA (Section 3.1), which is much bigger and
different from the common ATIS dataset, and would be a
valuable contribution to dialog system research.
• We evaluate DCMTL in both offline and online settings.
Offline results show the model outperforms several strong
baseline methods by a substantial margin of 14.6% on F 1
score (Section 3.3). Online testing deployed on the men-
tioned E-commerce platform shows that slot filling results
returned by our model achieve 130% improvement on ac-
curacy which significantly benefits to the understanding
of users' utterances (Section 3.4). Our model has already
gone production in the platform.
2 Approach
In this section we describe our approach in detail. Figure 2
gives an overview of the proposed architectures. First we in-
troduce the most common and popular BiLSTM-CRF model
(Figure 2(a)) for sequence labeling tasks. Then we move on
to multi-task learning perspective (Figure 2(b) and (c)). Fi-
nally we propose our new method, which is called Deep Cas-
cade Multi-task Learning in Figure 2(d).
Given an utterance containing a sequence of words w =
(w1, w2, ..., wT ), the goal of our problem is to find a se-
quence of slot labels y = (y1, y2, ..., yT ), one for each word
in the utterance, such that:
y = arg max
y
P (yw).
We use "word" in problem and model description, but
"word" actually means Chinese char in our problem. And
a "term" consists of one or several words.
2.1 RNN Sequence Labeling
Figure 2(a) shows the principle architecture of a BiLSTM-
CRF model, which is the state-of-the-art model for var-
ious sequence labeling tasks (Huang, Xu, and Yu 2015;
Reimers and Gurevych 2017). BiLSTM-CRF model consists
of a BiLSTM layer and a CRF layer.
BiLSTM (Bidirectional-LSTM) enables the hidden states
to capture both historical and future context information of
the words. Mathematically, the input of this BiLSTM layer is
a sequence of input vectors, denoted as X = (x1, x2, ..., xT ).
The output of BiLSTM layer is a sequence of the hidden
states for each input word, denoted as H = (h1, h2, ..., hT ).
Each final hidden state is the concatenation of the forward
Besides, Chinese language, like many other Asian lan-
guages, is not word segmented by nature, and word segmen-
tation is a difficult first step in many NLP tasks. Without
proper word segmentation, sequence labeling becomes very
challenging as the errors from segmentation will propagate.
On the other hand, more than 97% of the chunks in ATIS
data have only one or two words, in which segmentation (or
chunking) is not a serious problem. Due to these reasons, if
we simply apply basic sequence labeling models, which can
be regarded as an end-to-end method, the sentences may not
be segmented correctly in the first place. Then the errors will
propagate and the resulting slot labels will be incorrect.
In this paper, we propose to employ multi-task sequence
labeling model to tackle slot filling in a novel Chinese E-
commerce dialog system. Inspired by the natural structure
of E-commerce knowledge base shown in Figure 1, we ex-
tract two additional lower-level tasks from the slot filling
task: named entity tagging and segment tagging. Example
labels of these two tasks are shown in the bottom two rows
of Table 1. Segment tagging and named entity tagging can be
regarded as syntactic labeling, while slot filling is more like
semantic labeling. With the help of information sharing abil-
ity of multi-task learning, once we learn the information of
syntactic structure of an input sentence, filling the semantic
labels becomes much easier. Compared to directly attack-
ing slot filling, these two low-level tasks are much easier
to solve due to fewer labels. To this end, we propose a Deep
Cascade Multi-task Learning model, and co-train three tasks
in the same framework with a goal of optimizing the target
slot filling task.
The contributions of this paper are summarized below:
• To the best of our knowledge, this is the first piece of work
focusing on slot filling in E-commerce. We propose a
novel deep multi-task sequence labeling model (DCMTL)
with cascading and residual connection to solve it (Sec-
ascent. For a training dataset {(H(i), y(i))}, the final log-
likelihood is:
L(W, b) =
log p(y(i)H(i); W, b).
(cid:88)
i
Finally, the Viterbi algorithm is adopted to decode the opti-
mal output sequence y∗:
y∗ = arg max
y∈Y(H)
p(yH; W, b).
2.2 Multi-task Learning
The slot labels are large-scaled, informative and diverse in
the case of E-commerce, and the syntactic structure of in-
put Chinese utterance are complicated, so that the slot filling
problem becomes hard to solve. If we directly train an end-
to-end sequential model, the tagging performance will suffer
from data sparsity severely. When we try to handle slot fill-
ing (can be seen as semantic labeling task), some low-level
tasks such as named entity tagging or segment tagging (can
be seen as syntactic labeling task) may first make mistakes.
If the low-level tasks get wrong, so as to the target slot fill-
ing task. That is to say it is easy to make wrong decisions in
the low-level tasks, if we try to fill in all the labels at once.
Then the error will propagate and lead to a bad performance
of slot filling, which is our high-level target.
While directly attacking the slot filling task is hard, low-
level tasks with fewer labels are much easier to solve. Once
we know the syntactic structure of a sentence, filling in se-
mantic labels will become easier accordingly. Thus, it is rea-
sonable to solve the problem in a multi-task learning frame-
work. In our problem, following the special structure of E-
commerce knowledge base (Figure 1), we can devise three
individual tasks: slot filling, named entity tagging and seg-
ment tagging. Slot filling is our target task; named entity
tagging is to classify which named entity type (PV/PK/CG)
a word is; and segment tagging is to judge whether a word
is begin (B), in (I) or out (O) of a trunking.
In a multi-task learning (MTL) setting, we have several
prediction tasks over the same input sequence, where each
task has its own output vocabulary (a set of task specified
labels). Intuitively, the three tasks do share a lot of infor-
mation. Consider the example in Table 1 again. Knowing
" being B-PVI-PV can def-
the named entity type of "
initely help determine its slot label, which is B-ColorI-
Color. Similarly, knowing its segment type (BI) also helps
with both named entity tagging and slot filling. Thus it is
reasonable for these tasks to share parameters and learn in
the same framework cooperatively.
Vanilla Multi-task Learning The general idea of multi-
task learning is to share parameters of encoding part of the
network. As Figure 2(b) shows, this is naturally achieved
by sharing the k-layers BiLSTM part of the network across
three tasks. Based on that, we use a separate CRF decoder
for each task t ∈ {seg, ne, slot}: p(ytHk; Wt, bt), where
Wt and bt are task-specific parameters. This encourages the
deep BiLSTM network to learn a hidden representation Hk
which benefits all three different tasks.
Figure 2: Sequential models for slot filling task.
−→
hi and backward
function BiLSTM(xi):
←−
hi hidden states. We view BiLSTM as a
−→
hi = LSTM(xi,
−−→
hi−1),
←−
hi = LSTM(xi,
←−−
hi+1),
BiLSTM(xi) = hi = [
−→
hi (xi);
←−
hi (xi)].
Most of time we stack multiple BiLSTMs to make the model
deeper, in which the output hl
i of layer l becomes the input
of layer l + 1, e.g. hl+1
i = BiLSTMl+1(hl
i).
It is always beneficial to consider the correlations between
the current label and neighboring labels, since there are
many syntactical constraints in natural language sentences.
For example, I-Brand is never followed by a B-Color. If
we simply feed the above mentioned hidden states indepen-
dently to a softmax layer to predict the labels (Hakkani-
Tur et al. 2016), such constraints are more likely to be vi-
olated. Linear-chain Conditional Random Field (CRF) (Laf-
ferty, McCallum, and Pereira 2001) is the most popular way
to control the structure prediction and its basic idea is to use
a series of potential functions to approximate the conditional
probability of the output label sequence given the input word
sequence.
Formally, we take the above sequence of hidden states
H = (h1, h2, ..., hT ) as input to a CRF layer, and the
output of the CRF is the final prediction label sequence
y = (y1, y2, ..., yT ), where yi is in the set of pre-defined
target labels. We denote Y(H) as the set of all possible label
sequences. Then we derive the conditional probability of the
output sequence, given the input hidden state sequence is:
(cid:81)T
(cid:80)
(cid:81)T
i=1 ϕ(yi−1, yi, H)
i−1, y(cid:48)
i=1 ϕ(y(cid:48)
,
i, H)
p(yH; W, b) =
y(cid:48)∈Y(H)
where ϕ(y(cid:48), y, H) = exp(WT
y(cid:48),yH + by(cid:48),y) are potential
y(cid:48),y and by(cid:48),y are weight vector and bias
functions and WT
of label pair (y(cid:48), y). To train the CRF layer, we use the clas-
sic maximum conditional likelihood estimate and gradient
(a) BasicBiLSTM-CRF(b) VanillaMulti-task(c) HierarchyMulti-task(d) Deep CascadeMulti-task!"!"!"!"!"#!"#!"#!"#!"#!"#!"#!"#!"#!"#Hierarchy Multi-task Learning Previous discussion in-
dicates that there is a natural order among the different tasks:
slot filling may benefit more from named entity tagging, than
the other way around. This motivates us to employ low-level
tasks at lower BiLSTM layers, while high level tasks are
trained at higher layers. We borrow the idea of involving
a hierarchical neural networks structure (Peters et al. 2018;
Søgaard and Goldberg 2016). As shown in Figure 2(c), in-
stead of decoding all tasks separately at the outermost BiL-
STM layer, we associate each BiLSTM layer l(t) with one
task t. Then the conditional probabilities of the output se-
quence for each task are:
seg tag(w) = p(ysegHl(seg); Wseg, bseg),
Hl(seg) = BiLSTMl(seg)(E(w)).
ne tag(w) = p(yneHl(ne); Wne, bne),
Hl(ne) = BiLSTMl(ne)(Hl(seg)).
slot fill(w) = p(yslotHl(slot); Wslot, bslot),
Hl(slot) = BiLSTMl(slot)(Hl(ne)).
Here seg tag, ne tag and slot fill represent the tasks of seg-
ment tagging, named entity tagging and slot filling, respec-
tively. E(w) is the word embeddings of input sequence w
and l(seg) < l(ne) < l(slot). We call this model hierarchy
multi-task learning, since some layers are shared by all tasks
while the others are only related to specific tasks.
2.3 Deep Cascade Multi-task Learning
Hierarchy multi-task learning share parameters among dif-
ferent tasks, and allow low-level tasks help adjust the re-
sult of high-level target task. It is effective for those tasks
which are weakly correlated, such as POS tagging, syntac-
tic chunking and CCG supertagging (Søgaard and Goldberg
2016). However, when it comes to problems where differ-
ent tasks maintain a strict order, in another word, the perfor-
mance of high-level task dramatically depends on low-level
tasks, the hierarchy structure is not compact and effective
enough. Therefore, we propose cascade and residual con-
nections to allow high-level tasks to take the tagging results
and hidden states from low-level tasks as additional input.
These connections serves as "shortcuts" that create a more
closely coupled and efficient model. We call it deep cascade
multi-task learning, and the framework is shown in Figure
2(d).
Cascade Connection Here we feed the tagging output of
the task at lower layer e.g. seg tag∗(w) or ne tag∗(w) to the
upper BiLSTM layer as its additional input. Now the hidden
states of each task layer become:
Hl(seg) = BiLSTMl(seg)(E(w)),
Hl(ne) = BiLSTMl(ne)(Wseg
Hl(slot) = BiLSTMl(slot)(Wne
Cas. · seg tag∗(w) + Hl(seg)),
Cas. · ne tag∗(w) + Hl(ne)),
Cas. are the weight parameters for cas-
At training time, seg tag∗(w) and ne tag∗(w) can be
the true tagging outputs. At inference time, we simply
where Wseg
cade connection.
Cas. and Wne
take the greedy path of our cascade model without doing
search, where the model emits the best seg tag∗(w) and
ne tag∗(w) by Viterbi inference algorithm. Alternatively,
one can do beam search (Sutskever, Vinyals, and Le 2014;
Vinyals et al. 2015) by maintaining a set of k best partial hy-
potheses at each cascade layer. However, unlike traditional
seq2seq models e.g., in machine translation, where each in-
ference step is just based on probability of a discrete vari-
able (by softmax function), our inference for tagging output
is a structured probability distribution defined by the CRF
output. Efficient beam search method for this structured cas-
cade model is left to our future work.
Residual Connection To encourage the information shar-
ing among different tasks, we also introduce the residual
connection, where we add the input of a previous layer to
the current input:
Hl(seg) = BiLSTMl(seg)(xl(seg)),
xl(seg) = E(w).
Hl(ne) = BiLSTMl(ne)(Wseg
Cas. · seg tag∗(w) + xl(ne)),
xl(ne) = Hl(seg) + xl(seg).
Hl(slot) = BiLSTMl(slot)(Wne
Cas. · ne tag∗(w) + xl(slot)),
xl(slot) = Hl(ne) + xl(ne).
Deep residual learning (He et al. 2016) is introduced to
ease the gradient vanish problem for training very deep neu-
ral networks. Here we borrow the idea of cross residual
learning method for multi-task visual recognition (Jou and
Chang 2016) and believe the residual connection between
different layers can benefit our multi-task sequence learning.
We propose cascade residual connection instead of cross
residual connection because different tasks are connected
via cascading in our problem, while they are organized via
branching in visual recognition.
2.4 Training
For our multi-task setting, we define three loss functions (re-
fer to Section 2.1): Lseg, Lne and Lslot for tasks of segment
tagging, named entity tagging and slot filling respectively.
We construct three training set, Dseg, Dne and Dslot, where
each of them (called Dt generically) contains a set of input-
output sequence pair (w, yt). The input utterance w is shared
across tasks, but the output yt is task dependent.
For vanilla multi-task learning, we define a unified loss
function L = αLseg + βLner + (1 − α − β)Lslot, where
α and β are hyper-parameters. And we update the model
parameters by loss L.
As for hierarchy multi-task learning and cascade multi-
task learning, we choose a random task t ∈ {seg, ne, slot}
at each training step, followed by a random training batch
Batch(w, yt) ∈ Dt. Then we update the model parameters
by back-propagating the corresponding loss Lt.
3 Experiments
In this section we first introduce the popular ATIS dataset1,
then describe how we collect our E-commerce Shopping
1https://github.com/yvchen/JointSLU
Assistant (ECSA) dataset2. Then we show the implementa-
tion details for our model. Finally we demonstrate the eval-
uation results on both ATIS and ECSA dataset and give
some discussions. In the following experiments, we call our
proposed Deep Cascade Multi-Task Learning method as
DCMTL for short.
3.1 Dataset
ATIS Dataset The ATIS corpus, the most commonly used
dataset for slot filling research, contains reservation requests
for air travel. It contains 4,978 training and 893 testing sen-
tences in total, with a vocabulary size of 572 (Mesnil et
al. 2015). Apart from the ground-truth slot labels, we also
generate its corresponding segment labels for our multi-task
model setting.
ECSA Dataset To create large amounts of gold standard
data to train our model, we adopt an unsupervised method
to automatically tag the input utterances. All the utterances
are extracted from the user input logs (either from text or
voice) on our online shopping assistant system. Besides our
E-commerce knowledge-base is a dictionary consisting of
pairs of word terms and their ground-truth slot labels such
as "red-Color" or "Nike-Brand". Since this resource is cre-
ated by human beings, we will use it to create gold standard.
We use a dynamic programming algorithm of max-matching
to match words in the utterances and then assign each word
with its slot label in IOB scheme. We filter utterances whose
matching result is ambiguous and only reserve those that can
be perfectly matched (all words can be tagged by only one
unique label) as our training and testing data. With the slot
labels of each word, we can induce the named entity labels
and segment labels straightforwardly via the E-commerce
knowledge-base. For we only extract the perfectly matched
sentences, the quality of our ECSA dataset can be guaran-
teed. It can be considered as a long-distance supervision
method (Mintz et al. 2009).
To evaluate model's ability to generalize, we randomly
split the dictionary into three parts. One part is used to gen-
erate testing data and the other two to generate training data.
If we don't split the dictionary and use the whole to gen-
erate both training and testing data, then the trained model
may remember the whole dictionary and the results will not
reflect the true performance of the models.
This unsupervised approach alleviates human annota-
tions, and we can produce a large volume of labeled data
automatically. The following experiments use a dataset of
24,892 training pairs and 2,723 testing pairs. Each pair con-
tains an input utterance w, its corresponding gold sequence
of slot labels yslot, named entity labels yne and segment la-
bels yseg. The vocabulary size of ECSA is 1265 (Chinese
characters), and the amount of segmented terms can be much
larger. The Out-of-Vocabulary (OOV) rate of ESCA dataset
is 85.3% (Meaning 85.3% of terms in testing data never ap-
pear in training data) while the OOV rate of ATIS is lower
than 1%. Apparently slot filling task on ESCA dataset is
more challenging.
2https://github.com/pangolulu/DCMTL
Implementation Details
3.2
For the RNN component in our system, we use a 3-layers
BiLSTM networks for ECSA and 2-layers BiLSTM net-
works for ATIS (no named entity tagging in this case), and
all LSTM networks come with hidden state size 100. The
input in ECSA is a sequence of Chinese characters rather
that words since there is no segmentation. The dimension of
embedding layer E and BiLSTM network output state (con-
catenation of the forward and backward LSTM) are set to
200. We perform a mini-batch log-likelihood loss training
with a batch size of 32 sentences for 10 training epochs. We
use Adam optimizer, and the learning rate is initialized to
0.001. To prevent the gradient explosion problem for train-
ing LSTM networks, we set gradient clip-norm as 5.
3.3 Results and Discussions
Evaluation on ATIS We compare the ATIS results of
our DCMTL model with current published results in Ta-
ble 2. We split the methods into two categories: one is Se-
quence Labeling based method, and the other is Encoder-
Decoder based method. Sequence Labeling based method
generally adopts a sequential network (RNN (Yao et al.
2013; Yao et al. 2014; Liu and Lane 2015; Peng and Yao
2015; Vu et al. 2016) or CNN (Xu and Sarikaya 2013;
Vu 2016)) and calculate a loss function (such as CRF loss
(Xu and Sarikaya 2013), cross entropy loss (Yao et al. 2013;
Yao et al. 2014) or ranking loss (Vu et al. 2016)) on top of
the network output. Encoder-Decoder based method, on the
other hand, usually employs a RNN to encode the whole
sentence and another RNN to decode the labels (Kurata
et al. 2016). The decoder will attend to the whole encod-
ing sequence with attention mechanism (Zhu and Yu 2017;
Zhai et al. 2017). Our method follows the Sequence Label-
ing framework and we design a novel multi-task sequence
labeling model which achieve the best performance against
the published Sequence Labeling based method (F1+0.22%)
and compatible result against the best Encoder-Decoder
based method (F1-0.03%). As we claim in Section 1, more
than 97% of chunks in ATIS dataset have only one or two
words and there are no named entity labels at all. These two
reasons prevent our proposed DCMTL model from further
improving the performance on ATIS dataset. Thus, we will
mainly focus on ECSA dataset, which is much larger and
more sophisticated, to prove the effectiveness of our pro-
posed model.
Besides, almost all the methods (including ours) reach
very high F1 score of around 0.96. This also makes us won-
der whether it is meaningful enough to continue evaluating
on this dataset, for minor differences in the results may be
attributed to data variance more than the models. Apparently
high performance on ATIS does not mean working on real-
world application which contains more informative semantic
slot labels and more complicated expressions as in the case
of online shopping assistant.
Evaluation on ECSA On ECSA dataset, we evaluate dif-
ferent models including Basic BiLSTM-CRF, Vanilla Multi-
task, Hierarchy Multi-task and Deep Cascade Multi-task on
Methods
simple RNN (Yao et al. 2013)
CNN-CRF (Xu and Sarikaya 2013)
LSTM (Yao et al. 2014)
RNN-SOP (Liu and Lane 2015)
Deep LSTM (Yao et al. 2014)
RNN-EM (Peng and Yao 2015)
Bi-RNN with ranking loss (Vu et al. 2016)
Sequential CNN (Vu 2016)
Encoder-labeler Deep LSTM (Kurata et al. 2016)
BiLSTM-LSTM (focus) (Zhu and Yu 2017)
Neural Sequence Chunking (Zhai et al. 2017)
DCMTL (Ours)
F1
0.9411
0.9435
0.9485
0.9489
0.9508
0.9525
0.9547
0.9561
0.9566
0.9579
0.9586
0.9583∗
Table 2: Comparison with published results on the ATIS
dataset.
Models
Precision
Recall
F1
Basic BiLSTM-CRF
* Basic BiLSTM-CRF (cond. SEG)
* Basic BiLSTM-CRF (cond. NE)
Vanilla Multi-task
Hierarchy Multi-task
** DCMTL (- cascade)
** DCMTL (- residual)
DCMTL (full)
0.4330
0.7948
0.8985
0.3990
0.4417
0.4654
0.4923
0.5281
0.4275
0.7953
0.8986
0.3941
0.4494
0.4613
0.4760
0.4941
0.4302
0.7950
0.8985
0.3965
0.4455
0.4633
0.4840
0.5105
Table 3: Results for slot filling task on the ECSA dataset.
Columns with highlighted boldface are the best perfor-
mance. Rows with * prefix are just results for our case study.
Rows with ** prefix are results for ablation test.
testing data regarding slot filling as the target task. We report
Precision, Recall and F1 in Table 3.
The Basic BiLSTM-CRF model achieves an F1 score of
0.43. To show the usefulness of the lower tasks to slot filling,
we "cheated" by using the ground-truth segment type (cond.
SEG) or named entity type (cond. NE) as the extra features
for each word in the Basic BiLSTM-CRF model. Row 3 and
4 (with *) in Table 3 show that the slot filling performance
can be improved by 85% and 109% if the correct segment
type or named entity type is pre-known. It can perfectly ver-
ify our claim that low-level syntactic tasks can significantly
affect to the slot filling performance. Of course in practice,
the model doesn't know the true values of these types during
prediction.
Our further experiments show that DCMTL outperforms
the baselines on both precision and recall. DCMTL achieves
the best F1 score of 0.5105, which improves by a relative
margin of 14.6% against the strong baseline method (see
Table 3). Multi-task models generally perform better than
the Basic BiLSTM with single-task target. The exception is
the vanilla multi-task setting. This is mainly because vanilla
multi-task shares parameters across all the layers, and these
parameters are likely to be disturbed by the interaction of
three tasks. It is more desirable to let the target task domi-
nate the weights at high-level layers.
(a)
(b)
Figure 3: (a) Learning trends of F1 respectively for different
methods. (b) Result of different cascade connection types in
DCMTL.
We further investigate the learning trend of our proposed
approach against baseline methods. Figure 3(a) shows the
typical learning curves of performance measured by F1. We
can observe that our method DCMTL performs worse than
other baseline methods for the first 450 batch steps. After
that, other methods converge quickly and DCMTL perform
much better after 500 batch steps and finally converge to
the best F1 score. We believe that in the beginning, high-
level task in DCMTL is affected more by the noise of low-
level tasks comparing to others, but as the training goes on,
the high-level slot filling task slowly reaps the benefits from
low-level tasks.
To make our experiments more solid, we implemented
two previous best performing models on ATIS dataset: Se-
quential CNN (Vu 2016) (Sequence Labeling based) and
Neural Sequence Chunking (Zhai et al. 2017) (Encoder-
Decoder based). They achieved 0.2877 and 0.4355 F1 scores
respectively, while our DCMTL model scores 0.5105 F1
and outperforms both of them (by 77% and 17% improve-
ments).
Ablation Test Our "shortcuts" connections come in two
flavors: cascade connection and residual connection. Multi-
task outputs and "shortcuts" connections are highly related
since without the multi-task framework, there will be no cas-
cade connections. We go on to show that both multi-task set-
ting and the "shortcuts" connections are effective and useful
in Table 3, where F1 score improves from 0.4302 to 0.4455
and 0.5105 respectively. We also investigate how our model
DCMTL performs with or without cascade and residual con-
nections (rows with ** prefix in Table 3). F1 score increases
from 0.4840 to 0.5105 when residual connection is applied,
which verifies its benefit. If we remove cascade connection
from DCMTL, the model actually degenerates into hierar-
chy multi-task model with residual connection and performs
0.4633 F1 score. Thus we can conclude that both connec-
tions are helpful for our DCMTL model. However, the cas-
cade connection, which relies on the multi-task, is more ef-
fective than the residual connection. We can verify it from
the fact that DCMTL model without cascade connection per-
forms much worse than without residual connection (0.4633
vs. 0.4840 F1 scores).
Furthermore, we explore how DCMTL performs with dif-
ferent cascade connection methods. We compare three dif-
0200400600800Training Batch Step0.00.10.20.30.40.5F1Basic BiLSTM-CRFVanilla Multi-taskHierarchy Multi-taskDCMTL(full)PrecisionRecallF10.00.10.20.30.40.50.60.7SLOT+SEGSLOT+NESLOT+NE+SEGferent types of cascade connection illustrated in Figure 4(a):
1. Segment labeling skipped to slot filling (SLOT+SEG).
2. Named entity labeling directly connected to slot filling
(SLOT+NE).
3. Segment labeling, named entity labeling and slot filling in
sequence (SLOT+NE+SEG).
From Figure 3(b), we find that cascade connection with
type 3 performs the best and then with type 2, while cas-
cade method with skipped connection (type 1) performs
the worst. Therefore, we design the networks with a cas-
cade connection in a hierarchical fashion and do not apply
skipped connection for the cascade inputs (Figure 4(b)). This
phenomenon here may also be proved by our "cheated" case
study above. Slot filling performance with pre-known named
entity type is much better than with pre-known segment type
(rows with * in Table 3).
(a)
(b)
Figure 4: (a) Three types of cascade connection in our ex-
periment. (b) Comparison between hierarchical and skipped
cascade connection.
3.4 Online Testing
Previous experimental results have proven the advantages of
our proposed DCMTL approach, so we deploy it in a real
world online environment to test its practical performance.
For online A/B testing, we extracted users query log with
the slot filling results for one day. There are in total 251,409
unique queries. We let three persons to manually evaluate
whether a query is slotted perfectly with the strategy where
the minority obeys the majority. A query is slotted perfectly
means all terms in query are assigned with the correct slot la-
bels. Our DCMTL model results in 152,178 perfectly slotted
queries which is 60.53% accuracy3. While the original on-
line max-matching algorithm with E-commerce knowledge
base4 (more details in Section 3.1) only covers 66,302 per-
fectly slotted queries with 26.37% accuracy. Thus, the ac-
curacy of query slot filling in such online shopping assis-
tant system is improved by 130% after deploying DCMTL
3We only report accuracy as evaluation metric, because preci-
sion and recall are the same in such case.
4As we have showed that our DCMTL model outperforms sev-
eral strong baselines in the offline evaluation, and the gap between
online and offline is minor since our offline dataset also comes from
online queries, we only deploy DCMTL model online since such
evaluation is costly.
model. This demonstrates that our model can effectively
extract the semantic attributes of users query which is ex-
tremely helpful E-commerce Shopping Assistant system.
4 Related Work
There are mainly two lines of research that are related to our
work: slot filling for dialog system and multi-task learning
in natural language processing.
Slot Filling is considered a sequence labeling problem
that is traditionally solved by generative models. such as
Hidden Markov Models (HMMs) (Wang, Deng, and Acero
2005), hidden vector state model (He and Young 2003),
and discriminative models such as conditional random fields
(CRFs) (Raymond and Riccardi 2007; Lafferty, McCallum,
and Pereira 2001) and Support Vector Machine (SVMs)
(Kudo and Matsumoto 2001). In recent years, deep learning
approaches have been explored due to its successful appli-
cation in many NLP tasks. Many neural network architec-
tures have been used such as simple RNNs (Yao et al. 2013;
Mesnil et al. 2015), convolutional neural networks (CNNs)
(Xu and Sarikaya 2013), LSTMs (Yao et al. 2014) and vari-
ations like encoder-decoder (Zhu and Yu 2017; Zhai et al.
2017) and external memory (Peng and Yao 2015). In gen-
eral, these works adopt a BiLSTM (Zhu et al. 2018; Zhu et
al. 2017) as the major labeling architecture to extract various
features, then use a CRF layer (Huang, Xu, and Yu 2015) to
model the label dependency. We also adopt a BiLSTM-CRF
model as baseline and claim that a multi-task learning frame-
work is working better than directly applying it on Chinese
E-commerce dataset. Previous works only apply joint model
of slot filling and intent detection (Zhang and Wang 2016;
Liu and Lane 2016). Our work is the first to propose a multi-
task sequence labeling model with novel cascade and resid-
ual connections based on deep neural networks to tackle
real-world slot filling problem.
Multi-task Learning (MTL) has attracted increasing at-
tention in both academia and industry recently. By jointly
learning across multiple tasks (Caruana 1998), we can im-
prove performance on each task and reduce the need for la-
beled data. There has been several attempts of using multi-
task learning on sequence labeling task (Peng and Dredze
2016b; Peng and Dredze 2016a; Yang, Salakhutdinov, and
Cohen 2017), where most of these works learn all tasks at
the out-most layer. Sgaard and Goldberg (2016) is the first
to assume the existence of a hierarchy between the different
tasks in a stacking BiRNN model. Compared to these works,
our DCMTL model further improves this idea even thorough
with cascade and residual connection.
5 Conclusion
In this paper, we tackle the real-world slot filling task in
a novel Chinese online shopping assistant system. We pro-
posed a deep multi-task sequence learning framework with
cascade and residual connection. Our model achieves com-
parable results with several state-of-the-art models on the
common slot filling dataset ATIS. On our real-world Chinese
E-commerce dataset ECSA, our proposed model DCMTL
also achieves best F1 score comparing to several strong
Segment LabelingNamed Entity LabelingSlot Fillingtype 1type 2type 3type 3baselines. DCMTL has been deployed on the online shop-
ping assistant of a dominant Chinese E-commerce platform.
Online testing results show that our model meets better
understanding of users utterances and improves customers
shopping experience. Our future research may include a
joint model for category classification and slot filling. Active
learning for slot filling can also be investigated by involving
human-beings interaction with our system.
Acknowledgments
This work as partially supported by NSFC grants 91646205
and 61373031. We thank the anonymous reviewers for their
valuable comments.
References
[2018] B´echet, F., and Raymond, C. 2018. Is atis too shallow
to go deeper for benchmarking spoken language understand-
ing models? In InterSpeech.
[1998] Caruana, R. 1998. Multitask learning. In Learning to
learn. Springer.
[2016] Hakkani-Tur, D.; Tur, G.; Celikyilmaz, A.; Chen, Y.-
N.; Gao, J.; Deng, L.; and Wang, Y.-Y. 2016. Multi-domain
joint semantic frame parsing using bi-directional rnn-lstm.
In INTERSPEECH.
[2003] He, Y., and Young, S. 2003. A data-driven spoken
language understanding system. In ASRU.
[2016] He, K.; Zhang, X.; Ren, S.; and Sun, J. 2016. Deep
residual learning for image recognition. In CVPR.
[2015] Huang, Z.; Xu, W.; and Yu, K. 2015. Bidirectional
lstm-crf models for sequence tagging. arXiv.
[2016] Jou, B., and Chang, S.-F. 2016. Deep cross residual
learning for multitask visual recognition. In ACM MM.
[2001] Kudo, T., and Matsumoto, Y. 2001. Chunking with
support vector machines. In NAACL.
[2016] Kurata, G.; Xiang, B.; Zhou, B.; and Yu, M. 2016.
Leveraging sentence-level information with encoder lstm for
semantic slot filling. arXiv.
[2001] Lafferty, J.; McCallum, A.; and Pereira, F. C. 2001.
Conditional random fields: Probabilistic models for seg-
menting and labeling sequence data.
[2015] Liu, B., and Lane, I. 2015. Recurrent neural net-
work structured output prediction for spoken language un-
derstanding. In NIPS Workshop.
[2016] Liu, B., and Lane, I. 2016. Joint online spoken lan-
guage understanding and language modeling with recurrent
neural networks. arXiv.
[2015] Mesnil, G.; Dauphin, Y.; Yao, K.; Bengio, Y.; Deng,
L.; Hakkani-Tur, D.; He, X.; Heck, L.; Tur, G.; Yu, D.; et al.
2015. Using recurrent neural networks for slot filling in spo-
ken language understanding. TASLP.
[2009] Mintz, M.; Bills, S.; Snow, R.; and Jurafsky, D. 2009.
Distant supervision for relation extraction without labeled
data. In ACL.
[2016a] Peng, N., and Dredze, M. 2016a. Improving named
entity recognition for chinese social media with word seg-
mentation representation learning. In ACL.
[2016b] Peng, N., and Dredze, M. 2016b. Multi-task multi-
domain representation learning for sequence tagging. arXiv.
[2015] Peng, B., and Yao, K. 2015. Recurrent neural net-
works with external memory for language understanding.
arXiv.
[2018] Peters, M.; Neumann, M.; Iyyer, M.; Gardner, M.;
Clark, C.; Lee, K.; and Zettlemoyer, L. 2018. Deep con-
textualized word representations. In NAACL.
[1990] Price, P. J. 1990. Evaluation of spoken language sys-
tems: The atis domain. In Speech and Natural Language.
[2007] Raymond, C., and Riccardi, G. 2007. Generative and
discriminative algorithms for spoken language understand-
ing. In INTERSPEECH.
[2017] Reimers, N., and Gurevych, I. 2017. Optimal hy-
perparameters for deep lstm-networks for sequence labeling
tasks. arXiv.
[2016] Søgaard, A., and Goldberg, Y. 2016. Deep multi-task
learning with low level tasks supervised at lower layers. In
ACL.
[2014] Sutskever, I.; Vinyals, O.; and Le, Q. V. 2014. Se-
quence to sequence learning with neural networks. In NIPS.
[2015] Vinyals, O.; Toshev, A.; Bengio, S.; and Erhan, D.
2015. Show and tell: A neural image caption generator. In
CVPR.
[2016] Vu, N. T.; Gupta, P.; Adel, H.; and Schutze, H. 2016.
Bi-directional recurrent neural network with ranking loss for
spoken language understanding. In ICASSP.
[2016] Vu, N. T. 2016. Sequential convolutional neural
networks for slot filling in spoken language understanding.
arXiv.
[2005] Wang, Y.-Y.; Deng, L.; and Acero, A. 2005. Spoken
language understanding. IEEE Signal Processing Magazine.
[2013] Xu, P., and Sarikaya, R. 2013. Convolutional neural
network based triangular crf for joint intent detection and
slot filling. In ASRU.
[2017] Yan, Z.; Duan, N.; Chen, P.; Zhou, M.; Zhou, J.; and
Li, Z. 2017. Building task-oriented dialogue systems for
online shopping. In AAAI.
[2017] Yang, Z.; Salakhutdinov, R.; and Cohen, W. W. 2017.
Transfer learning for sequence tagging with hierarchical re-
current networks. arXiv.
[2013] Yao, K.; Zweig, G.; Hwang, M.-Y.; Shi, Y.; and Yu,
D. 2013. Recurrent neural networks for language under-
standing. In Interspeech.
[2014] Yao, K.; Peng, B.; Zhang, Y.; Yu, D.; Zweig, G.; and
Shi, Y. 2014. Spoken language understanding using long
short-term memory neural networks. In SLT Workshop.
[2017] Zhai, F.; Potdar, S.; Xiang, B.; and Zhou, B. 2017.
Neural models for sequence chunking. In AAAI.
[2016] Zhang, X., and Wang, H. 2016. A joint model of
intent determination and slot filling for spoken language un-
derstanding. In IJCAI.
[2017] Zhu, S., and Yu, K. 2017. Encoder-decoder with
focus-mechanism for sequence labelling based spoken lan-
guage understanding. In ICASSP.
[2017] Zhu, Y.; Li, H.; Liao, Y.; Wang, B.; Guan, Z.; Liu, H.;
and Cai, D. 2017. What to do next: Modeling user behaviors
by time-lstm. IJCAI.
[2018] Zhu, Y.; Zhu, J.; Hou, J.; Li, Y.; Wang, B.; Guan, Z.;
and Cai, D. 2018. A brand-level ranking system with the
customized attention-gru model. IJCAI.
|
1807.03586 | 5 | 1807 | 2019-05-30T09:41:11 | Difficulty Controllable Generation of Reading Comprehension Questions | [
"cs.CL",
"cs.AI"
] | We investigate the difficulty levels of questions in reading comprehension datasets such as SQuAD, and propose a new question generation setting, named Difficulty-controllable Question Generation (DQG). Taking as input a sentence in the reading comprehension paragraph and some of its text fragments (i.e., answers) that we want to ask questions about, a DQG method needs to generate questions each of which has a given text fragment as its answer, and meanwhile the generation is under the control of specified difficulty labels---the output questions should satisfy the specified difficulty as much as possible. To solve this task, we propose an end-to-end framework to generate questions of designated difficulty levels by exploring a few important intuitions. For evaluation, we prepared the first dataset of reading comprehension questions with difficulty labels. The results show that the question generated by our framework not only have better quality under the metrics like BLEU, but also comply with the specified difficulty labels. | cs.CL | cs | Difficulty Controllable Generation of Reading Comprehension Questions
Yifan Gao1∗ , Lidong Bing2 , Wang Chen1 , Michael R. Lyu1 and Irwin King1
1Department of Computer Science and Engineering,
The Chinese University of Hong Kong, Shatin, N.T., Hong Kong
2R&D Center Singapore, Machine Intelligence Technology, Alibaba DAMO Academy
1{yfgao,wchen,lyu,king}@cse.cuhk.edu.hk, [email protected]
9
1
0
2
y
a
M
0
3
]
L
C
.
s
c
[
5
v
6
8
5
3
0
.
7
0
8
1
:
v
i
X
r
a
Abstract
We investigate the difficulty levels of questions in
reading comprehension datasets such as SQuAD,
and propose a new question generation setting,
named Difficulty-controllable Question Generation
(DQG). Taking as input a sentence in the read-
ing comprehension paragraph and some of its text
fragments (i.e., answers) that we want to ask ques-
tions about, a DQG method needs to generate ques-
tions each of which has a given text fragment as
its answer, and meanwhile the generation is under
the control of specified difficulty labels -- the output
questions should satisfy the specified difficulty as
much as possible. To solve this task, we propose an
end-to-end framework to generate questions of des-
ignated difficulty levels by exploring a few impor-
tant intuitions. For evaluation, we prepared the first
dataset of reading comprehension questions with
difficulty labels. The results show that the question
generated by our framework not only have better
quality under the metrics like BLEU, but also com-
ply with the specified difficulty labels.
1 Introduction
Question Generation (QG) aims to generate natural and
human-like questions from a range of data sources, such as
image [Mostafazadeh et al., 2016], knowledge base [Serban
et al., 2016; Su et al., 2016], and free text [Du et al., 2017].
Besides for constructing SQuAD-like dataset [Rajpurkar et
al., 2016], QG is also helpful for the intelligent tutor system:
The instructor can actively ask the learner questions accord-
ing to reading comprehension materials [Heilman and Smith,
2010] or particular knowledge [Danon and Last, 2017]. In
this paper, we focus on QG for reading comprehension text.
For example, Figure 1 gives three questions from SQuAD,
our goal is to generate such questions.
QG for reading comprehension is a challenging task be-
cause the generation should not only follow the syntactic
structure of questions, but also ask questions to the point, i.e.,
∗This work was partially done when Yifan Gao was an intern
at Tencent AI Lab working with Lidong Bing, who was a full-time
researcher there.
Figure 1: Example questions from SQuAD. The answers of Q1 and
Q2 are facts described in the sentences, thus they are easy to answer.
But it is not straightforward to answer Q3
having a specified aspect as its answer. Some template-based
approaches [Vanderwende, 2007; Heilman and Smith, 2010]
were proposed initially, where well-designed rules and heavy
human labor are required for declarative-to-interrogative sen-
tence transformation. With the rise of data-driven learning
approach and sequence to sequence (seq2seq) framework,
some researchers formulated QG as a seq2seq problem [Du
et al., 2017]: The question is regarded as the decoding tar-
get from the encoded information of its corresponding input
sentence. However, different from existing seq2seq learning
tasks such as machine translation and summarization which
could be loosely regarded as learning a one-to-one mapping,
for question generation, different aspects of the given descrip-
tive sentence can be asked, and hence the generated ques-
tions could be significantly different. Several recent works
tried to tackle this problem by incorporating the answer in-
formation to indicate what to ask about, which helps the
models generate more accurate questions [Song et al., 2018;
Zhou et al., 2017]. In our work, we also focus on the answer-
aware QG problem, which assumes the answer is given. Sim-
ilar problems have been addressed in, e.g., [Zhao et al., 2018;
Sun et al., 2018].
In this paper, we investigate a new setting of QG, namely
Difficulty controllable Question Generation (DQG). In this
setting, given a sentence in the reading comprehension para-
graph, the text fragments (i.e., answers) that we want to ask
questions about, and the specified difficulty levels, a frame-
S2:It is a member of the chalcogengroup on the periodic table and is a highly reactive nonmetal and oxidizing agent that readily forms compounds (notably oxides) with most elements. Q2: (Easy) Of what group in the periodic table is oxygen a member?A2:chalcogenS3:The electric guitaris often emphasised, used with distortion and other effects, both as a rhythm instrument using repetitive riffs with a varying degree of complexity, and as a solo lead instrument. Q3: (Hard) What instrument is usually at the center of a hard rock sound?A3:Theelectric guitarS1:OxygenisachemicalelementwithsymbolOandatomicnumber8. Q1: (Easy) What is the atomicnumberoftheelementoxygen? A1:8work needs to generate questions that are asked about the
specified answers and satisfy the difficulty levels as much as
possible. For example, given the sentence S3 and the answer
"the electric guitar" in Figure 1, the system should be capable
of asking both a hard question like Q3 and an easy one such as
"What is often emphasised as a rhythm instrument?". DQG
has rich application scenarios. For instance, when instruc-
tors prepare learning materials for students, they may want
to balance the numbers of hard questions and easy questions.
Besides, the generated questions can be used to test how a
QA system works for questions with diverse difficulty levels.
Generating questions with designated difficulty levels is
a more challenging task. First, no existing large-scale QA
dataset has difficulty labels for questions to train a reliable
neural network model. Second, for a single sentence and an-
swer pair, we want to generate questions with diverse dif-
ficulty levels. However, the current datasets like SQuAD
only have one given question for each sentence and answer
pair. Finally, there is no metric to evaluate the difficulty
of questions. To overcome the first issue, we prepare a
dataset of reading comprehension questions with difficulty la-
bels. Specifically, we design a method to automatically label
SQuAD questions with multiple difficulty levels, and obtain
76K questions with difficulty labels.
To overcome the second issue, we propose a framework
that can learn to generate questions complying with the spec-
ified difficulty levels by exploring the following intuitions.
To answer a SQuAD question, one needs to locate a text frag-
ment in the input sentence as its answer. Thus, if a question
has more hints that can help locate the answer fragment, it
would be easier to answer. For the examples in Figure 1,
the hint "atomic number" in Q1 is very helpful, because, in
the corresponding sentence, it is just next to the answer "8",
while for Q3, the hint "instrument" is far from the answer
"The electric guitar". The second intuition is inspired by
the recent research on style-guided text generation, which in-
corporates a latent style representation (e.g., sentiment label
or review rating score) as an input of the generator [Shen et
al., 2017; Liao et al., 2018]. Similarly, performing difficulty
control can be regarded as a problem of sentence generation
towards a specified attribute or style. On top of the typical
seq2seq architecture, our framework has two tailor-made de-
signs to explore the above intuitions: (1) Position embeddings
are learned to capture the proximity hint of the answer in the
input sentence; (2) Global difficulty variables are learned to
control the overall "difficulty" of the questions. For the last
issue, we propose to employ the existing reading comprehen-
sion (RC) systems to evaluate the difficulty of generated ques-
tions. Intuitively, questions which cannot be answered by RC
systems are more difficult than these correctly answered ones.
In the quantitative evaluation, we compare our DQG model
with state-of-the-art models and ablation baselines. The re-
sults show that our model not only generates questions of bet-
ter quality under the metrics like BLEU and ROUGE, but also
has the capability of generating questions complying with the
specified difficulty labels. The manual evaluation finds that
the language quality of our generated questions is better, and
our model can indeed control the question difficulty.
2 Task Definition
In the DQG task, our goal is to generate SQuAD-like ques-
tions of diverse difficulty levels for a given sentence. Note
that the answers of SQuAD questions are text spans in the in-
put sentence, and they are significantly different from RACE
questions [Lai et al., 2017] such as "What do you learn from
the story?". Considering their different emphases, SQuAD
questions are more suitable for our task, while the difficulty
of RACE questions mostly comes from the understanding of
the story but not from the way how the question is asked.
Thereby, we assume that the answers for asking questions are
given, and they appear as text fragments in the input sentences
by following the paradigm of SQuAD.
We propose an end-to-end framework to handle DQG. For-
mally, let a denote the answer for asking question, let s de-
note the sentence containing a from a reading comprehension
paragraph. Given a, s, and a specified difficulty level d as in-
put, the DQG task is to generate a question q which has a
as its answer, and meanwhile should have d as its difficulty
level.
3 The Protocol of Difficulty Labeling
SQuAD [Rajpurkar et al., 2016] is a reading comprehension
dataset containing 100,000+ questions on Wikipedia articles.
The answer of each question is a text fragment from the cor-
responding input passage. We employ SQuAD questions to
prepare our experimental dataset.
The difficulty level is a subjective notion and can be ad-
dressed in many ways, e.g., syntax complexity, coreference
resolution and elaboration [Sugawara et al., 2017]. To avoid
the ambiguity of the "question difficulty" in this preliminary
study, we design the following automatic labeling protocol
and study the correlation between automatically labelled dif-
ficulty with human difficulty. We first define two difficulty
levels, Hard and Easy, in this preliminary dataset for the sake
of simplicity and practicality. We employ two RC systems,
namely R-Net [Wang et al., 2017] 1 and BiDAF [Seo et al.,
2017] 2, to automatically assess the difficulty of the questions.
The labeling protocol is: A question would be labelled with
Easy if both R-Net and BiDAF answer it correctly under the
exact match metric, and labelled with Hard if both systems
fail to answer it. The remaining questions are eliminated for
suppressing the ambiguity.
Note that we cannot directly employ the original data split
of SQuAD to train a model of R-Net or BiDAF, and use the
model to assess all questions. Such assessment is not appro-
priate, because models will overfit training questions and la-
bel them all as easy ones. To avoid this problem, we re-split
the original SQuAD questions into 9 splits and adopt a 9-fold
strategy. To label every single split (the current split), 7 splits
are used as the training data, and the last split is used as the
validation data. Then the trained model is used to assess the
difficulty of questions in the current split. This way guar-
antees that the model is never shown with the questions for
automatic labeling. Finally, we obtain 44,723 easy questions
and 31,332 hard questions.
1https://github.com/HKUST-KnowComp/R-Net
2https://github.com/allenai/bi-att-flow
Avg. distance of question words
Avg. distance of all sentence words
Easy
7.67
11.23
Hard
9.71
11.16
All
8.43
11.20
Table 1: Distance statistics for non-stop words
Table 1. In contrast, the average distance of all nonstop sen-
tence words to the answer is also given in the bottom line.
If we only count those nonstop question words, we find that
their distance to the answer fragment is much smaller than
the sentence words, namely 8.43 vs. 11.20. We call this
Question Word Proximity Hint (QWPH). More importantly,
the distance for hard questions is significantly larger than that
for easy questions, namely 9.71 vs. 7.67, which well verifies
our intuition that if a question has more obvious proximity
hints (i.e., containing more words that are near the answer
in the corresponding sentence), it would be easier to solve.
We model QWPH for easy questions and hard questions sep-
arately and call this Difficulty Level Proximity Hint (DLPH).
To implement the QWPH intuition, our model learns a
lookup table which maps the distance of each sentence word
to the answer fragment, i.e., 0 (for answer words), 1, 2,
etc., into a position embedding: (p0, p1, p2, ..., pL), where
pi ∈ Rdp and dp is the dimension. L is the maximum dis-
tance we consider. Different from QWPH that is difficulty
agnostic, the DLPH intuition additionally explores the infor-
mation of question difficulty levels. Therefore, we define two
L) for the Easy label, and
lookup tables: (pe
0, pe
L) for the Hard label. Note that the above
(ph
2 , ..., ph
position embeddings not only carry the information of sen-
tence word position, but also let our model know which as-
pect (i.e., answer) to ask with the embeddings of position 0.
4.2 Characteristic-rich Encoder
The characteristic-rich encoder incorporates several features
into a contextualized representation. For each sentence word
w, an embedding lookup table is firstly used to map tokens
in the sentence into dense vectors: (w1, w2, ..., wm), where
wi ∈ Rdw of dw dimensions. Then we concatenate its word
embedding and position embedding (proximity hints) to de-
rive a characteristic-rich embedding: x = [w; p]. We use
bidirectional LSTMs to encode the sequence (x1, x2, ..., xm)
to get a contextualized representation for each token:
2, ..., pe
0 , ph
1 , ph
1, pe
←−
h i =
←−−−−
LSTM(
←−
h i+1, xi),
−→
h i−1, xi),
−→
h i =
−→
h i and
−−−−→
LSTM(
←−
where
h i are the hidden states at the i-th time step of
the forward and the backward LSTMs. We concatenate them
together as hi = [
4.3 Difficulty-controllable Decoder
We use another LSTM as the decoder to generate the ques-
tion. We employ the difficulty label d to initialize the hidden
state of the decoder. During the decoding, we incorporate the
attention and copy mechanisms to enhance the performance.
Global Difficulty Control. We regard the generation of
difficulty-controllable questions as a problem of sentence
generation towards a specified style, i.e., easy or hard. To
−→
h i;
←−
h i].
Figure 2: Overview of our DQG framework (better viewed in color)
To verify the reasonability of our labeling protocol, we
evaluate its consistency with human being's judgment. We
sample 100 Easy questions and 100 Hard questions, and hire
3 annotators to rate the difficulty level of all these questions
on a 1-3 scale (3 for the most difficult). The result shows that
average difficulty rating for the Easy questions is 1.90 while
it is 2.52 for the Hard ones.
4 Framework Description
Given an input sentence s = (w1, w2, ..., wm), a text frag-
ment a in s, and a difficulty level d, our task is to gener-
ated a question q, which is asked with s as its background
information, takes a as its answer, and has d as its difficulty.
The architecture of our difficulty-controllable question gen-
erator is depicted in Figure 2. The encoder takes two types
of inputs, namely, the word embeddings and the relative posi-
tion embeddings (capturing the proximity hints) of sentence
words (including the answer words). Bidirectional LSTMs
are employed to encode the input into contextualized repre-
sentations. Besides two standard elements, namely attention
and copy, the decoder contains a special initialization to con-
trol the difficulty of the generated question. Specifically, we
map the difficulty label d into a global difficulty variable with
a lookup table, and combine the variable with the last hidden
state of the encoder to initialize the decoder.
4.1 Exploring Proximity Hints
Recall that our first intuition tells that the proximity hints are
helpful for answering the SQuAD-like questions. Before in-
troducing our design for implementing the intuition, we quan-
titatively verify it by showing some statistics. Specifically,
we examine the average distance of those nonstop question
words that also appear in the input sentence to the answer
fragment. For example, for Q1 in Figure 1 and its corre-
sponding input sentence "Oxygen is a chemical element with
symbol O and atomic number 8", we calculate the word-level
average distance of words "atomic", "number", "element",
and "oxygen" to the answer "8". The statistics are given in
⋯Context Vector⋮Final Distribution⋯proximityhints𝑤𝑖wordembvocabulary𝐰𝑖𝐩𝑖𝑒𝐡𝑖𝐡𝑚𝐮𝑡−1𝐜𝑡𝐮𝑡𝐰𝑡−1(1−𝑔𝑡)P𝑉+𝑔𝑡P𝐶𝐮0difficultyvariablediff leveld𝐝Global DifficultyControlEncoderDecoder⋯P(𝑤)𝐰𝑏𝑜𝑠LL-1…3210LL-1…3210𝐩𝑖𝑒𝐩𝑖ℎ# easy questions
# hard questions
Easy ratio
Test
Train
4,937
34,813
24,317
3,442
58.88% 58.19% 58.92%
Dev
4,973
3,573
Table 2: The statistics of our dataset
Ans
QWPH
QWPH-GDC
DLPH
DLPH-GDC
Easy Questions Set
R-Net
BiDAF
EM
82.16
82.66
84.35
85.49
85.82
F1
87.22
87.37
88.86
89.50
89.69
EM
75.43
76.10
77.23
78.35
79.09
F1
83.17
83.90
84.78
85.34
85.72
Hard Questions Set
R-Net
BiDAF
EM
34.15
33.35
31.60
28.05
26.71
F1
60.07
59.50
57.88
54.21
53.40
EM
29.36
28.40
26.68
24.89
24.47
F1
55.89
55.21
54.31
51.25
51.20
do so, we introduce a global difficulty variable to control the
generation. We follow the recent works for the task of style
transfer that apply the control variable globally, i.e., using
the style variable to initialize the decoder [Liao et al., 2018].
Specifically, for the specified difficulty level d, we first map it
to its corresponding difficulty variable d ∈ Rdd, where dd is
the dimension of a difficulty variable. Then we use the con-
catenation of d with the final hidden state hm of the encoder
to initialize the decoder hidden state u0 = [hm; d]. Note that
in the training stage, we feed the model the ground truth dif-
ficulty labels, while in the testing stage, our model can take
any specified difficulty labels, i.e., difficulty-controllable, for
question generation. We have also tried some variations by
adding this variable to other places such as every encoder or
decoder input in the model but it does not work.
Decoder with Attention & Copy.
The decoder predicts
the word probability distribution at each decoding timestep
to generate the question. At the t-th timestep, it reads the
word embedding wt and the hidden state ut−1 of the pre-
vious timestep to generate the current hidden state ut =
LSTM(ut−1, wt). Then the decoder employs the atten-
tion mechanism [Luong et al., 2015; Zhang et al., 2018;
Chen et al., 2019] and copy mechanism [See et al., 2017]
to generate the question by copying words in the sentence or
generating words from a predefined vocabulary.
5 Experiments
5.1 Experimental Settings
Dataset. Our prepared dataset is split according to articles
of the SQuAD data, and Table 2 provides the detailed statis-
tics. Across the training, validation and test sets, the splitting
ratio is around 7:1:1, and the easy sample ratio is around 58%
for all three.
Baselines and Ablation Tests. We only employ neural net-
work based methods as our baselines, since they perform bet-
ter than non-neural methods as shown in recent works [Du et
al., 2017; Zhou et al., 2017]. The first baseline models the
question generation as a seq2seq problem incorporating the
attention mechanism, and we refer to it as L2A [Du et al.,
2017]. The second baseline Ans adds answer indicator em-
bedding to the seq2seq model, similar to [Zhou et al., 2017;
Kumar et al., 2018]. Two ablations that only employ the ques-
tion word proximity hint or the difficulty level proximity hint
are referred to as QWPH and DLPH. Moreover, we exam-
ine the effectiveness of the global difficulty control (GDC)
combined with QWPH and DLPH, refer to them as QWPH-
GDC and DLPH-GDC. All these methods are enhanced by
the copy mechanism.
Model Details and Parameter Settings. The embedding
dimensions for the position embedding and the global diffi-
culty variable, i.e. dp and dd, are set to 50 and 10 respectively.
Table 3: Difficulty of the generated questions, measured with R-
Net and BiDAF. For easy questions, higher score indicates better
difficulty-control, while for hard questions, lower indicates better
Easy Questions Set
R-Net
BiDAF
EM
7.41
12.41
12.91
F1
5.72
9.51
9.95
EM
7.13
11.28
12.40
F1
5.88
8.49
9.23
Hard Questions Set
R-Net
BiDAF
EM
6.45
12.01
12.68
F1
5.47
10.45
10.76
EM
6.13
10.51
11.22
F1
5.10
9.37
9.97
QWPH-GDC
DLPH
DLPH-GDC
Table 4: The results of controlling difficulty, measured with R-Net
and BiDAF. The scores are performance gap between questions gen-
erated with original difficulty label and questions generated with re-
verse difficulty label
We use the maximum relative distance L = 20 in the position
embedding. We adopt teacher-forcing in the encoder-decoder
training and use the ground truth difficulty labels. In the test-
ing procedure, we select the model with the lowest perplexity
and beam search with size 3 is employed for question gener-
ation. All important hyper-parameters, such as dp and dd, are
selected on the validation dataset.
5.2 Difficulty Control Results
We run R-Net and BiDAF to assess the difficulty of our gen-
erated hard and easy questions. Here the R-Net and BiDAF
systems are trained using the same train/validation splits as
shown in Table 2, and we report their performance under the
standard reading comprehension measures for SQuAD ques-
tions, i.e., Exact Match (EM) and macro-averaged F1 score
(F1), on the easy and hard question sets respectively. For all
experiments, we firstly show the performance of difficulty-
controllable question generation by feeding ground truth dif-
ficulty labels, then we feed the reverse difficulty labels to
demonstrate our model can control the difficulty of generated
questions.
Recall that the generated questions can be split into an easy
set and a hard set according to the difficulty labels. Here
we evaluate the generated questions from the perspective that
a reading comprehension system (e.g., R-Net and BiDAF)
should perform better on the generated questions in the easy
set, and perform worse on the hard question set. If a pipeline
does not use the answer information, its generated questions
are likely not about the answers, thus both BiDAF and R-Net
cannot work well no matter for easy or hard questions. There-
fore, we do not use L2A here.
As shown in Table 3, for the easy set, the questions gener-
ated by the methods using the difficulty label "Easy" are eas-
ier to answer. Specifically, compared with Ans and QWPH
which cannot control the difficulty, QWPH-GDC, DLPH,
and DLPH-GDC generate easier questions, showing that they
have the capability of generating difficulty-controllable ques-
tions. One instant doubt is that a model can simply produce
Easy Question Set
R
F
0.74
2.91
2.94
0.76
D
2.02
1.84
Hard Question Set
R
F
0.58
2.87
2.87
0.64
D
2.12
2.26
Ans
DLPH-GDC
Table 5: Human evaluation results for generated questions.
Fluency(F) and Difficulty(D) take values from {1, 2, 3} (3
means the top fluency or difficulty), while Relevance(R) takes a
binary value, i.e., 1 or 0
trivial questions by having them contain the answer words.
In fact, our models do not have this behaviour, because it will
increase the training loss. To further verify this, we calculate
the occurrence rate of answer words in the generated ques-
tions. The result shows that only 0.09% answer words appear
in the questions generated by our models.
For the hard set, we can draw the same conclusion by keep-
ing in mind that a lower score indicates the corresponding
method performs better in generating difficulty-controllable
questions. (Note that questions irrelevant to the answer can
also yield lower scores, and we have more discussion about
this issue in Section 5.3 for the human evaluation.) This ob-
servation shows that incorporating the difficulty information
locally by the two position embeddings or globally by the
difficulty-controlled initialization indeed guides the genera-
tor to generate easier or harder questions. Comparing DLPH
and QWPH-GDC, we find that the local difficulty control by
the position embedding is more effective. DLPH-GDC per-
forms the best by combining the local and global difficulty
control signals.
Moreover, we find that QWPH achieves slightly better per-
formance than Ans baseline. A large performance gap be-
tween QWPH-GDC and QWPH again validates the effective-
ness of the global difficulty control. Meanwhile, the improve-
ment from QWPH to DLPH shows that the local difficulty
level proximity hint can stress the question difficulty at each
time step to perform better.
On the other hand, another way to validate our model is
testing whether our model can control the difficulty by feed-
ing the reversed difficulty labels. For example, for a question
in the easy set, if we feed the "Hard" label together with the
input sentence and answer of this question into our model,
we expect the generated question should be harder than feed-
ing the "Easy" label. Concretely, if a method has the better
capability in controlling the difficulty, on two sets of ques-
tions generated with this method by taking the true label and
the reversed label, the performance gap of a reading compre-
hension system should be larger. The results of this experi-
ment are given in Table 4. We only compare models which
have difficulty control capability. The model combining lo-
cal and global difficulty signals, i.e., DLPH-GDC, achieves
the largest gap, which again shows that: (1) DLPH-GDC has
the strongest capability of generating difficulty-controllable
questions; (2) The local difficulty control (i.e. DLPH) is more
effective than the global (i.e. QWPH-GDC).
5.3 Manual Evaluation
We hire 3 annotators to rate the model generated questions.
We randomly sampled 100 question with "Easy" labels and
100 with "Hard" labels from the test set, and let each an-
notator annotate these 200 cases. During the annotation,
each data point contains a sentence, an answer, and the ques-
tions generated by different models, without showing the dif-
ficulty labels. We consider three metrics: Fluency(F),
Difficulty(D) and Relevance(R). The annotators
are first asked to read the generated questions to evaluate their
grammatical correctness and fluency. Then, all annotators are
required to rate the difficulty of each generated question by
considering the corresponding sentence and answer. Finally,
for relevance, we ask the annotators to judge if the question is
asking about the answer. Fluency and Difficulty take
values from {1, 2, 3} (3 means the top fluency or difficulty),
while Relevance takes a binary value (1 or 0).
Table 5 shows the results of the manual evaluation. We
compare our best model DLPH-GDC with the Ans baseline.
We separate the Easy questions and Hard questions for
statistics. For both question sets, both models achieve high
scores on Fluency, owing to the strong language modeling
capability of neural models. For Difficulty, we can find
that DLPH-GDC can generate easier or harder questions than
Ans by feeding the true difficulty labels. Another observation
is that, for the Ans baseline, questions generated in the Easy
set are easier than those in the Hard set, which validates our
difficulty labelling protocol from another perspective. Note
that for human beings, all SQuAD-like questions are not re-
ally difficult, therefore, the difference of Difficulty val-
ues between the easy set and the hard set is not large.
Furthermore, we can observe our model can generate more
relevant questions compared with the Ans baseline. The rea-
son could be that our position embedding can not only tell
where the answer words are, but also indicate the distance of
the context words to the answer. Thus, it provides more in-
formation to the model for asking to the point questions. Ans
only differentiates the answer token and non-answer token,
and treats all non-answer tokens equally.
Recall that we had the concern regarding Table 3 that the
generated hard questions by our difficulty-controlling mod-
els say DLPH-GDC may simply be irrelevant to the answer,
which makes DLPH-GDC achieves lower EM/F1 scores than
the Ans baseline. By comparing the Relevance scores in
Table 5 and EM/F1 scores in Table 3 for Hard Question Set,
we find that the questions generated by DLPH-GDC are more
relevant (as shown in Table 5) and more difficult (as shown in
both Tables 3 and 5) than those generated by the Ans base-
line. This observation resolves our doubt on the irrelevance
issue and supports the conclusion that our DLPH-GDC does
generate more difficult and relevant questions which can fail
the two RC pipelines.
5.4 Automatic Evaluation of Question Quality
Here we evaluate the similarity of generated questions with
the ground truth. Since our dataset is not parallel (i.e., for a
sentence and answer pair, our dataset only has one question
with the "easy" or "hard" label), here we only evaluate the
question quality by feeding the ground truth difficulty labels.
We employ BLEU (B), METEOR (MET) and ROUGE-L (R-
L) scores by following [Du et al., 2017]. BLEU evaluates
the average N-gram precision on a set of reference sentences,
with a penalty for overly long sentences. ROUGE-L is com-
B3
B2
B1
B4 MET R-L
36.01 21.61 14.97 10.88 15.99 38.06
L2A
43.51 29.06 21.35 16.22 20.53 45.66
Ans
QWPH
43.75 29.28 21.61 16.46 20.70 46.02
QWPH-GDC 43.99 29.60 21.86 16.63 20.87 46.26
DLPH
44.11 29.64 21.89 16.68 20.94 46.22
DLPH-GDC 43.85 29.48 21.77 16.56 20.79 46.16
Table 6: Automatic evaluation for question quality
monly employed to evaluate the recall of the longest common
subsequences, with a penalty for short sentences.
Table 6 shows the quality of generated questions. Com-
paring the first three methods, we can find that the answer
and position information helps a lot for asking to the point
questions, i.e., more similar to the ground truth. Moreover,
QWPH performs better than Ans, indicating that further dis-
tinguishing the different distance of the non-answer words to
the answer provides richer information for the model to gen-
erate better questions. The results in the lower half show that,
given the ground truth difficulty labels, these three methods
with the capability of difficulty control are better than the first
three methods. These three models achieve comparable per-
formance, and DLPH-GDC sacrifices a little in N-gram based
performance here while achieving the best difficulty control
capability (refer to Tables 3 & 4).
5.5 Case Study
Figure 3 provides some examples of generated questions
(with answers marked in red). The number after the model
is the average distance of the overlapped nonstop words be-
tween the question and the input sentence to the answer frag-
ment. The average distance corresponds to the our intuition
proximity hints well. Compared with questions generated
by Ans baseline, our model can give more hints (shorter
distance) when asking easier questions and give less hints
(longer distance) when asking harder questions.
For the first example, we observe that the ground truth
question generated by Human is quite easy, just replacing
the answer "bodhi" with "what". Among the three systems,
Ans asks a question that is not about the answer. While both
DLPH-GDC and DLPH-GDC (reverse) are able to generate
to the point questions. Specifically, by taking the "Easy" la-
bel, DLPH-GDC tends to use more words from the input sen-
tence, while DLPH-GDC (reverse) uses less and its generated
question is relatively difficult. For the second example, we
find our system is also applicable to the question with "Hard"
label.
6 Related Work
In this section, we primarily review question generation (QG)
works on free text. Vanderwende [2007] proposed this task,
later on, several rule-based approaches were proposed. They
manually design some question templates and transform the
declarative sentences to interrogative questions [Mazidi and
Nielsen, 2014; Labutov et al., 2015; Lindberg et al., 2013;
Heilman and Smith, 2010]. These Rule-based approaches
need extensive human labor to design question templates,
Figure 3: Example questions (with answers marked in red). The
human question for Input 2 uses some information ("hard rock") in
preceding sentences which are not shown here
and usually can only ask annotators to evaluate the generated
questions.
Du et al. [2017] proposed the first automatic QG frame-
work. They view QG as a seq2seq learning problem to
learn the mapping between sentences and questions in read-
ing comprehension. Moreover, the procedure of QG from a
sentence is not a one-to-one mapping, because given a sen-
tence, different questions can be asked from different aspects.
As Du et al. [2017] mentioned, in their dataset, each sentence
corresponds to 1.4 questions on average. Seq2seq learning
may not perform well for learning such a one-to-many map-
ping. Some recent works attempt to solve this issue by assum-
ing the aspect has been already known when asking a question
[Zhou et al., 2017; Yuan et al., 2017] or can be detected with
a third-party pipeline [Du and Cardie, 2018]. This assump-
tion makes sense, because for humans to ask questions, we
usually first read the sentence to decide which aspect to ask.
In this paper, we explore another important dimension in QG,
i.e., generating questions with controllable difficulty, that has
never been studied before.
7 Conclusions
In this paper, we present a novel setting, namely difficulty-
controllable question generation for reading comprehension,
which to the best of our knowledge has never been studied
before. We propose an end-to-end approach to learn the ques-
tion generation with designated difficulty levels. We also pre-
pared the first dataset for this task, and extensive experiments
show that our framework can solve this task reasonably well.
One interesting future direction is to explore generating mul-
tiple questions for different aspects in one sentence [Gao et
al., 2019].
Acknowledgments
This work is supported by the Research Grants Council of
the Hong Kong Special Administrative Region, China (No.
CUHK 14208815 and No. CUHK 14210717 of the General
Research Fund). We thank Department of Computer Science
and Engineering, The Chinese University of Hong Kong for
the conference grant support. We would like to thank Jianan
Wang for her efforts in the preliminary investigation.
Input 1:prajñāis the wisdom that is able to extinguish afflictions and bring about bodhi. (Easy Question)Human: (4.5) prajnais the wisomthat is able to extinguish afflictions and bring about what ? Ans: (13.0) what is prajñā?DLPH-GDC: (6.2) prajñāis able to extinguish afflictions and bring about what ?DLPH-GDC(reverse): (7.3) what isprajñāable to bring ?Input 2:the electric guitar is often emphasised, used with distortion and other effects , both as a rhythm instrument using repetitive riffs with a varying degree of complexity , and as a solo lead instrument . (Hard Question)Human: (16.0) what instrument is usually at the center of a hard rock sound ?Ans: (5.5) what is often emphasisedwith distortion and other effects ?DLPH-GDC: (25.7) what is a solo lead instrument ?DLPH-GDC(reverse): (2.5) what is often emphasised?References
[Chen et al., 2019] Wang Chen, Yifan Gao, Jiani Zhang, Ir-
win King, and Michael R. Lyu. Title-guided encoding for
keyphrase generation. In AAAI, 2019.
[Danon and Last, 2017] Guy Danon and Mark Last. A
syntactic approach to domain-specific automatic question
generation. CoRR, abs/1712.09827, 2017.
[Du and Cardie, 2018] Xinya Du and Claire Cardie. Harvest-
ing paragraph-level question-answer pairs from wikipedia.
In ACL, 2018.
[Du et al., 2017] Xinya Du, Junru Shao, and Claire Cardie.
Learning to ask: Neural question generation for reading
comprehension. In ACL, 2017.
[Gao et al., 2019] Yifan Gao, Lidong Bing, Piji Li, Irwin
King, and Michael R. Lyu. Generating distractors for read-
ing comprehension questions from real examinations. In
AAAI, 2019.
[Heilman and Smith, 2010] Michael Heilman and Noah A.
Smith. Good question! statistical ranking for question
generation. In HLT-NAACL, 2010.
[Kumar et al., 2018] Vishwajeet Kumar, Kireeti Boorla, Yo-
gesh Meena, Ganesh Ramakrishnan, and Yuan-Fang Li.
Automating reading comprehension by generating ques-
tion and answer pairs. In PAKDD, 2018.
[Labutov et al., 2015] Igor Labutov, Sumit Basu, and Lucy
Vanderwende. Deep questions without deep understand-
ing. In ACL, 2015.
[Lai et al., 2017] Guokun Lai, Qizhe Xie, Hanxiao Liu,
Yiming Yang, and Eduard Hovy. Race: Large-scale
reading comprehension dataset from examinations. arXiv
preprint arXiv:1704.04683, 2017.
[Liao et al., 2018] Yi Liao, Lidong Bing, Piji Li, Shuming
Shi, Wai Lam, and Tong Zhang. Quase: Sequence editing
under quantifiable guidance. In EMNLP, 2018.
[Lindberg et al., 2013] David Lindberg, Fred Popowich,
John C. Nesbit, and Philip H. Winne. Generating natural
language questions to support learning on-line. In ENLG,
2013.
[Luong et al., 2015] Thang Luong, Hieu Pham, and Christo-
pher D. Manning. Effective approaches to attention-based
neural machine translation. In EMNLP, 2015.
[Mazidi and Nielsen, 2014] Karen Mazidi and Rodney D.
Nielsen. Linguistic considerations in automatic question
generation. In ACL, 2014.
[Mostafazadeh et al., 2016] Nasrin Mostafazadeh,
Ishan
Misra, Jacob Devlin, Margaret Mitchell, Xiaodong He,
and Lucy Vanderwende. Generating natural questions
about an image. In ACL, 2016.
[Rajpurkar et al., 2016] Pranav Rajpurkar, Jian Zhang, Kon-
stantin Lopyrev, and Percy S. Liang. Squad: 100, 000+
questions for machine comprehension of text. In EMNLP,
2016.
[See et al., 2017] Abigail See, Peter J. Liu, and Christo-
pher D. Manning. Get to the point: Summarization with
pointer-generator networks. In ACL, 2017.
[Seo et al., 2017] Min Joon Seo, Aniruddha Kembhavi, Ali
Farhadi, and Hannaneh Hajishirzi. Bidirectional attention
flow for machine comprehension. ICLR, 2017.
[Serban et al., 2016] Iulian Serban, Alberto Garc´ıa-Dur´an,
C¸ aglar Gulc¸ehre, Sungjin Ahn, A. P. Sarath Chandar,
Aaron C. Courville, and Yoshua Bengio. Generating fac-
toid questions with recurrent neural networks: The 30m
factoid question-answer corpus. In ACL, 2016.
[Shen et al., 2017] Tianxiao Shen, Tao Lei, Regina Barzilay,
and Tommi S. Jaakkola. Style transfer from non-parallel
text by cross-alignment. In NIPS, pages 6833 -- 6844, 2017.
[Song et al., 2018] Linfeng Song, Zhiguo Wang, Wael
Leveraging
In
Hamza, Yue Zhang, and Daniel Gildea.
context information for natural question generation.
NAACL-HLT, 2018.
[Su et al., 2016] Yu Su, Huan Sun, Brian Sadler, Mudhakar
Srivatsa, Izzeddin Gur, Zenghui Yan, and Xifeng Yan. On
generating characteristic-rich question sets for qa evalua-
tion. In EMNLP, 2016.
[Sugawara et al., 2017] Saku Sugawara, Yusuke Kido,
Hikaru Yokono, and Akiko Aizawa. Evaluation metrics
for machine reading comprehension: Prerequisite skills
and readability. In ACL, 2017.
[Sun et al., 2018] Xingwu Sun, Jing Liu, Yajuan Lyu, Wei
He, Yanjun Ma, and Shi Wang. Answer-focused and
In EMNLP,
position-aware neural question generation.
2018.
[Vanderwende, 2007] Lucy Vanderwende. Answering and
In AAAI Spring Sym-
questioning for machine reading.
posium: Machine Reading, 2007.
[Wang et al., 2017] Wenhui Wang, Nan Yang, Furu Wei,
Baobao Chang, and Ming Zhou. Gated self-matching net-
works for reading comprehension and question answering.
In ACL, 2017.
[Yuan et al., 2017] Xingdi Yuan, Tong Wang, C¸ aglar
Gulc¸ehre, Alessandro Sordoni, Philip Bachman, Sandeep
Subramanian, Saizheng Zhang, and Adam Trischler.
Machine comprehension by text-to-text neural question
generation. In Rep4NLP@ACL, 2017.
[Zhang et al., 2018] Jiani Zhang, Xingjian Shi, Junyuan Xie,
Hao Ma, Irwin King, and Dit-Yan Yeung. Gaan: Gated at-
tention networks for learning on large and spatiotemporal
graphs. In UAI, 2018.
[Zhao et al., 2018] Yao Zhao, Xiaochuan Ni, Yuanyuan
Ding, and Qifa Ke. Paragraph-level neural question gen-
eration with maxout pointer and gated self-attention net-
works. In ENNLP, 2018.
[Zhou et al., 2017] Qingyu Zhou, Nan Yang, Furu Wei,
Chuanqi Tan, Hangbo Bao, and Ming Zhou. Neural ques-
tion generation from text: A preliminary study. In NLPCC,
2017.
|
1803.04757 | 1 | 1803 | 2018-03-13T12:56:27 | Monitoring Targeted Hate in Online Environments | [
"cs.CL"
] | Hateful comments, swearwords and sometimes even death threats are becoming a reality for many people today in online environments. This is especially true for journalists, politicians, artists, and other public figures. This paper describes how hate directed towards individuals can be measured in online environments using a simple dictionary-based approach. We present a case study on Swedish politicians, and use examples from this study to discuss shortcomings of the proposed dictionary-based approach. We also outline possibilities for potential refinements of the proposed approach. | cs.CL | cs | Monitoring Targeted Hate in Online Environments
Tim Isbister1, Magnus Sahlgren1, Lisa Kaati1, Milan Obaidi2, Nazar Akrami2
1Swedish Defense Research Agency (FOI), 2Uppsala University
1164 90 Stockholm, Sweden, 2Box 256, 751 05 Uppsala, Sweden
{Tim.Isbister, Magnus.Sahlgren, Lisa.Kaati}@foi.se, {Milan.Obaidi, Nazar.Akrami}@psyk.uu.se
8
1
0
2
r
a
M
3
1
]
L
C
.
s
c
[
1
v
7
5
7
4
0
.
3
0
8
1
:
v
i
X
r
a
Hateful comments, swearwords and sometimes even death threats are becoming a reality for many people today in online environments.
This is especially true for journalists, politicians, artists, and other public figures. This paper describes how hate directed towards
individuals can be measured in online environments using a simple dictionary-based approach. We present a case study on Swedish
politicians, and use examples from this study to discuss shortcomings of the proposed dictionary-based approach. We also outline
possibilities for potential refinements of the proposed approach.
Abstract
1.
Introduction
Digital environments provide an enormously large and ac-
cessible platform for people to express a broad range of be-
havior - perhaps even broader than what can be expressed
in real world environments, due to the lack of social ac-
countability in many digital environments. Hate and prej-
udice are examples of such behaviors that are overrepre-
sented in digital environments. Hate messages in particular
are quite common, and have increased significantly in re-
cent years. In fact, many, if not most, digital newspapers
have closed down the possibility to comment on articles
since the commentary fields have been overflowing with
hate messages and racist comments (Gardiner et al., 2016).
To many journalists, politicians, artists, and other public
figures, hate messages and threats have become a part of
daily life. A recent study on Swedish journalists showed
that almost 3 out of 4 journalists received threats and in-
sulting comments through emails and social media (Nils-
son, 2015).
Several attempts to automatically detect hate messages
in online environments have been made. For example,
Warner and Hirschberg (2012) use machine learning cou-
pled with template-based features to detect hate speech in
user-generated web content with promising results. Wester
et al. (2016) examine the effects of various types of linguis-
tic features for detecting threats of violence in a corpus of
YouTube comments, and find promising results even using
simple bag-of-words representations. On the other hand,
Ross et al. (2016) examine the reliability of annotations of
hate speech, and find that the annotator agreement is very
low, indicating that hate speech detection is a very challeng-
ing problem. The authors suggest that hate speech should
be seen as a continuous rather then as a binary problem, and
that detailed instructions for the annotators are needed to
improve the reliability of hate speech annotation. Waseem
and Hovy (2016) examine the effect of various types of
features on hate speech detection, and find that character
n-grams and gender information provide the best results.
Davidson et al. (2017) argues that lexical methods suffer
from low precision and aims to separate hate speech from
other instances of offensive language. Their results show
that while racist and homophobic content are classified as
hate speech, this is not the case for sexist content, which il-
lustrates the challenge in separating hate speech from other
instances of offensive language.
The apparent lack of consensus regarding the difficulty of
the hate speech detection problem suggests that the prob-
lem of hate speech detection deserves further study. This
paper contributes to the discussion in two ways. Firstly,
we provide a psychological perspective on the concept of
hate. Secondly, we present a study of the advantages and
disadvantages of using the arguably simplest possible ap-
proach to hate speech detection:
that of counting occur-
rences of keywords based on dictionaries of terms related
to hate speech. The main goal of this paper is to provide
a critical discussion about the possibility of monitoring tar-
geted hate in online environments.
This paper is outlined as follows. Section 2 discusses
the psychological aspects of hate and how hate messages
can have various level of severity. Section 3 presents
a dictionary-based approach to measure hate directed to-
wards individuals. Section 4 provides a case study where
we analyze hate speech targeted towards 23 Swedish politi-
cians on immigration-critical websites, and discuss chal-
lenges and directions for future work. Finally, Section 5
provides some concluding remarks.
2. On hate
In the psychological literature hate is thought to be a combi-
nation to two components: one cognitive and one emotional
(Sternberg and Sternberg, 2008). The cognitive component
can be threat perceptions caused for example by out-group
members, but it can also involve devaluation or a nega-
tive view of others. The emotional component on the other
hand involves emotions such as contempt, disgust, fear, and
anger that are generally evoked by the cognitive compo-
nent. Defined in this way, hates shares much with prejudice,
which is defined as negative evaluations or devaluations of
others based on their group membership. Like hate, prej-
udice is argued to be consisting of a cognitive component
(stereotypes about others), an emotional component (dis-
like of others) and a behavioral component (acting in ac-
cordance with the emotional and cognitive component (All-
port, 1954)). Hate, like prejudice, functions as the motiva-
tional force when people behave in harmful ways toward
others.
Category
Swearword
Anger
Naughtiness
General threat
Death threat
Sexism
Sample terms (ENG)
fuck, shit, gay
is crazy, idiot, enemy
clown, is an idiot, stupid
kidnap, be followed, hunt
should be killed, ruin, bomb
whore, bitch, should be raped
Sample terms (SWE)
fan, skit, bog
ar galen, idiot, fiende
clown, ar en idiot, knapp
kidnappa, bor forfoljas, jaga
borde dodas, utrota, bomba
hora, subban, borde valdtas
Normalized frequency per category
0.00137
0.00106
0.00076
0.00068
0.00031
0.00005
Table 1: Different categories of hate with representative terms and normalized frequency.
Hate is commonly directed toward individuals and groups
but it is also expressed toward other targets in the social
world. For example, it is common that hate is expressed to-
ward concepts (e.g. communism) or countries (e.g. USA).
It is important to note however that there is some disagree-
ment about not only the definition but also the behavioral
outcomes of hate. For example, while some see hate lead-
ing to behavioral tendencies such as withdrawal caused by
disgust or fear, others see hate as the manifestation of anger
or rage, which lead one to approach, or attack, the object of
hate (Edward et al., 2005).
Dealing with digital environments, the disagreement about
behavioral tendencies might seem less relevant. Specifi-
cally, withdrawal caused by disgust or fear in the real world
is not the same in digital environment where withdrawal
would not be necessary - or approach would not be a di-
rect threat to wellbeing. Acknowledging the disagreements
noted above, we aim to examine hate messages with vari-
ous level of severity varying between swearwords directed
to individuals to outright death threats.
3. Monitoring hate
This work focuses on detecting hate messages and expres-
sions directed towards individuals. The messages can have
various level of severity with respect to individual integrity
and individual differences in perception of threat. More
specifically, we examine six different categories: anger,
naughtiness, swearwords, general threats, and death threats.
While the two categories naughtiness and anger may over-
lap in some aspects, they were aimed to capture different
expressions and causes of hate speech, with naughtiness in-
dicating to the speaker's tendency to misbehave and gen-
erally express naughtiness toward others, and anger being
an emotional state triggered by something in the surround-
ing and leading to the expression of anger (and/or naugh-
tiness) towards a person. We also include sexism (degra-
dation of women), since it is commonly used for devalua-
tive purposes. Each category is represented by a dictionary
of terms, as exemplified in Table 1. Our study focuses on
Swedish data, but to ease understanding we have translated
some of the words to English. Note that the dictionaries
may contain both unigrams and multiword expressions.
The dictionaries are constructed in a manner similar to
Tulkens et al. (2016b; 2016a); human experts (psychologist
and computer scientist) manually study a large number of
posts from the text domain of interest (see further Section
4.1.) and record significant words and phrases. In order to
improve the recall of the dictionaries, a word embedding
is then used to suggest other relevant terms to the experts.
This is done by simply computing the 15 nearest neighbors
in the embedding space to each term in the dictionaries. For
each term suggestion, the expert has the choice to either in-
clude or reject the term suggestion. We note that it is also
possible to cast the term suggestion task as an active learn-
ing problem, in which a classifier is iteratively refined to
identify useful term suggestions based on the expert's feed-
back (Gyllensten and Sahlgren, 2018).
As embedding, we use Gensim's ( Rehurek and Sojka,
2010) implementation of the Continuous Bag of Words
(CBOW) model (Mikolov et al., 2013), which builds word
vectors by training a 2-layer neural network to predict a
target word based on a set of context words. The network
learns two sets of vectors, one for the target terms (the em-
bedding vectors), and one for context terms. The objective
of the network is to learn vectors such that their dot product
correspond to the log likelihood of observing word pairs in
the training data. We use default parameters for the em-
beddings, with a window size set to 5. The embeddings
are trained on a collection of immigration-critical websites,
further discussed in Section 4.1.. Note that the embedding
method does not handle multiword units in any special way;
if multiword units are to be included in the analysis, they
need to be incorporated in the data as a preprocessing step.
The expanded dictionaries are used to detect and moni-
tor hate by simple frequency counting; if a term from one
of the dictionaries occurs in the vicinity of a mention of
a target individual, we increment the count for that cate-
gory. This is arguably the simplest possible approach to
hate speech monitoring, and many types of refinements are
possible, such as weighting of the dictionary entries (Eisen-
stein, 2017), handling of negation (Reitan et al., 2015), and
scope detection. We will return to a more detailed discus-
sion of problems with the proposed approach in Section
4.3.. At this point, we note that one possible advantage
of using such a simple approach is its transparency; it is
easy to understand a simple frequency counter for a non-
technical end user.
Of course, transparency and comprehensibility are useless
if the method generates an excessive amount of false posi-
tives. The only way for us to control the precision of the fre-
quency counting is to delimit the context within which oc-
currences of dictionary terms are counted; a narrow context
window spanning something like one to three words around
a target individual's name will reduce the probability that a
term from one of the dictionaries refers to something other
than the target name. In the following case study, we opt for
the most conservative approach and use a context of only
one term on each side of the target name.
Website
avpixlat.info
nordfront.se
nyatider.nu
motgift.nu
nordiskungdom.com
# comments
2 904 933
89 495
2 176
1 380
117
# words
99 472 281
3 125 218
124 949
68 992
6 530
Table 2: The websites included in our study.
4. Case study
To exemplify the dictionary-based approach, we have ex-
amined the expression of the different categories of hate
toward 23 national-level politicians (10 males and 13 fe-
males). Studying national-level politicians in Sweden is
timely as we are approaching the Swedish parliament elec-
tion in September 2018. There have also been recent alarms
on politicians threatening to leave politics because of an in-
creasing amount of hate being expressed in recent years.
Our analyses are based on text from commentary fields on
immigration critical websites from September 2014 to De-
cember 2017. The time period was chosen to cover a single
electoral period in the Swedish parliament.
As target names, we use the full names of the politicians.
This is obviously a crude simplification that severely af-
fects the recall of the approach, since people are often re-
ferred to using only their first name, a pronoun, or, in the
data we studied, some negative nickname or slur. As an ex-
ample, the Swedish prime minister, Stefan Lofven, is often
referred to in online discussions as "svetsarn" (the welder),
or using negative nicknames such as "Rofven", which is a
paraphrase of "roven" (in English "the ass").
4.1. Data
In Sweden, as well as in several other European coun-
tries, there has been a recent surge in activity and forma-
tion of movements that are critical of immigration. These
immigration-critical groups show a high interactivity on so-
cial media and on websites. In Sweden, there are several
digital immigration-critical milieus with a similar structure:
articles published by editorial staff and user-generated com-
ments. The commentary fields are not moderated, which
makes the comments an important scene to express hate to-
ward journalists, politicians, artists, and other public fig-
ures. The comment section allows readers to respond to
an editorial article instantly. The editorial articles gener-
ally focuses on topics such as crimes, migration, politics
and societal issues. The websites that we have studied are
listed in Table 2. For each website, we have downloaded all
comments between 2014/09/01 to 2017/10/01. Note that
the embeddings used for term suggestions are also trained
on this data.
4.2. Results
Table 3 shows the how many times each minister is men-
tioned in the comments with his or hers full name dur-
ing the given time period. Obviously, the Prime Minister
Stefan Lofven is the most frequently mentioned politician,
with more than 10,000 mentions during the analyzed pe-
riod. The second most mentioned politician in the studies
Name
Stefan Lofven
Morgan Johansson
Margot Wallstrom
Magdalena Andersson
Ylva Johansson
Gustav Fridolin
Alice Bah Kuhnke
Peter Eriksson
Peter Hultqvist
Isabella Lovin
Mikael Damberg
Ardalan Shekarabi
Asa Regn´er
Ann Linde
Annika Strandhall
Ibrahim Baylan
Per Bolund
Anna Ekstrom
Hel´ene Fritzon
Helene Hellmark Knutsson
Karolina Skog
Sven-Erik Bucht
Mentions
10 663
3 142
2 681
1 931
1 524
1 113
567
248
228
184
169
158
136
128
98
61
48
36
36
14
11
8
Table 3: Number of times each Swedish minister is men-
tioned in the comments during the time period.
data is Morgan Johansson, the Swedish Minister of Justice
and Home Affairs, and the third most mentioned minister is
Margot Wallstrom, Minister for Foreign Affairs.
Figure 1 (next page) shows the amount of hate towards the
Swedish ministers. The left figure shows simple frequency
counts of hate terms in the immediate vicinity of each tar-
get name, while the right figure shows the proportions of
targeted hate toward the Swedish ministers, calculated as
the frequency of each hate category in the context of each
politician, divided by the total number of mentions for that
politician. In both figures, it is obvious that naughtiness (in
purple) is the most frequent category for the politicians as a
group, followed by anger (in red), swearwords (in yellow)
and general threat (in gray). We do not see any sexism and
no explicit death threats in our data, most likely due to the
very narrow context used in these experiments.
Figure 1 shows that the most frequently mentioned minis-
ters are also those who receive the most hate in the data
we have studied. However, when looking at the propor-
tions of hateful comments for each minister, we see that
the most mentioned politician (Stefan Lofven) is not the
minister with the proportionally most hateful comments.
This is instead Mikael Damberg, the Minister for Enterprise
and Innovation. However, Damberg is only mentioned 169
times in the data, and a mere 1.18% of these contain hate;
that is, only 2 mentions of 169. It is a similar situation with
Ann Linde, the Minister for EU Affairs and Trade, who has
the proportionally most general threats in her mentions, but
this is based on only 1 mention out of 128. Isabella Lovin,
the Minister for International Development Cooperation, is
the target of the proportionally most naughtiness, but also
in this case, this is only 1 mention out of 184.
Figure 1: Amount of hate contexts for Swedish ministers (using only the preceding and succeeding terms). The left figure
shows simple frequency counts of hate terms, while the right figure shows proportions (i.e. counts divided by the total
number of mentions).
4.3. Discussion
The results in Figure 1 demonstrate that even with such a
simple and naıve method as the one used in this paper, it
is possible to do a general and rudimentary form of threat
assessment based on mentions in social media data. The
method is sufficiently simple to be adaptable to many dif-
ferent scenarios, and sufficiently transparent for end-users
to understand. However, we do pay a price for the simplic-
ity.
As we noted in the last section, expressions of hate seem to
correlate with frequency of mention (at least in the data we
have studied). This makes the left part of Figure 1 less inter-
esting. On the other hand, counting proportions, as we do in
the right part of the figure, risks overestimating the signifi-
cance of very rare events. A perhaps more useful measure
might be to calculate deviations from the expected amount
of hateful comments for each minister. As an example,
Morgan Johansson is mentioned 3 142 by his full name in
our data. Based on the normalized category frequencies in
Table 3, we should expect that 4 of these mentions contain
swearwords, 3 contain anger, 2 contain naughtiness, and
2 contain general threat. Looking at the actual frequency
counts, we see that 3 mentions contain swearwords, 8 con-
tain anger, 14 contain naughtiness, and 5 contain general
threat. For the last three categories, the actual counts are
much higher than would be expected, indicating that these
are significant measurements.
Table 4 (next page) shows the deviations from expected
counts per category for each minister. The deviation is com-
puted as the actual counts minus the expected counts:
(cid:18) #(c)
T
(cid:19)
#(m, c) −
· #(m)
(1)
This is a obviously a severely oversimplified probabilistic
model, but it does provide useful information. We note that
the columns for death threats and sexism only contain nega-
tive or zero values, which indicates that no significant death
threats or sexism is being expressed towards the ministers
in the data. Two ministers have higher general threats than
can be expected, and a few more have higher swearwords
and anger, but the deviations for these categories in our data
are not very large. The highest deviation in our study is
the naughtiness category for the prime minister, which in-
dicates that he is the subject of a significant amount of neg-
ative remarks in the data we have studied. Another poten-
tially interesting observandum is the combination of cate-
gories that have positive deviations for the different min-
isters. To take two examples, Morgan Johansson has pos-
itive deviations for anger, naughtiness and general threat,
while Ylva Johansson has positive deviations for swear-
words, anger and naughtiness. One might hypothesize that
the combination of anger and general threat deserves more
attention than the combination of swearwords and naughti-
ness.
The perhaps most obvious drawback of the approach used
in this paper is that it will only detect hate in direct rela-
tion to a full name, but not in relation to pronouns or slang
expressions referring to the person in question; i.e. the ap-
proach suffers from a lack of coreference resolution. This
will obviously affect the recall of the method, which is a
serious shortcoming that risks missing critical mentions. In
the present analysis, we have no idea whether the lack of
death threats in our results is due to an actual absence of
death threats in the data, or whether it is due to omissions
in the analysis.
where #(m, c) is the actual co-occurrence count of a min-
ister and a category, #(c)
is the relative frequency of a cat-
egory in the data #(c) is the frequency of the category and
T is the total number of words in the data), and #(m) is
the frequency of mention of a minister.
T
Although we delimit the context as much as possible to only
include the preceding and succeeding terms, our results are
still affected by false positives. There are three basic error
types for false positives in our analysis. One is negated
statements, such as (hate term in boldface):
Person
Stefan Lofven
Morgan Johansson
Margot Wallstrom
Magdalena Andersson
Ylva Johansson
Gustav Fridolin
Alice Bah Kuhnke
Peter Eriksson
Peter Hultqvist
Isabella Lovin
Mikael Damberg
Ardalan Shekarabi
Asa Regn´er
Ann Linde
Annika Strandhall
Ibrahim Baylan
Per Bolund
Anna Ekstrom
Hel´ene Fritzon
Helene Hellmark Knutsson
Karolina Skog
0.98
−1.16
1.5
−1.56
2.95
1.51
0.24
0.67
−0.29
−0.24
0.77
−0.21
−0.18
−0.17
−0.13
−0.08
−0.06
−0.05
−0.01
−0.02
−0.01
3.29
2.82
2.32
−1.96
1.43
−0.14
−0.58
0.74
−0.22
−0.18
0.83
−0.16
−0.14
−0.13
−0.1
−0.06
−0.05
−0.04
−0.01
−0.01
−0.01
16.49
2.77
3.12
0.63
1.9
2.2
−0.4
−0.18
−0.15
0.87
−0.12
−0.11
−0.1
−0.09
−0.07
−0.04
−0.03
−0.03
−0.01
−0.01
−0.01
−2.65
2.32
−1.41
−1.03
−0.83
−0.6
−0.3
−0.13
−0.12
−0.1
−0.09
−0.08
−0.07
0.93
−0.05
−0.03
−0.02
−0.02
−0.01
−0.01
−0.01
Swearword Anger Naughtiness General threat Death threat
−3.15
−0.93
−0.79
−0.57
−0.46
−0.33
−0.17
−0.08
−0.06
−0.05
−0.05
−0.05
−0.04
−0.04
−0.03
−0.02
−0.01
−0.01
0
0
0
Sexism
−0.46
−0.14
−0.12
−0.08
−0.07
−0.05
−0.02
−0.01
−0.01
−0.01
−0.01
−0.01
−0.01
−0.01
0
0
0
0
0
0
0
Table 4: Deviation from expected counts per category for each minister. Positive scores indicate that the actual count is
higher than the expected count.
jag tror inte Stefan Lovfen ar dum
(I don't think Stefan Lovfen is stupid)
Handling negations is a well-known issue in both informa-
tion retrieval and sentiment analysis, and one could think
of several different ways to deal with negations. The per-
haps most simple method is to use a skip or flip function
that skips a sequence of text when having encountered a
negation, or simply flips the sentiment of the negated text
(Choi and Cardie, 2009). It is of course also necessary to
determine the scope of the negation, which is a non-trivial
problem in itself (Lazib et al., 2016).
Another error type in our analysis is quotes, such as:
vi har varit naiva [sa] Stefan Lofven
(we have been naive [said] Stefan Lofven)
The "said" is implicit, and is signaled by quotation marks
and punctuation in the original data. However, when using
aggressive tokenization, such punctuation is normally re-
moved, which leads to the above type of errors. Retaining
punctuation would obviously be one way to prevent such
errors. Another possibility is to use a dependency parse of
the data, which would rearrange the context according to
the dependency structure. "Naive" would then be closer to
"we" than to "Stefan Lofven".
A third error type that is related to the previous one is mis-
interpreting (or ignoring) the semantic roles of the proposi-
tion. Consider the following examples:
lat regeringen med Stefan Lovfen hota
med nyval
(let the government with Stefan Lovfen threaten with new
election)
vi skiter i om du blir forbannad Stefan
Lovfen
(we don't care if you get upset Stefan Lovfen)
Stefan Lofven is not the target of hate in neither of these
cases. Instead, he (or in the first case, he and the Swedish
government) is the agent of the predicates "threatened"
vs. "upset". In order to resolve agency of the predicates,
we would need to do semantic role labeling, which assigns
a semantic role to each participant of a proposition. Iden-
tifying the agent of the predicate becomes even more im-
portant when increasing the context size, since it will also
increase the number of false positives when only counting
occurrences of hate terms.
5. Conclusion
In this paper, we have aimed to measure how online hate is
directed toward national-level politicians in Sweden. This
is an important and timely endeavor because the expression
of online hate is becoming increasingly pervasive in online
forums, especially toward this specific group. The expres-
sion of hate has shown to have downstream consequences
not only for individuals who are targeted, but also for our
democratic society and core liberal values. Recent stud-
ies show that the frequent exposure to hate speeches does
not only lead to increased devaluation and prejudice (So-
ral et al., 2017), but may also increase dehumanization of
the targeted group (Fasoli et al., 2016). Dehumanization in
return makes the targeted groups or individuals seem less
than human, legitimizing and increasing the likelihood of
violence (Rai et al., 2017). Moreover, online hate does not
only play a significant role in shaping people's attitudes and
beliefs toward certain groups, but it also have far-reaching
consequences for societies in general, such as increasing
tendency to violating social norms and threatening demo-
cratic core values.
As we mentioned in the introduction, many digital newspa-
pers in Sweden and other countries have closed down the
possibility to comment on articles due to the degree of hate
expressed by some users. This is a clear example of how
online hate restricts and threatens one of the core values
of democracy. That is the freedom to express your views
and opinions. To prevent such harmful effects it is impor-
tant to monitor and measure how and toward whom hate is
expressed online.
The second aim of this study was to address some of the
gaps in the field. As noted in the introduction, the con-
temporary approaches to measuring online hate are marked
by the apparent lack of consensus regarding the difficulty
of the hate speech detection. The approach for monitor-
ing targeted hate that we have described in this work is a
simple yet powerful way to understand hate messages di-
rected toward individuals. The strength of this method lies
in its simplicity and transparency, and perhaps also for hav-
ing more conservative criteria that reduces the number of
false positives. We have also identified a number of ways
to improve the method, including the use of coreference
resolution, handling of negation, context refinement using
dependency parsing, and agency detection using seman-
tic role labeling.
The trade-off between complexity and performance, and
between recall and precision, are challenging dilemmas for
law enforcement and other end users of hate monitoring
tools. Acknowledging these dilemmas, future improve-
ments of hate monitoring should be directed toward the
optimal cut-off where usefulness for law enforcement can
meet ease of conduct when it comes to analyzing data.
6. References
Allport, G.
(1954). The Nature of Prejudice. Reading,
MA: Addison-Wesley.
Choi, Y. and Cardie, C. (2009). Adapting a polarity lexicon
using integer linear programming for domain-specific
In Proceedings of EMNLP,
sentiment classification.
EMNLP '09, pages 590–598, Stroudsburg, PA, USA.
Association for Computational Linguistics.
Davidson, T., Warmsley, D., Macy, M. W., and Weber,
I.
(2017). Automated hate speech detection and the
problem of offensive language. In Proceedings of the
Eleventh International Conference on Web and Social
Media, pages 512–515.
Edward, B., McCauley, C., and Rosin, P. (2005). From
plato to putnam: Four ways to think about hate. in the
psychology of hate. pages 3–36.
Eisenstein, J. (2017). Unsupervised learning for lexicon-
based classification. In Proceedings of the Thirty-First
AAAI Conference on Artificial Intelligence, pages 3188–
3194.
Fasoli, F., Paladino, M., Carnaghi, A., Jetten, J., Bastian,
B., and Bain, P. (2016). Not "just words": Exposure to
homophobic epithets leads to dehumanizing and physical
distancing from gay men. European Journal of Social
Psychology, 46:237–248.
Gardiner, B., Mansfield, M., Anderson, I., Holder, J.,
Louter, D., and Ulmanu, M. (2016). The web we want:
The dark side of guardian comments. The Guardian, 12,
April.
Gyllensten, A. C. and Sahlgren, M. (2018). Distributional
term set expansion. In Accepted for publication in the
Proceedings of LREC 2018.
Lazib, L., Zhao, Y., Qin, B., and Liu, T. (2016). Negation
scope detection with recurrent neural networks models
in review texts. In Wanxiang Che, et al., editors, Social
Computing, pages 494–508, Singapore. Springer Singa-
pore.
Mikolov, T., Sutskever, I., Chen, K., Corrado, G. S., and
Dean, J. (2013). Distributed representations of words
and phrases and their compositionality. In Proceedings
of NIPS, pages 3111–3119.
Nilsson, M. L. (2015). Hot och hat mot svenska journalis-
ter. Nordicom-information, 37(3-4):31–56.
Rai, T., Valdesolo, P., and Graham, J. (2017). Dehuman-
ization increases instrumental violence, but not moral vi-
olence. Pnas, 114(32):8511–8516.
Rehurek, R. and Sojka, P. (2010). Software Framework for
Topic Modelling with Large Corpora. In Proceedings of
the LREC 2010 Workshop on New Challenges for NLP
Frameworks, pages 45–50, Valletta, Malta, May. ELRA.
Reitan, J., Faret, J., Gamback, B., and Bungum, L. (2015).
Negation scope detection for twitter sentiment analysis.
In Proceedings of the 6th Workshop on Computational
Approaches to Subjectivity, Sentiment and Social Media
Analysis, pages 99–108, Lisboa, Portugal, September.
Ross, B., Rist, M., Carbonell, G., Cabrera, B., Kurowsky,
N., and Wojatzki, M. (2016). Measuring the reliabil-
ity of hate speech annotations: The case of the euro-
pean refugee crisis. In Proceedings of NLP4CMC III.
Bochumer Linguistische Arbeitsberichte.
Soral, W., Bilewicz, M., and Winiewski, M. (2017). Expo-
sure to hate speech increases prejudice through desensi-
tization. Aggressive Behaviour.
Sternberg, R. and Sternberg, K. (2008). The nature of hate.
New York: Cambridge University Press.
Tulkens, S., Hilte, L., Lodewyckx, E., Verhoeven, B., and
(2016a). The automated detection of
Daelemans, W.
racist discourse in dutch social media. Computational
Linguistics in the Netherlands Journal, 6:3–20, 12/2016.
Tulkens, S., Hilte, L., Lodewyckx, E., Verhoeven, B., and
Daelemans, W. (2016b). A dictionary-based approach
to racism detection in dutch social media. In First Work-
shop on Text Analytics for Cybersecurity and Online
Safety (TA-COS 2016).
Warner, W. and Hirschberg, J.
(2012). Detecting hate
speech on the world wide web. In Proceedings of the
Second Workshop on Language in Social Media, LSM
'12, pages 19–26, Stroudsburg, PA, USA. Association
for Computational Linguistics.
Waseem, Z. and Hovy, D. (2016). Hateful symbols or hate-
ful people? predictive features for hate speech detection
on twitter. In Proceedings of the Student Research Work-
shop, SRW@HLT-NAACL 2016, pages 88–93.
Wester, A., Øvrelid, L., Velldal, E., and Hammer, H. L.
(2016). Threat detection in online discussions. In Pro-
ceedings of the 7th Workshop on Computational Ap-
proaches to Subjectivity, Sentiment & Social Media
Analysis, pages 66–71, San Diego, USA.
|
1505.00161 | 1 | 1505 | 2015-05-01T11:43:34 | Embedding Semantic Relations into Word Representations | [
"cs.CL"
] | Learning representations for semantic relations is important for various tasks such as analogy detection, relational search, and relation classification. Although there have been several proposals for learning representations for individual words, learning word representations that explicitly capture the semantic relations between words remains under developed. We propose an unsupervised method for learning vector representations for words such that the learnt representations are sensitive to the semantic relations that exist between two words. First, we extract lexical patterns from the co-occurrence contexts of two words in a corpus to represent the semantic relations that exist between those two words. Second, we represent a lexical pattern as the weighted sum of the representations of the words that co-occur with that lexical pattern. Third, we train a binary classifier to detect relationally similar vs. non-similar lexical pattern pairs. The proposed method is unsupervised in the sense that the lexical pattern pairs we use as train data are automatically sampled from a corpus, without requiring any manual intervention. Our proposed method statistically significantly outperforms the current state-of-the-art word representations on three benchmark datasets for proportional analogy detection, demonstrating its ability to accurately capture the semantic relations among words. | cs.CL | cs | Embedding Semantic Relations into Word Representations
Danushka Bollegala Takanori Maehara Ken-ichi Kawarabayashi
University of Liverpool Shizuoka University National Institute of Informatics
JST, ERATO, Kawarabayashi Large Graph Project.
5
1
0
2
y
a
M
1
]
L
C
.
s
c
[
1
v
1
6
1
0
0
.
5
0
5
1
:
v
i
X
r
a
Abstract
Learning representations for semantic relations is
important for various tasks such as analogy de-
tection, relational search, and relation classifica-
tion. Although there have been several proposals
for learning representations for individual words,
learning word representations that explicitly cap-
ture the semantic relations between words re-
mains under developed. We propose an unsuper-
vised method for learning vector representations
for words such that the learnt representations are
sensitive to the semantic relations that exist be-
tween two words. First, we extract lexical patterns
from the co-occurrence contexts of two words in a
corpus to represent the semantic relations that ex-
ist between those two words. Second, we represent
a lexical pattern as the weighted sum of the rep-
resentations of the words that co-occur with that
lexical pattern. Third, we train a binary classifier
to detect relationally similar vs. non-similar lexi-
cal pattern pairs. The proposed method is unsuper-
vised in the sense that the lexical pattern pairs we
use as train data are automatically sampled from a
corpus, without requiring any manual intervention.
Our proposed method statistically significantly out-
performs the current state-of-the-art word repre-
sentations on three benchmark datasets for propor-
tional analogy detection, demonstrating its ability
to accurately capture the semantic relations among
words.
1 Introduction
Representing the semantics of words and relations are funda-
mental tasks in Knowledge Representation (KR). Numerous
methods for learning distributed word representations have
been proposed in the NLP community [Turian et al., 2010;
Collobert et al., 2011; Mikolov et al., 2013b; Mikolov et al.,
2013a; Pennington et al., 2014]. Distributed word representa-
tions have shown to improve performance in a wide-range of
tasks such as, machine translation [Cho et al., 2014], seman-
tic similarity measurement [Mikolov et al., 2013d; Penning-
ton et al., 2014], and word sense disambiguation [Huang et
al., 2012].
Despite the impressive performance of representation
learning methods for individual words, existing methods use
only co-occurrences between words, ignoring the rich se-
mantic relational structure. The context in which two words
co-occur provides useful insights into the semantic relations
that exist between those two words. For example, the sen-
tence ostrich is a large bird not only provides the infor-
mation that ostrich and bird are co-occurring, but also de-
scribes how they are related via the lexical pattern X is a
large Y, where slot variables X and Y correspond to the
two words between which the relation holds. If we can
somehow embed the information about the semantic rela-
tions R that are associated with a particular word w into
the representation of w, then we can construct richer seman-
tic representation than the pure co-occurrence-based word
representations. Although the word representations learnt by
co-occurrence prediction methods [Mikolov et al., 2013d;
Pennington et al., 2014] have implicitly captured a certain
degree of relational structure, it remains unknown how to ex-
plicitly embed the information about semantic relations into
word representations.
We propose a method for learning word representations
that explicitly encode the information about the semantic re-
lations that exist between words. Given a large corpus, we
extract lexical patterns that correspond to numerous seman-
tic relations that exist between word-pairs (xi, xj). Next, we
represent each word xi in the vocabulary by a d-dimensional
vector xi ∈ Rd. Word representations can be initialized ei-
ther randomly or by using pre-trained word representations.
Next, we represent a pattern p by the weighted average of
the vector differences (xi − xj) corresponding to word-
pairs (xi, xj) that co-occur with p in the corpus. This en-
ables us to represent a pattern p by a d-dimensional vector
p ∈ Rd in the same embedding space as the words. Using
vector difference between word representations to represent
semantic relations is motivated by the observations in prior
work on word representation learning [Mikolov et al., 2013d;
Pennington et al., 2014] where, for example, the difference of
vectors representing king and queen has shown to be similar
to the difference of vectors representing man and woman.
We model the problem of embedding semantic relations
into word representations as an analogy prediction task
where, given two lexical patterns, we train a binary classifier
that predicts whether they are relationally similar. Our pro-
posed method is unsupervised in the sense that both positive
and negative training instances that we use for training are
automatically selected from a corpus, without requiring any
manual intervention. Specifically, pairs of lexical patterns that
co-occur with the same set of word-pairs are selected as pos-
itive training instances, whereas negative training instances
are randomly sampled from pairs of patterns with low rela-
tional similarities. Our proposed method alternates between
two steps (Algorithm 1). In the first step, we construct pat-
tern representations from current word representations. In the
second step, we predict whether a given pair of patterns is re-
lationally similar using the computed representations of pat-
terns in the previous step. We update the word representations
such that the prediction loss is minimized.
Direct evaluation of word representations is difficult be-
cause there is no agreed gold standard for semantic represen-
tation of words. Following prior work on representation learn-
ing, we evaluate the proposed method using the learnt word
representations in an analogy detection task. For example, de-
noting the word representation for a word w by v(w), the
vector v(king)− v(man) + v(woman) is required to be sim-
ilar to v(queen), than all the other words in the vocabulary.
Similarity between two vectors is computed by the cosine of
the angle between the corresponding vectors. The accuracy
obtained in the analogy detection task with a particular word
representation method is considered as a measure of its ac-
curacy. In our evaluations, we use three previously proposed
benchmark datasets for word analogy detection: SAT anal-
ogy dataset [Turney, 2005], Google analogy dataset [Mikolov
et al., 2013c], and SemEval analogy dataset [Jurgens et al.,
2012]. The word representations produced by our proposed
method statistically significantly outperform the current state-
of-the-art word representation learning methods on all three
benchmark datasets in an analogy detection task, demonstrat-
ing the accuracy of the proposed method for embedding se-
mantic relations in word representations.
2 Related Work
Representing words using vectors (or tensors in general) is
an essential task in text processing. For example, in distri-
butional semantics [Baroni and Lenci, 2010], a word x is
represented by a vector that contains other words that co-
occur with x in a corpus. Numerous methods for selecting co-
occurrence contexts (e.g. proximity-based windows, depen-
dency relations), and word association measures (e.g. point-
wise mutual information (PMI), log-likelihood ratio (LLR),
local mutual information (LLR)) have been proposed [Tur-
ney and Pantel, 2010]. Despite the successful applications of
co-occurrence counting-based distributional word representa-
tions, their high dimensionality and sparsity is often problem-
atic when applied in NLP tasks. Consequently, further post-
processing such as dimensionality reduction, and feature se-
lection is often required when using distributional word rep-
resentations.
On the other hand, distributed word representation learn-
ing methods model words as d-dimensional real vectors and
learn those vector representations by applying them to solve
an auxiliary task such as language modeling. The dimen-
sionality d is fixed for all the words in the vocabulary and,
unlike distributional word representations, is much smaller
(e.g. d ∈ [10, 1000] in practice) compared to the vocabulary
size. A pioneering work on word representation learning is
the neural network language model (NNLMs) [Bengio et al.,
2003], where word representations are learnt such that we can
accurately predict the next word in a sentence using the word
representations for the previous words. Using backpropaga-
tion, word vectors are updated such that the prediction error
is minimized.
Although NNLMs learn word representations as a by-
product, the main focus on language modeling is to predict
the next word in a sentence given the previous words, and
not on learning word representations that capture word se-
mantics. Moreover, training multi-layer neural networks with
large text corpora is often time consuming. To overcome
those limitations, methods that specifically focus on learn-
ing word representations that capture word semantics us-
ing large text corpora have been proposed. Instead of using
only the previous words in a sentence as in language mod-
eling, these methods use all the words in a contextual win-
dow for the prediction task [Collobert et al., 2011]. Meth-
ods that use one or no hidden layers are proposed to im-
prove the scalability of the learning algorithms. For exam-
ple, the skip-gram model [Mikolov et al., 2013c] predicts
the words c that appear in the local context of a word x,
whereas the continuous bag-of-words model (CBOW) pre-
dicts a word x conditioned on all the words c that appear in
x’s local context [Mikolov et al., 2013a]. However, meth-
ods that use global co-occurrences in the entire corpus to
learn word representations have shown to outperform meth-
ods that use only local co-occurrences [Huang et al., 2012;
Pennington et al., 2014]. Word representations learnt us-
ing above-mentioned representation learning methods have
shown superior performance over word representations con-
structed using the traditional counting-based methods [Baroni
et al., 2014].
Word representations can be further classified depending
on whether they are task-specific or task-independent. For ex-
ample, methods for learning word representations for specific
tasks such as sentiment classification [Socher et al., 2011],
and semantic composition [Hashimoto et al., 2014] have been
proposed. These methods use label data for the target task to
train supervised models, and learn word representations that
optimize the performance on this target task. Whether the
meaning of a word is task-specific or task-independent re-
mains an interesting open question. Our proposal can be seen
as a third alternative in the sense that we use task-independent
pre-trained word representations as the input, and embed the
knowledge related to the semantic relations into the word rep-
resentations. However, unlike the existing task-specific word
representation learning methods, we do not require manually
labeled data for the target task (i.e. analogy detection).
3 Learning Word Representations
The local context in which two words co-occur provides use-
ful information regarding the semantic relations that exist be-
tween those two words. For example, from the sentence Os-
trich is a large bird that primarily lives in Africa, we can
infer that the semantic relation IS-A-LARGE exists between
ostrich and bird. Prior work on relational similarity measure-
ment have successfully used such lexical patterns as features
to represent the semantic relations that exist between two
words [Duc et al., 2010; Duc et al., 2011]. According to the
relational duality hypothesis [Bollegala et al., 2010], a se-
mantic relation R can be expressed either extensionally by
enumerating word-pairs for which R holds, or intensionally
by stating lexico-syntactic patterns that define the properties
of R.
Following these prior work, we extract lexical patterns
from the co-occurring contexts of two words to represent the
semantic relations between those two words. Specifically, we
extract unigrams and bigrams of tokens as patterns from the
midfix (i.e. the sequence of tokens that appear in between
the given two words in a context) [Bollegala et al., 2007b;
Bollegala et al., 2007a]. Although we use lexical patterns as
features for representing semantic relations in this work, our
proposed method is not limited to lexical patterns, and can be
used in principle with any type of features that represent rela-
tions. The strength of association between a word pair (u, v)
and a pattern p is measured using the positive pointwise mu-
tual information (PPMI), f (p, u, v), which is defined as fol-
lows,
(cid:18) g(p, u, v)g(∗,∗,∗)
g(p,∗,∗)g(∗, u, v)
(cid:19)
f (p, u, v) = max(0, log
).
(1)
Here, g(p, u, v) denotes the number of co-occurrences be-
tween p and (u, v), and ∗ denotes the summation taken over
all words (or patterns) corresponding to the slot variable. We
represent a pattern p by the set R(p) of word-pairs (u, v) for
which f (p, u, v) > 0. Formally, we define R(p) and its norm
R(p) as follows,
We represent a word x using a vector x ∈ Rd. The dimen-
sionality of the representation, d, is a hyperparameter of the
proposed method. Prior work on word representation learn-
ing have observed that the difference between the vectors that
represent two words closely approximates the semantic re-
lations that exist between those two words. For example, the
vector v(king)−v(queen) has shown to be similar to the vec-
tor v(man) − v(woman). We use this property to represent a
pattern p by a vector p ∈ Rd as the weighted sum of dif-
ferences between the two words in all word-pairs (u, v) that
co-occur with p as follows,
p =
1
R(p)
(u,v)∈R(p)
f (p, u, v)(u − v).
(4)
(cid:88)
For example, consider Fig. 1, where the two word-pairs
(lion, cat), and (ostrich, bird) co-occur respectively with
the two lexical patterns, p1 = large Ys such as Xs, and
p2 = X is a huge Y. Assuming that there are no other co-
occurrences between word-pairs and patterns in the corpus,
R(p) = {(u, v)f (p, u, v) > 0}
R(p) =
f (p, u, v)
(cid:88)
(u,v)∈R(p)
(2)
(3)
Figure 1: Computing the similarity between two patterns.
the representations of the patterns p1 and p2 are given respec-
tively by p1 = x1 − x2, and p2 = x3 − x4. We measure the
relational similarity between (x1, x2) and (x3, x4) using the
inner-product p1(cid:62)p2.
We model the problem of learning word representations as
a binary classification task, where we learn representations
for words such that they can be used to accurately predict
whether a given pair of patterns are relationally similar. In
our previous example, we would learn representations for the
four words lion, cat, ostrich, and bird such that the similarity
between the two patterns large Ys such as Xs, and X is a huge
Y is maximized. Later in Section 3.1, we propose an unsuper-
vised method for selecting relationally similar (positive) and
dissimilar (negative) pairs of patterns as training instances to
train a binary classifier.
Let us denote the target label for two patterns p1, p2 by
t(p1, p2) ∈ {1, 0}, where the value 1 indicates that p1 and
p2 are relationally similar, and 0 otherwise. We compute the
prediction loss for a pair of patterns (p1, p2) as the squared
loss between the target and the predicted labels as follows,
L(t(p1, p2), p1, p2) =
(t(p1, p2) − σ(p1(cid:62)p2))
2
.
(5)
1
2
Different non-linear functions can be used as the prediction
function σ(·) such as the logistic-sigmoid, hyperbolic tan-
gent, or rectified linear units. In our preliminary experiments
we found hyperbolic tangent, tanh, given by
σ(θ) = tanh(θ) =
exp(θ) − exp(−θ)
exp(θ) + exp(−θ)
(6)
to work particularly well among those different non-
linearities.
To derive the update rule for word representations, let us
consider the derivative of the loss w.r.t. the word representa-
tion x of a word x,
∂L
∂x
∂p1
∂x
∂p2
∂x
(7)
+
∂L
∂p2
=
∂L
∂p1
,
where the partial derivative of the loss w.r.t. pattern represen-
x1x2p11x3x4p2lioncatostrichbirdlarge Ys such as XsX is a huge Yf(p1, x1, x2) (p1>p2)-f(p1, x1, x2)f(p2, x3, x4)-f(p2, x3, x4)tations are given by,
= σ
(cid:62)
(cid:48)
(p1
p2)(σ(p1
= σ
(cid:62)
(cid:48)
(p1
p2)(σ(p1
(cid:62)
p2) − t(p1, p2))p2,
p2) − t(p1, p2))p1.
(cid:62)
∂L
∂p1
∂L
∂p2
(8)
(9)
Here, σ(cid:48) denotes the first derivative of tanh, which is given
by 1− σ(θ)2. To simplify the notation we drop the arguments
of the loss function.
From Eq. 4 we get,
1
R(p1) (h(p1, u = x, v) − h(p1, u, v = x)) ,
R(p2) (h(p2, u = x, v) − h(p2, u, v = x)) ,
1
(10)
(11)
=
=
∂p1
∂x
∂p2
∂x
where,
h(p, u = x, v) =
and
h(p, u, v = x) =
(cid:88)
(cid:88)
(x,v)∈{(u,v)(u,v)∈R(p),u=x}
f (p, x, v),
f (p, u, x).
(u,x)∈{(u,v)(u,v)∈R(p),v=x}
Substituting the partial derivatives given by Eqs. 8-11 in
Eq. 7 we get,
∂L
∂x
= λ(p1, p2)[H(p1, x)
+H(p2, x)
(cid:88)
(cid:88)
(u,v)∈R(p2)
f (p2, u, v)(u − v)
f (p1, u, v)(u − v)],
where λ(p1, p2) is defined as
(u,v)∈R(p1)
λ(p1, p2) =
σ(cid:48)(p1
(cid:62)p2)(t(p1, p2) − σ(p1
R(p1)R(p2)
(cid:62)p2))
,
and H(p, x) is defined as
H(p, x) = h(p, u = x, v) − h(p, u, v = x).
(12)
(13)
(14)
1 , p(i)
1 , p(i)
2 )}N
2 , t(p(i)
We use stochastic gradient decent (SGD) with learning rate
adapted by AdaGrad [Duchi et al., 2011] to update the word
representations. The pseudo code for the proposed method is
shown in Algorithm 1. Given a set of N relationally similar
and dissimilar pattern-pairs, {(p(i)
i=1, Al-
gorithm 1 initializes each word xj in the vocabulary with a
vector xj ∈ Rd. The initialization can be conducted either
using randomly sampled vectors from a zero mean and unit
variance Gaussian distribution, or by pre-trained word rep-
resentations. In our preliminary experiments, we found that
the word vectors learnt by GloVe [Pennington et al., 2014]
to perform consistently well over random vectors when used
as the initial word representations in the proposed method.
Because word vectors trained using existing word representa-
tions already demonstrate a certain degree of relational struc-
ture with respect to proportional analogies, we believe that
initializing using pre-trained word vectors assists the subse-
quent optimization process.
Algorithm 1 Learning word representations.
Input: Training pattern-pairs {(p(i)
1 , p(i)
2 )}N
i=1,
dimensionality d of the word representations, and the
maximum number of iterations T .
Output: Representation xj ∈ Rd, of a word xj for j =
2 , t(p(i)
1 , p(i)
1, . . . , M, where M is the vocabulary size.
j=1.
(cid:80)
(u,v)∈R(pk) f (pk, u, v)(u − v)
R(pk)
pk = 1
for k = 1 to K do
end for
for i = 1 to N do
1: Initialize word vectors {xj}M
2: for t = 1 to T do
3:
4:
5:
6:
7:
8:
9:
10:
11: end for
12: return {xj}M
for j = 1 to M do
xj = xj − α(t)
end for
end for
∂L
∂xj
j=1.
j
During each iteration, Algorithm 1 alternates between two
steps. First, in Lines 3-5, it computes pattern representations
using Eq. 4 from the current word representations for all the
patterns (K in total) in the training dataset. Second, in Lines
6-10, for each train pattern-pair we compute the derivative of
the loss according to Eq. 12, and update the word represen-
tations. These two steps are repeated for T iterations, after
which the final set of word representations are returned.
The computational complexity of Algorithm 1 is Ø(T Kd+
T N M d), where d is the dimensionality of the word represen-
tations. Naively iterating over N training instances and M
words in the vocabulary can be prohibitively expensive for
large training datasets and vocabularies. However, in practice
we can efficiently compute the updates using two tricks: de-
layed updates and indexing. Once we have computed the pat-
tern representations for all K patterns in the first iteration, we
can postpone the update of a representation for a pattern until
that pattern next appears in a training instance. This reduces
the number of patterns that are updated in each iteration to
a maximum of 2 instead of K for the iterations t > 1. Be-
cause of the sparseness in co-occurrences, only a handful (ca.
100) of patterns co-occur with any given word-pair. There-
fore, by pre-compiling an index from a pattern to the words
with which that pattern co-occurs, we can limit the update
of word representations in Line 8 to a much smaller number
than M. Moreover, the vector subtraction can be parallized
across the dimensions. Although the loss function defined by
Eq. 5 is non-convex w.r.t. to word representations, in practice,
Algorithm 1 converges after a few (less than 5) iterations. In
practice, it requires less than an hour to train from a 2 bil-
lion word corpus where we have N = 100, 000, T = 10,
K = 10, 000 and M = 210, 914.
Lexical patterns contain sequences of multiple words.
Therefore, exact occurrences of lexical patterns are rare com-
pared to that of individual words even in large corpora. Di-
rectly learning representations for lexical patterns using their
co-occurrence statistics leads to data sparseness issues, which
becomes problematic when applying existing methods pro-
posed for learning representations for single words to learn
representations for lexical patterns that consist of multiple
words. The proposal made in Eq. 4 to compute representa-
tions for patterns circumvent this data sparseness issue by in-
directly modeling patterns through word representations.
3.1 Selecting Similar/Dissimilar Pattern-Pairs
We use the ukWaC corpus1 to extract relationally similar
(positive) and dissimilar (negative) pairs of patterns (pi, pj)
to train the proposed method. The ukWaC is a 2 billion word
corpus constructed from the Web limiting the crawl to the .uk
domain. We select word-pairs that co-occur at least in 50 sen-
tences within a co-occurrence window of 5 tokens. Moreover,
using a stop word list, we ignore word-pairs that purely con-
sists of stop words. We obtain 210, 914 word-pairs from this
step. Next, we extract lexical patterns for those word-pairs
by replacing the first and second word in a word-pair respec-
tively by slot variables X and Y in a co-occurrence window of
length 5 tokens to extract numerous lexical patterns. We select
the top occurring 10, 000 lexical patterns (i.e. K = 10, 000)
for further processing.
We represent a pattern p by a vector where the elements
correspond to the PPMI values f (p, u, v) between p and all
the word-pairs (u, v) that co-occur with p. Next, we com-
pute the cosine similarity between all pairwise combinations
of the 10, 000 patterns, and rank the pattern pairs in the de-
scending order of their cosine similarities. We select the top
ranked 50, 000 pattern-pairs as positive training instances. We
select 50, 000 pattern-pairs from the bottom of the list which
have non-zero similarity scores as negative training instances.
The reason for not selecting pattern-pairs with zero similar-
ity scores is that such patterns do not share any word-pairs in
common, and are not informative as training data for updat-
ing word representations. Thus, the total number of training
instances we select is N = 50, 000 + 50, 000 = 100, 000.
4 Evaluating Word Representations using
Proportional Analogies
To evaluate the ability of the proposed method to learn word
representations that embed information related to semantic
relations, we apply it to detect proportional analogies. For
example, consider the proportional analogy, man:woman ::
king:queen. Given, the first three words, a word represen-
tation learning method is required to find the fourth word
from the vocabulary that maximizes the relational similar-
ity between the two word-pairs in the analogy. Three bench-
mark datasets have been popularly used in prior work for
evaluating analogies: Google dataset [Mikolov et al., 2013c]
(10, 675 syntactic analogies and 8869 semantic analogies),
SemEval dataset [Jurgens et al., 2012] (79 questions), and
SAT dataset [Turney, 2006] (374 questions). For the Google
dataset, the set of candidates for the fourth word consists of
all the words in the vocabulary. For the SemEval and SAT
datasets, each question word-pair is assigned with a limited
number of candidate word-pairs out of which only one is cor-
rect. The accuracy of a word representation is evaluated by
1http://wacky.sslmit.unibo.it
Table 1: Word analogy results on benchmark datasets.
Method
ivLBL CosAdd
ivLBL CosMult
ivLBL PairDiff
skip-gram CosAdd
skip-gram CosMult
skip-gram PairDiff
CBOW CosAdd
CBOW CosMult
CBOW PairDiff
GloVe CosAdd
GloVe CosMult
GloVe PairDiff
Prop CosAdd
Prop CosMult
Prop PairDiff
sem.
63.60
65.20
52.60
31.89
33.98
7.20
39.75
38.97
5.76
86.67
86.84
45.93
86.70
86.91
41.85
synt.
61.80
63.00
48.50
67.67
69.62
19.73
70.11
70.39
13.43
82.81
84.80
41.23
85.35
87.04
42.86
total
62.60
64.00
50.30
51.43
53.45
14.05
56.33
56.13
9.95
84.56
85.72
43.36
85.97
86.98
42.40
SAT
20.85
19.78
22.45
29.67
28.87
35.29
29.41
28.34
33.16
27.00
25.66
44.65
29.41
28.87
45.99
SemEval
34.63
33.42
36.94
40.89
38.54
43.99
40.31
38.19
42.89
40.11
37.56
44.67
41.86
39.67
44.88
the percentage of the correctly answered analogy questions
out of all the questions in a dataset. We do not skip any ques-
tions in our evaluations.
Given a proportional analogy a : b :: c : d, we use the
following measures proposed in prior work for measuring the
relational similarity between (a, b) and (c, d).
CosAdd proposed by Mikolov et al. [2013d] ranks candi-
dates c according to the formula
CosAdd(a : b, c : d) = cos(b − a + c, d),
(15)
and selects the top-ranked candidate as the correct an-
swer.
CosMult: CosAdd measure can be decomposed into the
summation of three cosine similarities, where in practice
one of the three terms often dominates the sum. To over-
come this bias in CosAdd, Levy and Goldberg [2014]
proposed the CosMult measure given by,
cos(b, d) cos(c, d)
cos(a, d) +
CosMult(a : b, c : d) =
(16)
We convert all cosine values x ∈ [−1, 1] to positive val-
ues using the transformation (x+1)/2. Here, is a small
constant value to prevent denominator becoming zero,
and is set to 10−5 in the experiments.
.
PairDiff measures the cosine similarity between the two
vectors that correspond to the difference of the word
representations of the two words in each word-pair. It
follows from our hypothesis that the semantic relation
between two words can be represented by the vector dif-
ference of their word representations. PairDiff has been
used by Mikolov et al. [2013d] for detecting semantic
analogies and is given by,
PairDiff(a : b, c : d) = cos(b − a, d − c).
(17)
5 Experiments and Results
In Table 1, we compare the proposed method against pre-
viously proposed word representation learning methods:
ivLBL [Mnih and Kavukcuoglu, 2013], skip-gram [Mikolov
et al., 2013c], CBOW [Mikolov et al., 2013a], and
Figure 2: Accuracy on Google dataset when the proposed
method is trained using 10k and 100k instances.
GloVe [Pennington et al., 2014]. All methods compared in
Table 1 are trained on the same ukWaC corpus of 2B tokens
to produce 300 dimensional word vectors. We use the pub-
licly available implementations2,3 by the original authors for
training the word representations using the recommended pa-
rameter values. Therefore, any differences in performances
reported in Table 1 can be directly attributable to the differ-
ences in the respective word representation learning methods.
In all of our experiments, the proposed method converged
with less than 5 iterations.
From Table 1 we see that the proposed method (denoted by
Prop) achieves the best results for the semantic (sem), syn-
tactic (synt) and their union (total) analogy questions in the
Google dataset using CosMult measure. For analogy ques-
tions in SAT and SemEval datasets the best performance is
reported by the proposed method using the PairDiff measure.
The PairDiff measure computes the cosine similarity between
the two difference vectors b − a and d − c, ignoring the
spatial distances between the individual words as opposed to
CosAdd or CosMult. Recall that in the Google dataset we
are required to find analogies from a large open vocabulary
whereas in SAT and SemEval datasets the set of candidates
is limited to a closed pre-defined set. Relying on direction
alone, while ignoring spatial distance is problematic when
considering the entire vocabulary as candidates because, we
are likely to find candidates d that have the same relation
to c as reflected by a − b. For example, given the analogy
man:woman::king:?, we are likely to recover feminine en-
tities, but not necessarily royal ones using PairDiff. On the
other hand, in both SemEval and SAT datasets, the set of can-
didate answers already contains the related candidates, leav-
ing mainly the direction to be decided. For the remainder of
the experiments described in the paper, we use CosMult for
evaluations on the Google dataset, whereas PairDiff is used
for the SAT and SemEval datasets. Results reported in Table 1
reveal that according to the binomial exact test with 95% con-
2https://code.google.com/p/word2vec/
3http://nlp.stanford.edu/projects/glove/
Figure 3: Accuracy of the proposed method on benchmark
datasets for dimensionalities of the word representations.
fidence the proposed method statistically significantly outper-
forms GloVe, the current state-of-the-art word representation
learning method, on all three benchmark datasets.
To study the effect of the train dataset size on the perfor-
mance of the proposed method, following the procedure de-
scribed in Section 3.1, we sample two balanced datasets con-
taining respectively 10, 000 and 100, 000 instances. Figure 2
shows the performance reported by the proposed method on
the Google dataset. We see that the overall performance in-
creases with the dataset size, and the gain is more for syntac-
tic analogies. This result can be explained considering that se-
mantic relations are more rare compared to syntactic relations
in the ukWaC corpus, a generic web crawl, used in our exper-
iments. However, the proposed train data selection method
provides us with a potentially unlimited source of positive
and negative training instances which we can use to further
improve the performance.
To study the effect of the dimensionality d of the represen-
tation on the performance of the proposed method, we hold
the train data size fixed and produce word representations for
different dimensionalities. As shown in Figure 3, the perfor-
mance increases until around 600 dimensions on the Google,
and the SAT datasets after which it stabilizes. The perfor-
mance on the SemEval dataset remains relatively unaffected
by the dimensionality of the representation.
6 Conclusions
We proposed a method to learn word representations that
embeds information related to semantic relations between
words. A two step algorithm that alternates between pat-
tern and word representations was proposed. The proposed
method significantly outperforms the current state-of-the-art
word representation learning methods on three datasets con-
taining proportional analogies.
Semantic relations that can be encoded as attributes in
words are only a fraction of all types of semantic relations.
Whether we can accurately embed semantic relations that in-
volve multiple entities, or semantic relations that are only ex-
trinsically and implicitly represented remains unknown. We
semanticsyntactictotal82838485868788Accuracy10k100k1002003004005006007008009001000Dimensionality354045505560657075AccuracysemanticsyntactictotalSATSemEvalplan to explore these possibilities in our future work.
References
[Baroni and Lenci, 2010] Marco Baroni and Alessandro
Lenci. Distributional memory: A general framework
for corpus-based semantics. Computational Linguistics,
36(4):673 – 721, 2010.
[Baroni et al., 2014] Marco Baroni, Georgiana Dinu, and
Germ´an Kruszewski. Don’t count, predict! a systematic
comparison of context-counting vs. context-predicting se-
mantic vectors. In ACL’14, pages 238–247, 2014.
[Bengio et al., 2003] Yoshua Bengio, R´ejean Ducharme,
Pascal Vincent, and Christian Jauvin. A neural proba-
bilistic language model. Journal of Machine Learning Re-
search, 3:1137 – 1155, 2003.
[Bollegala et al., 2007a] D. Bollegala, Y. Matsuo,
and
M. Ishizuka.
An integrated approach to measuring
semantic similarity between words using information
In Proceedings of NAACL HLT,
available on the web.
pages 340–347, 2007.
[Bollegala et al., 2007b] Danushka Bollegala, Yutaka Mat-
suo, and Mitsuru Ishizuka. Websim: A web-based seman-
tic similarity measure. In Proc. of 21st Annual Conference
of the Japanese Society of Artitificial Intelligence, pages
757 – 766, 2007.
[Bollegala et al., 2010] Danushka Bollegala, Yutaka Matsuo,
and Mitsuru Ishizuka. Relational duality: Unsupervised
extraction of semantic relations between entities on the
web. In WWW 2010, pages 151 – 160, 2010.
[Cho et al., 2014] Kyunghyun Cho, Bart van Merrienboer,
Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Hol-
ger Schwenk, and Yoshua Bengio. Learning phrase rep-
resentations using rnn encoder–decoder for statistical ma-
chine translation. In EMNP’14, pages 1724–1734, 2014.
Jason Weston,
Leon Bottou, Michael Karlen, Koray Kavukcuoglu, and
Pavel Kuska. Natural language processing (almost) from
scratch. Journal of Machine Learning Research, 12:2493
– 2537, 2011.
[Collobert et al., 2011] Ronan Collobert,
[Duc et al., 2010] Nguyen Tuan Duc, Danushka Bollegala,
and Mitsuru Ishizuka. Using relational similarity between
word pairs for latent relational search on the web.
In
IEEE/WIC/ACM International Conference on Web Intelli-
gence and Intelligent Agent Technology, pages 196 – 199,
2010.
[Duc et al., 2011] Nguyen Tuan Duc, Danushka Bollegala,
and Mitsuru Ishizuka. Cross-language latent relational
In Proc.
search: Mapping knowledge across languages.
of the Twenty-Fifth AAAI Conference on Artificial Intelli-
gence, pages 1237 – 1242, 2011.
[Duchi et al., 2011] John Duchi, Elad Hazan, and Yoram
Singer. Adaptive subgradient methods for online learning
and stochastic optimization. Journal of Machine Learning
Research, 12:2121 – 2159, July 2011.
[Hashimoto et al., 2014] Kazuma Hashimoto, Pontus Stene-
torp, Makoto Miwa, and Yoshimasa Tsuruoka.
Jointly
learning word representations and composition functions
using predicate-argument structures. In EMNLP’14, pages
1544–1555, 2014.
[Huang et al., 2012] Eric H. Huang, Richard Socher,
Christopher D. Manning, and Andrew Y. Ng. Improving
word representations via global context and multiple word
prototypes. In ACL’12, pages 873 – 882, 2012.
[Jurgens et al., 2012] David A. Jurgens, Saif Mohammad,
Peter D. Turney, and Keith J. Holyoak. Measuring degrees
of relational similarity. In SemEval’12, 2012.
[Levy and Goldberg, 2014] Omer Levy and Yoav Goldberg.
Linguistic regularities in sparse and explicit word repre-
sentations. In CoNLL, 2014.
[Mikolov et al., 2013a] Tomas Mikolov, Kai Chen, and Jef-
frey Dean. Efficient estimation of word representation in
vector space. CoRR, 2013.
[Mikolov et al., 2013b] Tomas Mikolov, Quoc V. Le, and
Ilya Sutskever. Exploiting similarities among languages
for machine translation. arXiv, 2013.
[Mikolov et al., 2013c] Tomas Mikolov, Ilya Sutskever, Kai
Chen, Gregory S. Corrado, and Jeffrey Dean. Distributed
representations of words and phrases and their composi-
tionality. In NIPS, pages 3111 – 3119, 2013.
[Mikolov et al., 2013d] Tomas Mikolov, Wen tau Yih, and
Geoffrey Zweig. Linguistic regularities in continous space
In NAACL’13, pages 746 – 751,
word representations.
2013.
[Mnih and Kavukcuoglu, 2013] Andriy Mnih and Koray
Kavukcuoglu. Learning word embeddings efficiently with
noise-contrastive estimation. In NIPS, 2013.
[Pennington et al., 2014] Jeffery
Richard
Socher, and Christopher D. Manning. Glove: global
vectors for word representation. In EMNLP, 2014.
Pennington,
[Socher et al., 2011] Richard Socher, Jeffrey Pennington,
Eric H. Huang, Andrew Y. Ng, and Christopher D. Man-
ning. Semi-supervised recursive autoencoders for predict-
In EMNLP’11, pages 151–
ing sentiment distributions.
161, 2011.
[Turian et al., 2010] Joseph Turian, Lev Ratinov, and Yoshua
Bengio. Word representations: A simple and general
method for semi-supervised learning. In ACL, pages 384
– 394, 2010.
[Turney and Pantel, 2010] Peter D. Turney and Patrick Pan-
tel. From frequency to meaning: Vector space models of
Journal of Aritificial Intelligence Research,
semantics.
37:141 – 188, 2010.
[Turney, 2005] P.D. Turney. Measuring semantic similarity
by latent relational analysis. In Proc. of IJCAI’05, pages
1136–1141, 2005.
[Turney, 2006] P.D. Turney. Similarity of semantic relations.
Computational Linguistics, 32(3):379–416, 2006.
|
1612.02706 | 2 | 1612 | 2017-07-21T16:03:13 | Entity Identification as Multitasking | [
"cs.CL"
] | Standard approaches in entity identification hard-code boundary detection and type prediction into labels (e.g., John/B-PER Smith/I-PER) and then perform Viterbi. This has two disadvantages: 1. the runtime complexity grows quadratically in the number of types, and 2. there is no natural segment-level representation. In this paper, we propose a novel neural architecture that addresses these disadvantages. We frame the problem as multitasking, separating boundary detection and type prediction but optimizing them jointly. Despite its simplicity, this architecture performs competitively with fully structured models such as BiLSTM-CRFs while scaling linearly in the number of types. Furthermore, by construction, the model induces type-disambiguating embeddings of predicted mentions. | cs.CL | cs | Entity Identification as Multitasking∗
Karl Stratos
Toyota Technological Institute at Chicago
[email protected]
7
1
0
2
l
u
J
1
2
]
L
C
.
s
c
[
2
v
6
0
7
2
0
.
2
1
6
1
:
v
i
X
r
a
Abstract
Standard approaches in entity identifica-
tion hard-code boundary detection and
type prediction into labels and perform
Viterbi. This has two disadvantages: 1. the
runtime complexity grows quadratically in
the number of types, and 2. there is no nat-
ural segment-level representation. In this
paper, we propose a neural architecture
that addresses these disadvantages. We
frame the problem as multitasking, sep-
arating boundary detection and type pre-
diction but optimizing them jointly. De-
spite its simplicity, this architecture per-
forms competitively with fully structured
models such as BiLSTM-CRFs while scal-
ing linearly in the number of types. Fur-
thermore, by construction, the model in-
duces type-disambiguating embeddings of
predicted mentions.
in the number of types (assuming exact decoding
with first-order label dependency). We empha-
size that the asymptotic runtime remains quadratic
even if we heuristically prune previous labels
based on the BIO scheme. This is not an issue
when the number of types is small but quickly be-
comes problematic as the number grows. Second,
there is no segment-level prediction: every predic-
tion happens at the word-level. As a consequence,
models do not induce representations correspond-
ing to multi-word mentions, which can be useful
for downstream tasks such as named-entity disam-
biguation (NED).
In this paper, we propose a neural architecture
that addresses these disadvantages. Given a sen-
tence, the model uses bidirectional LSTMs (BiL-
STMs) to induce features and separately predicts:
1. Boundaries of mentions in the sentence.
2. Entity types of the boundaries.
1 Introduction
A popular convention in segmentation tasks such
as named-entity recognition (NER) and chunk-
ing is the so-called "BIO"-label scheme.
It
hard-codes boundary detection and type predic-
tion into labels using the indicators "B" (Begin-
ning), "I" (Inside), and "O" (Outside). For in-
stance, the sentence Where is John Smith
is tagged as Where/O is/O John/B-PER
Smith/I-PER. In this way, we can treat the
problem as sequence labeling and apply standard
structured models such as CRFs.
But this approach has certain disadvantages.
First, the runtime complexity grows quadratically
∗Part of the work was done while the author was at
Bloomberg L. P.
Crucially, during training, the errors of these two
predictions are minimized jointly.
One might suspect that the separation could de-
grade performance; neither prediction accounts
for the correlation between entity types. But we
find that this is not the case due to joint op-
timization.
In fact, our model performs com-
petitively with fully structured models such as
BiLSTM-CRFs (Lample et al., 2016),
implying
that the model is able to capture the entity cor-
relation indirectly by multitasking. On the other
hand, the model scales linearly in the number of
types and induces segment-level embeddings of
predicted mentions that are type-disambiguating
by construction.
2 Related Work
Our work is directly inspired by Lample et al.
(2016) who demonstrate that a simple neural
architecture based on BiLSTMs achieves state-
of-the-art performance on NER with no exter-
nal features. They propose two models. The
first makes structured prediction of NER labels
with a CRF loss (LSTM-CRF) using the conven-
tional BIO-label scheme. The second, which per-
forms slightly worse, uses a shift-reduce frame-
work mirroring tansition-based dependency pars-
ing (Yamada and Matsumoto, 2003). While the
latter also scales linearly in the number of types
and produces embeddings of predicted mentions,
our approach is quite different. We frame the
problem as multitasking and do not need the
stack/buffer data structure. Semi-Markov models
(Kong et al., 2015; Sarawagi et al., 2004) explic-
itly incorporate the segment structure but are com-
putationally intensive (quadratic in the sentence
length).
Multitasking has been shown to be effective in
numerous previous works (Collobert et al., 2011;
Yang et al.,
2016; Kiperwasser and Goldberg,
2016). This is especially true with neural net-
works which greatly simplify joint optimization
across multiple objectives. Most of these works
consider multitasking across different problems.
In contrast, we decompose a single problem
(NER) into two natural subtasks and perform
them jointly. Particularly relevant in this regard is
the parsing model of Kiperwasser and Goldberg
(2016) which multitasks edge prediction and
classification.
LSTMs (Hochreiter and Schmidhuber, 1997),
and other variants of recurrent neural networks
such as GRUs (Chung et al., 2014), have re-
cently been wildly successful in various NLP tasks
(Lample et al., 2016; Kiperwasser and Goldberg,
2016; Chung et al., 2014). Since there are many
detailed descriptions of LSTMs available, we omit
a precise definition. For our purposes, it is suffi-
cient to treat an LSTM as a mapping φ : Rd ×
Rd′
that takes an input vector x and a state
vector h to output a new state vector h′ = φ(x, h).
→ Rd′
3 Model
Let C denote the set of character types, W the
set of word types, and E the set of entity types.
Let ⊕ denote the vector concatenation operation.
Our model first constructs a network over a sen-
tence closely following Lample et al. (2016); we
describe it here for completeness. The model pa-
rameters Θ associated with this base network are
• Character embedding ec ∈ R25 for c ∈ C
• Character LSTMs φC
f , φC
b : R25 × R25 → R25
• Word embedding ew ∈ R100 for w ∈ W
• Word LSTMs φW
f , φW
b
: R150×R100 → R100
Let w1 . . . wn ∈ W denote a word sequence where
word wi has character wi(j) ∈ C at position j.
First, the model computes a character-sensitive
word representation vi ∈ R150 as
j = φC
f C
bC
j = φC
vi = f C
f(cid:0)ewi(j), f C
j−1(cid:1)
b (cid:0)ewi(j), bC
j+1(cid:1)
wi ⊕ bC
1 ⊕ ewi
∀j = 1 . . . wi
∀j = wi . . . 1
for each i = 1 . . . n.1 Next, the model computes
f W
i = φW
bW
i = φW
f (cid:0)vi, f W
i−1(cid:1)
b (cid:0)vi, bW
i+1(cid:1)
∀i = 1 . . . n
∀i = n . . . 1
and induces a character- and context-sensitive
word representation hi ∈ R200 as
hi = f W
i ⊕ bW
i
(1)
for each i = 1 . . . n. These vectors are used to de-
fine the boundary detection loss and the type clas-
sification loss described below.
Boundary detection loss We frame boundary
detection as predicting BIO tags without types.
A natural approach is to optimize the condi-
tional probability of the correct tags y1 . . . yn ∈
{B, I, O}:
p(y1 . . .ynh1 . . . hn)
∝ exp n
Xi=1
Tyi−1,yi × gyi(hi)! (2)
where g : R200 → R3 is a function that ad-
justs the length of the LSTM output to the num-
ber of targets. We use a feedforward network
g(h) = W 2relu(W 1h + b1) + b2. We write Θ1
to refer to T ∈ R3×3 and the parameters in g. The
1For simplicity, we assume some random initial state vec-
tors such as f C
0 and bC
wi+1 when we describe LSTMs.
boundary detection loss is given by the negative
log likelihood:
L1 (Θ, Θ1) = −Xl
log p(cid:16)y(l)h(l)(cid:17)
where l iterates over tagged sentences in the data.
The global normalizer for (2) can be computed
using dynamic programming; see Collobert et al.
(2011). Note that
the runtime complexity of
boundary detection is constant despite dynamic
programming since the number of tags is fixed
(three).
Type classification loss Given a mention bound-
ary 1 ≤ s ≤ t ≤ n, we predict its type using
(1) as follows. We introduce an additional pair
: R200 × R200 → R200 and
of LSTMs φE
compute a corresponding mention representation
µ ∈ RE as
f , φE
b
CoNLL 2003 (4 types)
BiLSTM-CRF
Mention2Vec
OntoNotes (18 types)
BiLSTM-CRF
Mention2Vec
F1
90.22
90.90
F1
90.77
89.37
# words/sec
3889
4825
# words/sec
495
4949
Table 1: Test F1 scores on CoNLL 2003 and
OntoNotes newswire portion.
Model
McCallum and Li (2003)
Collobert et al. (2011)
Lample et al. (2016)–Greedy
Lample et al. (2016)–Stack
Lample et al. (2016)–CRF
Mention2Vec
F1
84.04
89.59
89.15
90.33
90.94
90.90
Table 2: Test F1 scores on CoNLL 2003.
f E
j = φE
bE
j = φE
f (cid:0)hj , f E
j−1(cid:1)
b (cid:0)hj , bE
j+1(cid:1)
s(cid:1)
t ⊕ bE
µ = q(cid:0)f E
∀j = s . . . t
∀j = t . . . s
is optimized to handle both tasks. During train-
ing, we use gold boundaries and types to optimize
L2 (Θ, Θ2). At test time, we predict boundaries
from the tagging layer (2) and classify them using
the classification layer (4).
(3)
where q : R400 → RE is again a feedforward
network that adjusts the vector length to E.2 We
write Θ2 to refer to the parameters in φE
b , q.
Now we can optimize the conditional probability
of the correct type τ :
f , φE
p(τ hs . . . ht) ∝ exp (µτ )
(4)
The type classification loss is given by the negative
log likelihood:
L2 (Θ, Θ2) = −Xl
log p(cid:16)τ (l)h(l)
s . . . h
(l)
t (cid:17)
where l iterates over typed mentions in the data.
Joint loss The final training objective is to min-
imize the sum of the boundary detection loss and
the type classification loss:
L(Θ, Θ1, Θ2) = L1 (Θ, Θ1) + L2 (Θ, Θ2)
(5)
In stochastic gradient descent (SGD), this amounts
to computing the tagging loss l1 and the classifi-
cation loss l2 (summed over all mentions) at each
annotated sentence, and then taking a gradient step
on l1 + l2. Observe that the base network Θ
2Clearly, one can consider different networks over the
boundary, for instance simple bag-of-words or convolutional
neural networks. We leave the exploration as future work.
4 Experiments
Data We use two NER datasets: CoNLL 2003
which has four entity types PER, LOC, ORG and
MISC (Tjong Kim Sang and De Meulder, 2003),
and the newswire portion of OntoNotes Release
5.0 which has 18 entity types (Weischedel et al.,
2013).
Implementation and baseline We denote our
model Mention2Vec and implement it using the
DyNet library.3 We use the same pre-trained
word embeddings in Lample et al. (2016). We use
the Adam optimizer (Kingma and Ba, 2014) and
apply dropout at all LSTM layers (Hinton et al.,
2012). We perform minimal tuning over develop-
ment data. Specifically, we perform a 5 × 5 grid
search over learning rates 0.0001 . . . 0.0005 and
dropout rates 0.1 . . . 0.5 and choose the configu-
ration that gives the best performance on the dev
set.
We also re-implement the BiLSTM-CRF model
of Lample et al. (2016); this is equivalent to opti-
mizing just L1(Θ, Θ1) but using typed BIO tags.
Lample et al. (2016) use different details in opti-
mization (SGD with gradient clipping), data pre-
processing (replacing every digit with a zero), and
3https://github.com/karlstratos/mention2vec
PER
LOC
ORG
WORK OF ART
GPE
ORG
In another letter dated January 1865, a well-to-do Washington matron wrote to Lincoln to plead for . . .
Chang and Washington were the only men's seeds in action on a day that saw two seeded women's . . .
"Just one of those things, I was just trying to make contact," said Bragg.
Washington's win was not comfortable, either.
Lauck, from Lincoln, Nebraska, yelled a tirade of abuse at the court after his conviction for inciting . . .
. . . warring factions, with the PUK aming to break through to KDP's headquarters in Saladhuddin.
. . . is not expected to travel to the West Bank before Monday," Nabil Abu Rdainah told Reuters.
. . . off a bus near his family home in the village of Donje Ljupce in the municipality of Podujevo.
English division three - Swansea v Lincoln.
SOCCER - OUT-OF-SORTS NEWCASTLE CRASH 2 1 AT HOME.
Moura, who appeared to have elbowed Cyprien in the final minutes of the 3 0 win by Neuchatel, was . . .
In Sofia: Leviski Sofia (Bulgaria) 1 Olimpija (Slovenia) 0
. . . Bond novels, and "Treasure Island," produced by Charlton Heston who also stars in the movie.
. . . probably started in 1962 with the publication of Rachel Carson's book "Silent Spring."
. . . Victoria Petrovich) spout philosophic bon mots with the self-concious rat-a-tat pacing of "Laugh In."
Dennis Farney's Oct. 13 page - one article "River of Despair," about the poverty along the . . .
. . . from a naval station at Treasure Island near the Bay Bridge to San Francisco to help fight fires.
. . . lived in an expensive home on Lido Isle, an island in Newport's harbor, according to investigators.
. . . Doris Moreno, 37, of Bell Gardens; and Ana L. Azucena, 27, of Huntington Park.
One group of middle-aged manufacturing men from the company's Zama plant outside Tokyo was . . .
. . . initiative will spur members of the General Agreement on Tariffs and Trade to reach . . .
. . . question of Taiwan's membership in the General Agreement on Tariffs and Trade should . . .
"He doesn't know himself," Kathy Stanwick of the Abortion Rights League says of . . .
. . . administrative costs, management and research, the Office of Technology Assessment just reported.
Table 3: Nearest neighbors of detected mentions in CoNLL 2003 and OntoNotes using (3).
the dropout scheme (droptout at BiLSTM input
(1)). As a result, our re-implementation is not di-
rectly comparable and obtains different (slightly
lower) results. But we emphasize that the main
goal of this paper is to demonstrate the utility the
proposed approach rather than obtaining a new
state-of-the-art result on NER.
McCallum and Li (2003) use CRFs with manually
crafted features; Collobert et al. (2011) use convo-
lutional neural networks; Lample et al. (2016) use
BiLSTMs in a greedy tagger (Greedy), a stack-
based model (Stack), and a global tagger using a
CRF output layer (CRF). Mention2Vec performs
competitively.
4.1 NER Performance
4.2 Mention Embeddings
Table 1 compares the NER performance and de-
coding speed between BiLSTM-CRF and Men-
tion2Vec. The F1 scores are obtained on test data.
The speed is measured by the average number of
words decoded per second.
On CoNLL 2003 in which the number of types
is small, our model achieves 90.50 compared to
90.22 of BiLSTM-CRF with minor speed im-
provement. This shows that despite the separation
between boundary detection and type classifica-
tion, we can achieve good performance through
joint optimization. On OntoNotes in which the
number of types is much larger, our model still
performs well with an F1 score of 89.37 but is
behind BiLSTM-CRF which achieves 90.77. We
suspect that this is due to strong correlation be-
tween mention types that fully structured models
can exploit more effectively. However, our model
is also an order of magnitude faster: 4949 com-
pared to 495 words/second.
Finally, Table 2 compares our model with
other works in the literature on CoNLL 2003.
Table 3 shows nearest neighbors of detected
mentions using the mention representations µ in
(3). Since µτ represents the score of type τ ,
the mention embeddings are clustered by en-
tity types by construction. The model induces
completely different representations even when
the mention has the same lexical form.
For
instance, based on its context Lincoln re-
ceives a person, location, or organization repre-
sentation; Treasure Island receives a book
or
The model also
learns representations for long multi-word expres-
sions such as the General Agreement on
Tariffs and Trade.
location representation.
5 Conclusion
We have presented a neural architecture for en-
tity identification that multitasks boundary detec-
tion and type classification. Joint optimization en-
ables the base BiLSTM network to capture the
correlation between entities indirectly via multi-
Andrew McCallum and Wei Li. 2003. Early results for
named entity recognition with conditional random
fields, feature induction and web-enhanced lexicons.
In Proceedings of the seventh conference on Natu-
ral language learning at HLT-NAACL 2003-Volume
4. Association for Computational Linguistics, pages
188–191.
Barbara Plank. 2016. Keystroke dynamics as signal for
shallow syntactic parsing. In Proceedings of COL-
ING.
Barbara Plank, Anders Søgaard, and Yoav Goldberg.
2016. Multilingual part-of-speech tagging with
bidirectional long short-term memory models and
auxiliary loss. In Proceedings of ACL.
Sunita Sarawagi, William W Cohen, et al. 2004. Semi-
markov conditional random fields for information
extraction. In NIPs. volume 17, pages 1185–1192.
Erik F Tjong Kim Sang and Fien De Meulder.
2003.
Introduction to the conll-2003 shared task:
Language-independent named entity recognition. In
Proceedings of the seventh conference on Natural
language learning at HLT-NAACL 2003-Volume 4.
Association for Computational Linguistics, pages
142–147.
Ralph Weischedel, Martha Palmer, Mitchell Marcus,
Eduard Hovy, Sameer Pradhan, Lance Ramshaw,
Nianwen Xue, Ann Taylor, Jeff Kaufman, Michelle
Franchini, et al. 2013.
Ontonotes release 5.0
ldc2013t19. Linguistic Data Consortium, Philadel-
phia, PA .
Hiroyasu Yamada and Yuji Matsumoto. 2003. Statis-
tical dependency analysis with support vector ma-
chines. In Proceedings of IWPT. volume 3, pages
195–206.
Zhilin Yang, Ruslan Salakhutdinov, and William Co-
hen. 2016. Multi-task cross-lingual sequence tag-
ging from scratch. arXiv preprint arXiv:1603.06270
.
tasking. As a result, the model is competitive
with fully structured models such as BiLSTM-
CRFs on CoNLL 2003 while being more scal-
able and also inducing context-sensitive mention
embeddings clustered by entity types. There are
many interesting future directions, such as apply-
ing this framework to NED in which type classi-
fication is much more fine-grained and finding a
better method for optimizing the multitasking ob-
jective (e.g., instead of using gold boundaries for
training, dynamically use predicted boundaries in
a reinforcement learning framework).
Acknowledgments
The author would like to thank Linpeng Kong for
his consistent help with DyNet and Miguel Balles-
teros for pre-trained word embeddings.
References
Junyoung Chung, Caglar Gulcehre, KyungHyun Cho,
and Yoshua Bengio. 2014. Empirical evaluation of
gated recurrent neural networks on sequence model-
ing. In NIPS Deep Learning Workshop.
Ronan Collobert, Jason Weston, L´eon Bottou, Michael
Karlen, Koray Kavukcuoglu, and Pavel Kuksa.
2011. Natural language processing (almost) from
scratch. The Journal of Machine Learning Research
12:2493–2537.
Geoffrey E Hinton, Nitish Srivastava, Alex Krizhevsky,
Ilya Sutskever, and Ruslan R Salakhutdinov. 2012.
Improving neural networks by preventing co-
adaptation of feature detectors.
arXiv preprint
arXiv:1207.0580 .
Sepp Hochreiter and Jurgen Schmidhuber. 1997.
Neural computation
Long short-term memory.
9(8):1735–1780.
Diederik Kingma and Jimmy Ba. 2014. Adam: A
method for stochastic optimization. arXiv preprint
arXiv:1412.6980 .
Eliyahu Kiperwasser and Yoav Goldberg. 2016. Sim-
ple and accurate dependency parsing using bidirec-
tional lstm feature representations. Transactions
of the Association for Computational Linguistics
4:313–327.
Lingpeng Kong, Chris Dyer, and Noah A Smith.
2015. Segmental recurrent neural networks. arXiv
preprint arXiv:1511.06018 .
Guillaume Lample, Miguel Ballesteros, Sandeep Sub-
ramanian, Kazuya Kawakami, and Chris Dyer. 2016.
Neural architectures for named entity recognition.
In Proceedings of NAACL.
|
1702.01944 | 1 | 1702 | 2017-02-07T10:18:07 | EliXa: A Modular and Flexible ABSA Platform | [
"cs.CL"
] | This paper presents a supervised Aspect Based Sentiment Analysis (ABSA) system. Our aim is to develop a modular platform which allows to easily conduct experiments by replacing the modules or adding new features. We obtain the best result in the Opinion Target Extraction (OTE) task (slot 2) using an off-the-shelf sequence labeler. The target polarity classification (slot 3) is addressed by means of a multiclass SVM algorithm which includes lexical based features such as the polarity values obtained from domain and open polarity lexicons. The system obtains accuracies of 0.70 and 0.73 for the restaurant and laptop domain respectively, and performs second best in the out-of-domain hotel, achieving an accuracy of 0.80. | cs.CL | cs |
EliXa: A modular and flexible ABSA platform
Inaki San Vicente, Xabier Saralegi
Elhuyar Foundation
Osinalde industrialdea 3
Usurbil, 20170, Spain
Rodrigo Agerri
IXA NLP Group
University of the Basque Country (UPV/EHU)
Donostia-San Sebasti´an
{i.sanvicente,x.saralegi}@elhuyar.com
[email protected]
Abstract
This paper presents a supervised Aspect Based
Sentiment Analysis (ABSA) system. Our aim
is to develop a modular platform which allows
to easily conduct experiments by replacing the
modules or adding new features. We obtain
the best result in the Opinion Target Extrac-
tion (OTE) task (slot 2) using an off-the-shelf
sequence labeler. The target polarity classi-
fication (slot 3) is addressed by means of a
multiclass SVM algorithm which includes lex-
ical based features such as the polarity values
obtained from domain and open polarity lex-
icons. The system obtains accuracies of 0.70
and 0.73 for the restaurant and laptop domain
respectively, and performs second best in the
out-of-domain hotel, achieving an accuracy of
0.80.
1 Introduction
for
Nowadays Sentiment Analysis is proving very
useful
tasks such as decision making and
market analysis. The ever increasing interest is
also shown in the number of related shared tasks
TASS (Villena-Rom´an et al., 2012;
organized:
Villena-Rom´an et al., 2014),
SemEval
(Nakov et al., 2013;
Pontiki et al., 2014;
Rosenthal et al., 2014),
the SemSA Chal-
lenge at ESWC20141. Research has also been
evolving towards specific opinion elements such
as entities or properties of a certain opinion target,
which is also known as ABSA. The Semeval
or
1http://challenges.2014.eswc-
conferences.org/index.php/SemSA
2015 ABSA shared task aims at covering the most
common problems in an ABSA task: detecting
the specific topics an opinion refers to (slot1);
extracting the opinion targets (slot2), combining the
topic and target identification (slot1&2) and, finally,
computing the polarity of the identified word/targets
(slot3).
Participants were allowed to send one
constrained (no external resources allowed) and one
unconstrained run for each subtask. We participated
in the slot2 and slot3 subtasks.
Our main is to develop an ABSA system to be
used in the future for further experimentation. Thus,
rather than focusing on tuning the different mod-
ules our goal is to develop a platform to facilitate
future experimentation. The EliXa system consists
of three independent supervised modules based on
the IXA pipes tools (Agerri et al., 2014) and Weka
(Hall et al., 2009). Next section describes the ex-
ternal resources used in the unconstrained systems.
Sections 3 and 4 describe the systems developed for
each subtask and briefly discuss the obtained results.
2 External Resources
Several polarity Lexicons and various corpora were
used for the unconstrained versions of our systems.
To facilitate reproducibility of results, every re-
source listed here is publicly available.
2.1 Corpora
For
the restaurant domain we used the Yelp
Dataset
Following
(Kiritchenko et al., 2014), we manually filtered
Challenge
dataset2.
2http://www.yelp.com/dataset challenge
out categories not corresponding to food related
businesses (173 out of 720 were finally selected). A
total of 997,721 reviews (117.1M tokens) comprise
what we henceforth call
the Yelp food corpus
(CY elp).
For the laptop domain we leveraged a corpus
composed of Amazon reviews of electronic devices
(Jo and Oh, 2011). Although only 17,53% of the re-
views belong to laptop products, early experiments
showed the advantage of using the full corpus for
both slot 2 and slot 3 subtasks. The Amazon elec-
tronics corpus (CAmazon) consists of 24,259 reviews
(4.4M tokens). Finally, the English Wikipedia was
also used to induce word clusters using word2vec
(Mikolov et al., 2013).
2.2 Polarity Lexicons
We generated two types of polarity lexicons to rep-
resent polarity in the slot3 subtasks: general purpose
and domain specific polarity lexicons.
A general purpose polarity lexicon Lgen was built
by combining four well known polarity lexicons:
SentiWordnet SWN (Baccianella et al., 2010), Gen-
eral Inquirer GI (Stone et al., 1966), Opinion Finder
OF (Wilson et al., 2005) and Liu's sentiment lex-
icon Liu (Hu and Liu, 2004). When a lemma oc-
curs in several lexicons, its polarity is solved ac-
cording to the following priority order: Liu > OF
> GI > SW N. The order was set based on the
results of (San Vicente et al., 2014). All polarity
weights were normalized to a [−1, 1] interval. Po-
larity categories were mapped to weights for GI
(neg+→−0.8; neg→-0.6; neg−→-0.2; pos−→0.2;
pos→0.6; pos+→0.8), Liu and OF (neg→-0.7;
pos→0.7 for both). In addition, a restricted lexicon
Lgenres including only the strongest polarity words
was derived from Lgen by applying a threshold of
±0.6.
Domain
General
General
Electronic
devices
Food
Polarity Lexicon
Lgen
Lgenres
LAmazon
LY elp
Total
42,218
12,398
4,511
4,691
LAmazon were automatically extracted from CY elp
and CAmazon reviews corpora. Reviews are rated
in a [1..5] interval, being 1 the most negative and
5 the most positive. Using the Log-likelihood ratio
(LLR) (Dunning, 1993) we obtained the ranking of
the words which occur more with negative and pos-
itive reviews respectively. We considered reviews
with 1 and 2 rating as negative and those with 4 and 5
ratings as positive. LLR scores were normalized to a
[−1, 1] interval and included in LY elp and LAmazon
lexicons as polarity weights.
3 Slot2 Subtask: Opinion Target
Extraction
The Opinion Target Extraction task (OTE) is ad-
dressed as a sequence labeling problem. We use
the ixa-pipe-nerc Named Entity Recognition sys-
tem3 (Agerri et al., 2014) off-the-shelf to train our
OTE models;
the system learns supervised mod-
els via the Perceptron algorithm as described by
(Collins, 2002).
ixa-pipe-nerc uses the Apache
OpenNLP project implementation of the Percep-
tron algorithm4 customized with its own features.
Specifically,
ixa-pipe-nerc implements basic non-
linguistic local features and on top of those a combi-
nation of word class representation features partially
inspired by (Turian et al., 2010). The word repre-
sentation features use large amounts of unlabeled
data. The result is a quite simple but competitive
system which obtains the best constrained and un-
constrained results and the first and third best overall
results.
The local features implemented are: current to-
ken and token shape (digits, lowercase, punctuation,
etc.) in a 2 range window, previous prediction, be-
ginning of sentence, 4 characters in prefix and suffix,
bigrams and trigrams (token and shape). On top of
them we induce three types of word representations:
• Brown (Brown et al., 1992) clusters, taking the
4th, 8th, 12th and 20th node in the path. We in-
duced 1000 clusters on the Yelp reviews dataset
described in section 2.1 using the tool imple-
mented by Liang5.
Table 1: Statistics of the polarity lexicons.
Domain specific polarity lexicons LY elp and
3https://github.com/ixa-ehu/ixa-pipe-nerc
4http://opennlp.apache.org/
5https://github.com/percyliang/brown-cluster
• Clark (Clark, 2003) clusters, using the standard
configuration to induce 200 clusters on the Yelp
reviews dataset and 100 clusters on the food
portion of the Yelp reviews dataset.
• Word2vec
(Mikolov et al., 2013)
clusters,
based on K-means applied over the extracted
word vectors using the skip-gram algorithm6;
400 clusters were induced using the Wikipedia.
The implementation of the clustering features
looks for the cluster class of the incoming token in
one or more of the clustering lexicons induced fol-
lowing the three methods listed above.
If found,
then we add the class as a feature. The Brown
clusters only apply to the token related features,
which are duplicated. We chose the best combina-
tion of features using 5-fold cross validation, ob-
taining 73.03 F1 score with local features (e.g. con-
strained mode) and 77.12 adding the word clustering
features, namely, in unconstrained mode. These two
configurations were used to process the test set in
this task. Table 2 lists the official results for the first
4 systems in the task.
System (type)
Baseline
EliXa (u)
NLANGP (u)
EliXa (c)
IHS-RD-Belarus (c)
Precision Recall
43.4
71.22
64.02
66.61
59.23
55.42
68.93
70.53
67.23
67.58
F1 score
48.68
70.05
67.12
66.91
63.13
Table 2: Results obtained on the slot2 evaluation on
restaurant data.
The results show that leveraging unlabeled text is
helpful in the OTE task, obtaining an increase of 7
points in recall. It is also worth mentioning that our
constrained system (using non-linguistic local fea-
tures) performs very closely to the second best over-
all system by the NLANGP team (unconstrained).
Finally, we would like to point out to the overall
low results in this task (for example, compared to
the 2014 edition), due to the very small and diffi-
cult training set (e.g., containing many short samples
such as "Tasty Dog!") which made it extremely hard
to learn good models for this task. The OTE mod-
els will be made freely available in the ixa-pipe-nerc
website in time for SemEval 2015.
6https://code.google.com/p/word2vec/
4 Slot3 Subtask: Sentiment Polarity
The EliXa system implements a single multiclass
SVM classifier. We use the SMO implementation
provided by the Weka library (Hall et al., 2009). All
the classifiers built over the training data were eval-
uated via 10-fold cross validation. The complexity
parameter was optimized as (C = 1.0). Many con-
figurations were tested in this experiments, but in the
following we only will describe the final setting.
4.1 Baseline
The very first features we introduced in our classi-
fier were token ngrams. Initial experiments showed
that lemma ngrams (lgrams) performed better than
raw form ngrams. One feature per lgram is added
to the vector representation, and lemma frequency
is stored. With respect to the ngram size used, we
tested up to 4-gram features and improvement was
achieved in laptop domain but only when not com-
bined with other features.
4.2 PoS
PoS tag and lemma information, obtained using the
IXA pipes tools (Agerri et al., 2014), were also in-
cluded as features. One feature per PoS tag was
added again storing the number of occurrences of a
tag in the sentence. These features slightly improve
over the baseline only in the restaurant domain.
4.3 Window
Given that a sentence may contain multiple opin-
ions, we define a window span around a given opin-
ion target (5 words before and 5 words after). When
the target of an opinion is null the whole sentence is
taken as span. Only the restaurant and hotel domains
contained gold target annotations so we did not use
this feature in the laptop domain.
4.4 Polarity Lexicons
The positive and negative scores we extracted as fea-
tures from both general purpose and domain specific
lexicons. Both scores are calculated as the sum of
every positive/negative score in the corresponding
lexicon divided by the number of words in the sen-
tence. Features obtained from the general lexicons
provide a slight improvement. Lgenres is better for
restaurant domain, while Lgen is better for laptops.
Domain specific lexicons LAmazon and LY elp also
help as shown by tables 3 and 4.
4.5 Word Clusters
Word2vec clustering features combine best with the
rest as shown by table 3. These features only were
useful for the restaurant domain, perhaps due to the
small size of the laptops domain data.
4.6 Feature combinations
Every feature, when used in isolation, only
marginally improves the baseline. Some of them,
such as the E&A features (using the gold informa-
tion from the slot1 subtask) for the laptop domain,
only help when combined with others. Best perfor-
mance is achieved when several features are com-
bined. As shown by tables 4 and 5, improvement
over the baseline ranges between 2,8% and 1,9% in
the laptop and restaurant domains respectively.
Classifier
Baseline (organizers)
Baseline
1lgram
2lgram
1lgram + E&A
1lgram(w5)
1lgram + P oS
Lexicons
1lgram + Lgen
1lgram + Lgenres
1lgram + LY elp
Combinations
Acc Rest
78.8
80.11
79.3
79.8
80.41
80.59 (c)
80.6
81
80.9
1lgram(w5) + w2v(CY elp) + Lgenres +
82.34 (u)
LY elp + P oS
Table 3: Slot3 ablation experiments for restaurants. (c)
and (u) refer to constrained and unconstrained tracks.
Classifier
Baseline (organizers)
Baseline
1lgram
2lgram
1lgram + clusters(w2v)
1lgram + E&A
1lgram + P oS
Lexicons
1lgram + Lgen
1lgram + Lgenres
1lgram + LAmazon
Combinations
Acc Lapt
78.3
79.33
79.7
79.23
79.23
78.88
79.2
79
79.7
1lgram + P oS + E&A
2lgram + P oS + E&A
1lgram + Lgenres + LAmazon + P oS +
79.99 (c)
78.27
80.85 (u)
E&A
Table 4: Slot3 ablation experiments for laptops; (c) and
(u) refer to constrained and unconstrained tracks.
strained system could mean that the feature combi-
nation used may be robust across domains. With re-
spect to the unconstrained system, we suspect that
such a good performance is achieved due to the fact
that word cluster information was very adequate for
the hotel domain, because Cyelp contains a 10.55%
of hotel reviews.
System
Baseline
Sentiue
lsislif
EliXa (u)
EliXa (c)
Rest.
63.55
78.70 (1)
75.50 (3)
70.06(10)
67.34 (14)
Lapt.
69.97
79.35 (1)
77.87 (3)
72.92 (7)
71.55 (9)
Hotel
71.68 (majority)
71.68 (4)
85.84 (1)
79.65 (3)
74.93 (5)
Table 5: Results obtained on the slot3 evaluation on
restaurant data; ranking in brackets.
4.7 Results
Table 5 shows the result achieved by our sentiment
polarity classifier. Although for both restaurant and
laptops domains we obtain results over the baseline
both performance are modest.
In contrast, for the out of domain track, which was
evaluated on hotel reviews our system obtains the
third highest score. Because of the similarity of the
domains, we straightforwardly applied our restau-
rant domain models. The good results of the con-
5 Conclusions
We have presented a modular and supervised ABSA
platform developed to facilitate future experimenta-
tion in the field. We submitted runs corresponding
to the slot2 and slot3 subtasks, obtaining competi-
tive results. In particular, we obtained the best re-
sults in slot2 (OTE) and for slot3 we obtain 3rd best
result in the out-of-domain track, which is nice for a
supervised system. Finally, a system for topic detec-
tion (slot1) is currently under development.
6 Acknowledgments
This work has been supported by the following
projects: ADi project (Etortek grant No. IE-14-382),
NewsReader (FP7-ICT 2011-8-316404), SKaTer
(TIN2012-38584-C06-02) and Tacardi (TIN2012-
38523-C02-01).
References
[Agerri et al.2014] Rodrigo Agerri, Josu Bermudez, and
German Rigau. 2014.
Ixa pipeline: Efficient and
ready to use multilingual nlp tools. In Proceedings of
the 9th Language Resources and Evaluation Confer-
ence (LREC2014), pages 26–31, Reykjavik, Iceland,
May.
2010.
[Baccianella et al.2010] S. Baccianella, A. Esuli, and
F. Sebastiani.
SentiWordNet 3.0: An en-
hanced lexical resource for sentiment analysis and
opinion mining.
In Seventh conference on Interna-
tional Language Resources and Evaluation (LREC-
2010), Malta., volume 25.
[Brown et al.1992] Peter F Brown, Peter V Desouza,
Robert L Mercer, Vincent J Della Pietra, and Jenifer C
Lai. 1992. Class-based n-gram models of natural lan-
guage. Computational linguistics, 18(4):467–479.
[Clark2003] Alexander Clark.
2003. Combining dis-
tributional and morphological information for part of
speech induction. In Proceedings of the tenth confer-
ence on European chapter of the Association for Com-
putational Linguistics-Volume 1, pages 59–66.
[Collins2002] Michael Collins.
2002. Discriminative
training methods for hidden markov models: Theory
and experiments with perceptron algorithms. In Pro-
ceedings of the ACL-02 conference on Empirical meth-
ods in natural language processing-Volume 10, pages
1–8.
[Dunning1993] Ted Dunning. 1993. Accurate methods
for the statistics of surprise and coincidence. Com-
putacional Linguistics, 19(1):61–74, March.
[Hall et al.2009] Mark Hall, Eibe Frank, Geoffrey
Holmes, Bernhard Pfahringer, Peter Reutemann,
and Ian H. Witten. 2009. The WEKA data mining
software:
an update.
SIGKDD Explor. Newsl.,
11(1):10–18, november.
2004. Mining
[Hu and Liu2004] M. Hu and B. Liu.
and summarizing customer reviews.
In Proceedings
of the tenth ACM SIGKDD international conference
on Knowledge discovery and data mining, pages 168–
177.
[Jo and Oh2011] Yohan Jo and Alice H. Oh. 2011. As-
pect and sentiment unification model for online review
In Proceedings of the fourth ACM inter-
analysis.
national conference on Web search and data mining,
WSDM '11, pages 815–824, New York, NY, USA.
ACM.
[Kiritchenko et al.2014] Svetlana Kiritchenko, Xiaodan
Zhu, Colin Cherry, and Saif Mohammad. 2014. NRC-
canada-2014: Detecting aspects and sentiment in cus-
tomer reviews. In Proceedings of the 8th International
Workshop on Semantic Evaluation (SemEval 2014),
pages 437–442, Dublin, Ireland, August.
[Mikolov et al.2013] Tomas Mikolov, Ilya Sutskever, Kai
Chen, Greg S Corrado, and Jeff Dean. 2013. Dis-
tributed representations of words and phrases and their
compositionality. In Advances in Neural Information
Processing Systems, pages 3111–3119.
[Nakov et al.2013] Preslav Nakov, Sara Rosenthal, Zor-
nitsa Kozareva, Veselin Stoyanov, Alan Ritter, and
Theresa Wilson. 2013. SemEval-2013 task 2: Senti-
ment analysis in twitter. In Proceedings of the Seventh
International Workshop on Semantic Evaluation (Se-
mEval 2013), pages 312–320, Atlanta, Georgia, USA,
June.
[Pontiki et al.2014] Maria Pontiki, Dimitrios Galanis,
John Pavlopoulos, Harris Papageorgiou, Ion Androut-
sopoulos, and Suresh Manandhar. 2014. Semeval-
2014 task 4: Aspect based sentiment analysis. In Pro-
ceedings of the International Workshop on Semantic
Evaluation (SemEval).
[Rosenthal et al.2014] Sara Rosenthal, Preslav Nakov,
Alan Ritter, and Veselin Stoyanov. 2014. Semeval-
2014 task 9: Sentiment analysis in twitter.
In Pro-
ceedings of the 8th International Workshop on Seman-
tic Evaluation, SemEval, volume 14.
[San Vicente et al.2014] Inaki San Vicente, Rodrigo
Agerri, and German Rigau. 2014. Simple, robust and
(almost) unsupervised generation of polarity lexicons
for multiple languages.
In Proceedings of the 14th
Conference of the European Chapter of the Associa-
tion for Computational Linguistics, EACL2014, pages
88–97, Gothenburg, Sweden.
[Stone et al.1966] P. Stone, D. Dunphy, M. Smith, and
D. Ogilvie. 1966. The General Inquirer: A Computer
Approach to Content Analysis. Cambridge (MA): MIT
Press.
[Turian et al.2010] Joseph Turian, Lev-Arie Ratinov, and
Yoshua Bengio. 2010. Word representations: A sim-
ple and general method for semi-supervised learning.
In Proceedings of the 48th Annual Meeting of the Asso-
ciation for Computational Linguistics, pages 384–394,
Uppsala, Sweden, July.
[Villena-Rom´an et al.2012] Julio Villena-Rom´an, Sara
and
Tass-
Lana-Serrano,
Jos´e Carlos Gonz´alez-Crist´obal.
Eugenio Mart´ınez-C´amara,
2012.
workshop on sentiment analysis at sepln.
samiento del Lenguaje Natural, 50:37–44.
Proce-
[Villena-Rom´an et al.2014] Julio Villena-Rom´an, Janine
Garc´ıa-Morera, Sara Lana-Serrano, and Jos´e Carlos
Gonz´alez-Crist´obal. 2014. Tass 2013 - a second step
in reputation analysis in spanish. Procesamiento del
Lenguaje Natural, 52(0).
[Wilson et al.2005] Theresa Wilson, Janyce Wiebe, and
Paul Hoffmann. 2005. Recognizing contextual polar-
ity in phrase-level sentiment analysis. In Proceedings
of the conference on Human Language Technology and
Empirical Methods in Natural Language Processing,
page 347–354.
|
1811.04531 | 1 | 1811 | 2018-11-12T02:55:55 | Sequence-Level Knowledge Distillation for Model Compression of Attention-based Sequence-to-Sequence Speech Recognition | [
"cs.CL"
] | We investigate the feasibility of sequence-level knowledge distillation of Sequence-to-Sequence (Seq2Seq) models for Large Vocabulary Continuous Speech Recognition (LVSCR). We first use a pre-trained larger teacher model to generate multiple hypotheses per utterance with beam search. With the same input, we then train the student model using these hypotheses generated from the teacher as pseudo labels in place of the original ground truth labels. We evaluate our proposed method using Wall Street Journal (WSJ) corpus. It achieved up to $ 9.8 \times$ parameter reduction with accuracy loss of up to 7.0\% word-error rate (WER) increase | cs.CL | cs |
SEQUENCE-LEVEL KNOWLEDGE DISTILLATION FOR MODEL COMPRESSION OF
ATTENTION-BASED SEQUENCE-TO-SEQUENCE SPEECH RECOGNITION
Raden Mu'az Mun'im, Nakamasa Inoue, Koichi Shinoda
[email protected], [email protected], [email protected]
Tokyo Institute of Technology
ABSTRACT
We investigate the feasibility of sequence-level knowledge
distillation of Sequence-to-Sequence (Seq2Seq) models for
Large Vocabulary Continuous Speech Recognition (LVSCR).
We first use a pre-trained larger teacher model to generate
multiple hypotheses per utterance with beam search. With the
same input, we then train the student model using these hy-
potheses generated from the teacher as pseudo labels in place
of the original ground truth labels. We evaluate our proposed
method using Wall Street Journal (WSJ) corpus. It achieved
up to 9.8× parameter reduction with accuracy loss of up to
7.0% word-error rate (WER) increase.
Index Terms -- speech recognition, large vocabulary con-
tinuous speech recognition, sequence-to-sequence, attention
model, knowledge distillation, sequence-level knowledge dis-
tillation
1. INTRODUCTION
In recent years, end-to-end deep neural networks for Large
Vocabulary Continuous Speech Recognition (LVSCR) have
been steadily improving their accuracy, rivalling the tra-
ditional Gaussian Mixture Model-Hidden Markov Models
(GMM-HMM) and hybrid models of deep neural networks
and HMMs (DNN-HMM). While these models have an
acoustic model and a language model which are trained sep-
arately, for end-to-end training, the whole model is trained
using backpropagation with audio-transcription pairs [1].
Several end-to-end architectures for speech recogni-
tion have been proposed. Their examples include Con-
nectionist Temporal Classification (CTC) [2], Recurrent
Neural Network-Transducer (RNN-T) [3], and Sequence-
to-Sequence (Seq2Seq) with attention [4]. Unlike CTC and
RNN-T, Seq2Seq with attention does not make any prior as-
sumptions on the output sequence alignment given an input;
it jointly learns how to align while learning to encode the
input and decode its result into the output.
In machine learning, model compression [5] is a way to
significantly compress a model by reducing the number of
its parameters while having negligible accuracy loss. This
is important for deploying trained models on memory and
compute-constrained devices such as mobile phones and em-
bedded systems, and when energy efficiency is needed on
large-scale deployment. Several model compression methods
exist, such as pruning, quantization [5], and knowledge distil-
lation (KD) [6]. KD is the focus of this work, where a smaller
student model is trained by using the output distribution of a
larger teacher model. Recently KD for Seq2Seq models with
attention was proposed for neural machine translation (NMT)
task [7] and proved to be effective. Also, Seq2Seq models for
CTC-based speech recognition was recently proposed [11].
In this paper, we propose a sequence-level KD method
for Seq2Seq speech recognition models with attention. Dif-
ferent from the previous work for NMT [7], we extract the
hypotheses from a pre-trained teacher Seq2Seq model using
beam search, and train student Seq2Seq models using the hy-
potheses as pseudo labels on the sequence-level cross-entropy
criterion. To the best of our knowledge, there is no prior work
on applying KD in Seq2Seq-based speech recognition mod-
els.
2. KNOWLEDGE DISTILLATION FOR SEQ2SEQ
MODELS
2.1. Sequence-to-Sequence Learning
The Sequence-to-Sequence (Seq2Seq) [1] is neural network
architecture which directly models conditional probability
p(yx) where x = [x1, ..., xS] is the source sequence with
length S and y = [y1, ..., yT ] is the target sequence with
length T .
Figure 1 illustrates the Seq2Seq model. It consists of an
encoder, a decoder and an attention module. The encoder pro-
cesses an input sequence x and outputs encoded hidden repre-
sentation he = [he
S] for the decoder [9]. The attention
module is a network that assists the decoder to find relevant
information on the encoder side based on the current decoder
hidden states [4]. The attention module does this by produc-
ing a context vector ct at time t based on the encoder and
1, ..., he
2.2. Knowledge Distillation
In knowledge distillation (KD), a teacher model's probability
distribution q(θTx; θ) is trained by using a given dataset,
where θt is a set of its parameters. Using the same dataset,
a student model p(θx; θ) is trained by minimizing cross-
entropy with the teacher model's probability distribution
q(θTx; θ) instead of the ground truth labels from the dataset.
Let an input-label pairs be (x, y) and V is a set of possible
classes. Then, the loss for KD is given as:
V(cid:88)
LKD(θ; θT ) = −
q(y = k x; θT ) log p(y = k x; θ).
k=1
(5)
In KD training, the teacher produces softmax probabili-
ties (soft targets), which reveal teacher's confidences for what
classes it predicts given an input. With this additional knowl-
edge, the student can model the data distribution better than
learning directly from the ground truth labels consisting of
one-hot vectors (hard targets) [6].
2.3. Sequence-Level Knowledge Distillation
While it is possible to use the original KD method to train
autoregressive models such as RNN,
it only gives non-
significant accuracy gains [7], or simply degrade the per-
formance compared to training with the dataset directly [10].
To adapt KD to autoregressive models, [7] suggested to
use the approximation of a teacher's sequence-level distribu-
tion instead of the teacher's single time step frame-level dis-
tribution, so as to capture the time-dependencies between the
inputs.
Consider the sequence-level distribution specified by the
model over all possible teacher label sequences t ∈ T , given
the input sequence s :
J(cid:89)
j=1
Fig. 1. Architecture of Seq2Seq with Attention module
decoder hidden states:
s=1
S(cid:88)
(cid:80)S
(cid:104)he
ct =
at(s) ∗ he
s,
at(s) =
exp(Score(he
s, hd
s=1 exp(Score(he
t ))
s, hd
t ))
(1)
(2)
,
Several variations exist for Score(he
s, hd
t ):
Score(he
s, hd
t ) =
t(cid:105),
s, hd
he(cid:124)
s Wshd
t ,
(cid:124)
s tanh(Ws[he
V
s, hd
t ]),
: dot product
: bilinear
: MLP
(3)
where Score is a function (RM ×RN ) → R, M is the number
of hidden units for the encoder, N is the number of hidden
(cid:124)
units for the decoder, and both Ws and V
s are weight ma-
trices. Finally, the decoder predicts the probability of target
sequence y at time t based on the previous output y<t and ct,
which can be formulated as:
T(cid:88)
log p(yx) =
log p(yty<t, ct).
(4)
p(t s) =
p(tj s, t<j),
(6)
t=1
The previous outputs ct can obtained with greedy decod-
ing, i.e. by taking the output with the highest probability for
each time step (e.g in [7]). It is also possible to perform beam
search to obtain more than one ct [1].
Seq2Seq can handle virtually any sequence related tasks[1],
such as NMT and speech recognition. For speech recogni-
tion, the input x is a sequence of feature vectors derived
from audio waveform such as Short-time Fourier Transform
(STFT) spectrogram or Mel-frequency cepstral coefficients
(MFCC). Therefore, x is a real vector with S × D dimension
where D is the number of the features and S is the total length
of the utterance in frames. The output y can be a sequence of
phonemes or graphemes (characters).
for any length J. The sequence-level loss for Seq2Seq in-
volves matching the input s with the one-hot distribution of
all the complete sequences:
1{t = y} log p(t s)
LSEQ-NLL = −(cid:88)
= − J(cid:88)
V(cid:88)
t∈T
1{yj = k} log p(tj = k s, t<j),
j=1
k=1
where 1{·} is the indicator function and y = [y1, . . . , yJ ] is
the observed sequence.
To formulate the sequence-level KD, we use q(t s) to
represent the teacher's sequence distribution over the sample
(7)
(8)
Model
Teacher
Student-mid
Student-small
Encoder bi-GRU Decoder bi-GRU
3 layers 384 cells
5 layers 384 cells
1 layer 256 cells
4 layers 256 cells
3 layers 128 cells
1 layer 128 cells
Table 1. Model configurations. 2D CNN and Attention mod-
ule configuration is the same for all models.
labels with generated pseudo labels (Figure 2). In this proce-
dure, the size of beam search and the value of k are adjustable
hyperparameters. The dataset size increases with factor of k
from the method using the 1-best [7].
The pseudo labels are analogous to soft targets in the orig-
inal KD. Even if the pseudo labels are not fully accurate, the
student is expected to achieve better performance with this
training method since the student tries to imitate the teacher's
distribution instead of trying to model the training data dis-
tribution directly. Training with these pseudo labels can be
seen as a form of regularization similar to the original KD [6],
because the slightly inaccurate transcriptions from pseudo la-
bels can prevent the trained models from overfitting to train-
ing data distribution (Figure 2).
4. IMPLEMENTATION AND EXPERIMENTS
4.1. Seq2Seq Model Architecture
The input speech audio waveform is sampled at 16kHz, then
transformed into STFT spectrogram with Hanning window
of 20ms and step size of 10ms. Then the STFT spectro-
grams are fed into 2D convolutional neural network (CNN)
with two layers, as described by [12, 13], as this STFT and
CNN combination can further improve accuracy compared to
using MFCC alone. 2D CNN is configured with filters=32,
kernel size=(5, 8), stride=(2,2).
Bidirectional Gated Recurrent Unit (GRU) [14] is used
for the encoder and the decoder. The feature vector from 2D
CNN is first fed into the encoder. Then, the hidden represen-
tation made by the encoder is fed to an embedding layer of
size 32. Next, the output of the embedding layer is fed into
the decoder.
The output of the decoder is fed into the softmax layer
consisting of 31 classes (26 English alphabet plus 5 classes for
start-of-sentence (sos), end-of-sentence (eos), space, apostro-
phe and period). The decoder's attention module consists
of 1D CNN layer with kernel=128, kernel size=15, stride=1,
padding=7 followed by a fully-connected layer, as proposed
by [4]. The models are trained with Dropout set to 0.4.
The model configurations are summarised in Table 1. We
have designed two kinds of student models with different
sizes, Student-mid and Student-small.
Fig. 2. Example of sequence-level KD training. The teacher
produces pseudo labels obtained from the top-k results from
beam search, then the student learns by minimizing cross en-
tropy with them.
space of all possible sequences,
LSEQ-KD = −(cid:88)
t∈T
q(t s) log p(t s)
(9)
Different from previously stated LKD, LSEQ-KD minimizes
the loss on the whole-sequence level. However, this loss is
intractable. An approximation to calculate it is required.
There are many ways to approximate the loss. The
sequence-level KD for NMT [7] uses a single hypothesis
with the best score as the pseudo label per input. For CTC-
based speech recognition [11], this loss was k-best hypotheses
from beam search per input (Figure 2). The loss is then
LSEQ-KD ≈ −(cid:88)
1{t = y} log p(t s)
t∈T
= − log p(t = y s),
(10)
(11)
where y is the output hypothesis obtained from running beam
search with the teacher model. In this work, we investigated
on how to apply these for Seq2Seq-based speech recognition
models, which will be discussed in the next sections.
3. MULTIPLE HYPOTHESES FROM BEAM
SEARCH FOR KNOWLEDGE DISTILLATION
For Seq2Seq-based speech recognition, the sequence-level
KD with the loss approximation can be done by the following
three steps: (1) Pre-train a teacher model with a dataset, (2)
With the same dataset, generate k-best sequences with beam
search, and save them as pseudo labels, (3) Train a student
model with the same dataset but replace the ground truth
Table 2. Results on WSJ eval92 (trained on train si284).
beamSize (shorthand for size of beam search) and topK
(shorthand for top k-best hypotheses) are hyperparameters.
We measured the accuracy using the character-error rate
(CER) and word-error rate (WER).
Model
Teacher
(Params: 16.8M; 100% size)
CER (%) WER (%)
Baseline
4.6
15.3
Student-mid
(Params: 6.1M; 37% size)
Baseline
topK=1, beamSize=5
topK=1, beamSize=10
topK=5, beamSize=5
topK=5, beamSize=10
topK=10, beamSize=10
Student-small
(Params: 1.7M; 10% size)
Baseline
topK=1, beamSize=5
topK=1, beamSize=10
topK=5, beamSize=5
topK=5, beamSize=10
topK=10, beamSize=10
7.0
6.4
6.5
6.0
6.5
6.1
9.2
7.6
7.7
6.5
6.9
7.4
21.8
20.5
20.5
20.1
21.2
19.7
28.7
26.1
25.3
22.3
23.3
24.7
4.2. Dataset and Software
Wall Street Journal (WSJ) corpus (available at the Linguistic
Data Consortium as LDC93S6B and LDC94S13B) is used as
the training and testing datasets. From the corpus, train si284
(81 hours of 37k sentences) is used for training, dev93 is used
for validation, and eval92 is used for testing. Data is extracted
as according to WSJ recipe from Kaldi toolkit [15]. STFT
spectrogram extraction, implementation of the models, train-
ing and testing are conducted using Python 3.6, Scipy 1.0.1
and Pytorch 0.3.1.
4.3. Experimental Setup
First, the teacher model and student models are trained di-
rectly with train si284 and tested with eval92 to serve as the
baselines. To perform Sequence-level KD, the teacher model
pre-trained with train si284 is used for pseudo labels genera-
tion. This is done by extracting k-best hypotheses from beam
search with combinations of beam size of 5, 10 and k-best of
1, 5, 10.
For each model the training is done using Adam op-
timizer, with learning rate of 2e-4 exponential decay rate
of 0.99 per epoch, and mini-batch size set at 16. Seq2Seq
teacher forcing rate [4] is set at 0.4. Training is done up to
200 epochs, or until no improvement can be seen in validation
or testing set.
5. RESULTS
The results are shown in Table 2. The teacher model serves
the reference baseline for student models. We benchmarked
the character-error rate (CER) and word-error rate (WER).
With KD training, the student models managed to achieve bet-
ter CER and WER than the case when training directly with
the dataset.
For Student-mid model, the number of parameters is 37%
of the teacher (2.7× reduction).
It achieved the best CER
(6.0%) with beamSize=5 and topK=5, and the best WER
(19.7%) with beamSize=10 and beamSize=10.
For Student-small model, the number of parameters is
10% of the teacher (9.8× reduction). As expected,
the
model suffered higher CER and WER compared to Student-
mid model. The model achieved the best CER (6.5%) and
WER (22.3%) with beamSize=5 and topK=5. The effect of
sequence-level KD is more obvious in Student-small, where it
achieve 6.4% reduction in WER with KD training compared
to directly training with the dataset.
Training was done using a server with Intel Xeon E5-2680
2.4GHz and NVIDIA Tesla P100 16GB. We did not found
significant improvement in training and testing time. Student-
mid and Student-small achieved speed-up of 1.4× and 1.7×
respectively, relative to the teacher model. This relatively
small improvement may be due to inherent sequential com-
putations using RNN where some operations simply cannot
be paralellized.
To summarise, generally we found that using beamSize=5
and topK=5 are sufficient for reasonable WER and CER re-
duction. Increasing beamSize and/or topK further do not nec-
essarily improve the performance.
6. CONCLUSION
In this work, we successfully performed sequence-level KD
training for Seq2Seq speech recognition models. Using beam
search to approximate the teacher's distribution, we extracted
k-best hypotheses to be used as pseudo labels to train the stu-
dent on the same dataset. We managed to train the students
with reduction of 9.8× parameter size of the teacher, with in-
crease of WER of 7.0% relative to the teacher.
There are many problems left for future work. Since RNN
is limited in inference speed due to its sequential operations,
we plan to investigate the feasibility of sequence-level KD
for other highly parallelizable attention-based architectures
which are not based on RNN, such as, Transformer [16] and
S2SConv [17].
7. ACKNOWLEDGMENT
This work was supported by JST CREST Grant Number JP-
MJCR1687 and JSPS KAKEN Grant Number 16H02845.
acoustic models," in Acoustics, Speech and Signal Pro-
cessing (ICASSP), 2018 IEEE International Conference
on. IEEE, 2018, pp. 5809 -- 5813.
[12] Andrew L Maas, Peng Qi, Ziang Xie, Awni Y Han-
nun, Christopher T Lengerich, Daniel Jurafsky, and An-
drew Y Ng, "Building dnn acoustic models for large
vocabulary speech recognition," Computer Speech &
Language, vol. 41, pp. 195 -- 213, 2017.
[13] Dario Amodei, Sundaram Ananthanarayanan, Rishita
Anubhai, Jingliang Bai, Eric Battenberg, Carl Case,
Jared Casper, Bryan Catanzaro, Qiang Cheng, Guoliang
Chen, et al., "Deep speech 2: End-to-end speech recog-
nition in english and mandarin," in International Con-
ference on Machine Learning, 2016, pp. 173 -- 182.
[14] Junyoung Chung, Caglar Gulcehre, Kyunghyun Cho,
and Yoshua Bengio,
"Empirical evaluation of gated
recurrent neural networks on sequence modeling," in
NIPS 2014 Workshop on Deep Learning, December
2014, 2014.
[15] Daniel Povey, Arnab Ghoshal, Gilles Boulianne, Lukas
Burget, Ondrej Glembek, Nagendra Goel, Mirko Han-
nemann, Petr Motlicek, Yanmin Qian, Petr Schwarz,
et al., "The kaldi speech recognition toolkit," in IEEE
2011 workshop on automatic speech recognition and
understanding. IEEE Signal Processing Society, 2011,
number EPFL-CONF-192584.
[16] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob
Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser,
and Illia Polosukhin, "Attention is all you need," in Ad-
vances in Neural Information Processing Systems, 2017,
pp. 5998 -- 6008.
[17] Jonas Gehring, Michael Auli, David Grangier, Denis
Yarats, and Yann N Dauphin, "Convolutional sequence
to sequence learning," in International Conference on
Machine Learning, 2017, pp. 1243 -- 1252.
8. REFERENCES
[1] Ilya Sutskever, Oriol Vinyals, and Quoc V Le,
"Se-
quence to sequence learning with neural networks,"
in Advances in neural information processing systems,
2014, pp. 3104 -- 3112.
[2] Alex Graves, Abdel-rahman Mohamed, and Geoffrey
Hinton, "Speech recognition with deep recurrent neural
networks," in Acoustics, speech and signal processing
(icassp), 2013 IEEE international conference on. IEEE,
2013, pp. 6645 -- 6649.
[3] Alex Graves and Navdeep Jaitly, "Towards end-to-end
speech recognition with recurrent neural networks," in
International Conference on Machine Learning, 2014,
pp. 1764 -- 1772.
[4] Dzmitry Bahdanau, Jan Chorowski, Dmitriy Serdyuk,
Philemon Brakel, and Yoshua Bengio,
"End-to-end
attention-based large vocabulary speech recognition,"
in Acoustics, Speech and Signal Processing (ICASSP),
2016 IEEE International Conference on. IEEE, 2016,
pp. 4945 -- 4949.
[5] Song Han, Huizi Mao, and William J Dally, "Deep com-
pression: Compressing deep neural networks with prun-
ing, trained quantization and huffman coding," arXiv
preprint arXiv:1510.00149, 2015.
[6] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean, "Distill-
ing the knowledge in a neural network," arXiv preprint
arXiv:1503.02531, 2015.
[7] Yoon Kim and Alexander M Rush,
"Sequence-level
in Proceedings of the 2016
knowledge distillation,"
Conference on Empirical Methods in Natural Language
Processing, 2016, pp. 1317 -- 1327.
[8] Jan K Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk,
Kyunghyun Cho, and Yoshua Bengio, "Attention-based
models for speech recognition," in Advances in neural
information processing systems, 2015, pp. 577 -- 585.
[9] Andros Tjandra, Sakriani Sakti, and Satoshi Nakamura,
"Attention-based wav2text with feature transfer learn-
in Automatic Speech Recognition and Under-
ing,"
standing Workshop (ASRU), 2017 IEEE. IEEE, 2017,
pp. 309 -- 315.
[10] Has¸im Sak, F´elix de Chaumont Quitry, Tara Sainath,
Kanishka Rao, et al., "Acoustic modelling with cd-ctc-
smbr lstm rnns," in Automatic Speech Recognition and
Understanding (ASRU), 2015 IEEE Workshop on. IEEE,
2015, pp. 604 -- 609.
[11] Ryoichi Takashima, Sheng Li, and Hisashi Kawai, "An
investigation of a knowledge distillation method for ctc
|
1807.01466 | 1 | 1807 | 2018-07-04T07:18:36 | Polarity and Intensity: the Two Aspects of Sentiment Analysis | [
"cs.CL"
] | Current multimodal sentiment analysis frames sentiment score prediction as a general Machine Learning task. However, what the sentiment score actually represents has often been overlooked. As a measurement of opinions and affective states, a sentiment score generally consists of two aspects: polarity and intensity. We decompose sentiment scores into these two aspects and study how they are conveyed through individual modalities and combined multimodal models in a naturalistic monologue setting. In particular, we build unimodal and multimodal multi-task learning models with sentiment score prediction as the main task and polarity and/or intensity classification as the auxiliary tasks. Our experiments show that sentiment analysis benefits from multi-task learning, and individual modalities differ when conveying the polarity and intensity aspects of sentiment. | cs.CL | cs | Polarity and Intensity: the Two Aspects of Sentiment Analysis
Leimin Tian
School of Informatics
the University of Edinburgh
[email protected]
Catherine Lai
School of Informatics
the University of Edinburgh
[email protected]
Johanna D. Moore
School of Informatics
the University of Edinburgh
[email protected]
8
1
0
2
l
u
J
4
]
L
C
.
s
c
[
1
v
6
6
4
1
0
.
7
0
8
1
:
v
i
X
r
a
Abstract
Current multimodal sentiment analysis
frames sentiment score prediction as a
general Machine Learning task. How-
ever, what the sentiment score actually
represents has often been overlooked. As
a measurement of opinions and affective
states, a sentiment score generally con-
sists of two aspects: polarity and intensity.
We decompose sentiment scores into these
two aspects and study how they are con-
veyed through individual modalities and
combined multimodal models in a natu-
ralistic monologue setting.
In particular,
we build unimodal and multimodal multi-
task learning models with sentiment score
prediction as the main task and polarity
and/or intensity classification as the auxil-
iary tasks. Our experiments show that sen-
timent analysis benefits from multi-task
learning, and individual modalities differ
when conveying the polarity and intensity
aspects of sentiment.
Introduction
1
Computational analysis of human multimodal lan-
guage is a growing research area in Natural Lan-
guage Processing (NLP). One important type of
information communicated through human multi-
modal language is sentiment. Current NLP stud-
ies often define sentiments using scores on a scale,
e.g., a 5-point Likert scale representing senti-
ments from strongly negative to strongly positive.
Previous work on multimodal sentiment analysis
has focused on identifying effective approaches
for sentiment score prediction (e.g., Zadeh et al.
(2018b)). However, in these studies sentiment
score prediction is typically represented as a re-
gression or classification task, without taking into
account what the sentiment score means. As
a measurement of human opinions and affective
states, a sentiment score can often be decomposed
into two aspects: the polarity and intensity of the
sentiment.
In this work, we study how individ-
ual modalities and multimodal information convey
these two aspects of sentiment.
More specifically, we conduct experiments on
the Carnegie Mellon University Multimodal Opin-
ion Sentiment Intensity (CMU-MOSI) database
(Zadeh et al., 2016). The CMU-MOSI database
is a widely used benchmark database for mul-
timodal sentiment analysis.
It contains natural-
istic monologues expressing opinions on various
subjects. Sentiments are annotated as continu-
ous scores for each opinion segment in the CMU-
MOSI database, and data were collected over the
vocal, visual, and verbal modalities. We build uni-
modal and multimodal multi-task learning models
with sentiment score regression as the main task,
and polarity and/or intensity classification as the
auxiliary tasks. Our main research questions are:
1. Does sentiment score prediction benefit from
multi-task learning?
2. Do individual modalities convey the polarity
and intensity of sentiment differently?
3. Does multi-task learning influence unimodal
and multimodal sentiment analysis models in
different ways?
Our work contributes to our current understand-
ing of the intra-modal and inter-modal dynamics
of how sentiments are communicated in human
multimodal language. Moreover, our study pro-
vides detailed analysis on how multi-task learning
and modality fusion influences sentiment analysis.
2 Background
Sentiment is an important type of information con-
veyed in human language. Previous sentiment
analysis studies in the field of NLP have mostly
been focused on the verbal modality (i.e., text).
For example, predicting the sentiment of Twit-
ter texts (Kouloumpis et al., 2011) or news ar-
ticles (Balahur et al., 2013). However, human
language is multimodal in, for instance, face-to-
face communication and online multimedia opin-
ion sharing. Understanding natural language used
in such scenarios is especially important for NLP
applications in Human-Computer/Robot Interac-
tion. Thus, in recent years there has been grow-
ing interest in multimodal sentiment analysis. The
three most widely studied modalities in current
multimodal sentiment analysis research are: vocal
(e.g., speech acoustics), visual (e.g., facial expres-
sions), and verbal (e.g., lexical content). These
are sometimes referred to as "the three Vs" of
communication (Mehrabian et al., 1971). Mul-
timodal sentiment analysis research focuses on
understanding how an individual modality con-
veys sentiment information (intra-modal dynam-
ics), and how they interact with each other (inter-
modal dynamics). It is a challenging research area
and state-of-the-art performance of automatic sen-
timent prediction has room for improvement com-
pared to human performance (Zadeh et al., 2018a).
While multimodal approaches to sentiment
analysis are relatively new in NLP, multimodal
emotion recognition has long been a focus of Af-
fective Computing. For example, De Silva and
Ng (2000) combined facial expressions and speech
acoustics to predict the Big-6 emotion categories
(Ekman, 1992). Emotions and sentiments are
closely related concepts in Psychology and Cog-
nitive Science research, and are often used in-
terchangeably. Munezero et al. (2014) identi-
fied the main differences between sentiments and
emotions to be that sentiments are more stable
and dispositional than emotions, and sentiments
are formed and directed toward a specific ob-
ject. However, when adopting the cognitive def-
inition of emotions which connects emotions to
stimuli in the environment (Ortony et al., 1990),
the boundary between emotions and sentiments
blurs. In particular, the circumplex model of emo-
tions proposed by Russell (1980) describes emo-
tions with two dimensions: Arousal which rep-
resents the level of excitement (active/inactive),
and Valence which represents the level of lik-
ing (positive/negative).
In many sentiment anal-
ysis studies, sentiments are defined using Likert
scales with varying numbers of steps. For ex-
ample, the Stanford Sentiment Treebank (Socher
et al., 2013) used a 7-point Likert scale to annotate
sentiments. Such sentiment annotation schemes
have two aspects: polarity (positive/negative val-
ues) and intensity (steps within the positive or neg-
ative range of values). This similarity suggests
connections between emotions defined in terms of
Valence and Arousal, and sentiments defined with
polarity and intensity, as shown in Table 1. How-
ever, while previous work on multimodal emo-
tion recognition often predicts Arousal and Va-
lence separately, most previous work on multi-
modal sentiment analysis generally predicts the
sentiment score as a single number. Thus, we are
motivated to study how the polarity and intensity
aspects of sentiments are each conveyed.
Aspect of the affect Activeness
Emotion as by
Arousal
Russell (1980)
Sentiment on
a Likert scale
Intensity
Liking
Valence
Polarity
Table 1: Similarity between circumplex model of
emotion and Likert scale based sentiment.
In order to decompose sentiment scores into po-
larity and intensity and study how they are con-
veyed through different modalities, we include po-
larity and/or intensity classification as auxiliary
tasks to sentiment score prediction with multi-task
learning. One problem with Machine Learning
approaches for Affective Computing is model ro-
bustness. In multi-task learning, the model shares
representations between the main task and auxil-
iary tasks related to the main task, often enabling
the model to generalize better on the main task
(Ruder, 2017). Multiple auxiliary tasks have been
used in previous sentiment analysis and emotion
recognition studies. For example, Xia and Liu
(2017) used dimensional emotion regression as
an auxiliary task for categorical emotion classi-
fication, while Chen et al. (2017) used sentence
type classification (number of opinion targets ex-
pressed in a sentence) as an auxiliary task for ver-
bal sentiment analysis. To the best of our knowl-
edge, there has been no previous work applying
multi-task learning to the CMU-MOSI database.
In addition to how individual modalities convey
sentiment, another interesting topic in multimodal
sentiment analysis is how to combine information
from multiple modalities. There are three main
types of modality fusion strategies in current mul-
timodal Machine Learning research (Baltrusaitis
et al., 2018): early fusion which combines features
from different modalities, late fusion which com-
bines outputs of unimodal models, and hybrid fu-
sion which exploits the advantages of both early
and late fusion. We will study the performance of
these different modality fusion strategies for mul-
timodal sentiment analysis.
3 Methodology
3.1 The CMU-MOSI Database
The CMU-MOSI database contains 93 YouTube
opinion videos from 89 distinct speakers (Zadeh
et al., 2016). The videos are monologues on var-
ious topics recorded with various setups, lasting
from 2 to 5 minutes.
2199 opinion segments
were manually identified from the videos with
an average length of 4.2 seconds (approximately
154 minutes in total). An opinion segment is
the expression of opinion on a distinct subject,
and can be part of a spoken utterance or consist
of several consecutive utterances. Zadeh et al.
(2016) collected sentiment score annotations of
the opinion segments using Amazon Mechanical
Turk and each video clip was annotated by five
workers. For each opinion segment the sentiment
scores are annotated on a 7-point Likert scale,
i.e., strongly negative (-3), negative (-2), weakly
negative (-1), neutral (0), weakly positive (+1),
positive (+2), strongly positive (+3). The gold-
standard sentiment score annotations provided are
the average of all five workers.
Previous work on the CMU-MOSI database ex-
plored various approaches to improving perfor-
mance of sentiment score prediction (e.g., Zadeh
et al. (2018b)). The target sentiment annotations
can be continuous sentiment scores or discrete
sentiment classes (binary, 5-class, or 7-class senti-
ment classes). The Tensor Fusion Network model
of Zadeh et al. (2017) achieved the best perfor-
mance for continuous sentiment score regression
on the CMU-MOSI database using features from
all three modalities. The Pearson's correlation co-
efficient between the automatic predictions of their
model and the gold-standard sentiment score an-
notations reached 0.70.
In this work, we follow
the parameter settings and features used by Zadeh
et al. (2017) when predicting the sentiment scores.
3.2 Multimodal Sentiment Analysis with
Multi-Task Learning
In this study, we apply multi-task learning to sen-
timent analysis using the CMU-MOSI database.
We consider predicting the gold-standard senti-
ment scores as the main task. Thus, the single-
task learning model is a regression model predict-
ing the sentiment score So of an opinion segment
o, which has a value within range [-3,+3]. To
perform multi-task learning, for each opinion seg-
ment, we transform the gold-standard sentiment
score So into binary polarity class Po and inten-
sity class Io:
(cid:40)
Po =
Positive,
Negative,
if So ≥ 0
if So < 0
Io =
Strong,
Medium,
Weak,
Neutral,
if So ≥ 2.5
if 1.5 ≤ So < 2.5
if 0.5 ≤ So < 1.5
if So < 0.5
(1)
(2)
Unlike previous studies performing a 5-class
or 7-class classification experiment for sentiment
analysis, our definition of intensity classes uses the
absolute sentiment scores, thus separating the po-
larity and intensity information. For example, an
opinion segment o1 with So1 = +3.0 will have Po1
= Positive and Io1 = Strong, while an opinion seg-
ment o2 with So2 = -2.75 will have Po2 = Negative
and Io2 = Strong. Note that here we group the sen-
timent scores into discrete intensity classes. In the
future we plan to study the gain of preserving the
ordinal information between the intensity classes.
For each modality or fusion strategy we build
four models:
single-task sentiment regression
model, bi-task sentiment regression model with
polarity classification as the auxiliary task, bi-task
sentiment regression model with intensity classi-
fication as the auxiliary task, and tri-task senti-
ment regression model with both polarity and in-
tensity classification as the auxiliary tasks. In the
bi-task and tri-task models, the main task loss is
assigned a weight of 1.0, while the auxiliary task
losses are assigned a weight of 0.5. Structures
of the single-task and multi-task learning models
only differ at the output layer: for sentiment score
regression the output is a single node with tanh ac-
tivation; for polarity classification the output is a
single node with sigmoid activation; for intensity
classification the output is 4 nodes with softmax
activation. The main task uses mean absolute er-
ror as the loss function, while polarity classifica-
tion uses binary cross-entropy as the loss function,
and intensity classification uses categorical cross-
entropy as the loss function. Following state-of-
the-art on the CMU-MOSI database (Zadeh et al.,
2017), during training we used Adam as the opti-
mization function with a learning rate of 0.0005.
We use the CMU Multimodal Data Software De-
velopment Kit (SDK) (Zadeh et al., 2018a) to
load and pre-process the CMU-MOSI database,
which splits the 2199 opinion segments into train-
ing (1283 segments), validation (229 segments),
and test (686 segments) sets.1 We implement the
sentiment analysis models using the Keras deep
learning library (Chollet et al., 2015).
3.3 Multimodal Features
For the vocal modality, we use the COVAREP fea-
ture set provided by the SDK. These are 74 vocal
features including 12 Mel-frequency cepstral co-
efficients, pitch tracking and voiced/unvoiced seg-
menting features, glottal source parameters, peak
slope parameters, and maxima dispersion quo-
tients. The vocal features are extracted from the
audio recordings at a sampling rate of 100Hz. For
the visual modality, we use the FACET feature set
provided by the SDK. These are 46 visual features
including facial indicators of 9 types of emotion
(anger, contempt, disgust, fear, joy, sadness, sur-
prise, frustration, and confusion) and movements
of 20 facial action units. The visual features are
extracted from the speaker's facial region in the
video recordings at a sampling rate of 30Hz. Fol-
lowing Zadeh et al. (2017), for the vocal and vi-
sual unimodal models, we apply a drop-out rate of
0.2 to the features and build a neural network with
three hidden layers of 32 ReLU activation units, as
shown in Figure 1.
Figure 1: Visual/vocal unimodal tri-task model
For the verbal modality, we use the word em-
1Segment 13 of video 8qrpnFRGt2A is partially missing
and thus removed for the experiments.
bedding features provided by the SDK, which are
300-dimensional GloVe word vectors. There are
26,295 words in total (3,107 unique words) in the
opinion segments of the CMU-MOSI database.
Following Zadeh et al. (2017), for the verbal uni-
modal model we build a neural network with one
layer of 128 Long Short-Term Memory (LSTM)
units and one layer of 64 ReLU activation units, as
shown in Figure 2. Previous work has found that
context information is important for multimodal
sentiment analysis, and the use of LSTM allows
us to include history (Poria et al., 2017).
Figure 2: Verbal unimodal tri-task model
Note that the visual and vocal features are ex-
tracted at the frame level, while the verbal features
are extracted at the word level. Before conduct-
ing all unimodal and multimodal experiments, we
aligned all the features to the word level using the
SDK. This down-samples the visual and vocal fea-
tures to the word level by computing the averaged
feature vectors for all frames within a word.
3.4 Modality Fusion Strategies
We test four fusion strategies here: Early Fusion
(EF), Tensor Fusion Network (TFN), Late Fusion
(LF), and Hierarchical Fusion (HF). EF and LF are
the most widely used fusion strategies in multi-
modal recognition studies and were shown to be
effective for multimodal sentiment analysis (Po-
ria et al., 2015). TFN achieved state-of-the-art
performance on the CMU-MOSI database (Zadeh
et al., 2017). HF is a form of hybrid fusion strat-
egy shown to be effective for multimodal emotion
recognition (Tian et al., 2016).
The structure of the EF model is shown in Fig-
ure 3. The feature vectors are simply concatenated
in the EF model. A drop-out rate of 0.2 is applied
to the combined feature vector. We then stack one
layer of 128 LSTM units and three layers of 32
ReLU units with an L2 regularizer weight of 0.01
on top of the multimodal inputs. To compare per-
formance of the fusion strategies, this same struc-
ture is applied to the multimodal inputs in all mul-
timodal models. In the TFN model, we compute
the Cartesian products (shown in Figure 4) of the
unimodal model top layers as the multimodal in-
puts. Unlike Zadeh et al. (2017), we did not add
the extra constant dimension with value 1 when
computing the 3-fold Cartesian space in order to
reduce the dimensionality of the multimodal in-
put. In the LF model, as shown in Figure 5, we
concatenate the unimodal model top layers as the
multimodal inputs.
In the HF model, unimodal
information is used in a hierarchy where the top
layer of the lower unimodal model is concatenated
with the input layer of the higher unimodal model,
as shown in Figure 6. We use the vocal modality at
the bottom of the hierarchy while using the verbal
modality at the top in HF fusion. This is because
in previous studies (e.g., Zadeh et al. (2018a)) the
verbal modality was shown to be the most effec-
tive for unimodal sentiment analysis, while the vo-
cal modality was shown to be the least effective.
Figure 3: Structure of EF tri-task model
Figure 4: Fusion strategy of the TFN model
(Zadeh et al., 2017)
4 Experiments and Results
Here we report our sentiment score prediction ex-
periments.2 In Tables 2 and 3, "S" is the single-
task learning model; "S+P" is the bi-task learn-
ing model with polarity classification as the aux-
illary task; "S+I" is the bi-task learning model
with intensity classification as the auxillary task;
"S+P+I" is the tri-task learning model. To evalu-
ate the performance of sentiment score prediction,
following previous work (Zadeh et al., 2018a), we
2Source code available at: https://github.com/
tianleimin/.
Figure 5: Structure of LF tri-task model
Figure 6: Structure of HF tri-task model
report both Pearson's correlation coefficient (CC,
higher is better) and mean absolute error (MAE,
lower is better) between predictions and annota-
tions of sentiment scores on the test set. In each
row of Tables 2 and 3, the numbers in bold are
the best performance for each modality or fusion
strategy. To identify the significant differences in
results, we perform a two-sample Wilcoxon test on
the sentiment score predictions given by each pair
of models being compared and consider p < 0.05
as significant. We also include random prediction
as a baseline and the human performance reported
by Zadeh et al. (2017).
4.1 Unimodal Experiments
The results of unimodal sentiment prediction ex-
periments are shown in Table 2.3 The verbal mod-
els have the best performance here, which is con-
sistent with previous sentiment analysis studies
on multiple databases (e.g., Zadeh et al. (2018a)).
This suggests that lexical information remains the
most effective for sentiment analysis. On each
modality,
the best performance is achieved by
a multi-task learning model. This answers our
first research question and suggests that sentiment
analysis can benefit from multi-task learning.
3All unimodal models have significantly different per-
formance. p = 0.009 for S+P and S+P+I Visual models,
p << 0.001 for Visual and Vocal S+I models.
UnimodalLanguage(zl)Acoustic(za)Visual(zv)EarlyFusionUnimodalLanguage(zl)Acoustic(za)Visual(zv)TensorFusionzlzvzaza⊗zvzl⊗zazl⊗zvzl⊗zv⊗zaIn multi-task learning, the main task gains addi-
tional information from the auxillary tasks. Com-
pared to the S model, the S+P model has increased
focus on the polarity of sentiment, while the S+I
model has increased focus on the intensity of sen-
timent. On the verbal modality, the S+P model
achieved the best performance, while on the vi-
sual modality the S+I model achieved the best per-
formance. This suggests that the verbal modal-
ity is weaker at communicating the polarity of
sentiment. Thus, verbal sentiment analysis ben-
efits more from including additional information
on polarity. On the contrary, the visual modal-
ity is weaker at communicating the intensity of
sentiment. Thus, visual sentiment analysis ben-
efits more from including additional information
on intensity. For the vocal modality, the S+P+I
model achieved the best performance, and the S+P
model yielded improved performance over that of
the S model. This suggests that the vocal modality
is weaker at communicating the polarity of senti-
ment. Thus, addressing our second research ques-
tion, the results suggest that individual modalities
differ when conveying each aspect of sentiment.
S
–
0.125
0.092
0.404
0.820
CC
Random
Vocal
Visual
Verbal
Human
MAE
Random 1.880
1.456
Vocal
Visual
1.442
1.196
Verbal
Human
0.710
S
S+P
–
0.149
0.109
0.455
–
S+P
–
1.471
1.439
1.156
–
S+I
–
0.119
0.116
0.434
–
S+I
–
1.444
1.453
1.181
–
S+P+I
–
0.153
0.106
0.417
–
S+P+I
–
1.431
1.460
1.206
–
Table 2: Unimodal sentiment analysis results on
the CMU-MOSI test set. Numbers in bold are the
best results on each modality.
results
4.2 Multimodal Experiments
The
experi-
ments are shown in Table 3. We find that
EF>HF>TFN>LF.4 The reason that
the EF
model yields the best performance may be that it
the multimodal
of
4Performance of multimodal models are significantly dif-
ferent, except that the HF S and the TFN S+P model have
p = 0.287. p = 0.001 for EF S+P+I and HF S, p = 0.017
for TFN S+P and LF S.
is the least complex. This is shown to be beneficial
for the small CMU-MOSI database (Poria et al.,
2015). Unlike Zadeh et al. (2017), here the EF
model outperforms the TFN model. However,
the TFN model achieved the best performance on
the training and validation sets. This indicates
that performance of the TFN model may be
limited by over-fitting. Compared to the feature
concatenation used in EF, the Cartesian product
used in TFN results in higher dimensionality
of the multimodal input vector,5 which in turn
increases the complexity of the model. Similarly,
the HF model has worse performance than the
EF model here, unlike in Tian et al. (2016). This
may be due to the HF model having the deepest
structure with the most hidden layers, which
increases its complexity.
The performance of unimodal and multimodal
models are significantly different. In general, the
multimodal models have better performance than
the unimodal models.6 Unlike unimodal models,
multimodal models benefit less from multi-task
learning. In fact, the HF and LF models have bet-
ter performance using single-task learning. For
the TFN models, only the S+P model outperforms
the S model, although the improvement is not sig-
nificant.7 For the EF models, multi-task learning
results in better performance.8 The reason that
EF benefits from multi-task learning may be that
it combines modalities without bias and individ-
ual features have more influence on the EF model.
Thus, the benefit of multi-task learning is pre-
served in EF. However, the other fusion strategies
(TFN, LF, HF) attempt to compensate one modal-
ity with information from other modalities, i.e., re-
lying more on other modalities when one modal-
ity is weaker at predicting an aspect of sentiment.
In Section 4.1 we showed that each modality has
different weaknesses when conveying the polarity
or intensity aspect of sentiment. The multimodal
models are able to overcome such weaknesses by
modality fusion. Thus, multi-task learning does
not yield additional improvement in these models.
Our observations answer our third research ques-
tion: multi-task learning influences unimodal and
5Dimension of the EF input is 420, for TFN is 65,536.
6Except that the LF models often have worse performance
than the verbal S+P model. p << 0.001 for TFN S+P and
verbal S+P, p = 0.017 for verbal S+P and LF S.
7p = 0.105 for S TFN and S+P TFN.
8p = 0.888 for S EF and S+P EF, p = 0.029 for S EF
and S+I EF, p = 0.009 for S EF and S+P+I EF.
multimodal sentiment analysis differently.
S
–
S
0.471
0.448
0.454
0.469
0.820
CC
Random
EF
TFN
LF
HF
Human
MAE
Random 1.880
1.197
EF
TFN
1.186
1.179
LF
1.155
HF
Human
0.710
S+P
–
0.472
0.461
0.413
0.424
–
S+P
–
1.181
1.181
1.211
1.211
–
S+I
–
0.476
0.446
0.428
0.458
–
S+I
–
1.193
1.178
1.204
1.164
–
S+P+I
–
0.482
0.429
0.428
0.432
–
S+P+I
–
1.172
1.205
1.201
1.187
–
Table 3: Multimodal sentiment analysis results on
the CMU-MOSI test set. Numbers in bold are the
best results for each fusion strategy in each row.
5 Discussion
Our unimodal experiments in Section 4.1 show
that unimodal sentiment analysis benefits signifi-
cantly from multi-task learning. As suggested by
Wilson (2008), polarity and intensity can be con-
veyed through different units of language. We can
use one word such as extremely to express inten-
sity, while the polarity of a word and the polar-
ity of the opinion segment the word is in may be
opposite. Our work supports a fine-grained sen-
timent analysis. By including polarity and inten-
sity classification as the auxiliary tasks, we illus-
trate that individual modalities differ when con-
veying sentiment. In particular, the visual modal-
ity is weaker at conveying the intensity aspect of
sentiment, while the vocal and verbal modalities
are weaker at conveying the polarity aspect of sen-
timent.
In previous emotion recognition studies
under the circumplex model of emotions (Rus-
sell, 1980), it was found that the visual modality
is typically weaker at conveying the Arousal di-
mension of emotion, while the vocal modality is
typically weaker at conveying the Valence dimen-
sion of emotion (e.g., Nicolaou et al. (2011)). The
similarities between the performance of different
communication modalities on conveying emotion
dimensions and on conveying different aspects of
sentiment indicate a connection between emotion
dimensions and sentiment. The different behav-
iors of unimodal models in conveying the polarity
and intensity aspects of sentiment also explain the
improved performance achieved by modality fu-
sion in Section 4.2 and in various previous stud-
ies. By decomposing sentiment scores into po-
larity and intensity, our work provides detailed
understanding on how individual modalities and
multimodal information convey these two aspects
of sentiment.
We are aware that performance of our senti-
ment analysis models leaves room for improve-
ment compared to state-of-the-art on the CMU-
MOSI database. One reason may be that we did
not perform pre-training in this study. In the fu-
ture, we plan to explore more advanced learning
techniques and models, such as a Dynamic Fu-
sion Graph (Zadeh et al., 2018b), to improve per-
formance. We also plan to perform case studies
to provide detailed analysis on how the unimodal
models benefit from multi-task learning, and how
individual modalities compensate each other in the
multimodal models.
6 Conclusions
In this work, we decouple Likert scale sentiment
scores into two aspects: polarity and intensity, and
study the influence of including polarity and/or
intensity classification as auxiliary tasks to senti-
ment score regression. Our experiments showed
that all unimodal models and some multimodal
models benefit from multi-task learning. Our uni-
modal experiments indicated that each modality
conveys different aspects of sentiment differently.
In addition, we observed similar behaviors be-
tween how individual modalities convey the po-
larity and intensity aspects of sentiments and how
they convey the Valence and Arousal emotion di-
mensions. Such connections between sentiments
and emotions encourage researchers to obtain an
integrated view of sentiment analysis and emotion
recognition. Our multimodal experiments showed
that unlike unimodal models, multimodal models
benefit less from multi-task learning. This sug-
gests that one reason that modality fusion yields
improved performance in sentiment analysis is its
ability to combine the different strengths of indi-
vidual modalities on conveying sentiments.
Note that we only conducted experiments on the
CMU-MOSI database. In the future, we plan to
expand our study to multiple databases. More-
over, we are interested in including databases col-
lected on modalities beyond the three Vs. For ex-
ample, gestures or physiological signals. We also
plan to perform sentiment analysis and emotion
recognition in a multi-task learning setting to fur-
ther explore the relationship between sentiments
and emotions.
Acknowledgments
We would like to thank Zack Hodari for his
support on computational resources, and Jennifer
Williams for the insightful discussion.
References
Alexandra Balahur, Ralf Steinberger, Mijail Kabad-
jov, Vanni Zavarella, Erik Van Der Goot, Matina
Halkia, Bruno Pouliquen, and Jenya Belyaeva. 2013.
arXiv preprint
Sentiment analysis in the news.
arXiv:1309.6202.
Tadas Baltrusaitis, Chaitanya Ahuja, and Louis-
Philippe Morency. 2018. Multimodal machine
IEEE Transac-
learning: A survey and taxonomy.
tions on Pattern Analysis and Machine Intelligence.
Tao Chen, Ruifeng Xu, Yulan He, and Xuan Wang.
2017.
Improving sentiment analysis via sentence
type classification using BiLSTM-CRF and CNN.
Expert Systems with Applications, 72:221–230.
Franc¸ois Chollet et al. 2015. Keras. https://
keras.io.
Liyanage C De Silva and Pei Chi Ng. 2000. Bimodal
emotion recognition. In FG, pages 332–335. IEEE.
Paul Ekman. 1992. An argument for basic emotions.
Cognition & Emotion, 6(3-4):169–200.
Efthymios Kouloumpis, Theresa Wilson, and Jo-
hanna D Moore. 2011. Twitter sentiment analysis:
ICWSM, 11(538-
The good the bad and the omg!
541):164.
Albert Mehrabian et al. 1971. Silent messages, vol-
ume 8. Wadsworth Belmont, CA.
Myriam D Munezero, Calkin Suero Montero, Erkki Su-
tinen, and John Pajunen. 2014. Are they different?
affect, feeling, emotion, sentiment, and opinion de-
tection in text. IEEE Transactions on Affective Com-
puting, 5(2):101–111.
Mihalis A Nicolaou, Hatice Gunes, and Maja Pantic.
2011. Continuous prediction of spontaneous af-
fect from multiple cues and modalities in valence-
arousal space. IEEE Transactions on Affective Com-
puting, 2(2):92–105.
Andrew Ortony, Gerald L Clore, and Allan Collins.
1990. The cognitive structure of emotions. Cam-
bridge University Press.
Soujanya Poria, Erik Cambria, and Alexander Gel-
bukh. 2015. Deep convolutional neural network
textual features and multiple kernel learning for
utterance-level multimodal sentiment analysis.
In
Proceedings of
the 2015 conference on empiri-
cal methods in natural language processing, pages
2539–2544.
Soujanya Poria, Erik Cambria, Devamanyu Hazarika,
Navonil Majumder, Amir Zadeh, and Louis-Philippe
Morency. 2017. Context-dependent sentiment anal-
ysis in user-generated videos. In Proceedings of the
55th Annual Meeting of the Association for Compu-
tational Linguistics (Volume 1: Long Papers), vol-
ume 1, pages 873–883.
Sebastian Ruder. 2017. An overview of multi-task
learning in deep neural networks. arXiv preprint
arXiv:1706.05098.
James A Russell. 1980. A circumplex model of af-
fect. Journal of Personality and Social Psychology,
39(6):1161.
Richard Socher, Alex Perelygin, Jean Wu, Jason
Chuang, Christopher D Manning, Andrew Ng, and
Christopher Potts. 2013. Recursive deep models
for semantic compositionality over a sentiment tree-
bank. In EMNLP, pages 1631–1642.
Leimin Tian, Johanna Moore, and Catherine Lai. 2016.
Recognizing emotions in spoken dialogue with hi-
erarchically fused acoustic and lexical features. In
SLT, pages 565–572. IEEE.
Theresa Ann Wilson. 2008. Fine-grained subjectiv-
ity and sentiment analysis: recognizing the intensity,
polarity, and attitudes of private states. University
of Pittsburgh.
Rui Xia and Yang Liu. 2017. A multi-task learning
framework for emotion recognition using 2d contin-
IEEE Transactions on Affective Com-
uous space.
puting, 8(1):3–14.
A Zadeh, PP Liang, S Poria, P Vij, E Cambria, and
LP Morency. 2018a. Multi-attention recurrent net-
work for human communication comprehension. In
AAAI.
Amir Zadeh, Minghai Chen, Soujanya Poria, Erik
Cambria, and Louis-Philippe Morency. 2017. Ten-
sor fusion network for multimodal sentiment analy-
sis. In EMNLP, pages 1103–1114.
Amir Zadeh, Paul Pu Liang, Jon Vanbriesen, Soujanya
Poria, Erik Cambria, Minghai Chen, and Louis-
Philippe Morency. 2018b. Multimodal language
analysis in the wild: CMU-MOSEI dataset and in-
terpretable dynamic fusion graph. In Association for
Computational Linguistics (ACL).
Amir Zadeh, Rowan Zellers, Eli Pincus, and Louis-
Philippe Morency. 2016. Multimodal sentiment in-
tensity analysis in videos: Facial gestures and verbal
messages. IEEE Intelligent Systems, 31(6):82–88.
|
1703.00786 | 1 | 1703 | 2017-03-02T13:52:47 | A Generic Online Parallel Learning Framework for Large Margin Models | [
"cs.CL",
"cs.LG"
] | To speed up the training process, many existing systems use parallel technology for online learning algorithms. However, most research mainly focus on stochastic gradient descent (SGD) instead of other algorithms. We propose a generic online parallel learning framework for large margin models, and also analyze our framework on popular large margin algorithms, including MIRA and Structured Perceptron. Our framework is lock-free and easy to implement on existing systems. Experiments show that systems with our framework can gain near linear speed up by increasing running threads, and with no loss in accuracy. | cs.CL | cs | A Generic Online Parallel Learning Framework for Large Margin Models
Shuming Ma and Xu Sun
MOE Key Laboratory of Computational Linguistics, Peking University
School of Electronics Engineering and Computer Science, Peking University
{shumingma, xusun}@pku.edu.cn
7
1
0
2
r
a
M
2
]
L
C
.
s
c
[
1
v
6
8
7
0
0
.
3
0
7
1
:
v
i
X
r
a
Abstract
To speed up the training process, many
existing systems use parallel technology
for online learning algorithms. However,
most research mainly focus on stochastic
gradient descent (SGD) instead of other
algorithms. We propose a generic online
parallel learning framework for large mar-
gin models, and also analyze our frame-
work on popular large margin algorithms,
including MIRA and Structured Percep-
tron. Our framework is lock-free and easy
to implement on existing systems. Exper-
iments show that systems with our frame-
work can gain near linear speed up by in-
creasing running threads, and with no loss
in accuracy.
1 Introduction
Large margin models have been widely used in
natural language processing for faster learning rate
and smaller computational cost. However, the al-
gorithms may still suffer from slow training time
when training examples are extremely massive,
the weight vector is large, or the inference process
is slow. With parallel algorithms, we can make
better use of our multi-core machine and reduce
the time cost of training process.
Unluckily, most studies about parallel algo-
rithms mainly focus on SGD. Recht et.al (2011)
first proposed a lock-free parallel SGD algorithm
called HOGWILD. It is a simple and effective
algorithm which outperforms non-parallel algo-
rithms by an order of magnitude. Lian et.al (2015)
provide theoretical analysis of asynchronous par-
allel SGD for nonconvex optimization and a more
precise description for lock-free implementation
on shared memory system.
Zinkevich et.al (2010) proposed a parallel algo-
rithm for multi-machine called Parallel Stochas-
tic Gradient Descent (PSGD). PSGD is an effec-
tive parallel approach on distributed machine but
Recht et.al (2011) found that it is not as promis-
ing as HOGWILD on a single machine. Zhao
and Li (2016) propose a fast asynchronous parallel
SGD approach with convergence guarantee. The
method has a much faster convergence rate than
HOGWILD.
To the best of our knowledge, there is no re-
lated research about asynchronous parallel method
for large margin models. McDonald et.al (2010)
proposed a distributed structured perceptron algo-
rithm but it needs multi-machine. We first pro-
pose a generic online parallel learning framework
for large margin models. In our framework, each
thread updates the weight vector independently
without any extra operation or lock. Besides, we
analyze the performance of structured perceptron
and Margin Infused Relaxed Algorithm (MIRA)
in our framework. The contribution of our frame-
work can be outlined as follow:
• Our framework is generic and suitable for
most of the large margin algorithms. It is sim-
ple and can be easily implemented on exist-
ing systems with large margin models.
• The framework does not use extra memory.
Experiments show that the memory cost is no
more than single-thread algorithm. Besides,
the parallel framework works on a shared
memory system so we have no need to care
about the data exchange.
2 Generic Parallel Learning Framework
Suppose we have a training dataset with N sam-
ples denoted as {(xi, yi)}N
i=1, where xi is a se-
quence (usually a sentence in natural language
Algorithm 1 The Generic Parallel Framework
Input: training set S with N samples
1: initialize: weight vector w = 0, v = 0
2: for t = 1 to T do
3:
Random shuffle training set S
Split training set into K part {Si}K
for all threads parallel do
4:
5:
6:
7:
8:
9:
i=1
Inference for update term Φi
Update wi+1 with Φi
v = v + wi+1
i = i + 1
end for
10:
11: end for
Output: the learned weights www∗ = vvv/(N ∗ T )
processing) and yi is a structure on sequence xi
(usually a tag list or a tree). The whole dataset is
trained with T passes. We denote the weight vec-
tor as w and after ith update the weight vector will
be wi.
In each pass, the online learning algorithm will
shuffle the dataset after which the weight vector
is updated with each sample in the dataset. Gen-
erally, gradient-based algorithms like SGD take a
lot of time to compute the gradient. Large margin
algorithms like perceptron and MIRA spend most
of time in decoding. Popular approach to speed up
inference process is to take approximate inference
instead of exact inference (Huang et al., 2012).
However, we can parallel the inference process of
several samples and update asynchronously to fur-
ther accelerate the training process (Sun, 2016).
In our parallel framework, we split the dataset
into k parts and then assign these split datasets
to k threads. Each thread updates independently
with a shared memory system. After that, we av-
erage the weight vector by the number of iterations
(not the number of threads as some distributed par-
allel algorithms). We can see that our approach
has no more computation than large margin algo-
rithms, so it is a simple parallel framework. Since
the whole framework runs on a shared memory
system, there are mainly two problems about this
framework: First, several threads update at the
same time so it may be closer to minibatch al-
gorithm instead of online learning algorithm intu-
itively. Whether the parallel framework will affect
the convergence rate of online learning algorithm
is a problem. Second, when a thread is work-
ing, the weight vector may be overwritten by other
threads. Whether it will lead to divergence is an-
other problem need to be analyzed.
For the first problem, Lian et.al (2015) proved
that the convergence rate will not be affected un-
der the parallel SGD framework. Our experiments
also support that the convergence rate of large
margin algorithms is still the same in our parallel
framework. For the second problem, Recht et.al
(2011) shows that individual SGD steps only mod-
ify a small part of the decision variable so mem-
ory overwrites are rare and barely any error will be
made into the computation. We will also explain
this problem on large margin models in Section 3.
Experiments show that our parallel algorithm is so
robust that the interference among threads will not
affect the convergence. In our framework we also
average the weight vector by the number of itera-
tions. One reason is that Collins (2002) explains
that averaging parameter helps advoid overfitting.
Another advantage is that we can ensure every up-
date will contribute to the final learned weight vec-
tor.
3 Large Margin Models
In this section, we will introduce some popular
large margin algorithms and analyze their perfor-
mance under our parallel framework.
3.1 MIRA
Crammer and Singer (2003) developed a large
margin algorithm called MIRA and later extended
by Taskar et.al (?). The algorithm has been widely
used in many popular models (McDonald et al.,
2005). It tries to minimize kwk so that the mar-
gin between output score s(x, z) and correct score
s(x, y) is larger than the loss of output structure:
minimizekwk
st. ∀z ∈ GEN (x) s(x, y) − s(x, z) ≥ L(y, z)
During the inference process,
the algorithm
manages to find out the output structure with the
highest score. However, in our parallel framework
weight vector can be overwritten so we may not
get the 1-best structure. Actually, it does not mat-
ter because the binary feature representation is so
sparse that the output score is still close to 1-best
score. We can say that the margin between output
score and correct score is larger than the loss, so
the margin between 1-best score and correct score
will still satisfy the constrain.
Chunking Speed Up
Bio−NER Speed Up
6
5
4
3
2
1
)
s
e
m
i
t
(
p
U
d
e
e
p
S
0
0
2
4
6
Number of threads
6
5
4
3
2
1
)
s
e
m
i
t
(
p
U
d
e
e
p
S
MIRA
Perc
8
10
0
0
2
4
6
Number of threads
MIRA
Perc
8
10
5
4.5
4
3.5
3
2.5
2
1.5
1
0.5
)
s
e
m
i
t
(
p
U
d
e
e
p
S
0
0
2
POS−tag Speed Up
4
6
Number of threads
MIRA
Perc
8
10
Figure 1: Speed up of our parallel framework.
3.2 Structured Perceptron
Structured perceptron is first proposed by
Collins (2002).
It proves to be an effective and
efficient structured prediction algorithm with con-
vergence guarantee for separable data (Sun et al.,
2009, 2013; Sun, 2015). We denote the binary
feature representation of sequence x and structure
y to be f (x, y). The set of structure candidates
for the input sequence x is denoted as GEN (x).
Structured perceptron searches
the space of
GEN (x) and finds the output z with highest
score f (x, z) · w. The weight vector w then
updates with the output z.
In our parallel framework, the inference and up-
date of different samples runs parallel. The infer-
ence and update for structured perceptron can be
descibed as:
z = argmaxt∈GEN (x)f (x, t) · w
w = w + f (x, y) − f (x, z)
(1)
(2)
During the inference, although the weight vector
may be modified, we can still ensure that the score
of the output z is higher than that of correct struc-
ture y. Huang et.al (2012) proved that if each up-
date involves a violation (the output has a higher
model score than the correct structure), structured
perceptron algorithm is bound to converge. There-
fore, our parallel framework on structure percep-
tron is effective theoretically.
4 Experiments
We compare our parallel framework and non-
parallel large margin algorithms on several bench-
mark datasets.
4.1 Experiment Tasks
Part-of-Speech Tagging (POS-tag):
Part of
Speech Tagging is a famous and important task in
natural language processing. Following the prior
work (Collins, 2002), we derives the dataset from
Penn Wall Street Journal Treebank (Marcus et al.,
1993). We use sections 0-18 of the treebank as
training set while sections 19-21 is development
set and sections 22-24 is test set. The selected fea-
ture is including unigrams and bigrams of neigh-
boring words as well as lexical patterns of current
word (Tsuruoka et al., 2011). We report the accu-
racy of output tag as evaluation metric.
The dataset
Phrase Chunking (Chunking):
In Phrase
Chunking task, we tag the words in the se-
I or O to identify the
quence to be B,
noun phrases.
is extracted from
the CoNLL-2000 shallow-parsing shared task
(Tjong Kim Sang and Buchholz, 2000). The fea-
ture includes word n-grams and part-of-speech n-
grams. Our evaluation metric is F-score following
prior works.
Biomedical Named Entity Recognition (Bio-
NER): Biomedical Named Entity Recognition is
mainly about the recognition of 5 kinds of biomed-
ical named entities. The dataset is from MED-
LINE biomedical text corpus. We use word pat-
tern features and part-of speech features in our
model (Tsuruoka et al., 2011). The evaluation
metric is F-score.
4.2 Experiment Setting
We implement our parallel framework with large
margin algorithms, including structured percep-
tron and MIRA on above benchmark datasets. We
use development set to tune the learning rate α0
and L2 regularization. The final learning rate α0
is set as 0.02, 0.05, 0.005 for above three tasks,
and L2 regularization is 1, 0.5, 5.
We implement a single-thread framework as our
baseline. The setting of baseline is totally the
same as our proposed framework. For fair com-
94.6
94.4
94.2
94
93.8
93.6
93.4
93.2
)
%
(
e
r
o
c
S
−
F
93
0
20
94.8
94.6
94.4
94.2
94
93.8
93.6
93.4
)
%
(
e
r
o
c
S
−
F
93.2
0
20
Perc:Chunking
1−thread
4−thread
10−thread
80
100
40
60
Number of iteration
72
71.5
71
70.5
70
69.5
69
68.5
68
)
%
(
e
r
o
c
S
−
F
67.5
0
20
Perc:Bio−NER
97.2
Perc:POS−tag
)
%
(
y
c
a
r
u
c
c
A
97.15
97.1
97.05
97
96.95
96.9
0
20
1−thread
4−thread
10−thread
80
100
40
60
Number of iteration
40
60
Number of iteration
1−thread
4−thread
10−thread
80
100
MIRA:Chunking
MIRA:Bio−NER
72.5
97.2
MIRA:POS−tag
)
%
(
e
r
o
c
S
−
F
72
71.5
71
70.5
70
69.5
69
68.5
68
0
20
1−thread
4−thread
10−thread
80
100
)
%
(
y
c
a
r
u
c
c
A
97.15
97.1
97.05
97
96.95
96.9
96.85
0
20
1−thread
4−thread
10−thread
80
100
1−thread
4−thread
10−thread
80
100
40
60
Number of iteration
40
60
Number of iteration
40
60
Number of iteration
Figure 2: Experiment Results on the benchmark datasets.
1
Chunking
Number of threads
Perc
94.40
MIRA 94.56
Perc
71.83
MIRA 71.75
Perc
97.17
MIRA 97.13
Bio-NER
POS-tag
4
94.46
94.50
71.90
71.70
97.18
97.15
10
94.50
94.53
71.80
71.91
97.10
97.15
Table 1: Accuracy/F-score of baseline and our
framework.
1
Chunking
Number of threads
Perc
1.0x
MIRA 1.0x
Perc
1.0x
MIRA 1.0x
Perc
1.0x
MIRA 1.0x
Bio-NER
POS-tag
4
3.0x
3.7x
3.0x
3.0x
3.3x
3.4x
10
5.5x
4.7x
5.0x
4.6x
4.4x
4.4x
Table 2: Speed up of our framework.
parison, we also average the parameters of the
baseline. We run our parallel framework up to 10
threads following prior work (Recht et al., 2011).
We compare our parallel framework with base-
line in accuracy/F-score and time cost. Experi-
ments are performed on a computer with Intel(R)
Xeon(R) 3.0GHz CPU.
4.3 Experiment Result
Figure 1 shows that our parallel algorithm can gain
near linear speed up. With 10 threads, our frame-
work brings 4-fold to 6-fold faster speed than that
with only 1 thread. Table 2 shows the speed up in
our benchmark datasets with 1,4 and 10 threads.
Figure 2 also shows that our parallel framework
has no loss in accuracy/F-score or convergence
rate compared with single-thread baseline. Table 1
indicates that our framework does not hurt large
margin algorithm because the difference of results
is very small. In other words, there is barely inter-
ference among threads, and the strong robustness
of large margin algorithm ensures no loss in per-
formance under the parallel framework.
5 Conclusions
We propose a generic online parallel
learning
framework for large margin models. Our experi-
ment concludes that the proposed framework has
no loss in performance compared with baseline
while the training speed up is near linear with in-
creasing running threads.
6 Acknowledgements
This work was supported in part by National Natu-
ral Science Foundation of China (No. 61673028),
and National High Technology Research and De-
velopment Program of China (863 Program, No.
Xu Sun, Takuya Matsuzaki, and Wenjie Li. 2013. La-
tent structured perceptrons for large-scale learning
with hidden information. IEEE Trans. Knowl. Data
Eng. 25(9):2063 -- 2075.
Xu Sun, Takuya Matsuzaki, Daisuke Okanohara, and
Jun'ichi Tsujii. 2009. Latent variable perceptron al-
gorithm for structured classification. In Proceedings
of the 21st International Joint Conference on Artifi-
cial Intelligence (IJCAI 2009). pages 1236 -- 1242.
Erik F Tjong Kim Sang and Sabine Buchholz. 2000.
Introduction to the conll-2000 shared task: Chunk-
ing. In Proceedings of the 2nd workshop on Learn-
ing language in logic and the 4th conference on
Computational natural language learning-Volume
7. Association for Computational Linguistics, pages
127 -- 132.
Yoshimasa Tsuruoka, Yusuke Miyao, and Jun'ichi
Kazama. 2011.
Learning with lookahead: can
history-based models rival globally optimized mod-
els? In Proceedings of the Fifteenth Conference on
Computational Natural Language Learning. Associ-
ation for Computational Linguistics, pages 238 -- 246.
Shen-Yi Zhao and Wu-Jun Li. 2016.
Fast asyn-
chronous parallel stochastic gradient descent: A
lock-free approach with convergence guarantee .
Martin Zinkevich, Markus Weimer, Lihong Li, and
Alex J Smola. 2010. Parallelized stochastic gradient
descent. In Advances in neural information process-
ing systems. pages 2595 -- 2603.
2015AA015404). Xu Sun is the corresponding au-
thor of this paper.
References
Michael Collins. 2002. Discriminative training meth-
ods for hidden markov models: Theory and exper-
iments with perceptron algorithms. In Proceedings
of the ACL-02 conference on Empirical methods in
natural language processing-Volume 10. Associa-
tion for Computational Linguistics, pages 1 -- 8.
Koby Crammer and Yoram Singer. 2003. Ultracon-
servative online algorithms for multiclass problems.
The Journal of Machine Learning Research 3:951 --
991.
Liang Huang, Suphan Fayong, and Yang Guo. 2012.
Structured perceptron with inexact search. In Pro-
ceedings of the 2012 Conference of the North Amer-
ican Chapter of the Association for Computational
Linguistics: Human Language Technologies. Asso-
ciation for Computational Linguistics, pages 142 --
151.
Xiangru Lian, Yijun Huang, Yuncheng Li, and Ji Liu.
2015. Asynchronous parallel stochastic gradient for
nonconvex optimization. In Advances in Neural In-
formation Processing Systems. pages 2719 -- 2727.
Mitchell P Marcus, Mary Ann Marcinkiewicz, and
Beatrice Santorini. 1993. Building a large annotated
corpus of english: The penn treebank. Computa-
tional linguistics 19(2):313 -- 330.
Ryan McDonald, Koby Crammer, and Fernando
Pereira. 2005. Online large-margin training of de-
pendency parsers.
In Proceedings of the 43rd an-
nual meeting on association for computational lin-
guistics. Association for Computational Linguistics,
pages 91 -- 98.
Ryan McDonald, Keith Hall, and Gideon Mann. 2010.
Distributed training strategies for the structured per-
ceptron.
In Human Language Technologies: The
2010 Annual Conference of the North American
Chapter of the Association for Computational Lin-
guistics. Association for Computational Linguistics,
pages 456 -- 464.
Benjamin Recht, Christopher Re, Stephen Wright, and
Feng Niu. 2011. Hogwild: A lock-free approach
to parallelizing stochastic gradient descent. In Ad-
vances in Neural Information Processing Systems.
pages 693 -- 701.
Xu Sun. 2015.
Towards shockingly easy struc-
tured classification: A search-based probabilis-
tic online learning framework. Technical report,
arXiv:1503.08381 .
Xu Sun. 2016. Asynchronous parallel learning for neu-
ral networks and structured models with dense fea-
tures. In COLING.
|
1806.10771 | 1 | 1806 | 2018-06-28T05:09:38 | Rich Character-Level Information for Korean Morphological Analysis and Part-of-Speech Tagging | [
"cs.CL"
] | Due to the fact that Korean is a highly agglutinative, character-rich language, previous work on Korean morphological analysis typically employs the use of sub-character features known as graphemes or otherwise utilizes comprehensive prior linguistic knowledge (i.e., a dictionary of known morphological transformation forms, or actions). These models have been created with the assumption that character-level, dictionary-less morphological analysis was intractable due to the number of actions required. We present, in this study, a multi-stage action-based model that can perform morphological transformation and part-of-speech tagging using arbitrary units of input and apply it to the case of character-level Korean morphological analysis. Among models that do not employ prior linguistic knowledge, we achieve state-of-the-art word and sentence-level tagging accuracy with the Sejong Korean corpus using our proposed data-driven Bi-LSTM model. | cs.CL | cs | Rich Character-Level Information for Korean Morphological Analysis
and Part-of-Speech Tagging
Andrew Matteson, Chanhee Lee, Heuiseok Lim∗
Korea University
{amatteson, chanhee0222, limhseok}@korea.ac.kr
Young-Bum Kim
Amazon Alexa
[email protected]
Abstract
8
1
0
2
n
u
J
8
2
]
L
C
.
s
c
[
1
v
1
7
7
0
1
.
6
0
8
1
:
v
i
X
r
a
Due to the fact that Korean is a highly agglutinative, character-rich language, previous work
on Korean morphological analysis typically employs the use of sub-character features known as
graphemes or otherwise utilizes comprehensive prior linguistic knowledge (i.e., a dictionary of
known morphological transformation forms, or actions). These models have been created with
the assumption that character-level, dictionary-less morphological analysis was intractable due to
the number of actions required. We present, in this study, a multi-stage action-based model that
can perform morphological transformation and part-of-speech tagging using arbitrary units of
input and apply it to the case of character-level Korean morphological analysis. Among models
that do not employ prior linguistic knowledge, we achieve state-of-the-art word and sentence-
level tagging accuracy with the Sejong Korean corpus using our proposed data-driven Bi-LSTM
model.
1 Introduction
Korean has traditionally posed a challenge for word segmentation and morphological analysis. In ad-
dition to virtually unbounded vocabulary sizes, out-of-vocabulary (OOV) rates for models can be high.
Korean is an agglutinative, phonetic language with a SOV (Subject-Object-Verb) syntax and a flexible
word order, although certain word orders are considered to be "canonical". Honorifics, conditionals, im-
peratives, and other forms are all signified using agglutinative endings which sometimes involve trans-
formation of the stem to which they attach. Some endings can be further combined or fused to other
endings in a defined order, and furthermore, morphological transformation rules also apply during this
process. Transformation rules are mostly consistent at the grapheme level and can be represented by a
handful of spelling rules, but many irregular forms do exist.
In Unicode, Hangul (Korean alphabet) characters are allocated 11,140 codepoints. Each character
contains an initial consonant, vowel, and final consonant represented in C+V+C, C+V, or V+C form.
In Unicode, the form is always assumed to be C+V+C and the initial or final consonants are set to null
according to the desired target form. Consonants and vowels are considered to be sub-character units
called graphemes. Each character is represented using a combination of 19 initial consonants (including
null), 21 vowels, and 27 final consonants (including null), and there is a mathematical formula that can
be used to combine graphemes to generate the codepoint of a Hangul character. The character "ьҗ" (gim)
can be represented in C+V+C form as follows.
Initial
Consonant
ㄱ(g)
Vowel
ㅣ(i)
Final
Consonant
ㅁ(m)
The Korean language has "fusion" spelling rules that apply across character boundaries (within
an agglutinative unit), which implies that morphological transformation may occur among adjacent
∗ Corresponding author
This work is licensed under a Creative Commons Attribution 4.0 International License.
License details:
http://creativecommons.org/licenses/by/4.0/
Morphemes
#
1 나(na)/VV + юҕ(neun)/ETM
2 ю҉ᆯ(nal)/VV + юҕ(neun)/ETM
3 나(na)/NP + юҕ(neun)/JX
4 나(na)/NNP + юҕ(neun)/JX
5 나(na)/VX + юҕ(neun)/ETM
Table 1: Ambiguous parses of Eojeol "na-
neun"
#
(3)
(2)
Eojeol
나юҕ
na-neun
하юҕnҎ
ha-neul-e
나юҕ
na-neun
ѕᅢёҕ
sae-leul
ѓґn҉ᆻ다
Morphemes
나(na)/NP + юҕ(neun)/JX
하юҕ(ha-neul)/NNG + nҎ(e)/JKB
ю҉ᆯ(nal)/VV + юҕ(neun)/ETM
ѕᅢ(sae)/NNG + ёҕ(leul)/JKO
ѓґ(bo)/VV + n҉ᆻ(ass)/EP
bo-ass-da.
+ 다(da)/EF + ./SF
Table 2: Correct transformation and tag sequence for
sample sentence containing ambiguous Eojeol "na-neun".
# corresponds to correct parse sequence in Table 1, only
labeled here for "na-neun".
graphemes. When the final consonant of one character meets the initial consonant of the next char-
acter during verb inflection, there may be a change in the resulting combined character. This presents
character-level embeddings with a unique challenge that is not present in most other languages.
In order to avoid confusion of terminology, we must define the precise meaning of morphological
analysis in the context of Korean. For most languages, morphological analysis refers to a word-level tag
that describes the aspect, tense, plurality, and other features of the word, whereas part-of-speech (POS)
tagging serves to classify the word as a noun, verb, etc. The POS tag is sometimes concatenated to the
morphological tag string as in the POSMORPH annotation employed by Heigold, et al (2016a).
In Korean, morphological analysis refers to the segmentation and restoration of morphemes within a
"word" unit called an Eojeol and the POS tagging of each constituent morpheme. An Eojeol encodes not
only lexical information but also grammatical information due to the agglutinative nature of the Korean
language. The recovered morpheme segments often include a stem and other morphemes which indicate
tense or other linguistic features. Traditional Korean morphological analysis algorithms operate at the
Eojeol level and yield all ambiguous parses (Table 1) that lead to that particular Eojeol, including the
morpheme transformations and tags. However, the model1 proposed in this paper receives input at the
sentence level and attempts to produce the one correct sequence of transformations and tags for all Eojeol
within the sentence according to the context (Table 2).
2 Related Work
Morphological analysis of the Korean language has traditionally been performed in several ways, in-
cluding separation of Korean characters into graphemes by using linguistic knowledge, lattice tree
lookup (Park et al., 2010), application of regular and irregular inflection rules (Kang and Kim, 1992),
morphosyntactic rule sets, and by using a pre-computed dictionary (Shim and Yang, 2004). However,
we investigate whether morphological analysis of Korean is feasible without the use of any of these
techniques and without a dictionary by making the assumption that common transformations and their
underlying grapheme modifications can be easily recognized and learned with a Bi-LSTM model.
Bi-LSTM-CRFs
BIO annotation
(Sang and Veenstra, 1999). Huang, et al (2015) show their effectiveness for POS tagging, chunk-
ing, named entity recognition (NER). These models show state-of-the-art accuracy at several tasks.
tagging with
for
sequential
have
been
used
Similar models have also been proposed in universal morphological analysis. Heigold, et al (2016b)
show how a nested LSTM architecture can be applied to word-level morphological tagging for a wide
variety of languages. At the lower level, an LSTM network is used for character-level embedding to
1Model source code is made available at https://github.com/xtknight/rich-morphological-tagger
reduce OOV errors. However, this work does not investigate how such a model would operate for the
most widely used Korean Sejong Corpus.
Sub-character tagging has also been attempted. Dong, et al (2016) demonstrate how radical-level
features incorporated at the character-level for named entity recognition achieve state-of-the-art accuracy
for Chinese. The most convincing attempt to tag Korean at the morpheme level is by Choi, et al (2016)
who achieve state-of-the-art (dictionary-less) performance by using a multi-stage Bi-LSTM-CRF model
that involves the splitting of Korean character input into constituent graphemes. However, the implicit
assumption that Korean characters must first be split into graphemes to achieve optimal performance
for morphological analysis is not well supported, and we should consider the splitting of characters into
graphemes to be employing linguistic knowledge specific to Korean.
In our paper, we seek to answer the question of whether Korean morphemes can be tagged without
grapheme-level splitting, rules specific to the language, or a dictionary. Although we initially considered
Bi-LSTM-CRF for our model architecture, we show that the performance benefit by adding CRF is
minimal and practically unnecessary compared to a standard Bi-LSTM model. Furthermore, CRF adds
training and inference computational complexity due to the Viterbi algorithm.
3 Lemma and Form Alignment
ьᅩ(go) іґ(tong) ѕҕ(seu)
B-KEEP
B-KEEP
ѕҕёҍ(seu-reob)
ьᅩіґ(go-tong)
I-KEEP
ㄴ(n)
ёҍ(reon)
I-MOD-ёҍ, B-MOD-ㄴ
ьᅩіґ(go-tong) ѕҕёҍ(seu-reob) ㄴ(n)
ETM
NNG
XSA
Figure 1: Gold morphological
transformation actions
given by alignment oracle, including the resulting mor-
phemes after running the BIO actions (Sejong corpus)
Figure 2: Gold tagging actions (Sejong
corpus)
In the Sejong corpus, Eojeol are annotated with their corresponding POS-tagged morpheme con-
stituents, exactly as shown in Table 2. As mentioned earlier, morpheme spelling transformations may
occur, and therefore the morpheme constituents may have slightly different graphemes than what is
present in the original Eojeol form. To generate our training data, we must align the Eojeol form and
its constituent morphemes at the character level, as we forbid using linguistic knowledge such as sub-
character elements (graphemes) in our model. Like most agglutinative languages, the Eojeol form and
lemmas (morphemic elements in the Sejong corpus) often share overlapping characters at the beginning
or end, and we utilize this assumption in our algorithm.
Gold Action
B-KEEP
I-KEEP
B-MOD-하(ha), B-MOD-ㄴ(n)
NOOP
B-MOD:하(ha), B-MOD-n҉ᆻ(ass)
B-MOD:nᅵ(i), B-MOD-ㄴ(n)
B-MOD:하(ha), B-MOD-아(a)
I-MOD:하(ha), B-MOD-아(a)
B-MOD:яt(doe), B-MOD-ㄴ(n)
B-MOD:하(ha), B-MOD-ㄹ(l)
Count
23,725,534
8,650,166
153,130
131,016
61,592
58,093
57,515
48,987
41,335
36,419
Table 3: Top 10 morphing actions
We present an action-based algorithm (called an "alignment oracle") to align two arbitrary strings.
Our oracle attempts to generate a 1:1 character-level mapping between the morphological form and the
lemmas of an Eojeol by searching for a prefix, suffix, and modified inner string portion. Three primary
actions are defined: KEEP (no modification to character), NOOP (drop character), and MOD (modify
character). In the case of Korean, morphological transformations happen at the end of a form, so there is
rarely a common suffix unless no transformation occurs at all. These primary actions are then augmented
with B- and I- actions to facilitate morpheme segmentation. It is important to note that our algorithm is
not specific in any way to the Sejong corpus or Korean itself.
The full process is demonstrated in Figure 1 starting from the source form. The gold untagged seg-
mented lemma form is shown in the bottom row, and the actions generated by the oracle to generate the
lemma are given in the middle row. The first three characters (go-tong-seu) are preserved with KEEP ac-
tions and the last character is considered the "modified inner string". In this case, the number of actions
(5) exceeds the number of full input characters (4), and therefore two actions are assigned to the last
character which split the "reon" syllable into "reob" and "n". The output after morpheme segmentation
can be seen in the bottom row. In Figure 2, these output morphemes are then placed through a standard
sequential tagger to assign part-of-speech tags.
Figure 3: Actions for transformation with output segmentation
For Korean, the task is considerably more complicated. Rather than merely character-level trans-
formation, new morpheme boundaries based on the results of those transformations are also required.
A segmentation module adds B-/I- (beginning and inside) annotations to the KEEP and MOD actions.
These actions allow morpheme segmentation to take place even amidst the modified character output
sequence. This is detailed in Figure 1, where the final consonant sub-character unit ("n") of the last
character of input ("reon") is transformed to "b" and the resulting fused full character is appended to the
previous output morpheme, whereas the "n" sub-character unit becomes separated and represented as an
entirely new morpheme itself. The top 10 resulting actions for the Sejong corpus on the form and lemma
alignment stage are shown in Table 3.
4 The Model
Our model makes the assumption that in order to support morphological analysis for languages like
Korean, two stages are required, which we call morphing and tagging. For tasks such as morphological
transformation, word-level morphological analysis, or morpheme segmentation, only one stage is strictly
necessary. To obtain tags for morphemes following morphological transformation, as in Korean, both
stages are necessary, with tagging following morphing. The stages have no fundamental difference from
each other:
the second stage simply acts on the result of applying actions output by the first stage.
Each stage outputs a single action for a single input unit. A single action could be as simple as a tag
or as complicated as information resulting in advanced multi-character transformation along with the
specification of the morphemic segments of those resulting characters. Model parameters are trained
independently for each stage unless otherwise specified.
The model presented in this paper is inspired by word-level morphological analysis work by Heigold,
et al (2016a) with the goal of allowing analysis at arbitrary units of input at each stage. Because we do not
specify whether the input unit should be a word, morpheme, character, or even a unit at the sub-character
level (such as graphemes in Korean or radicals in Chinese), we theoretically have the flexibility to tag a
variety of languages at any level.
We employ a bidirectional Long Short-Term Memory (Hochreiter and Schmidhuber, 1997;
Graves and Schmidhuber, 2005) network in our model and also experiment with optimization to a condi-
tional random field (CRF) objective (Lafferty et al., 2001). In theory, CRF allows us to consider the like-
lihood of neighboring outputs and therefore jointly decode the highest probable chain of output labels for
Figure 4: Partial example of two-stage tagging process for Korean phrase "to point out the sea"
a given set of inputs. Although we posit that CRF is not strictly necessary, the overall architecture of our
model is otherwise identical to a standard Bi-LSTM-CRF sequence tagging model (Huang et al., 2015)
used for POS tagging and NER.
An overview of the architecture is shown in Figure 4. The input unit is embedded as a multi-
dimensional vector. At the input level, an auxiliary attribute may be concatenated with the input unit
to include auxiliary information for the unit, such as word break-level information, although empiri-
cal findings indicate our model performs best when using only the input unit. Nested embeddings as
in (2016a) may also be appended at the input level.
All embeddings are concatenated to form a combined embedding which is then passed to the primary
Bi-LSTM-CRF network and trained against a set of output actions. Whitespace delimiting Eojeols is
represented as a reserved spacing token in the input unit.
Although each stage is independent and can accept an arbitrary unit of input suitable for any lan-
guage, the following sections describe how this model pertains to our primary task of morpheme-level
morphological analysis for the Korean language.
4.1 Morphing
The first stage of the model operates at the character level and is responsible for morphological trans-
formation of the input form into the desired output lemma(s). During training, each input character is
assigned one of three primary types by the alignment oracle as described in Section 3. Morpheme seg-
mentation actions are also generated and augmented to the transformation actions at this stage for proper
morpheme boundary identification. During inference, instead of using the alignment oracle, one action
(including transformation and B-/I- tags) is predicted for each character based on trained parameters. At
this point, tags are not yet assigned to each output morpheme.
4.2 Tagging
After the necessary morphological transformation and segmentation, tagging occurs at the morpheme
level and acts on output produced by actions in the first stage of the model. An example of this is shown
in Figure 2. In this stage, the action is simply to assign a POS tag to the morpheme, which is the input
unit.
5 Experiments
5.1 Datasets
We conduct experiments using the full Sejong Korean Balanced Corpus dataset. The experiments are
coded in Python using the TensorFlow library. The Sejong Corpus has been preprocessed to resolve
punctuation inconsistencies and other surface-level errors. All datasets are converted at the sentence-
level to a simple two-column format with each line containing an input unit and target action.
For all experiments, we follow an 85/10/5 cross-validation split for training, testing, and validation
sets respectively. All data is randomly shuffled prior to splitting. Actions are inferred from the dataset by
using lemma and form alignment. For evaluation, output from predicted actions in the first stage is used
as input to the subsequent stage.
U niT agger represents the model proposed in this paper. The following number (for example, 500)
represents the maximum action count for the morphing stage. The tagging stage only has as many actions
as possible POS tags (45 in the Sejong corpus, including the reserved space token). Action pruning is
performed at the training level, which removes from the training set the least common morphological
transformation actions generated by the alignment oracle. For fair evaluation, actions are not removed
from validation or test sets. All accuracy figures in this paper are reported based on a held-out test set.
5.2 Training
Optimization is performed using Adam (Kingma and Ba, 2014) with a learning rate of 0.001 and decay
of 0.9. In the case of multi-stage models, model parameters are optimized independently for each stage.
We use identical hyperparameters for all morphing and tagging models.
Input unit embedding size
was set to 300 (for character and morpheme input). The final Bi-LSTM concatenating all embeddings
before an optional CRF layer was used with an LSTM unit size of 300. Batch size was set to 64 for all
experiments, except for the CRF experiment where it was set to 16. The maximum LSTM input length
was set at a per-batch level which yielded optimal performance, and the maximum number of input units
(whether characters or morphemes) was limited to 400 in both stages. A dropout of 10% was used for the
reported model with best performance. Dropout is only applied at the unit embedding layer. Epoch count
was set to 100 with early-stopping after 3 epochs with no improvement in validation set performance.
Experiments were performed on GTX 1080 Ti 11GB GPUs. Average total training duration was around
5 hours for the entire Sejong dataset on a GTX 1080 Ti. In TensorFlow, the NVIDIA CuDNN-optimized
LSTM was used (Appleyard et al., 2016).
5.3 Results
In Table 4, we show Eojeol-level morphological analysis accuracy for Korean. Note here that an Eojeol
is considered correctly tagged only if all its constituent morphemes have been transformed, segmented,
and tagged properly. Table 5 measures sentence-level tagging performance, which is the accuracy of all
morphemes being transformed and tagged properly.
5.4 Analysis and Discussion
Our results show that our model can outperform previous state-of-the-art performance for Eojeol and
sentence-level morphological analysis of Korean without linguistic knowledge.
When the dropout factor is adjusted, all metrics follow a similar trend as seen in Figure 5. Sentence
accuracy is most sensitive to dropout factor adjustment. Best performance is achieved with a dropout
rate of 10%, and increasing the dropout rate further does not increase Eojeol-level OOV accuracy. This
is a positive finding, as it indicates the model is not considerably overfitting to the training data beyond
approximately the 10% level.
In Figure 6, a 300-dimensional unit embedding layer of the morphing stage is visualized using 2-
component t-SNE. The corresponding gold actions are shown in Table 6, where all past tense morphemes
end with final consonant "ㅆ" (ss). The model is able to infer that most of the forms shown in the
Model
Lee, et al. (2005)
Ahn, et al. (2007)
Lee, et al. (2009)
Choi, et al. (2016)
UniTagger-500
Accuracy
92.96
93.12
92.95
94.89
96.20
Table 4: End-to-end Eojeol-level accuracy for
morphological analysis of Korean (Sejong Cor-
pus)
Model
Choi, et al. (2016) Bi-LSTM-CRF
UniTagger-500
Model Type
Bi-LSTM
Acc
61.00
70.83
Form
ю҉ᆻ(nass)
ѕ҉ᆻ(sass)
n҉ᆻ(jass)
ї҉(pass)
яt(daess)
јҊ(haess)
юҏ(nyeoss)
ёҏ(ryeoss)
ѕҏ(syeoss)
nҏ(jieoss)
ьҏ(gyeoss)
nt(oass)
юt(noass)
Gold Action
B-나 + B-n҉ᆻ
B-사 + B-n҉ᆻ
B-자 + B-n҉ᆻ
B-파 + B-n҉ᆻ
B-яt + B-nҍ
B-하 + B-n҉ᆻ
B-юᅵ + B-nҍ
B-ёᅵ + B-nҍ
B-ѕᅵ + B-nҍ
B-nᅵ + B-nҍ
B-ьᅵ + B-nҍ
B-nґ + B-n҉ᆻ
B-юґ + B-n҉ᆻ
nt(chuweoss) B-nt + B-nҍ
Table 5: End-to-end sentence-level accuracy
for morphological analysis of Korean (Sejong
Corpus)
Table 6: Past tense morphing actions shown in
embedding and gold actions from Sejong cor-
pus
Model
Choi, et al. (2016) Bi-LSTM-CRF
UniTagger-500
Model Type
Bi-LSTM
Acc
67.25
79.49
Table 7: Eojeol-level OOV accuracy
graph represent the past tense and that they share a similar transformation pattern at the final consonant
grapheme level. This shows that our model is able to correlate similar sub-character level morphological
transformations even when operating at the character level. Furthermore, it is worth noting that Chinese
characters still occur rarely in the Korean language in certain contexts. We can see Chinese characters
grouped in a cluster, which shows that the model is able to distinguish one character-rich language
(Korean) from another (Chinese). Other characters, such as punctuation, are also grouped by type in
largely distinct clusters with occasional overlap.
Joint training of both stages was also attempted, though an initial investigation suggests that perfor-
mance is not significantly different from training each stage's parameters independently.
The use of using an auxiliary binary break level attribute to represent whitespace was also investigated,
but significantly higher accuracy was achieved by using a reserved spacing token instead. Despite the
auxiliary break level attribute embedding, both stages of the model have a tendency to learn ambiguous
morpheme transformations for adjacent Eojeol. In other words, even though the morpheme transforma-
tion and tags are correct, the Eojeol boundaries were incorrectly identified. With the reserved spacing
token, this issue was extremely rare.
6 Conclusion and Future Work
In this work, we address the commonly held notion that Korean can not be tagged with competitive
performance at the character level without prior linguistic knowledge. Our model architecture is not
novel compared to previous work. The novelty of our morphological analyzer is its striking simplic-
ity compared to previous approaches for character-rich languages such as Korean. The alignment ora-
cle does not require any cost value for alignment operations such as in the Needleman–Wunsch algo-
rithm (Needleman and Wunsch, 1970). The Bi-LSTM model is able to learn and utilize alignments that
are purely arbitrary and apply them to unseen test data. Even when significantly limiting the number
]
%
[
y
c
a
r
u
c
c
A
98
94
90
86
82
78
74
70
66
62
58
0
10
20
30
40
50
60
Dropout [%]
Correct Eojeol
Correct OOV Eojeol
Correct Sentences
Figure 5: Impact of dropout on end-to-end tagging performance
Figure 6: Deep embeddings of characters at the morphing stage (t-SNE)
of actions in the training data, we show that by using the most common morphological transformation
actions in an agglutinative language, we can exceed the performance of a model that uses linguistic
knowledge such as sub-character features. We also show that the widely used CRF layer may in fact be
unnecessary for high performance and add unnecessary computational complexity. This exceeded our
own expectations and raises the possibility that a single architecture can handle tagging universally with
only two simple Bi-LSTM stages. We contribute the necessary source code to replicate the experiments
and to attempt alignment and training for any other language, assuming a corpus exists. Nevertheless,
there are several points that future work should address.
Out-of-vocabulary morphemes generated by the morphing stage can also result in errors at the tag-
ging stage, as the tagging stage was trained on the assumption of gold morphemes. We would like to
experiment with including possible morpheme transformation errors at the tagging stage to determine if
tagging performance can be improved.
We attempted joint training but found that end-to-end accuracy was marginally lower. We suspect this
is because optimization of each individual stage is hindered by attempting to find optimal parameters
for both stages. Future work should attempt joint training of an end-to-end model with the preinitialized
parameters from optimizing each stage independently, which has been shown to be ideal in sequential
models (Tang et al., 2016).
Lastly, although we are unaware of a language more character-rich and more morphologically complex
than Korean, we would like to see our model applied to other morphologically complex languages to
prove its universality. At the time of writing, we lacked sufficient baseline figures and methodology
for generating training data for analyzing other languages at the morpheme level using the Universal
Dependencies corpus, and the morphological tags were often conflated with part-of-speech tags. The
baselines we found did not specify whether or not morpheme segmentation was taken into account.
Without this information, it would be difficult to prove the performance of our model for other languages
and we decided to leave training other languages as future work. That being said, our model does not
employ any linguistic knowledge specific to Korean, and we therefore have no reason to believe it cannot
be trained on any other arbitrary corpus with minor modifications at the preprocessing level.
Acknowledgements
This research was supported by the MSIT (Ministry of Science and ICT), South Korea, under the ITRC
(Information Technology Research Center) support program ("Research and Development of Human-
Inspired Multiple Intelligence") supervised by the IITP (Institute for Information & Communications
Technology Promotion). Additionally, this work was supported by the National Research Foundation of
Korea (NRF) grant funded by the South Korean government (MSIP) (No. NRF-2016R1A2B2015912).
References
Young-Min Ahn and Young-Hoon Seo. 2007. Korean part-of-speech tagging using disambiguation rules for
ambiguous word and statistical information. IEEE International Conference on Convergence Information Tech-
nology, pages 1598–1601.
Jeremy Appleyard, Tomáš Kociský, and Phil Blunsom. 2016. Optimizing performance of recurrent neural net-
works on gpus. arXiv, (1604.01946).
Jihun Choi, Jonghem Youn, and Sang goo Lee. 2016. A grapheme-level approach for constructing a korean mor-
phological analyzer without linguistic knowledge. IEEE International Conference on Big Data, pages 3872–
3879.
Chuanhai Dong, Jiajun Zhang, Chengqing Zong, Masanori Hattori, and Hui Di. 2016. Character-based lstm-
crf with radical-level features for chinese named entity recognition. International Conference on Computer
Processing of Oriental Languages, pages 239–250.
A. Graves and J. Schmidhuber. 2005. Framewise phoneme classification with bidirectional lstm and other neural
network architectures. Neural Networks, 18(5–6):602–610.
Georg Heigold, Guenter Neumann, and Josef van Genabith. 2016a. Neural morphological tagging from characters
for morphologically rich languages. arXiv, (1606.06640).
Georg Heigold, Guenter Neumann, and Josef van Genabith. 2016b. Scaling character-based morphological tag-
ging to fourteen languages. IEEE International Conference on Big Data.
Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long short-term memory. Neural Computation, 9(8):1735–
1780.
Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidirectional lstm-crf models for sequence tagging. arXiv,
(1508.01991).
Seungshik Kang and Yungtaek Kim. 1992. A computational analysis model of irregular verbs in korean morpho-
logical analyzer. Journal of Korea Information Science Society, 19(2):151–164.
Diederik Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv, (1412.6980).
J. Lafferty, A. McCallum, and F. Pereira. 2001. Conditional random fields: Probabilistic models for segmenting
and labeling sequence data. Proceedings of ICML.
Do-Gil Lee and Hae-Chang Rim. 2005. Probabilistic models for korean morphological analysis. Companion to
the Proceedings of the International Joint Conference on Natural Language Processing, pages 197–202.
Do-Gil Lee and Hae-Chang Rim. 2009. Probabilistic modeling of korean morphology. IEEE Transactions on
Audio, Speech, and Language Processing, 17(5):945–955.
Saul B. Needleman and Christian D. Wunsch. 1970. A general method applicable to the search for similarities in
the amino acid sequence of two proteins. Journal of Molecular Biology.
Sangwon Park, D Choi, E Kim, and K.-S Choi. 2010. A plug-in component-based korean morphological analyzer.
Tjong Kim Sang and Jorn Veenstra. 1999. Representing text chunks. EACL '99 Proceedings of the ninth confer-
ence on European chapter of the Association for Computational Linguistics, pages 173–179.
Gwang-Seob Shim and Jae-Hyung Yang. 2004. High speed korean morphological analysis based on adjacency
condition check. KIISE: Software and Applications, 31(1):89–99.
Hao Tang, Weiran Wang, Kevin Gimpel, and Karen Livescu. 2016. End-to-end training approaches for discrimi-
native segmental models. IEEE Spoken Language Technology Workshop.
This figure "chinese_characters.png" is available in "png"(cid:10) format from:
http://arxiv.org/ps/1806.10771v1
This figure "past_tenses4.png" is available in "png"(cid:10) format from:
http://arxiv.org/ps/1806.10771v1
|
1507.01839 | 2 | 1507 | 2015-08-03T15:36:45 | Dependency-based Convolutional Neural Networks for Sentence Embedding | [
"cs.CL",
"cs.AI",
"cs.LG"
] | In sentence modeling and classification, convolutional neural network approaches have recently achieved state-of-the-art results, but all such efforts process word vectors sequentially and neglect long-distance dependencies. To exploit both deep learning and linguistic structures, we propose a tree-based convolutional neural network model which exploit various long-distance relationships between words. Our model improves the sequential baselines on all three sentiment and question classification tasks, and achieves the highest published accuracy on TREC. | cs.CL | cs | Dependency-based Convolutional Neural Networks
for Sentence Embedding∗
Mingbo Ma†
Liang Huang† ‡
†Graduate Center & Queens College
City University of New York
{mma2,lhuang}gc.cuny.edu
5
1
0
2
g
u
A
3
]
L
C
.
s
c
[
2
v
9
3
8
1
0
.
7
0
5
1
:
v
i
X
r
a
Abstract
In sentence modeling and classification,
convolutional neural network approaches
have recently achieved state-of-the-art re-
sults, but all such efforts process word vec-
tors sequentially and neglect long-distance
dependencies. To combine deep learn-
ing with linguistic structures, we pro-
pose a dependency-based convolution ap-
proach, making use of tree-based n-grams
rather than surface ones, thus utlizing non-
local interactions between words. Our
model improves sequential baselines on all
four sentiment and question classification
tasks, and achieves the highest published
accuracy on TREC.
Introduction
1
Convolutional neural networks (CNNs), originally
invented in computer vision (LeCun et al., 1995),
has recently attracted much attention in natural
language processing (NLP) on problems such as
sequence labeling (Collobert et al., 2011), seman-
tic parsing (Yih et al., 2014), and search query
retrieval (Shen et al., 2014). In particular, recent
work on CNN-based sentence modeling (Kalch-
brenner et al., 2014; Kim, 2014) has achieved ex-
cellent, often state-of-the-art, results on various
classification tasks such as sentiment, subjectivity,
and question-type classification. However, despite
their celebrated success, there remains a major
limitation from the linguistics perspective: CNNs,
being invented on pixel matrices in image process-
ing, only consider sequential n-grams that are con-
secutive on the surface string and neglect long-
distance dependencies, while the latter play an im-
portant role in many linguistic phenomena such as
negation, subordination, and wh-extraction, all of
which might dully affect the sentiment, subjectiv-
ity, or other categorization of the sentence.
∗ This work was done at both IBM and CUNY, and was supported in
part by DARPA FA8750-13-2-0041 (DEFT), and NSF IIS-1449278. We thank
Yoon Kim for sharing his code, and James Cross and Kai Zhao for discussions.
Bing Xiang‡
Bowen Zhou‡
‡IBM Watson Group
T. J. Watson Research Center, IBM
{lhuang,bingxia,zhou}@us.ibm.com
Indeed, in the sentiment analysis literature, re-
searchers have incorporated long-distance infor-
mation from syntactic parse trees, but the results
are somewhat inconsistent: some reported small
improvements (Gamon, 2004; Matsumoto et al.,
2005), while some otherwise (Dave et al., 2003;
Kudo and Matsumoto, 2004). As a result, syn-
tactic features have yet to become popular in the
sentiment analysis community. We suspect one
of the reasons for this is data sparsity (according
to our experiments, tree n-grams are significantly
sparser than surface n-grams), but this problem
has largely been alleviated by the recent advances
in word embedding. Can we combine the advan-
tages of both worlds?
So we propose a very simple dependency-based
convolutional neural networks (DCNNs). Our
model is similar to Kim (2014), but while his se-
quential CNNs put a word in its sequential con-
text, ours considers a word and its parent, grand-
parent, great-grand-parent, and siblings on the de-
pendency tree. This way we incorporate long-
distance information that are otherwise unavail-
able on the surface string.
Experiments on three
classification tasks
demonstrate the superior performance of our
DCNNs over the baseline sequential CNNs.
In
particular, our accuracy on the TREC dataset
outperforms all previously published results
in the literature,
including those with heavy
hand-engineered features.
Independently of this work, Mou et al. (2015,
unpublished) reported related efforts; see Sec. 3.3.
2 Dependency-based Convolution
The original CNN, first proposed by LeCun et
al. (1995), applies convolution kernels on a se-
ries of continuous areas of given images, and was
adapted to NLP by Collobert et al. (2011). Fol-
lowing Kim (2014), one dimensional convolution
operates the convolution kernel in sequential order
in Equation 1, where xi ∈ Rd represents the d di-
mensional word representation for the i-th word in
Figure 1: Dependency tree of an example sentence from the Movie Reviews dataset.
the sentence, and ⊕ is the concatenation operator.
from the i-th word to the (i + j)-th word:
Therefore(cid:101)xi,j refers to concatenated word vector
Sequential word concatenation (cid:101)xi,j works as
n-gram models which feeds local information into
convolution operations. However, this setting can
not capture long-distance relationships unless we
enlarge the window indefinitely which would in-
evitably cause the data sparsity problem.
(cid:101)xi,j = xi ⊕ xi+1 ⊕ ··· ⊕ xi+j
(1)
In order to capture the long-distance dependen-
cies we propose the dependency-based convolu-
tion model (DCNN). Figure 1 illustrates an exam-
ple from the Movie Reviews (MR) dataset (Pang
and Lee, 2005). The sentiment of this sentence
is obviously positive, but this is quite difficult for
sequential CNNs because many n-gram windows
would include the highly negative word “short-
comings”, and the distance between “Despite” and
“shortcomings” is quite long. DCNN, however,
could capture the tree-based bigram “Despite –
shortcomings”, thus flipping the sentiment, and
the tree-based trigram “ROOT – moving – sto-
ries”, which is highly positive.
2.1 Convolution on Ancestor Paths
We define our concatenation based on the depen-
dency tree for a given modifier xi:
xi,k = xi ⊕ xp(i) ⊕ ··· ⊕ xpk−1(i)
(2)
where function pk(i) returns the i-th word’s k-th
ancestor index, which is recursively defined as:
pk(i) =(cid:40)p(pk−1(i))
i
if k > 0
if k = 0
(3)
Figure 2 (left) illustrates ancestor paths patterns
with various orders. We always start the convo-
lution with xi and concatenate with its ancestors.
If the root node is reached, we add “ROOT” as
dummy ancestors (vertical padding).
For a given tree-based concatenated word se-
quence xi,k, the convolution operation applies a
filter w ∈ Rk×d to xi,k with a bias term b de-
scribed in equation 4:
ci = f (w · xi,k + b)
(4)
where f is a non-linear activation function such as
rectified linear unit (ReLu) or sigmoid function.
The filter w is applied to each word in the sen-
tence, generating the feature map c ∈ Rl:
c = [c1, c2,··· , cl]
where l is the length of the sentence.
(5)
2.2 Max-Over-Tree Pooling and Dropout
The filters convolve with different word concate-
nation in Eq. 4 can be regarded as pattern detec-
tion: only the most similar pattern between the
words and the filter could return the maximum ac-
tivation. In sequential CNNs, max-over-time pool-
ing (Collobert et al., 2011; Kim, 2014) operates
over the feature map to get the maximum acti-
vation c = max c representing the entire feature
map. Our DCNNs also pool the maximum activa-
tion from feature map to detect the strongest ac-
tivation over the whole tree (i.e., over the whole
sentence). Since the tree no longer defines a se-
quential “time” direction, we refer to our pooling
as “max-over-tree” pooling.
In order to capture enough variations, we ran-
domly initialize the set of filters to detect different
structure patterns. Each filter’s height is the num-
ber of words considered and the width is always
equal to the dimensionality d of word representa-
tion. Each filter will be represented by only one
feature after max-over-tree pooling. After a series
of convolution with different filter with different
heights, multiple features carry different structural
information become the final representation of the
input sentence. Then, this sentence representation
is passed to a fully connected soft-max layer and
outputs a distribution over different labels.
Neural networks often suffer from overtrain-
ing. Following Kim (2014), we employ random
dropout on penultimate layer (Hinton et al., 2014).
in order to prevent co-adaptation of hidden units.
In our experiments, we set our drop out rate as 0.5
and learning rate as 0.95 by default. Following
Kim (2014), training is done through stochastic
gradient descent over shuffled mini-batches with
the Adadelta update rule (Zeiler, 2012).
Despitethefilm’sshortcomingsthestoriesarequietlymoving.ROOTFigure1:RunningexamplefromMovieReviewsdataset.mensionalwordrepresentationforthei-thwordinthesentence,and⊕istheconcatenationoperator.Thereforeexi,jreferstoconcatenatedwordvectorfromthei-thwordtothe(i+j)-thword:exi,j=xi⊕xi+1⊕···⊕xi+j(1)Sequentialwordconcatenationexi,jworksasn-grammodelswhichfeedslocalinformationintoconvolutionoperations.However,thissettingcannotcapturelong-distancerelationshipsunlessweenlargethewindowindefinitelywhichwouldin-evitablycausethedatasparsityproblem.Inordertocapturethelong-distancedependen-ciesweproposethedependencytree-basedcon-volutionmodel(DTCNN).Figure1illustratesanexamplefromtheMovieReviews(MR)dataset(PangandLee,2005).Thesentimentofthissen-tenceisobviouslypositive,butthisisquitedif-ficultforsequentialCNNsbecausemanyn-gramwindowswouldincludethehighlynegativeword“shortcomings”,andthedistancebetween“De-spite”and“shortcomings”isquitelong.DTCNN,however,couldcapturethetree-basedbigram“Despite–shortcomings”,thusflippingthesenti-ment,andthetree-basedtrigram“ROOT–moving–stories”,whichishighlypositive.2.1ConvolutiononAncestorPathsWedefineourconcatenationbasedonthedepen-dencytreeforagivenmodifierxi:xi,k=xi⊕xp(i)⊕···⊕xpk−1(i)(2)wherefunctionpk(i)returnsthei-thword’sk-thancestorindex,whichisrecursivelydefinedas:pk(i)=(p(pk−1(i))ifk>0iifk=0(3)Figure2(left)illustratesancestorpathspatternswithvariousorders.Wealwaysstarttheconvo-lutionwithxiandconcatenatewithitsancestors.Iftherootnodeisreached,weadd“ROOT”asdummyancestors(verticalpadding).Foragiventree-basedconcatenatedwordse-quencexi,k,theconvolutionoperationappliesafilterw∈Rk×dtoxi,kwithabiastermbde-scribedinequation4:ci=f(w·xi,k+b)(4)wherefisanon-linearactivationfunctionsuchasrectifiedlinearunit(ReLu)orsigmoidfunction.Thefilterwisappliedtoeachwordinthesen-tence,generatingthefeaturemapc∈Rl:c=[c1,c2,···,cl](5)wherelisthelengthofthesentence.2.2Max-Over-TreePoolingandDropoutThefiltersconvolvewithdifferentwordconcate-nationinEq.4canberegardedaspatterndetec-tion:onlythemostsimilarpatternbetweenthewordsandthefiltercouldreturnthemaximumac-tivation.InsequentialCNNs,max-over-timepool-ing(Collobertetal.,2011;Kim,2014)operatesoverthefeaturemaptogetthemaximumacti-vationc=maxcrepresentingtheentirefeaturemap.OurDTCNNsalsopoolthemaximumac-tivationfromfeaturemaptodetectthestrongestactivationoverthewholetree(i.e.,overthewholesentence).Sincethetreenolongerdefinesase-quential“time”direction,werefertoourpoolingas“max-over-tree”pooling.Inordertocaptureenoughvariations,weran-domlyinitializethesetoffilterstodetectdifferentstructurepatterns.Eachfilter’sheightisthenum-berofwordsconsideredandthewidthisalwaysequaltothedimensionalitydofwordrepresenta-tion.Eachfilterwillberepresentedbyonlyonefeatureaftermax-over-treepooling.Afteraseriesofconvolutionwithdifferentfilterwithdifferentheights,multiplefeaturescarrydifferentstructuralinformationbecomethefinalrepresentationoftheinputsentence.Then,thissentencerepresentationispassedtoafullyconnectedsoft-maxlayerandoutputsadistributionoverdifferentlabels.Neuralnetworksoftensufferfromovertrain-ing.FollowingKim(2014),weemployrandomdropoutonpenultimatelayer(Hintonetal.,2012).inordertopreventco-adaptationofhiddenunits.Inourexperiments,wesetourdropoutrateas0.5andlearningrateas0.95bydefault.FollowingKim(2014),trainingisdonethroughstochasticgradientdescentovershuffledmini-batcheswiththeAdadeltaupdaterule(Zeiler,2012).2.3ConvolutiononSiblingsAncestorpathsaloneisnotenoughtocapturemanylinguisticphenomenasuchasconjunction.Figure 2: Convolution patterns on trees. Word concatenation always starts with m, while h, g, and g2
denote parent, grand parent, and great-grand parent, etc., and “ ” denotes words excluded in convolution.
2.3 Convolution on Siblings
For all datasets, we first obtain the dependency
parse tree from Stanford parser (Manning et al.,
Ancestor paths alone is not enough to capture
2014).1 Different window size for different choice
many linguistic phenomena such as conjunction.
of convolution are shown in Figure 2. For the
Inspired by higher-order dependency parsing (Mc-
dataset without a development set (MR), we ran-
Donald and Pereira, 2006; Koo and Collins, 2010),
domly choose 10% of the training data to indicate
we also incorporate siblings for a given word in
early stopping. In order to have a fare compari-
various ways. See Figure 2 (right) for details.
son with baseline CNN, we also use 3 to 5 as our
window size. Most of our results are generated by
GPU due to its efficiency, however CPU could po-
tentially get better results.2 Our implementation,
on top of Kim (2014)’s code,3 will be released.4
2.4 Combined Model
Powerful as it is, structural information still does
not fully cover sequential information. Also, pars-
ing errors (which are common especially for in-
formal text such as online reviews) directly affect
DCNN performance while sequential n-grams are
always correctly observed. To best exploit both in-
formation, we want to combine both models. The
easiest way of combination is to concatenate these
representations together, then feed into fully con-
nected soft-max neural networks. In these cases,
combine with different feature from different type
of sources could stabilize the performance. The
final sentence representation is thus:
3.1 Sentiment Analysis
Both sentiment analysis datasets (MR and SST-
1) are based on movie reviews. The differences
between them are mainly in the different num-
bers of categories and whether the standard split
is given. There are 10,662 sentences in the MR
dataset. Each instance is labeled positive or neg-
ative, and in most cases contains one sentence.
Since no standard data split is given, following the
literature we use 10 fold cross validation to include
every sentence in training and testing at least once.
Concatenating with sibling and sequential infor-
mation obviously improves DCNNs, and the final
model outperforms the baseline sequential CNNs
by 0.4, and ties with Zhu et al. (2015).
Different from MR,
the Stanford Sentiment
Treebank (SST-1) annotates finer-grained labels,
very positive, positive, neutral, negative and very
negative, on an extension of the MR dataset. There
are 11,855 sentences with standard split. Our
model achieves an accuracy of 49.5 which is sec-
ond only to Irsoy and Cardie (2014).
1The phrase-structure trees in SST-1 are actually automatically parsed,
and thus can not be used as gold-standard trees.
2GPU only supports float32 while CPU supports float64.
3https://github.comw/yoonkim/CNN_sentence
4https://github.com/cosmmb/DCNN
c = [c(1)
a , ..., c(Na)
; c(1)
s , ..., c(Ns)
s
; c(1), ..., c(N )
]
siblings
sequential
(cid:123)(cid:122)
(cid:125)
(cid:124)
a
ancestors
(cid:123)(cid:122)
(cid:125)
(cid:124)
(cid:123)(cid:122)
(cid:125)
(cid:124)
where Na, Ns, and N are the number of ancestor,
sibling, and sequential filters. In practice, we use
100 filters for each template in Figure 2 . The fully
combined representation is 1,100-dimensional by
contrast to 300-dimensional for sequential CNN.
3 Experiments
Table 1 summarizes results in the context of other
high-performing efforts in the literature. We use
three benchmark datasets in two categories: senti-
ment analysis on both Movie Review (MR) (Pang
and Lee, 2005) and Stanford Sentiment Treebank
(SST-1) (Socher et al., 2013) datasets, and ques-
tion classification on TREC (Li and Roth, 2002).
ancestorpathssiblingsnpattern(s)npattern(s)3mhg2sm4mhgg23smhtsm5mhgg2g34tsmhsmhgTable1:Tree-basedconvolutionpatterns.Wordconcatenationalwaysstartswithm,whileh,g,andg2denoteparent,grandparent,andgreat-grandparent,etc.,and“”denoteswordsexcludedinconvolution.2.3ConvolutiononSiblingsAncestorpathsaloneisnotenoughtocapturemanylinguisticphenomenasuchasconjunction.Inspiredbyhigher-orderdependencyparsing(Mc-DonaldandPereira,2006;KooandCollins,2010),wealsoincorporatesiblingsforagivenwordinvariousways.SeeTable1(right)fordetails.2.4CombinedModelPowerfulasitis,structuralinformationstilldoesnotfullycoversequentialinformation.Also,pars-ingerrors(whicharecommonespeciallyforin-formaltextsuchasonlinereviews)directlyaffectDTCNNperformancewhilesequentialn-gramsarealwayscorrectlyobserved.Tobestexploitbothinformation,wewanttocombinebothmod-els.Theeasiestwayofcombinationistocon-catenatetheserepresentationstogether,thenfeedintofullyconnectedsoft-maxneuralnetworks.Inthesecases,combinewithdifferentfeaturefromdifferenttypeofsourcescouldstabilizetheperfor-mance.Thefinalsentencerepresentationisthus:c=[c(1)a,...,c(Na)a{z}ancestors;c(1)s,...,c(Ns)s{z}siblings;c(1),...,c(N){z}sequential]whereNa,Ns,andNarethenumberofancestor,sibling,andsequentialfilters.Inpractice,weuse100filtersforeachtemplateinTable1.Thefullycombinedrepresentationis1100-dimensionalbycontrastto300-dimensionalforsequentialCNN.3ExperimentsWeimplementourDTCNNontopoftheopensourceCNNcodebyKim(2014).1Table2summarizesourresultsinthecontextofotherhigh-performingeffortsintheliterature.Weusethreebenchmarkdatasetsintwocategories:senti-mentanalysisonbothMovieReview(MR)(PangandLee,2005)andStanfordSentimentTreebank1https://github.com/yoonkim/CNNsentence(SST-1)(Socheretal.,2013)datasets,andques-tionclassificationonTREC(LiandRoth,2002).Foralldatasets,wefirstobtainthedependencyparsetreefromStanfordparser(Manningetal.,2014).2DifferentwindowsizefordifferentchoiceofconvolutionareshowninTable1.Forthedatasetwithoutadevelopmentset(MR),weran-domlychoose10%ofthetrainingdatatoindicateearlystopping.Inordertohaveafarecompari-sonwithbaselineCNN,wealsouse3to5asourwindowsize.MostofourresultsaregeneratedbyGPUduetoitsefficiency,howeverCPUpoten-tiallycouldgeneratebetterresults.3Ourimple-mentationcanbefoundonGithub.43.1SentimentAnalysisBothsentimentanalysisdatasets(MRandSST-1)arebasedonmoviereviews.Thedifferencesbetweenthemaremainlyinthedifferentnum-bersofcategoriesandwhetherthestandardsplitisgiven.Thereare10,662sentencesintheMRdataset.Eachinstanceislabeledpositiveorneg-ative,andinmostcasescontainsonesentence.Sincenostandarddatasplitisgiven,followingtheliteratureweuse10foldcrossvalidationtoincludeeverysentenceintrainingandtestingatleastonce.Concatenatingwithsiblingandsequentialinfor-mationobviouslyimprovestree-basedCNNs,andthefinalmodeloutperformsthebaselinesequen-tialCNNsby0.4,andtieswithZhuetal.(2015).DifferentfromMR,theStanfordSentimentTreebank(SST-1)annotatesfiner-grainedlabels,verypositive,positive,neutral,negativeandverynegative,onanextensionoftheMRdataset.Thereare11,855sentenceswithstandardsplit.Ourmodelachievesanaccuracyof49.5whichissec-ondonlytoIrsoyandCardie(2014).Wesetbatchsizeto100forthistask.2Thephrase-structuretreesinSST-1areactuallyautomat-icallyparsed,andthuscannotbeusedasgold-standardtrees.3GPUonlysupportsfloat32whileCPUsupportsfloat64.4https://github.com/cosmmb/DTCNNCategory
This work
CNNs
Recursive NNs
Recurrent NNs
Other deep learning
Hand-coded rules
Model
DCNNs: ancestor
DCNNs: ancestor+sibling
DCNNs: ancestor+sibling+sequential
CNNs-non-static (Kim, 2014) – baseline
CNNs-multichannel (Kim, 2014)
Deep CNNs (Kalchbrenner et al., 2014)
Recursive Autoencoder (Socher et al., 2011)
Recursive Neural Tensor (Socher et al., 2013)
Deep Recursive NNs (Irsoy and Cardie, 2014)
LSTM on tree (Zhu et al., 2015)
Paragraph-Vec (Le and Mikolov, 2014)
SVMS (Silva et al., 2011)
MR
80.4†
81.7†
81.9
81.5
81.1
-
77.7
-
-
81.9
-
-
SST-1 TREC TREC-2
47.7†
48.3†
49.5
48.0
47.4
48.5
43.2
45.7
49.8
48.0
48.7
88.4†
89.0†
88.8†
86.4∗
86.0∗
-
-
-
-
-
-
90.8
95.4†
95.6†
95.4†
93.6
92.2
93.0
-
-
-
-
-
95.0
Table 1: Results on Movie Review (MR), Stanford Sentiment Treebank (SST-1), and TREC datasets.
TREC-2 is TREC with fine grained labels. †Results generated by GPU (all others generated by CPU).
∗Results generated from Kim (2014)’s implementation.
3.2 Question Classification
In the TREC dataset, the entire dataset of 5,952
sentences are classified into the following 6 cate-
gories: abbreviation, entity, description, location
and numeric. In this experiment, DCNNs easily
outperform any other methods even with ancestor
convolution only. DCNNs with sibling achieve the
best performance in the published literature. DC-
NNs combined with sibling and sequential infor-
mation might suffer from overfitting on the train-
ing data based on our observation. One thing
to note here is that our best result even exceeds
SVMS (Silva et al., 2011) with 60 hand-coded
rules.
The TREC dataset also provides subcategories
such as numeric:temperature, numeric:distance,
and entity:vehicle. To make our task more real-
istic and challenging, we also test the proposed
model with respect to the 50 subcategories. There
are obvious improvements over sequential CNNs
from the last column of Table 1. Like ours, Silva
et al. (2011) is a tree-based system but it uses
constituency trees compared to ours dependency
trees. They report a higher fine-grained accuracy
of 90.8 but their parser is trained only on the Ques-
tionBank (Judge et al., 2006) while we used the
standard Stanford parser trained on both the Penn
Treebank and QuestionBank. Moreover, as men-
tioned above, their approach is rule-based while
ours is automatically learned.
3.3 Discussions and Examples
Compared with sentiment analysis, the advantage
of our proposed model is obviously more substan-
tial on the TREC dataset. Based on our error anal-
ysis, we conclude that this is mainly due to the
Figure 3: Examples from TREC (a–c), SST-1 (d)
and TREC with fine-grained label (e–f) that are
misclassified by the baseline CNN but correctly
labeled by our DCNN. For example, (a) should be
entity but is labeled location by CNN.
CategoryModelMRSST-1TRECTREC-2ThisworkDTCNNs:ancestor80.4†47.7†95.4†88.4†DTCNNs:ancestor+sibling81.7†48.3†95.6†89.0†DTCNNs:ancestor+sibling+sequential81.949.595.4†88.8†CNNsCNNs-non-static(Kim,2014)–baseline81.548.093.686.4∗CNNs-multichannel(Kim,2014)81.147.492.286.0∗DeepCNNs(Kalchbrenneretal.,2014)-48.593.0-RecursiveNNsRecursiveAutoencoder(Socheretal.,2011)77.743.2--RecursiveNeuralTensor(Socheretal.,2013)-45.7--DeepRecursiveNNs(IrsoyandCardie,2014)-49.8--RecurrentNNsLSTMontree(Zhuetal.,2015)81.948.0--OtherdeeplearningParagraph-Vec(LeandMikolov,2014)-48.7--Hand-codedrulesSVMS(Silvaetal.,2011)-95.090.8Table2:ResultsonMovieReview(MR),StanfordSentimentTreebank(SST-1),andTRECdatasets.TREC-2isTRECwithfinegrainedlabels.†ResultsgeneratedbyGPU(allothersgeneratedbyCPU).∗ResultsgeneratedfromKim(2014)’simplementation.WhatisHawaii’sstateflower?root(a)enty⇒locWhatisnaturalgascomposedof?root(b)enty⇒descWhatdoesadefibrillatordo?root(c)desc⇒entyNothingplotwiseisworthemailinghomeaboutroot(d)mildnegative⇒mildpositiveWhatisthetemperatureatthecenteroftheearth?root(e)NUM:temp⇒NUM:distWhatwereChristopherColumbus’threeships?root(f)ENTY:veh⇒LOC:otherFigure2:ExamplesfromTREC(a–c),SST-1(d)andTRECwithfine-grainedlabel(e–f)thataremisclassifiedbythebaselineCNNbutcorrectlylabeledbyourDTCNN.Forexample,(a)shouldbeentitybutislabeledlocationbyCNN.3.2QuestionClassificationIntheTRECdataset,theentiredatasetof5,952sentencesareclassifiedintothefollowing6cate-gories:abbreviation,entity,description,locationandnumeric.Inthisexperiment,DTCNNseas-ilyoutperformanyothermethodsevenwithan-cestorconvolutiononly.DTCNNswithsiblingachievethebestperformanceinthepublishedlit-erature.DTCNNscombinedwithsiblingandse-quentialinformationmightsufferfromoverfittingonthetrainingdatabasedonourobservation.Onethingtonotehereisthatourbestresultevenex-ceedsSVMS(Silvaetal.,2011)with60hand-codedrules.Wesetbatchsizeto210forthistask.TheTRECdatasetalsoprovidessubcategoriessuchasnumeric:temperature,numeric:distance,andentity:vehicle.Tomakeourtaskmorereal-isticandchallenging,wealsotesttheproposedmodelwithrespecttothe50subcategories.ThereareobviousimprovementsoversequentialCNNsfromthelastcolumnofTable2.Likeours,Silvaetal.(2011)isatree-basedsystembutitusesconstituencytreescomparedtooursdependencytrees.Theyreportahigherfine-grainedaccuracyof90.8buttheirparseristrainedonlyontheQues-tionBank(Judgeetal.,2006)whileweusedthestandardStanfordparsertrainedonboththePennTreebankandQuestionBank.Moreover,asmen-tionedabove,theirapproachisrule-basedwhileoursisautomaticallylearned.Forthistask,wesetbatchsizeto30.3.3DiscussionsandExamplesComparedwithsentimentanalysis,theadvantageofourproposedmodelisobviouslymoresubstan-tialontheTRECdataset.Basedonourerroranal-Figure 4: Examples from TREC datasets that are
misclassified by DCNN but correctly labeled by
baseline CNN. For example, (a) should be numer-
ical but is labeled entity by DCNN.
difference of the parse tree quality between the
two tasks.
In sentiment analysis, the dataset is
collected from the Rotten Tomatoes website which
includes many irregular usage of language. Some
of the sentences even come from languages other
than English. The errors in parse trees inevitably
affect the classification accuracy. However, the
parser works substantially better on the TREC
dataset since all questions are in formal written
English, and the training set for Stanford parser5
already includes the QuestionBank (Judge et al.,
2006) which includes 2,000 TREC sentences.
Figure 3 visualizes examples where CNN errs
while DCNN does not. For example, CNN la-
bels (a) as location due to “Hawaii” and “state”,
while the long-distance backbone “What – flower”
is clearly asking for an entity. Similarly, in (d),
DCNN captures the obviously negative tree-based
trigram “Nothing – worth – emailing”. Note that
our model also works with non-projective depen-
dency trees such as the one in (b). The last two ex-
amples in Figure 3 visualize cases where DCNN
outperforms the baseline CNNs in fine-grained
TREC. In example (e), the word “temperature” is
at second from the top and is root of a 8 word span
“the ... earth”. When we use a window of size 5
for tree convolution, every words in that span get
convolved with “temperature” and this should be
the reason why DCNN get correct.
Figure 4 showcases examples where baseline
CNNs get better results than DCNNs. Example
(a) is misclassified as entity by DCNN due to pars-
ing/tagging error (the Stanford parser performs its
5 http://nlp.stanford.edu/software/parser-faq.shtml
Figure 5: Examples from TREC datasets that are
misclassified by both DCNN and baseline CNN.
For example, (a) should be numerical but is la-
beled entity by DCNN and description by CNN.
own part-of-speech tagging). The word “fly” at
the end of the sentence should be a verb instead of
noun, and “hummingbirds fly” should be a relative
clause modifying “speed”.
There are some sentences that are misclassified
by both the baseline CNN and DCNN. Figure 5
shows three such examples. Example (a) is not
classified as numerical by both methods due to the
ambiguous meaning of the word “point” which is
difficult to capture by word embedding. This word
can mean location, opinion, etc. Apparently, the
numerical aspect is not captured by word embed-
ding. Example (c) might be an annotation error.
Shortly before submitting to ACL 2015 we
learned Mou et al. (2015, unpublished) have inde-
pendently reported concurrent and related efforts.
Their constituency model, based on their unpub-
lished work in programming languages (Mou et
al., 2014),6 performs convolution on pretrained re-
cursive node representations rather than word em-
beddings, thus baring little, if any, resemblance to
our dependency-based model. Their dependency
model is related, but always includes a node and
all its children (resembling Iyyer et al. (2014)),
which is a variant of our sibling model and always
flat. By contrast, our ancestor model looks at the
vertical path from any word to its ancestors, being
linguistically motivated (Shen et al., 2008).
4 Conclusions
We have presented a very simple dependency-
based convolution framework which outperforms
sequential CNN baselines on modeling sentences.
6Both their 2014 and 2015 reports proposed (independently of each other
and independently of our work) the term “tree-based convolution” (TBCNN).
Whatisthespeedhummingbirdsfly?(noun)root(a)num⇒entyWhatbodyofwateraretheCanaryIslandsin?root(b)loc⇒entyWhatpositiondidWillieDavisplayinbaseball?root(c)hum⇒entyFigure3:ExamplesfromTRECdatasetsthataremisclassifiedbyDTCNNbutcorrectlylabeledbybaselineCNN.Forexample,(a)shouldbenumer-icalbutislabeledentitybyDTCNN.ysis,weconcludethatthisismainlyduetothedifferenceoftheparsetreequalitybetweenthetwotasks.Insentimentanalysis,thedatasetiscollectedfromtheRottenTomatoeswebsitewhichincludesmanyirregularusageoflanguage.SomeofthesentencesevencomefromlanguagesotherthanEnglish.Theerrorsinparsetreesinevitablyaffecttheclassificationaccuracy.However,theparserworkssubstantiallybetterontheTRECdatasetsinceallquestionsareinformalwrittenEnglish,andthetrainingsetforStanfordparser5alreadyincludestheQuestionBank(Judgeetal.,2006)whichincludes2,000TRECsentences.Figure2visualizesexampleswhereCNNerrswhileDTCNNdoesnot.Forexample,CNNla-bels(a)aslocationdueto“Hawaii”and“state”,whilethelong-distancebackbone“What–flower”isclearlyaskingforanentity.Similarly,in(d),DTCNNcapturestheobviouslynegativetree-basedtrigram“Nothing–worth–emailing”.Notethatourmodelalsoworkswithnon-projectivede-pendencytreessuchastheonein(b).ThelasttwoexamplesinFigure2visualizecaseswhereDTCNNoutperformsthebaselineCNNsinfine-grainedTREC.Inexample(e),theword“temper-ature”isatsecondfromthetopandisrootofa8wordspan“the...earth”.Whenweuseawin-dowofsize5fortreeconvolution,everywordsinthatspangetconvolvedwith“temperature”andthisshouldbethereasonwhyDTCNNgetcorrect.5http://nlp.stanford.edu/software/parser-faq.shtmlWhatisthemeltingpointofcopper?root(a)num⇒entyanddescWhatdidJesseJacksonorganize?root(b)hum⇒entyandentyWhatistheelectricaloutputinMadrid,Spain?root(c)enty⇒numandnumFigure4:ExamplesfromTRECdatasetsthataremisclassifiedbybothDTCNNandbaselineCNN.Forexample,(a)shouldbenumericalbutisla-beledentitybyDTCNNanddescriptionbyCNN.Figure3showcasesexampleswherebaselineCNNsgetbetterresultsthanDTCNNs.Exam-ple(a)ismisclassifiedasentitybyDTCNNduetoparsing/taggingerror(theStanfordparserper-formsitsownpart-of-speechtagging).Theword“fly”attheendofthesentenceshouldbeaverbinsteadofnoun,and“hummingbirdsfly”shouldbearelativeclausemodifying“speed”.TherearesomesentencesthataremisclassifiedbyboththebaselineCNNandDTCNN.Figure4showsthreesuchexamples.Example(a)isnotclassifiedasnumericalbybothmethodsduetotheambiguousmeaningoftheword“point”whichisdifficulttocapturebywordembedding.Thiswordcanmeanlocation,opinion,etc.Apparently,thenumericalaspectisnotcapturedbywordembed-ding.Example(c)mightbeanannotationerror.FromthemistakesmadebyDTCNNs,wefindtheperformanceofDTCNNismainlylimitedbytwofactors:theaccuracyoftheparserandthequalityofwordembedding.Futureworkwillfo-cusonthesetwoissues.4ConclusionsandFutureWorkWehavepresentedaverysimpledependencytree-basedconvolutionframeworkwhichoutperformssequentialCNNbaselinesonvariousclassificationtasks.Extensionsofthismodelwouldconsiderdependencylabelsandconstituencytrees.Also,wewouldevaluateongold-standardparsetrees.Whatisthespeedhummingbirdsfly?(noun)root(a)num⇒entyWhatbodyofwateraretheCanaryIslandsin?root(b)loc⇒entyWhatpositiondidWillieDavisplayinbaseball?root(c)hum⇒entyFigure3:ExamplesfromTRECdatasetsthataremisclassifiedbyDTCNNbutcorrectlylabeledbybaselineCNN.Forexample,(a)shouldbenumer-icalbutislabeledentitybyDTCNN.ysis,weconcludethatthisismainlyduetothedifferenceoftheparsetreequalitybetweenthetwotasks.Insentimentanalysis,thedatasetiscollectedfromtheRottenTomatoeswebsitewhichincludesmanyirregularusageoflanguage.SomeofthesentencesevencomefromlanguagesotherthanEnglish.Theerrorsinparsetreesinevitablyaffecttheclassificationaccuracy.However,theparserworkssubstantiallybetterontheTRECdatasetsinceallquestionsareinformalwrittenEnglish,andthetrainingsetforStanfordparser5alreadyincludestheQuestionBank(Judgeetal.,2006)whichincludes2,000TRECsentences.Figure2visualizesexampleswhereCNNerrswhileDTCNNdoesnot.Forexample,CNNla-bels(a)aslocationdueto“Hawaii”and“state”,whilethelong-distancebackbone“What–flower”isclearlyaskingforanentity.Similarly,in(d),DTCNNcapturestheobviouslynegativetree-basedtrigram“Nothing–worth–emailing”.Notethatourmodelalsoworkswithnon-projectivede-pendencytreessuchastheonein(b).ThelasttwoexamplesinFigure2visualizecaseswhereDTCNNoutperformsthebaselineCNNsinfine-grainedTREC.Inexample(e),theword“temper-ature”isatsecondfromthetopandisrootofa8wordspan“the...earth”.Whenweuseawin-dowofsize5fortreeconvolution,everywordsinthatspangetconvolvedwith“temperature”andthisshouldbethereasonwhyDTCNNgetcorrect.5http://nlp.stanford.edu/software/parser-faq.shtmlWhatisthemeltingpointofcopper?root(a)num⇒entyanddescWhatdidJesseJacksonorganize?root(b)hum⇒entyandentyWhatistheelectricaloutputinMadrid,Spain?root(c)enty⇒numandnumFigure4:ExamplesfromTRECdatasetsthataremisclassifiedbybothDTCNNandbaselineCNN.Forexample,(a)shouldbenumericalbutisla-beledentitybyDTCNNanddescriptionbyCNN.Figure3showcasesexampleswherebaselineCNNsgetbetterresultsthanDTCNNs.Exam-ple(a)ismisclassifiedasentitybyDTCNNduetoparsing/taggingerror(theStanfordparserper-formsitsownpart-of-speechtagging).Theword“fly”attheendofthesentenceshouldbeaverbinsteadofnoun,and“hummingbirdsfly”shouldbearelativeclausemodifying“speed”.TherearesomesentencesthataremisclassifiedbyboththebaselineCNNandDTCNN.Figure4showsthreesuchexamples.Example(a)isnotclassifiedasnumericalbybothmethodsduetotheambiguousmeaningoftheword“point”whichisdifficulttocapturebywordembedding.Thiswordcanmeanlocation,opinion,etc.Apparently,thenumericalaspectisnotcapturedbywordembed-ding.Example(c)mightbeanannotationerror.FromthemistakesmadebyDTCNNs,wefindtheperformanceofDTCNNismainlylimitedbytwofactors:theaccuracyoftheparserandthequalityofwordembedding.Futureworkwillfo-cusonthesetwoissues.4ConclusionsandFutureWorkWehavepresentedaverysimpledependencytree-basedconvolutionframeworkwhichoutperformssequentialCNNbaselinesonvariousclassificationtasks.Extensionsofthismodelwouldconsiderdependencylabelsandconstituencytrees.Also,wewouldevaluateongold-standardparsetrees.References
R. Collobert,
J. Weston, L. Bottou, M. Karlen,
K. Kavukcuoglu, and P. Kuksa. 2011. Natural lan-
guage processing (almost) from scratch. Journal of
Machine Learning Research, 12.
Kushal Dave, Steve Lawrence, and David M Pennock.
2003. Mining the peanut gallery: Opinion extraction
and semantic classification of product reviews.
In
Proceedings of World Wide Web.
Michael Gamon. 2004. Sentiment classification on
customer feedback data: noisy data, large feature
vectors, and the role of linguistic analysis. In Pro-
ceedings of COLING.
Geoffrey E. Hinton, Nitish Srivastava, Alex
Krizhevsky, Ilya Sutskever, and Ruslan Salakhut-
Improving neural networks by
dinov.
preventing co-adaptation of
feature detectors.
Journal of Machine Learning Research, 15.
2014.
Ozan Irsoy and Claire Cardie. 2014. Deep recursive
neural networks for compositionality in language.
In Advances in Neural Information Processing Sys-
tems, pages 2096–2104.
Mohit Iyyer, Jordan Boyd-Graber, Leonardo Claudino,
Richard Socher, and Hal Daum´e III. 2014. A neural
network for factoid question answering over para-
graphs. In Proceedings of EMNLP.
John Judge, Aoife Cahill, and Josef van Genabith.
2006. Questionbank: Creating a corpus of parse-
annotated questions. In Proceedings of COLING.
Nal Kalchbrenner, Edward Grefenstette, and Phil Blun-
som. 2014. A convolutional neural network for
modelling sentences. In Proceedings of ACL.
Yoon Kim. 2014. Convolutional neural networks for
sentence classification. In Proceedings of EMNLP.
Terry Koo and Michael Collins. 2010. Efficient third-
order dependency parsers. In Proceedings of ACL.
Taku Kudo and Yuji Matsumoto. 2004. A boosting
algorithm for classification of semi-structured text.
In Proceedings of EMNLP.
Quoc V Le and Tomas Mikolov. 2014. Distributed
representations of sentences and documents. In Pro-
ceedings of ICML.
Y. LeCun, L. Jackel, L. Bottou, A. Brunot, C. Cortes,
J. Denker, H. Drucker,
I. Guyon, U. Mller,
E. Sckinger, P. Simard, and V. Vapnik. 1995. Com-
parison of learning algorithms for handwritten digit
recognition. In Int’l Conf. on Artificial Neural Nets.
Xin Li and Dan Roth. 2002. Learning question classi-
fiers. In Proceedings of COLING.
Christopher D. Manning, Mihai Surdeanu, John Bauer,
Jenny Finkel, Steven J. Bethard, and David Mc-
Closky. 2014. The Stanford CoreNLP natural lan-
guage processing toolkit.
In Proceedings of ACL:
Demonstrations, pages 55–60.
Shotaro Matsumoto, Hiroya Takamura, and Manabu
2005. Sentiment classification using
In
Okumura.
word sub-sequences and dependency sub-trees.
Proceedings of PA-KDD.
Ryan McDonald and Fernando Pereira. 2006. Online
learning of approximate dependency parsing algo-
rithms. In Proceedings of EACL.
Lili Mou, Ge Li, Zhi Jin, Lu Zhang, and Tao Wang.
2014. TBCNN: A tree-based convolutional neu-
ral network for programming language processing.
Unpublished manuscript: http://arxiv.org/
abs/1409.5718.
Lili Mou, Hao Peng, Ge Li, Yan Xu, Lu Zhang, and
Zhi Jin.
2015. Discriminative neural sentence
modeling by tree-based convolution. Unpublished
manuscript: http://arxiv.org/abs/1504.
01106v5. Version 5 dated June 2, 2015; Version 1
(“Tree-based Convolution: A New Architecture for
Sentence Modeling”) dated Apr 5, 2015.
Bo Pang and Lillian Lee. 2005. Seeing stars: Exploit-
ing class relationships for sentiment categorization
with respect to rating scales. In Proceedings of ACL,
pages 115–124.
Libin Shen, Lucas Champollion, and Aravind K Joshi.
2008. LTAG-spinal and the treebank. Language Re-
sources and Evaluation, 42(1):1–19.
Yelong Shen, Xiaodong he, Jianfeng Gao, Li Deng, and
Gregoire Mesnil. 2014. Learning semantic repre-
sentations using convolutional neural networks for
web search. In Proceedings of WWW.
J. Silva, L. Coheur, A. C. Mendes, and Andreas
Wichert. 2011. From symbolic to sub-symbolic in-
formation in question classification. Artificial Intel-
ligence Review, 35.
Richard Socher, Jeffrey Pennington, Eric H. Huang,
Andrew Y. Ng, and Christopher D. Manning. 2011.
Semi-Supervised Recursive Autoencoders for Pre-
dicting Sentiment Distributions. In Proceedings of
EMNLP 2011.
Richard Socher, Alex Perelygin, Jean Wu, Jason
Chuang, Christopher D. Manning, Andrew Y. Ng,
and Christopher Potts. 2013. Recursive deep mod-
els for semantic compositionality over a sentiment
treebank. In Proceedings of EMNLP 2013.
Wen-tau Yih, Xiaodong He, and Christopher Meek.
2014. Semantic parsing for single-relation question
answering. In Proceedings of ACL.
Mattgew Zeiler. 2012. Adadelta: An adaptive learning
rate method. Unpublished manuscript: http://
arxiv.org/abs/1212.5701.
Xiaodan Zhu, Parinaz Sobhani, and Hongyu Guo.
2015. Long short-term memory over tree structures.
In Proceedings of ICML.
|
1907.00184 | 2 | 1907 | 2019-09-11T12:35:35 | Empirical Evaluation of Sequence-to-Sequence Models for Word Discovery in Low-resource Settings | [
"cs.CL"
] | Since Bahdanau et al. [1] first introduced attention for neural machine translation, most sequence-to-sequence models made use of attention mechanisms [2, 3, 4]. While they produce soft-alignment matrices that could be interpreted as alignment between target and source languages, we lack metrics to quantify their quality, being unclear which approach produces the best alignments. This paper presents an empirical evaluation of 3 main sequence-to-sequence models (CNN, RNN and Transformer-based) for word discovery from unsegmented phoneme sequences. This task consists in aligning word sequences in a source language with phoneme sequences in a target language, inferring from it word segmentation on the target side [5]. Evaluating word segmentation quality can be seen as an extrinsic evaluation of the soft-alignment matrices produced during training. Our experiments in a low-resource scenario on Mboshi and English languages (both aligned to French) show that RNNs surprisingly outperform CNNs and Transformer for this task. Our results are confirmed by an intrinsic evaluation of alignment quality through the use of Average Normalized Entropy (ANE). Lastly, we improve our best word discovery model by using an alignment entropy confidence measure that accumulates ANE over all the occurrences of a given alignment pair in the collection. | cs.CL | cs | Empirical Evaluation of Sequence-to-Sequence Models for Word Discovery in
Low-resource Settings
Marcely Zanon Boito1, Aline Villavicencio2,3, Laurent Besacier1
1Laboratoire d'Informatique de Grenoble, Univ. Grenoble Alpes (UGA), France
2School of Computer Science and Electronic Engineering, University of Essex, UK
3Institute of Informatics, Federal University of Rio Grande do Sul, Brazil
contact:
[email protected]
9
1
0
2
p
e
S
1
1
]
L
C
.
s
c
[
2
v
4
8
1
0
0
.
7
0
9
1
:
v
i
X
r
a
Abstract
Since Bahdanau et al. [1] first introduced attention for
neural machine translation, most sequence-to-sequence models
made use of attention mechanisms [2, 3, 4]. While they pro-
duce soft-alignment matrices that could be interpreted as align-
ment between target and source languages, we lack metrics to
quantify their quality, being unclear which approach produces
the best alignments. This paper presents an empirical evalu-
ation of 3 of the main sequence-to-sequence models for word
discovery from unsegmented phoneme sequences: CNN, RNN
and Transformer-based. This task consists in aligning word se-
quences in a source language with phoneme sequences in a tar-
get language, inferring from it word segmentation on the target
side [5]. Evaluating word segmentation quality can be seen as
an extrinsic evaluation of the soft-alignment matrices produced
during training. Our experiments in a low-resource scenario on
Mboshi and English languages (both aligned to French) show
that RNNs surprisingly outperform CNNs and Transformer for
this task. Our results are confirmed by an intrinsic evalua-
tion of alignment quality through the use Average Normalized
Entropy (ANE). Lastly, we improve our best word discovery
model by using an alignment entropy confidence measure that
accumulates ANE over all the occurrences of a given alignment
pair in the collection.
Index Terms: sequence-to-sequence models, soft-alignment
matrices, word discovery, low-resource languages, computa-
tional language documentation
1. Introduction
Sequence-to-Sequence (S2S) models can solve many tasks
where source and target sequences have different lengths. For
learning to focus on specific parts of the input at decoding
time, most of these models are equipped with attention mech-
anisms [1, 2, 3, 4, 6]. By-products of the attention are soft-
alignment probability matrices, that can be interpreted as align-
ment between target and source. However, we lack metrics to
quantify their quality. Moreover, while these models perform
very well in a typical use case, it is not clear how they would be
affected by low-resource scenarios.
This paper proposes an empirical evaluation of well-known
S2S models for a particular S2S modeling task. This task con-
sists of aligning word sequences in a source language with
phoneme sequences in a target language, inferring from it word
segmentation on the target side [5]. We concentrate on three
models: Convolutional Neural Networks (CNN) [2], Recurrent
Neural Networks (RNN) [1] and Transformer-based models [3].
While this word segmentation task can be used for the extrinsic
evaluation of the soft-alignment probability matrices produced
during S2S learning, we also introduce Average Normalized
Entropy (ANE), a task-agnostic confidence metric to quantify
the quality of the source-to-target alignments obtained. Experi-
ments performed on a low-resource scenario for two languages
(Mboshi and English) using equivalently sized corpora aligned
to French, are, to our knowledge, the first empirical evaluation
of these well-known S2S models for a word segmentation task.
We also illustrate how our entropy-based metric can be used in
a language documentation scenario, helping a linguist to effi-
ciently discover types, in an unknown language, from an unseg-
mented sequence of phonemes. This work is thus also a contri-
bution to the emerging computational language documentation
domain [7, 8, 9, 10, 11], whose main goal is the creation of au-
tomatic approaches able to help the documentation of the many
languages soon to be extinct [12].
Lastly, studies focused on comprehensive attention mech-
anisms for NMT [13, 14, 15] lack evaluation of the resulting
alignments, and the exceptions [16] do so for the task of word-
to-word alignment in well-resourced languages. Differently,
our work is not only an empirical evaluation of NMT models
focused on alignment quality, but it also tackles data scarcity of
low-resource scenarios.
2. Experimental Settings
2.1. Unsupervised Word Segmentation from Speech
As in language documentation scenarios available corpora usu-
ally contain speech in the language to document aligned with
translations in a well-resourced language, Godard et al. [5] in-
troduced a pipeline for performing Unsupervised Word Seg-
mentation (UWS) from speech. The system outputs time-
stamps delimiting stretches of speech, associated with class
labels, corresponding to real words in the language. The
pipeline consists of first transforming speech into a sequence of
phonemes, either through Automatic Unit Discovery (e.g. [17])
or manual transcription. The phoneme sequences, together
with their translations, are then fed to an attention-based S2S
system that produces soft-alignment probability matrices be-
tween target and source languages. The alignment probability
distributions between the phonemes and the translation words
(as in Figure 1) are used to cluster (segment) together neigh-
bor phonemes whose alignment distribution peaks at the same
word. The final speech segmentation is evaluated using the Zero
Resource Challenge1 (ZRC) 2017 evaluation suite (track 2).2
1Available at http://zerospeech.com/2017.
2 We increment over [5] by removing silence labels before training,
and using them for segmentation. This results in slightly better scores.
by averaging NE for all phonemes from a single (discovered)
token. Type ANE results from averaging the ANE for every to-
ken instance of a discovered type. Finally, Alignment ANE is the
result of averaging the ANE for every discovered (type, trans-
lation word) alignment pair. Intuition that lower ANEs corre-
spond to better alignments is exemplified in Figure 1.
3. Empirical Comparison of S2S Models
We compare three NMT models §3.1, §3.2, §3.3) for UWS,
focusing on their ability of aligning words (French) with
phonemes (English or Mboshi) in medium-low resource set-
tings. The results, an analysis of the impact of data size and
quality, and the correlation between intrinsic (ANE) and extrin-
sic (boundary F-score) metrics are presented in §3.4. The ap-
plication of ANE for type discovery in low-resource settings is
presented in §3.5.
3.1. RNN: Attention-based Encoder-Decoder
The classic RNN encoder-decoder model [1] connects a bidi-
rectional encoder with an unidirectional decoder by the use of
an alignment module. The RNN encoder learns annotations for
every source token, and these are weighted by the alignment
module for the generation of every target token. Weights are
defined as context vectors, since they capture the importance of
every source token for the generation of each target token.
Attention mechanism: a context vector for a decoder step t
is computed using the set of source annotations H and the last
state of the decoder network (translation context). The attention
is the result of the weighted sum of the source annotations H
(with H = h1, ..., hA) and their α probabilities (3) obtained
through a feed-forward network align (4).
A(cid:88)
ct = Att(H, st−1) =
αt
ihi
i=1
αt
i = softmax(align(hi, st−1))
(3)
(4)
3.2. Transformer
Transformer [3] is a fully attentional S2S architecture, which
has obtained state-of-the-art results for several NMT shared
tasks. It replaces the use of sequential cell units (such as LSTM)
by Multi-Head Attention (MHA) operations, which make the
architecture considerably faster. Both encoder and decoder net-
works are stacked layers sets that receive source and target se-
quences, embedded and concatenated with positional encoding.
An encoder layer is made of two sub-layers: a Self-Attention
MHA and a feed-forward. A decoder layer is made of three
sub-layers: a masked Self-Attention MHA (no access to sub-
sequent positions); an Encoder-Decoder MHA (operation over
the encoder stack's final output and the decoder self-attention
output); and a feed-forward sub-layer. Dropout and residual
connections are applied between all sub-layers. Final output
probabilities are generated by applying a linear projection over
the decoder stack's output, followed by a softmax operation.
Multi-head attention mechanism: attention is seen as a map-
ping problem: given a pair of key-value vectors and a query
vector, the task is the computation of the weighted sum of the
given values (output). In this setup, weights are learned by com-
patibility functions between key-query pairs (of dimension dk).
For a given query (Q), keys (K) and values (V) set, the Scaled
Figure 1: Soft-alignment probability matrices from the UWS
task. ANE values (from left to right) are 0.11, 0.64 and 0.83.
The gold segmentation is "BAH1T MAA1MAH0 PAA1PAH0
IH0Z AW1T", which corresponds to the English sentence "But
mama, papa is out".
2.2. Parallel Speech Corpora
The parallel speech corpora used in this work are the English-
French (EN-FR) [18] and the Mboshi-French (MB-FR) [19]
parallel corpora. EN-FR corpus is a 33,192 sentences mul-
tilingual extension from librispeech [20], with English audio
books automatically aligned to French translations. MB-FR is a
5,130 sentences corpus from the language documentation pro-
cess of Mboshi (Bantu C25), an endangered language spoken
in Congo-Brazzaville. Thus, while the former corpus presents
larger vocabulary and longer sentences, the latter presents a
more tailored environment, with short sentences and simpler
vocabulary. In order to provide a fair comparison, as well as
to study the impact of corpus size, the EN-FR corpus was also
down-sampled to 5K utterances (to the exact same size than the
MB-FR corpus). Sub-sampling was conducted preserving the
average number of tokens per sentence, shown in Table 1.
2.3. Introducing Average Normalized Entropy (ANE)
In this paper, we focus on studying the soft-alignment probabil-
ity matrices resulting from the learning of S2S models for the
UWS task. To assess the overall quality of these matrices with-
out having gold alignment information, we introduce Average
Normalized Entropy (ANE).
Definition: Given the source and target pair (s, t) of lengths s
and t respectively, for every phone ti, the normalized entropy
(NE) is computed considering all possible words in s (Equa-
tion 1), where P (ti, sj) is the alignment probability between
the phone ti and the word sj (a cell in the matrix). The ANE
for a sentence is then defined by the arithmetic mean over the
resulting NE for every phone from the sequence t (Equation 2).
N E(ti, s) = −
s(cid:88)
j=1
P (ti, sj) · logs(P (ti, sj))
(cid:80)t
i=1 N E(ti, s)
(1)
(2)
AN E(t, s) =
t
From this definition, we can derive ANE for different granular-
ities (sub or supra-sentential) by accumulating its value for the
full corpus, for a single type or for a single token. Corpus ANE
will be used to summarize the overall performance of a S2S
model on a specific corpus. Token ANE extends ANE to tokens
Table 1: Statistics of the three source-target data sets.
corpus
EN-FR (33k)
EN-FR (5k)
MB-FR (5k)
#types
source
21,083
8,740
6,633
target
33,135
12,226
5,162
#tokens
source
381,044
59,090
30,556
target
467,475
72,670
42,715
Dot-Product (SDP) Attention function is computed as:
Att(V, K, Q) = sof tmax(
QK T√
dk
)V
(5)
In practice, several attentions are computed for a given QKV
set. The QKV set is first projected into h different spaces (mul-
tiple heads), where the SDP attention is computed in parallel.
Resulting values for all heads are then concatenated and once
again projected, yielding the layer's output. (6) and (7) illustrate
the process, in which H is the set of h heads (H = h1, ..., hh)
and f is a linear projection. Self-Attention defines the case
where query and values come from same source (learning com-
patibility functions within the same sequence of elements).
M ultiHead(V, K, Q) = f (Concat(H))
hi = Att(fi(V ), fi(K), fi(Q))
(6)
(7)
3.3. CNN: Pervasive Attention
Different from the previous models, which are based on
encoder-decoder structures interfaced by attention mechanisms,
this approach relies on a single 2D CNN across both sequences
(no separate coding stages) [2]. Using masked convolutions,
an auto-regressive model predicts the next output symbol based
on a joint representation of both input and partial output se-
quences. Given a source-target pair (s, t) of lengths s and t
respectively, tokens are first embed in ds and dt dimensional
spaces via look-up tables. Token embeddings {x1, . . . , xs}
and {y1, . . . , yt} are then concatenated to form a 3D tensor
X ∈ Rt×s×f0, with f0 = dt + ds, where:
Xij = [yi xj]
(8)
Each convolutional layer l ∈ {1, . . . , L} of the model produces
a tensor Hl of size t×s× fl, where fl is the number of
output channels for that layer. To compute a distribution over
the tokens in the output vocabulary, the second dimension of the
tensor is used. This dimension is of variable length (given by the
input sequence) and it is collapsed by max or average pooling to
L of size t×fL. Finally, 1×1 convolution
obtain the tensor HPool
followed by a softmax operation are applied, resulting in the
distribution over the target vocabulary for the next output token.
Attention mechanism: joint encoding acts as an attention-like
mechanism, since individual source elements are re-encoded as
the output is generated. The self-attention approach of [21] is
applied. It computes the attention weight tensor α, of size t ×
s, from the last activation tensor HL, to pool the elements of
the same tensor along the source dimension, as follows:
HAtt
L = αHL.
α = softmax (W1 tanh (HLW2))
(9)
(10)
where W1 ∈ Rfa and W2 ∈ Rfa×fL are weight tensors that
map the fL dimensional features in HL to the attention weights
via an fa dimensional intermediate representation.
average( token length)
source
4.37
4.38
4.18
target
4.57
4.57
4.39
average( #tokens / sentence)
source
11.48
11.52
5.96
target
14.08
14.17
8.33
3.4. Comparing S2S Architectures
For each S2S architecture, and each of the three corpora, we
train five models (runs) with different initialization seeds.3 Be-
fore segmenting, we average the produced matrices from the
five different runs as in [5]. Evaluation is done in a bilingual
segmentation condition that corresponds to the real UWS task.
In addition, we also perform segmentation in a monolingual
condition, where a phoneme sequence is segmented with re-
gards to the corresponding word sequence (transcription) in the
same language (hence monolingual).4 Our networks are opti-
mized for the monolingual task. Across all architectures, we
use embeddings of size 64 and batch size of 32 (5K data set),
or embeddings of size 128 and batch size of 64 (33K data set).
Dropout of 0.5 and early-stopping procedure are applied in all
cases. RNN models have only one layer, a bi-directional en-
coder, and cell size equal to the embedding size, as in [5]. CNN
models use the hyper-parameters from [2] with only 3 layers
(5K data set), or 6 (33K data set), and kernel size of 3. Trans-
former models were optimized starting from the original hyper-
parameters of [3]. Best results (among 50 setups) were achieved
using 2 heads, 3 layers (encoder and decoder), warm-up of 5K
steps, and using cross-entropy loss without label-smoothing.
Finally, for selecting which head to use for UWS, we exper-
imented using the last layer's averaged heads, or by selecting
the head with minimum corpus ANE. While the results were
not significantly different, we kept the ANE selection.
3.4.1. Unsupervised Word Segmentation Results
The word boundary F-scores5 for the task of UWS from
phoneme sequence (in Mboshi or English) are presented in Ta-
ble 2, with monolingual results shown for information only
(topline). Surprisingly, RNN models outperform the more re-
cent (CNN and Transformer) approaches. One possible expla-
nation is the lower number of parameters (for a 5K setup, in
average 700K parameters are trained, while CNN needs an ad-
ditional 30.79% and Transformer 5.31%). However, for 33K
setups, CNNs actually need 30% less parameters than RNNs,
but still perform worse. Transformer's low performance could
be due to the use of several heads "distributing" alignment in-
formation across different matrices. Nonetheless, we evaluated
averaged heads and single-head models, and these resulted in
significant decreases in performance. This suggests that this ar-
chitecture may not need to learn explicit alignment to translate,
but instead it could be capturing different kinds of linguistic
information, as discussed in the original paper and in its exam-
ples [3]. Also, on the decoder side, the behavior of the self-
attention mechanism on phoneme units is unclear and under-
3RNN, CNN and Transformer implementations from [22, 2, 23] re-
spectively.
4This task can be seen as an automatic extraction of a pronunciation
lexicon from parallel words/phonemes sequences.
5For CNN and RNN, average standard deviation for the bilingual
task is of less than 0.8%. For Transformer, it is almost 4%.
Table 2: Boundary F-scores for the UWS task.
Bilingual Monolingual
EN 33K
EN 5K
MB 5K
RNN
CNN
Transformer
RNN
CNN
Transformer
RNN
CNN
Transformer
77.10
71.30
52.70
70.40
55.90
52.50
74.00
68.20
66.40
99.80
98.60
94.90
99.30
98.80
80.90
92.50
89.80
83.50
studied so far. For the encoder, Voita et al. [15] performed after-
training encoder head removal based on head confidence, show-
ing that after initial training, most heads were not necessary
for maintaining translation performance. Hence, we find the
Multi-head mechanism interpretation challenging, and maybe
not suitable for a direct word segmentation application, such as
our method.
As in [24], our best UWS method (RNN) for the bilingual
task does not reach the performance level of a strong Bayesian
baseline [25] with F-scores of 89.80 (EN33K), 87.93 (EN5K),
and 77.00 (MB5K). However, even if we only evaluate word
segmentation performance, our neural approaches learn to seg-
ment and align, whereas this baseline only learns to segment.
Section 3.5 will leverage those alignments for a type discovery
task useful in language documentation.
The Pearson's ρ correlation coefficients between ANE and
boundary F-scores for all mono and bilingual runs of all cor-
pora (N = 30) are −0.98 (RNN), −0.97 (CNN), and −0, 66
(Transformer), with p-values smaller than 10−5. These strong
negative correlations confirm our hypothesis that lower ANEs
correspond to sharper and better alignments.
3.4.2. Impact of Data Size and Quality
EN33K and EN5K results of Table 2 allow us to analyze the
impact of data size on the S2S models. For the bilingual task,
RNN performance drops by 7% on average, whereas perfor-
mance drop is bigger for CNN (14-15%). Transformer performs
poorly in both cases, and increasing data size from 5K to 33K
seems to help only for a trivial task (see monolingual results).
The EN5K and MB5K results of Table 2 reflect the impact
of language pairs on the S2S models. We know from [26, 27]
that English should be easier to segment than Mboshi, and this
was confirmed by both dpseg and monolingual results. How-
ever, this trend is not confirmed in the bilingual task, where
the quality of the (sentence aligned) parallel corpus seems to
have more impact (higher boundary F-scores for MB5K than for
EN5K for all S2S models). As shown in Table 1, MB-FR corpus
has shorter sentences and smaller lexicon diversity, while EN-
FR is made of automatically aligned books (noisy alignments),
what may explain our experimental results.
3.5. Type Discovery in Low-Resource Settings
We investigate the use of Alignment ANE as a confidence mea-
sure. From the RNN models, we extract and rank the discovered
types by their ANE, and examine if it can be used to separate
true words in the discovered vocabulary from the rest. The
results for low-resource scenarios (only 5K) in Table 3 sug-
gest that low ANE corresponds to the portion of the discov-
Table 3: Type retrieval results (RNN) using ANE for keeping
most confident (type, translation) pairs. For instance, AN E =
0.4 means all discovered types have AN E ≤ 0.4.
EN 5K
R
0.50
3.85
12.51
21.76
28.17
32.41
34.34
35.16
35.31
35.34
P
70.97
55.43
44.99
32.81
23.37
18.54
16.23
15.21
15.01
15.01
F
1.00
7.20
19.58
26.17
25.54
23.59
22.04
21.23
21.06
21.07
MB 5K
R
0.57
2.89
8.14
16.61
23.44
27.61
30.12
30.95
31.05
31.05
F
1.12
5.46
13.41
22.01
25.49
26.09
26.08
25.84
25.80
25.80
P
72.13
49.02
38.18
32.63
27.93
24.73
23.00
22.17
22.06
22.06
ANE
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
all
Table 4: Top 5 low and high ANE ranking for the discovered
types (EN5K), with gold transcription and aligned information
between parentheses (respectively). "INV" means incorrect
type.
Top Low ANE
Top High ANE
1
SER1 (sir, EOS token)
2 HHAH1SH (hush, chut)
3
4 KLER1K (clerk, clerc)
5 KIH1S (kiss, embrasse)
AH0 (a, convenable)
IH1 (INV, ah)
FIH1SHER0 (fisher, fisher) D (INV, riant)
N (INV, obit)
YUW1 (you, diable)
ered vocabulary the network is confident about, and these are,
in most of the cases, true discovered lexical items (first row,
P ≥ 70%).6 As we keep higher Alignment ANE values, we
increase recall but loose precision. This suggests that, in a doc-
umentation scenario, ANE could be used as a confidence mea-
sure by a linguist to extract a list of types with higher precision,
without having to pass through all the discovered vocabulary.
Moreover, as exemplified for EN5K in Table 4, we also retrieve
aligned information (translation candidates) for the generated
lexicon.
4. Conclusions
We presented an empirical evaluation of different architectures
(RNN, CNN and Transformer) with respect to their capacity to
align word sequences in a source language with phoneme se-
quences in a target language, inferring from it word segmen-
tation on the target side (UWS task).7 Although RNNs have
been outperformed by CNN and Transformer-based models for
machine translation, for UWS these architectures are still more
robust in low-resource scenarios, and present the best segmen-
tation results. We also introduced ANE, an intrinsic measure of
alignment quality of S2S models. Accumulating it over the dis-
covered alignments, we showed it can be used as a confidence
measure to select true words, increasing Type F-scores.
6Type ANE for the retrieval task was also investigated, and results
were positive, but slightly worse than the ones from Alignment ANE.
7Pointers for corpora, parameters and implementations available at
https://gitlab.com/mzboito/attention_study
[19] P. Godard, G. Adda, M. Adda-Decker, J. Benjumea, L. Be-
sacier, J. Cooper-Leavitt, G.-N. Kouarata, L. Lamel, H. Maynard,
M. Muller et al., "A very low resource language speech corpus
for computational language documentation experiments," arXiv
preprint arXiv:1710.03501, 2017.
[20] V. Panayotov, G. Chen, D. Povey,
and S. Khudanpur,
"Librispeech: An ASR corpus based on public domain audio
books," in 2015 IEEE International Conference on Acoustics,
Speech and Signal Processing, ICASSP 2015, South Brisbane,
Queensland, Australia, April 19-24, 2015, 2015, pp. 5206 --
5210. [Online]. Available: https://doi.org/10.1109/ICASSP.2015.
7178964
[21] Z. Lin, M. Feng, C. dos Santos, M. Yu, B. Xiang, B. Zhou, and
Y. Bengio, "A structured self-attentive sentence embedding," in
iclr, 2017.
[22] A. B´erard, O. Pietquin, C. Servan, and L. Besacier, "Listen and
translate: A proof of concept for end-to-end speech-to-text trans-
lation," arXiv preprint arXiv:1612.01744, 2016.
[23] M. Ott, S. Edunov, A. Baevski, A. Fan, S. Gross, N. Ng, D. Grang-
ier, and M. Auli, "fairseq: A fast, extensible toolkit for sequence
modeling," arXiv preprint arXiv:1904.01038, 2019.
[24] P. Godard, "Unsupervised word discovery for computational lan-
guage documentation," Ph.D. dissertation, Universit Paris-Saclay,
2019.
[25] S. Goldwater, T. L. Griffiths, and M. Johnson, "A Bayesian frame-
work for word segmentation: Exploring the effects of context,"
Cognition, vol. 112, no. 1, pp. 21 -- 54, 2009.
[26] A. Fourtassi, B. Borschinger, M. Johnson, and E. Dupoux, "Why
is english so easy to segment?" in Proceedings of the Fourth An-
nual Workshop on Cognitive Modeling and Computational Lin-
guistics (CMCL), 2013, pp. 1 -- 10.
[27] A. Rialland, M. E. Aborobongui, M. Adda-Decker, and L. Lamel,
"Dropping of the class-prefix consonant, vowel elision and auto-
matic phonological mining in embosi (bantu c 25)," in Selected
Proceedings of the 44th Annual Conference on African Linguis-
tics, 2015, pp. 7 -- 10.
5. References
[1] D. Bahdanau, K. Cho, and Y. Bengio, "Neural machine trans-
lation by jointly learning to align and translate," arXiv preprint
arXiv:1409.0473, 2014.
[2] M. Elbayad, L. Besacier, and J. Verbeek, "Pervasive attention: 2d
convolutional neural networks for sequence-to-sequence predic-
tion," arXiv preprint arXiv:1808.03867, 2018.
[3] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N.
Gomez, Ł. Kaiser, and I. Polosukhin, "Attention is all you need,"
in Advances in Neural Information Processing Systems, 2017, pp.
5998 -- 6008.
[4] J. Gehring, M. Auli, D. Grangier, D. Yarats, and Y. N. Dauphin,
"Convolutional sequence to sequence learning," in Proceedings of
the 34th International Conference on Machine Learning-Volume
70.
JMLR. org, 2017, pp. 1243 -- 1252.
[5] P. Godard, M. Zanon Boito, L. Ondel, A. Berard, F. Yvon,
A. Villavicencio, and L. Besacier, "Unsupervised word segmenta-
tion from speech with attention," in Interspeech, 2018.
Curran Associates,
[Online]. Available:
and Q. V. Le,
[6] I. Sutskever, O. Vinyals,
"Sequence to
sequence learning with neural networks," in Advances in
Neural Information Processing Systems 27, Z. Ghahramani,
and K. Q.
M. Welling, C. Cortes, N. D. Lawrence,
Weinberger, Eds.
Inc.,
2014,
pp.
3104 -- 3112.
http://papers.nips.cc/paper/
5346-sequence-to-sequence-learning-with-neural-networks.pdf
[7] G. Adda, S. Stuker, M. Adda-Decker, O. Ambouroue, L. Be-
sacier, D. Blachon, H. Bonneau-Maynard, P. Godard, F. Ham-
laoui, D. Idiatov, G.-N. Kouarata, L. Lamel, E.-M. Makasso,
A. Rialland, M. V. de Velde, F. Yvon, and S. Zerbian, "Break-
ing the unwritten language barrier: The BULB project," Procedia
Computer Science, vol. 81, pp. 8 -- 14, 2016.
[8] A. Anastasopoulos and D. Chiang, "A case study on using speech-
to-translation alignments for language documentation," arXiv
preprint arXiv:1702.04372, 2017.
[9] L. Besacier, B. Zhou, and Y. Gao, "Towards speech translation of
non written languages," in Spoken Language Technology Work-
shop, 2006. IEEE.
IEEE, 2006, pp. 222 -- 225.
[10] C. Lignos and C. Yang, "Recession segmentation: simpler on-
line word segmentation using limited resources," in Proceedings
of the fourteenth conference on computational natural language
learning. Association for Computational Linguistics, 2010, pp.
88 -- 97.
[11] C. Bartels, W. Wang, V. Mitra, C. Richey, A. Kathol, D. Vergyri,
H. Bratt, and C. Hung, "Toward human-assisted lexical unit dis-
covery without text resources," in Spoken Language Technology
Workshop (SLT), 2016 IEEE.
IEEE, 2016, pp. 64 -- 70.
[12] P. K. Austin and J. Sallabank, The Cambridge handbook of en-
dangered languages. Cambridge University Press, 2011.
[13] K. Song, T. Xu, F. Peng, and J. Lu, "Hybrid self-attention network
for machine translation," arXiv preprint arXiv:1811.00253, 2018.
[14] J. Li, Z. Tu, B. Yang, M. R. Lyu, and T. Zhang, "Multi-
head attention with disagreement regularization," arXiv preprint
arXiv:1810.10183, 2018.
[15] E. Voita, D. Talbot, F. Moiseev, R. Sennrich, and I. Titov, "Ana-
lyzing multi-head self-attention: Specialized heads do the heavy
lifting, the rest can be pruned," arXiv preprint arXiv:1905.09418,
2019.
[16] T. Zenkel, J. Wuebker, and J. DeNero, "Adding interpretable at-
tention to neural translation models improves word alignment,"
arXiv preprint arXiv:1901.11359, 2019.
[17] L. Ondel, L. Burget, and J. Cernock`y, "Variational inference for
acoustic unit discovery," Procedia Computer Science, vol. 81, pp.
80 -- 86, 2016.
[18] A. C. Kocabiyikoglu, L. Besacier, and O. Kraif, "Augmenting lib-
rispeech with french translations: A multimodal corpus for direct
speech translation evaluation," arXiv preprint arXiv:1802.03142,
2018.
|
1811.05569 | 1 | 1811 | 2018-11-13T23:27:06 | Cross-lingual Short-text Matching with Deep Learning | [
"cs.CL"
] | The problem of short text matching is formulated as follows: given a pair of sentences or questions, a matching model determines whether the input pair mean the same or not. Models that can automatically identify questions with the same meaning have a wide range of applications in question answering sites and modern chatbots. In this article, we describe the approach by team hahu to solve this problem in the context of the "CIKM AnalytiCup 2018 - Cross-lingual Short-text Matching of Question Pairs" that is sponsored by Alibaba. Our solution is an end-to-end system based on current advances in deep learning which avoids heavy feature-engineering and achieves improved performance over traditional machine-learning approaches. The log-loss scores for the first and second rounds of the contest are 0.35 and 0.39 respectively. The team was ranked 7th from 1027 teams in the overall ranking scheme by the organizers that consisted of the two contest scores as well as: innovation and system integrity, understanding data as well as practicality of the solution for business. | cs.CL | cs | Cross-lingual Short-text Matching with Deep Learning
Asmelash Teka Hadgu
[email protected]
L3S Research Center
Hannover, Germany
ABSTRACT
The problem of short text matching is formulated as follows:
given a pair of sentences or questions, a matching model
determines whether the input pair mean the same or not.
Models that can automatically identify questions with the
same meaning have a wide range of applications in question
answering sites and modern chatbots. In this article, we de-
scribe the approach by team ሀሁ to solve this problem in
the context of the "CIKM AnalytiCup 2018 - Cross-lingual
Short-text Matching of Question Pairs" that is sponsored by
Alibaba. Our solution is an end-to-end system based on cur-
rent advances in deep learning which avoids heavy feature-
engineering and achieves improved performance over tradi-
tional machine-learning approaches. The log-loss scores for
the first and second rounds of the contest are 0.35 and 0.39
respectively. The team was ranked 7th from 1027 teams in
the overall ranking scheme by the organizers that consisted
of the two contest scores as well as: innovation and system
integrity, understanding data as well as practicality of the
solution for business.
KEYWORDS
natural language inference, deep learning, cross-lingual text
matching
1
Many large Internet companies such as Alibaba, perform mil-
lions of transactions with users every day. For instance, Al-
iMe is an online conversational assistant for individuals that
enables intelligent services such as all-time shopping guides,
assistance service, chatting service and supports many other
products within Alibaba's ecosystem. Short-text matching is
one of the most common and important tasks when designing
and developing such chatbots. With increased globalization,
the services need to be provided with foreign languages, such
as English, Spanish, etc. In this challenge, we focus on the
language adaptation problem in short-text matching task.
A similar challenge was posed by Quora on Kaggle 1 where
Kagglers were challenged to tackle the problem of classify-
ing whether question pairs are duplicates or not. A good
model would help Quora to provide better experience for
users (writers, seekers and readers) by making it easier to
find high quality answers to questions.
INTRODUCTION
The goal of this challenge is to build a cross-lingual short-
text matching model. The source language is English and
the target language is Spanish. Participants could train their
models by applying advanced techniques to classify whether
1https://www.kaggle.com/c/quora-question-pairs
question pairs are the same meaning or not. At the end, the
models' performance is tested on the target language.
Challenge Restrictions
The organizers wanted all participants to focus on the text
matching and language adaptation problems in this task.
They gave the following restrictions:
(cid:15) During training one can only use the data provided by
them, including labeled data, unlabeled data, transla-
tions, word vectors. No other data or pre-trained mod-
els are allowed.
(cid:15) If one uses pre-trained word vectors, only fastText pre-
trained word vectors are allowed.
(cid:15) If one needs translation model or translation corpus,
he/she can only use the translations provided by them.
(cid:15) With the parallel data provided, theoretically one can
train a translation model. Such methods are not pro-
hibited, but the organizers do not recommend so.
Dataset
In this competition, the training dataset contains two lan-
guages. There are 20,000 labeled question pairs in English.
There are 1,400 labeled question pairs and 55,669 unlabeled
questions in Spanish. The ground truth is the set of labels
that have been supplied by human experts. Following is the
description of each file.
(cid:15) cikm_english_train: English pairs, labels, and the cor-
responding Spanish translations. The format is: Eng-
lish question 1, Spanish translation 1, English question
2, Spanish translation 2, label. Label being 1 indicates
that the two questions have essentially the same mean-
ing, and 0 otherwise.
(cid:15) cikm_spanish_train: Spanish pairs, labels, and the
corresponding English translations. The format is
Spanish question 1, English translation 1, Spanish
question 2, English translation 2, label Label being
1 indicates that the two questions have essentially the
same meaning, and 0 otherwise.
(cid:15) cikm_unlabel_spanish_train:
Spanish
questions and corresponding English translations.
(cid:15) cikm_test_a: Spanish question pairs to be predicted
in phase one.
(cid:15) cikm_test_b: Spanish question pairs to be predicted
in phase two.
unlabeled
2 RELATED WORK
Traditional approaches to question matching involve trans-
forming pair of questions into a term space or latent space
and performing matching in term/latent space through dis-
tance measures such as cosine similarity or dot product. E.g.,
BM25 is a bag-of-words retrieval function that is used to
identify matching questions based on the terms appearing
in each question.
However, relying on terms that appear in question pairs
is problematic. Questions may be formulated using differ-
ent words to mean the same thing. This includes words that
are synonyms which are used to convey the same intent but
have different surface forms. In this case, trivial approaches
that rely on exact matches of terms will not work since
there maybe no overlapping words. The key challenges are (i)
bridging the semantic gap between words and (ii) capturing
the order of words. Current advances in deep learning have
improved performance of many natural language processing
(NLP) tasks including the problem of text matching. Deep
learning methods for matching have two components. They
use distributed representation of words and sentences. The
use neural networks to perform more complex relationships
instead of applying similarity functions such as cosine or dot
product.
In this work, we follow the latter line of research because
better representation gives better generalization ability and
these deep learning models involve richer matching signals.
Methods for representation learning involve first comput-
ing representation through: deep neural networks (DNN),
convolutional neural networks (CNN) or Recurrent Neural
Networks (RNN). This is followed by performing a match-
ing function on the representations using (i) cosine similarity
dot product or (ii) learning through feed forward networks.
In [3] the authors use bag of words and bag of letter tri-
grams to capture compositional representation of sentences.
Using letter trigrams to represent questions has the advan-
tage of reduced vocabulary, generalizes to unseen words and
is robust to misspelling, inflection etc. After learning the
representations through DNNs, they use cosine similarity
between the learned semantic vectors to perform matching.
One of the weaknesses of this approach is that bag of letter
trigrams cannot keep the word order information. CNNs are
good to keep local order of words. In [2] Hu et al. use CNNs
for matching sentences. RNNs can keep long dependence re-
lations. Mueller and Thyagarajan [4] use siamese RNNs to
learn sentence similarity.
Two state-of-the-art approaches we will use in our ex-
periments are: A decomposable attention model for natural
language inference (Decomposable) [6] that combines neu-
ral network attention with token alignment and Enhanced
LSTM for natural language inference (ESIM) [1] that uses
chain LSTMs.
3 SOLUTION
In this section, we describe our solution. Our key contri-
butions are (i) unsupervised training data generation from
small labeled data and (ii) a novel neural architecture for
short text matching.
3.1 Data Preprocessing
As with any data science task, we will begin by first exploring
our dataset to help us get a good grasp of the problem and
make better decisions e.g., of neural network setup. Table 1
shows the number of terms per sentence for Spanish. This is
important to determine the maximum length of tokens per
sentence to feed to an embedding layer. After trying 50, 60,
and 70, we found 60 to be better.
Since there is a restriction to use word embeddings from
fastText2, it is important to assess the out-of-vocabulary
terms. These are tokens that are in our dataset but can-
not be found in the vocabulary of the fastText embedding
vocabulary. As we can see from Table 1 the test data (both
for stage one and stage two) has significantly more out-of-
vocabulary tokens than all the other available data sources
that can be potentially used for training. Out-of-vocabulary
terms are indeed a big problem in this challenge. Inspecting
the out-of-vocabulary terms, reveals that these are of many
types: foreign words such as 'trademanager', misspellings
and typos e.g., reemboloso, reembolzo to mean reembolso,
misspellings such as the use of v in place of b e.g., recivido to
mean recibido as well as the use of accented or non-accented
characters for instance (cancelé, cancele), (cupon, cupón),
(trabajais, trabajáis), (recibire, recibiré) where the first term
in each of these tuples is an out-of-vocabulary term and the
second is available in the embedding. We add these rules
that cover many out-of-vocabulary cases in our preprocess-
ing step.
3.2 Unsupervised Training Data Generation
The datasets provided in the challenge mirrors a very com-
mon scenario in large Internet companies where there is al-
ready a relatively large training sample of English question
pairs (20,000) and a small labeled data set in the target lan-
guage (Spanish). Our first attempt to use the small Spanish
training dataset in combination with the Spanish transla-
tions of the English question pairs alone did not yield a
promising result. The question is how to leverage the big
(55,669) unlabeled Spanish question pairs? Our key insight is
to leverage the English translations as a link to 'mint' more
natural Spanish question pairs from the unlabeled dataset
for training. Concretely, for each labeled question pairs in
English, we generate the corresponding Spanish pair with
the same label.
Consolidating training data through user generated
matching of sentences proceeds in two stages. The first
one involves gathering matching question pairs form the
unlabeled dataset only. The second approach gathers all
unique English labeled question pairs from the English
(cikm_english_train) and Spanish (cikm_spanish_train)
ground truth data and uses the English translation in the
unlabeled data to collect more pairs with the same label. In
both of these tasks, the most important operation is how to
find whether or not two English questions mean the same.
2https://github.com/facebookresearch/fastText
2
Table 1: Characterizing Spanish sentences in terms of number of (i) unique and (ii) out-of-vocabulary terms per sentence.
cikm_spanish_train
cikm_english_train
cikm_unlabel_spanish_train
cikm_test_a
cikm_test_b
number of uni-grams per sentence
(max, mean, std)
51, 9.823, 5.547
53, 7.877, 5.093
73, 17.11, 8.588
57, 9.52, 6.481
55, 9.47, 6.801
out of vocabulary terms
(terms, sentences, pairs)
64, 143, 141
370, 451, 415
987, 1375, 1177
We require that such a method be very precise as we do not
want to introduce wrong labeled pairs in our training.
One basic and straightforward answer is to use exact
matching. Another idea would be to build a classifier us-
ing the English training set. We tried both ideas. Whereas
the first approach cannot generate many pairs the second
method did not meet our high precision requirement. Finally
we used exact matches of sentences after hashing each Eng-
lish sentence by taking a bag of words approach after lower
casing the sentence, stripping off stop-words, numbers and
separately encoding one or more negation keyword markers
as 'no'. This normalization step destroys the order but since
it keeps the most essential terms in a sentence, we can still
retain the intent of the question.
We observed the stop word lists in NLTK3 had some
omissions. For instance whereas the stop-word list contains
"you're" "you'll" "should" it does not contain: "I'm" "I'll"
"would" etc. This phenomenon has been studied in [5] where
the authors found that stop words in most open-source soft-
ware (OSS) packages for natural language processing have
omissions. We consolidated the stop-words list by adding
such omissions and removing some inclusions such as "re" or
"again" to better suite the particular problem we are solving.
Following this approach to gather more training data gave us
a big jump in the leaderboard and confirming our hypothesis
that minting more natural Spanish pairs from the unlabeled
dataset was indeed a good idea.
We evaluated our unsupervised approach of match-
ing English question pairs by applying the technique on
cikm_english_train. It is not possible to evaluate absolute
precision and recall. However we can ask how many of the
ground-truth matches can we obtain using this approach and
most importantly, what is the relative precision? i.e., of the
matches we generate how many are with the wrong label?
We recovered 404 of the 4887 (8.3%) matching pairs. We
also got 9 pairs out of the 15650 false positives. Overall, the
relative precision is 97.82%. On further inspection, we found
that half of the false positives are actually wrongly labeled
pairs on the ground truth data. This gives us the confidence
that our unsupervised approach has acceptable precision for
the purpose of generating more matching pairs from the un-
labeled dataset that we can use for training.
Expanding the ground-truth pairs follows the same logic.
After applying the normalization step described above, if an
English sentence in the unlabeled data matches a sentence in
3https://www.nltk.org
the ground-truth tuple, then the Spanish equivalent of this
sentence produces a new pair by replacing the Spanish sen-
tence on the ground-truth. Using these combined approaches,
we gathered a total of 76,178 pairs where 39,395 are non-
matches and the remaining 36,783 are matching pairs.
One of the main challenges in this competition has been
building a good validation set that would reflect the dis-
tribution of the test data. One approach we used to avoid
overfitting was to completely leave out the Spanish training
set as validation set and do the training on the combination
of Spanish translations on the English training dataset and
the data generated through the unsupervised approach.
3.3 Proposed Model
Current advanced in deep learning have improved results on
a variety of NLP tasks. With this observation, our focus was
to test current state-of-the-art methods and explore room for
improvement in the context of this challenge. Our approach
builds on the works we highlighted in the related work sec-
tion. A visual representation of our architecture is shown in
Figure 1. It is implemented in Keras4 and uses Tensorflow5
as back-end. Here is a brief description of how it works.
As with any matching system, our model accepts a pair of
questions as input. The questions are then passed through a
preprocessing step: lower casing, stripping punctuation and
checking for fixes if a term does not exist in the embedding
vocabulary. Then up to 60 of the terms in a question are
passed to an embedding layer that encodes each vocabulary
by a 300 dimensional dense vector. We use fastText embed-
dings provided by the organizers for this purpose.
After independently encoding the input question pairs,
they are passed through our representation learning mod-
ule that serves as a 'feature extractor'. Our representation
learning module is a Siamese network that has three compo-
nents: CNNs, an LSTM and a BiLSTM. We use three CNNs
using 1D convolutions that can iterate over the word vectors
of a sentence. We use kernel sizes of 1, 2 and 3 correspond-
ing to word uni- bi- and tri-grams. The LSTM unit in the
Siamese network similarly takes the output of the embed-
ding layer and produces a fixed size (experimented with 32,
64, 128) dimensional vector. Finally the third component
of the Siamese network is a BiLSTM unit. The sentences
encoded in the embedding spaces are passed through a BiL-
STM to produce a fixed size dimensional vector. These three
4https://keras.io
5https://www.tensorflow.org
3
Figure 1: An overview of our proposed approach.
units form the bases of our representation learning module.
The outputs of these three 'feature extractors' is then con-
catenated in one vector, the representation vector.
Finally we take the element-wise difference and element-
wise product of the representation vector, concatenate them
and feed the combined vector into a Multi-layer perceptron
(MLP) to learn the matching function. The MLP is a stan-
dard feed-forward neural network with two hidden layers
that uses relu as an activation function and has Dropout
and Batch normalization. We use the log loss to evaluate
the performance. If yi is the ground truth label and pi is the
probability assigned to instance xi, the log loss is defined as
follows:
log loss =
1
N
[yi log pi + (1 (cid:0) yi ) log(1 (cid:0) pi )]
.
Table 2: Evaluation of the different algorithms on the valida-
tion set, cikm_spanish_train dataset. Results are averages of
best 3-5 runs per algorithm.
N∑
i=1
algorithm log loss precision recall F1-score
character_ngram - baseline
siamese_lstm [4]
esim [1]
decomposable_attention [6]
siamese_conv
0.7433
0.4088
0.3114
0.3072
0.3093
siamese_conv_lstm 0.3072
siamese_conv_lstm_bilstm 0.3134
0.61
0.84
0.87
0.87
0.87
0.86
0.86
0.54
0.83
0.87
0.88
0.88
0.86
0.87
0.56
0.84
0.86
0.87
0.87
0.86
0.86
Our approach was
depicted in Figure
to use a Siamese network as
1. We
experimented by using
4
or
an ensemble
(siamese_conv); using CNNs and LSTM
only CNNs
using CNNs, LSTM and
(siamese_conv_lstm)
sub-
BiLSTM (siamese_conv_lstm_bilstm). Our best
esim,
one was
mission for phase
of
siamese_conv_lstm,
and
siamese_conv_lstm_bilstm,
decomposable_attention. For phase two we used esim,
siamese_conv,
siamese_conv_lstm_bilstm, and decom-
posable_attention. Extensive experimentation was done
to fine-tune and arrive at the best hyperparameters for
learning rate and batch-size among others. Table 2 shows
the performance of the different algorithms on the validation
set. Clearly, the algorithms perform much better on the
validation set than the acutal test set. This is due to the
fact that the test has slightly different distribution than
the validation set. One evidence is the out-of-vocabulary
problem we highlighted earlier in Table 1.
4 CONCLUSION
In this work we have described the approach used by team
ሀሁ to solve the problem of cross-linugal short-text match-
ing in the context of the "CIKM AnalytiCup 2018 - Cross-
lingual Short-text Matching of Question Pairs". This prob-
lem is quite useful for applications such as chat-bots and
question answering sites. We have shown a neural architec-
ture solution that yields very competitive results to the state-
of-the-art work in the literature. In future work, we would
like to explore character-level embeddings in addition to the
word-level embeddings to help tackle the problem of out-of-
vocabulary terms.
Question oneQuestion twoEmbeddingRepresentation learningMatching function learning(0,1)CNNsLSTMBiLSTMConcatMLPdifferenceproductelement-wiseConcatREFERENCES
[1] Qian Chen, Xiaodan Zhu, Zhen-Hua Ling, Si Wei, Hui Jiang, and
Diana Inkpen. 2017. Enhanced LSTM for Natural Language In-
ference.. In ACL (1). Association for Computational Linguistics,
1657 -- 1668.
[2] Baotian Hu, Zhengdong Lu, Hang Li, and Qingcai Chen. 2014.
Convolutional Neural Network Architectures for Matching Natural
Language Sentences.. In NIPS. 2042 -- 2050.
[3] Po-Sen Huang, Xiaodong He, Jianfeng Gao, Li Deng, Alex Acero,
and Larry P. Heck. 2013. Learning deep structured semantic mod-
els for web search using clickthrough data.. In CIKM. ACM, 2333 --
2338.
[4] Jonas Mueller and Aditya Thyagarajan. 2016. Siamese Recurrent
Architectures for Learning Sentence Similarity.. In AAAI. AAAI
Press, 2786 -- 2792.
[5] Joel Nothman, Hanmin Qin, and Roman Yurchak. 2018. Stop
Word Lists in Free Open-source Software Packages. In Proceedings
of Workshop for NLP Open Source Software (NLP-OSS). 7 -- 12.
[6] Ankur P. Parikh, Oscar Täckström, Dipanjan Das, and Jakob
Uszkoreit. 2016. A Decomposable Attention Model for Natural
Language Inference. CoRR abs/1606.01933 (2016).
5
|
1609.06791 | 1 | 1609 | 2016-09-22T01:08:31 | Twitter-Network Topic Model: A Full Bayesian Treatment for Social Network and Text Modeling | [
"cs.CL",
"cs.IR",
"cs.SI"
] | Twitter data is extremely noisy -- each tweet is short, unstructured and with informal language, a challenge for current topic modeling. On the other hand, tweets are accompanied by extra information such as authorship, hashtags and the user-follower network. Exploiting this additional information, we propose the Twitter-Network (TN) topic model to jointly model the text and the social network in a full Bayesian nonparametric way. The TN topic model employs the hierarchical Poisson-Dirichlet processes (PDP) for text modeling and a Gaussian process random function model for social network modeling. We show that the TN topic model significantly outperforms several existing nonparametric models due to its flexibility. Moreover, the TN topic model enables additional informative inference such as authors' interests, hashtag analysis, as well as leading to further applications such as author recommendation, automatic topic labeling and hashtag suggestion. Note our general inference framework can readily be applied to other topic models with embedded PDP nodes. | cs.CL | cs |
Twitter-Network Topic Model: A Full Bayesian
Treatment for Social Network and Text Modeling
Kar Wai Lim
ANU, NICTA
Canberra, Australia
Changyou Chen
ANU, NICTA
Canberra, Australia
Wray Buntine
NICTA, ANU
Canberra, Australia
Abstract
Twitter data is extremely noisy – each tweet is short, unstructured and with in-
formal language, a challenge for current topic modeling. On the other hand,
tweets are accompanied by extra information such as authorship, hashtags and
the user-follower network. Exploiting this additional information, we propose the
Twitter-Network (TN) topic model to jointly model the text and the social net-
work in a full Bayesian nonparametric way. The TN topic model employs the
hierarchical Poisson-Dirichlet processes (PDP) for text modeling and a Gaussian
process random function model for social network modeling. We show that the
TN topic model significantly outperforms several existing nonparametric models
due to its flexibility. Moreover, the TN topic model enables additional informative
inference such as authors' interests, hashtag analysis, as well as leading to further
applications such as author recommendation, automatic topic labeling and hashtag
suggestion. Note our general inference framework can readily be applied to other
topic models with embedded PDP nodes.
1
Introduction
Emergence of web services such as blog, microblog and social networking websites allows people
to contribute information publicly. This user-generated information is generally more personal,
informal and often contains personal opinions. In aggregate, it can be useful for reputation analysis
of entities and products, natural disasters detection, obtaining first-hand news, or even demographic
analysis. Twitter, an easily accessible source of information, allows users to voice their opinions and
thoughts in short text known as tweets.
Latent Dirichlet allocation (LDA) (Blei et al., 2003) is a popular form of topic model. Unfortunately,
a direct application of LDA on tweets yields poor result as tweets are short and often noisy (Zhao
et al., 2011), i.e. tweets are unstructured and often contain grammatical and spelling errors, as well
as informal words such as user-defined abbreviations due to the 140 characters limit. LDA fails
on short tweets since it is heavily dependent on word co-occurrence. Also notable is that text in
tweets may contain special tokens known as hashtags; they are used as keywords and allow users
to link their tweets with other tweets tagged with the same hashtag. Nevertheless, hashtags are
informal since they have no standards. Hashtags can be used as both inline words or categorical
labels. Hence instead of being hard labels, hashtags are best treated as special words which can
be the themes of the tweets. Tweets are thus challenging for topic models, and ad hoc alternatives
are used instead. In other text analysis applications, tweets are often 'cleansed' by NLP methods
such as lexical normalization (Baldwin et al., 2013). However, the use of normalization is also
criticized (Eisenstein, 2013).
In this paper, we propose a novel method for short text modeling by leveraging the auxiliary infor-
mation that accompanies tweets. This information, complementing word co-occurrence, allows us
to model the tweets better, as well as opening the door to more applications, such as user recommen-
1
dation and hashtag suggestion. Our main contributions include: 1) a fully Bayesian nonparametric
model called Twitter-Network (TN) topic model that models tweets very well; and 2) a combination
of both the hierarchical Poisson Dirichlet process (HPDP) and the Gaussian process (GP) to jointly
model text, hashtags, authors and the followers network. We also develop a flexible framework for
arbitrary PDP networks, which allows quick deployment (including inference) of new variants of
HPDP topic models. Despite the complexity of the TN topic model, its implementation is made
relatively straightforward with the use of the framework.
2 Background and Related Work
LDA is often extended for different types of data, some notable examples that use auxiliary infor-
mation are the author-topic model (Rosen-Zvi et al., 2004), the tag-topic model (Tsai, 2011), and
Topic-Link LDA (Liu et al., 2009). However, these models only deal with just one kind of additional
information and do not work well with tweets since they are designed for other types of text data.
Note that the tag-topic model treats tags as hard labels and uses them to group text documents, which
is not appropriate for tweets due to the noisy nature of hashtags. Twitter-LDA (Zhao et al., 2011) and
the behavior-topic model (Qiu et al., 2013) were designed to explicitly model tweets. Both models
are not admixture models since they limit one topic per document. The behavior-topic model an-
alyzes tweets' "posting behavior" of each topic for user recommendation. On the other hand, the
biterm topic model (Yan et al., 2013) uses only the biterm co-occurrence to model tweets, discard-
ing document level information. Both biterm topic model and Twitter-LDA do not incorporate any
auxiliary information. All the above topic models also have a limitation in that the number of topics
need to be chosen in advance, which is difficult since this number is not known.
To sidestep the need of choosing the number of topics, (Teh and Jordan, 2010) proposed Hierarchi-
cal Dirichlet process (HDP) LDA, which utilizes the Dirichlet process (DP) as nonparametric prior.
Furthermore, one can replace the DP with the Poisson-Dirichlet process (PDP, also known as the
Pitman-Yor process), which models the power-law of word frequencies distributions in natural lan-
guages. In natural languages, the distribution of word frequencies exhibits a power-law (Goldwater
et al., 2006). For topic models, replacing the Dirichlet distribution with the PDP can yield great
improvement (Sato and Nakagawa, 2010).
Some recent work models text data with network information ((Liu et al., 2009; Chang and Blei,
2010; Nallapati et al., 2008)), however, these models are parametric in nature and can be restrictive.
On the contrary, Miller et al. (Miller et al., 2009) and Lloyd et al. (Lloyd et al., 2012) model network
data directly with nonparametric priors, i.e. with the Indian Buffet process and the Gaussian process
respectively, but do not model text.
3 Model Summary
The TN topic model makes use of the accompanying hashtags, authors, and followers network to
model tweets better. The TN topic model is composed of two main components: a HPDP topic
Figure 1: Twitter-Network topic model
Figure 2: Log-likelihood vs. iterations
2
Misc. Topic Author Topic Authors Link Hashtags Words Word Dist. Tags Dist. Doc. Topic 0500100015002000-2400000-2200000-2000000iterationlog-likelihoodTN ATM HDP-LDA model for the text and hashtags, and a GP based random function model for the followers network.
The authorship information serves to connect the two together.
We design our HPDP topic model for text as follows. First, generate the global topic distribution µ0
that serves as a prior. Then generate the respective authors' topic distributions ν for each author, and
a miscellaneous topic distribution µ1 to capture topics that deviate from the authors' usual topics.
Given ν and µ1, we generate the topic distributions for the documents, and words (η, θ(cid:48), θ). We also
explicitly model the influence of hashtags to words. Hashtag and word generation follows standard
LDA and is not discussed here. Note that the tokens of hashtags are shared with the words, i.e.
the hashtag #happy share the same token as the word happy. Also note that all distributions on
probability vectors are modeled by the PDP, making the model a network of PDP nodes.
The network modeling is connected to the HPDP topic model via the author topic distributions ν,
where we treat ν as inputs to the GP in the network model. The GP, denoted as F, determines the
links between the authors (x). Figure 1 displays the graphical model of TN, where region a(cid:13) and b(cid:13)
shows the network model and topic model respectively. See supplementary material1 for a detailed
description. We emphasize that our treatment of the network model is different to that of (Lloyd
et al., 2012). We define a new kernel function based on the cosine similarity in our network model,
which provides significant improvement over the original kernel function. Also, we derive a new
sampling procedure for inference due to the additive coupling of topic distributions and network
connections.
4 Posterior Inference
We alternatively perform Markov chain Monte Carlo (MCMC) sampling on the topic model and
the network model, conditioned on each other. We derive a collapsed Gibbs sampler for the topic
model, and a Metropolis-Hastings (MH) algorithm for the network model. We develop a framework
to perform collapse Gibbs sampling generally on any Bayesian network of PDPs, built upon the
work of (Buntine et al., 2010; Chen et al., 2011), which allows quick prototyping and development
of new variants of topic model. We refer the readers to the supplementary materials for the technical
details.
5 Experiments and Applications
We evaluate the TN topic model quantitatively with standard topic model measures such as test-set
perplexity, likelihood convergence and clustering measures. Qualitatively, we evaluate the model
by visualizing the topic summaries, authors' topic distributions and by performing an automatic la-
beling task. We compare our model with HDP-LDA, a nonparametric variant of the author-topic
model (ATM), and the original random function network model. We also perform ablation studies
to show the importance of each component in the model. The results of the comparison and ablation
studies are shown in Table 1. We use two tweets corpus for experiments, first is a subset of Twit-
ter7 dataset2 (Yang and Leskovec, 2011), obtained by querying with certain keywords (e.g. finance,
sports, politics). we remove tweets that are not English with langid.py (Lui and Baldwin, 2012) and
filter authors who do not have network information and who authored less than 100 tweets. The
corpus consists of 60370 tweets by 94 authors. We then randomly select 90% of the dataset as train-
ing documents and use the rest for testing. Second tweets corpus is obtained from (Mehrotra et al.,
2013), which contains a total of 781186 tweets. We note that we perform no word normalization to
prevent any loss of meaning of the noisy text.
In all cases, we vary α from 0.3 to 0.7 on topic nodes (µ0, µ1, νi, ηm, θ(cid:48)
Experiment Settings
m,
θm) and set α = 0.7 on vocabulary nodes (ψ, γ) to induce power-law. We initialize β to 0.5, and set
its hyperprior to Gamma(0.1, 0.1). We fix the hyperparameters λ's, s, l and σ to 1 since their values
have no significant impact on model performance. In the following evaluations, we run the sampling
algorithms for 2000 iterations for the training likelihood to converge. We repeat each experiment
five times to reduce the estimation error of the evaluation measures.
In the experiments for the
TN topic model, we achieve a better computational efficiency by first running the collapsed Gibbs
1Supplementary material is available online at the authors' websites.
2http://snap.stanford.edu/data/twitter7.html
3
Table 1: Perplexity & network log-likelihood
Table 2: Labeling topics with hashtags
HDP-LDA
ATM
Random Function
No Author
No Hashtag
No µ1 node
No Word-tag link
No Power-law
No Network
Full TN
Network
N/A
N/A
Perplexity
358.1±6.7
302.9±8.1
N/A
N/A
−294.6±5.9
243.8±3.4
307.5±8.3 −269.2±9.5
221.3±3.9 −271.2±5.2
217.6±6.3 −275.0±10.1
222.5±3.1 −280.8±15.4
218.4±4.0
208.4±3.2 −266.0±6.9
N/A
Top hashtags/words
#finance #money #economy
finance money bank marketwatch
stocks china group
#politics #iranelection #tcot
politics iran iranelection tcot
tlot topprog obama
#music #folk #pop
music folk monster head pop
free indie album gratuit
T0
T1
T2
Table 3: Topics by authors
Table 4: Cosine similarity
Twitter ID
finance yard
ultimate music
seriouslytech
seriouspolitics
pr science
Top topics represented by hashtags
#finance #money #realestate
#music #ultimatemusiclist #mp3
#technology #web #tech
#politics #postrank #news
#science #news #postrank
Recommended
Original
TN
Not-recommended
Original
TN
1st
0.00
0.78
1st
0.36
0.17
2nd
0.05
0.57
2nd
0.33
0.09
3rd
0.06
0.55
3rd
0.14
0.10
sampling for 1000 iterations before the full inference procedure. In Figure 2, we can see that the
TN topic model converges quickly compared to the HDP-LDA and the nonparametric ATM. Also,
the training likelihood of the TN topic model becomes better sampling for the network information
after 1000 iterations.
Automatic Topic Labeling There have been recent attempts to label topics automatically in topic
modeling. Here, we show that using hashtag information allows us to get good labels for topics.
Table 2 shows topics labeled by the TN topic model. More detailed topic summaries are shown in
the supplementary material. We empirically evaluate the suitability of hashtags in representing the
topics and found that, consistently, over 90% of the hashtags are good candidates for the topic labels.
Inference on Authors' Topic Distributions
In addition to inference on the topic distribution of
each document, the TN topic model allows us to analyze the topic distribution of each author. Table 3
presents a summary of topics by different authors, where topics are obvious from the Twitter ID.
Author Recommendation We illustrate the use of the TN topic model for author recommenda-
tion. On a new test dataset with 90451 tweets and 625 new authors, we predict the most similar and
dissimilar authors for the new authors, based on the training model of 60370 tweets. We quantify
the recommendation quality with the cosine similarities of the authors' topic distributions for the
recommended author pairs. We compare our new kernel function with the original kernel function
(denoted as original) used in (Lloyd et al., 2012). Table 4 shows average cosine similarities between
the recommended and not-recommended authors. This suggests that our kernel function is more
appropriate. Additionally, we manually checked the recommended authors and we found that they
usually belong to the same community, i.e., having tweets with similar topics.
Clustering and Topic Coherence We also evaluate the TN topic model against state-of-the-art
LDA-based clustering techniques (Mehrotra et al., 2013). We find that the TN topic model outper-
forms the state-of-the-art in purity, normalized mutual information and pointwise mutual informa-
tion (PMI). Due to space, the evaluation result is provided in the supplementary material.
6 Conclusion and Future Work
We propose a full Bayesian nonparametric Twitter-Network (TN) topic model that jointly models
tweets and the associated social network information. Our model employs a nonparametric Bayesian
approach by using the PDP and GP, and achieves flexible modeling by performing inference on a
4
network of PDPs. Our experiments with Twitter dataset show that the TN topic model achieves sig-
nificant improvement compared to existing baselines. Furthermore, our ablation study demonstrates
the usefulness of each component of the TN model. Our model also shows interesting applications
such as author recommendation, as well as providing additional informative inferences.
We also engineered a framework for rapid topic model development, which is important due to the
complexity of the model. While we could have used Adaptor Grammars (Johnson et al., 2007), our
framework yields more efficient computation for topic models.
Future work includes speeding up the posterior inference algorithm, especially for the network
model, as well as incorporating other auxiliary information that is available in social media such
as location, hyperlinks and multimedia contents. We also intend to explore other applications that
can be addressed with the TN topic model, such as hashtag recommendation. It is also interesting
to apply the TN topic model to other types of data such as blog and publication data.
Acknowledgement
We would like to thank the anonymous reviewers for their helpful feedback and comments.
NICTA is funded by the Australian Government through the Department of Communications and
the Australian Research Council through the ICT Centre of Excellence Program.
References
Baldwin, T., Cook, P., Lui, M., MacKinlay, A., and Wang, L. (2013). How noisy social media text, how diffrnt
social media sources? IJCNLP.
Blei, D. M., Ng, A. Y., and Jordan, M. I. (2003). Latent Dirichlet Allocation. the Journal of machine Learning
research, 3:993–1022.
Buntine, W., Du, L., and Nurmi, P. (2010). Bayesian networks on dirichlet distributed vectors. pages 33–40.
Chang, J. and Blei, D. M. (2010). Hierarchical relational models for document networks. The Annals of Applied
Statistics, 4(1):124–150.
Chen, C., Du, L., and Buntine, W. (2011). Sampling table configurations for the hierarchical Poisson-Dirichlet
process. In Machine Learning and Knowledge Discovery in Databases, pages 296–311. Springer.
Eisenstein, J. (2013). What to do about bad language on the internet.
In Proceedings of the 2013 Confer-
ence of the North American Chapter of the Association for Computational Linguistics: Human Language
Technologies, Atlanta, Georgia. Association for Computational Linguistics.
Goldwater, S., Griffiths, T., and Johnson, M. (2006). Interpolating between types and tokens by estimating
power-law generators. Advances in neural information processing systems, 18:459.
Johnson, M., Griffiths, T. L., and Goldwater, S. (2007). Adaptor grammars: A framework for specifying
compositional nonparametric Bayesian models. Advances in neural information processing systems, 19:641.
Liu, Y., Niculescu-Mizil, A., and Gryc, W. (2009). Topic-link LDA: joint models of topic and author commu-
nity. In Proceedings of the 26th Annual International Conference on Machine Learning, pages 665–672.
ACM.
Lloyd, J., Orbanz, P., Ghahramani, Z., and Roy, D. (2012). Random function priors for exchangeable arrays
with applications to graphs and relational data. In Advances in Neural Information Processing Systems 25,
pages 1007–1015.
Lui, M. and Baldwin, T. (2012). langid.py: An off-the-shelf language identification tool. In Proceedings of the
ACL 2012 System Demonstrations, pages 25–30. Association for Computational Linguistics.
Mehrotra, R., Sanner, S., Buntine, W., and Xie, L. (2013). Improving LDA topic models for microblogs via
tweet pooling and automatic labeling. In The 36th Annual ACM SIGIR Conference, page 4, Dublin/Ireland.
Miller, K., Jordan, M. I., and Griffiths, T. L. (2009). Nonparametric latent feature models for link prediction.
In Advances in neural information processing systems, pages 1276–1284.
Nallapati, R., Ahmed, A., and Xing, E. P. (2008). Joint latent topic models for text and citations. In KDD.
Qiu, M., Zhu, F., and Jiang, J. (2013). It is not just what we say, but how we say them: Lda-based behavior-topic
model. 2013 SIAM International Conference on Data Mining (SDM'13).
Rosen-Zvi, M., Griffiths, T., Steyvers, M., and Smyth, P. (2004). The author-topic model for authors and
documents. In Proceedings of the 20th conference on Uncertainty in artificial intelligence, pages 487–494.
AUAI Press.
5
Sato, I. and Nakagawa, H. (2010). Topic models with power-law using pitman-yor process. In Proceedings of
the 16th ACM SIGKDD international conference on Knowledge discovery and data mining, KDD '10, pages
673–682, New York, NY, USA. ACM.
Teh, Y. W. and Jordan, M. I. (2010). Hierarchical Bayesian nonparametric models with applications.
Bayesian Nonparametrics: Principles and Practice. Cambridge University Press.
In
Tsai, F. S. (2011). A tag-topic model for blog mining. Expert Systems with Applications, 38(5):5330–5335.
Yan, X., Guo, J., Lan, Y., and Cheng, X. (2013). A biterm topic model for short texts. In Proceedings of the
22nd international conference on World Wide Web, WWW '13, pages 1445–1456, Republic and Canton of
Geneva, Switzerland. International World Wide Web Conferences Steering Committee.
Yang, J. and Leskovec, J. (2011). Patterns of temporal variation in online media. In Proceedings of the fourth
ACM international conference on Web search and data mining, pages 177–186. ACM.
Zhao, W. X., Jiang, J., Weng, J., He, J., Lim, E.-P., Yan, H., and Li, X. (2011). Comparing twitter and traditional
media using topic models. In Proceedings of the 33rd European conference on Advances in information
retrieval, ECIR'11, pages 338–349, Berlin, Heidelberg. Springer-Verlag.
6
|
1808.08762 | 2 | 1808 | 2019-06-03T19:50:52 | Sentence Embeddings in NLI with Iterative Refinement Encoders | [
"cs.CL",
"cs.LG"
] | Sentence-level representations are necessary for various NLP tasks. Recurrent neural networks have proven to be very effective in learning distributed representations and can be trained efficiently on natural language inference tasks. We build on top of one such model and propose a hierarchy of BiLSTM and max pooling layers that implements an iterative refinement strategy and yields state of the art results on the SciTail dataset as well as strong results for SNLI and MultiNLI. We can show that the sentence embeddings learned in this way can be utilized in a wide variety of transfer learning tasks, outperforming InferSent on 7 out of 10 and SkipThought on 8 out of 9 SentEval sentence embedding evaluation tasks. Furthermore, our model beats the InferSent model in 8 out of 10 recently published SentEval probing tasks designed to evaluate sentence embeddings' ability to capture some of the important linguistic properties of sentences. | cs.CL | cs |
1
Sentence Embeddings in NLI with Iterative
Refinement Encoders
Aarne Talman, Anssi Yli-Jyra and Jorg Tiedemann
Department of Digital Humanities
{aarne.talman, anssi.yli-jyra, jorg.tiedemann}@helsinki.fi
University of Helsinki
Abstract
Sentence-level representations are necessary for various NLP tasks. Recurrent neural net-
works have proven to be very effective in learning distributed representations and can
be trained efficiently on natural language inference tasks. We build on top of one such
model and propose a hierarchy of BiLSTM and max pooling layers that implements an
iterative refinement strategy and yields state of the art results on the SciTail dataset
as well as strong results for SNLI and MultiNLI. We can show that the sentence em-
beddings learned in this way can be utilized in a wide variety of transfer learning tasks,
outperforming InferSent on 7 out of 10 and SkipThought on 8 out of 9 SentEval sentence
embedding evaluation tasks. Furthermore, our model beats the InferSent model in 8 out of
10 recently published SentEval probing tasks designed to evaluate sentence embeddings'
ability to capture some of the important linguistic properties of sentences.
1 Introduction
Neural networks have been shown to provide a powerful tool for building represen-
tations of natural languages on multiple levels of linguistic abstraction. Perhaps the
most widely used representations in natural language processing are word embed-
dings (Mikolov, Sutskever, Chen, Corrado, and Dean 2013, Pennington, Socher, and
Manning 2014). Recently there has been a growing interest in models for sentence-
level representations using a range of different neural network architectures. Such
sentence embeddings have been generated using unsupervised learning approaches
(Kiros, Zhu, Salakhutdinov, Zemel, Urtasun, Torralba, and Fidler 2015, Hill, Cho,
and Korhonen 2016), and supervised learning (Bowman, Gauthier, Rastogi, Gupta,
Manning, and Potts 2016, Conneau, Kiela, Schwenk, Barrault, and Bordes 2017).
Supervision typically comes in the form of an underlying semantic task with
labeled data to train the model. The most prominent task for that purpose is natural
language inference (NLI) that tries to model the inferential relationship between
two or more given sentences. In particular, given two sentences - the premise p and
the hypothesis h - the task is to determine whether h is entailed by p, whether
the sentences are in contradiction with each other or whether there is no inferential
relationship between the sentences (neutral). There are two main neural approaches
2
Talman, Yli-Jyra and Tiedemann
to NLI. Sentence encoding-based models focus on building separate embeddings for
the premises and the hypothesis and then combine those using a classifier (Bowman,
Angeli, Potts, and Manning 2015, Bowman et al. 2016, Conneau et al. 2017). Other
approaches do not treat the two sentences separately but utilize e.g. cross-sentence
attention (Tay, Tuan, and Hui 2018, Chen, Zhu, Ling, Wei, Jiang, and Inkpen
2017a).
With the goal of obtaining general-purpose sentence representations in mind, we
opt for the sentence encoding approach. Motivated by the success of the InferSent
architecture (Conneau et al. 2017) we extend their architecture with a hierarchy-
like structure of bidirectional LSTM (BiLSTM) layers with max pooling. All in
all, our model improves the previous state of the art for SciTail (Khot, Sabharwal,
and Clark 2018) and achieves strong results for the SNLI and Multi-Genre Natural
Language Inference corpus (MultiNLI; Williams, Nangia, and Bowman 2018).
In order to demonstrate the semantic abstractions achieved by our approach, we
also apply our model to a number of transfer learning tasks using the SentEval test-
ing library (Conneau et al. 2017), and show that it outperforms the InferSent model
on 7 out of 10 and SkipThought (Kiros et al. 2015) on 8 out of 9 tasks, comparing to
the scores reported by Conneau et al. (2017). Moreover, our model outperforms the
InferSent model in 8 out of 10 recently published SentEval probing tasks designed
to evaluate sentence embeddings' ability to capture some of the important linguistic
properties of sentences (Conneau, Kruszewski, Lample, Barrault, and Baroni 2018).
This highlights the generalization capability of the proposed model, confirming that
its architecture is able to learn sentence representations with strong performance
across a wide variety of different NLP tasks.
2 Related Work
There is a wide variety of approaches to sentence-level representations that can
be used in natural language inference. Bowman et al. (2015) and Bowman et al.
(2016) explore RNN and LSTM architectures, Mou, Men, Li, Xu, Zhang, Yan, and
Jin (2016) convolutional neural networks and Vendrov, Kiros, Fidler, and Urtasun
(2016) GRUs, to name a few. The basic idea behind these approaches is to encode
the premise and hypothesis sentences separately and then combine those using a
neural network classifier.
Conneau et al. (2017) explore multiple different sentence embedding architectures
ranging from LSTM, BiLSTM and intra-attention to convolution neural networks
and the performance of these architectures on NLI tasks. They show that, out of
these models, BiLSTM with max pooling achieves the strongest results not only
in NLI but also in many other NLP tasks requiring sentence level meaning repre-
sentations. They also show that their model trained on NLI data achieves strong
performance on various transfer learning tasks.
Although sentence embedding approaches have proven their effectiveness in NLI,
there are multiple studies showing that treating the hypothesis and premise sen-
tences together and focusing on the relationship between those sentences yields bet-
ter results (Tay et al. 2018, Chen et al. 2017a). These methods are focused on the
Sentence Embeddings in NLI with Iterative Refinement Encoders
3
inference relations rather than the internal semantics of the sentences. Therefore,
they do not offer similar insights about the sentence level semantics, as individual
sentence embeddings do, and they cannot straightforwardly be used outside of the
NLI context.
3 Model Architecture
Our proposed architecture follows a sentence embedding-based approach for NLI
introduced by Bowman et al. (2015). The model illustrated in Figure 1 contains
sentence embeddings for the two input sentences, where the output of the sen-
tence embeddings are combined using a heuristic introduced by Mou et al. (2016),
putting together the concatenation (u, v), absolute element-wise difference u − v,
and element-wise product u ∗ v. The combined vector is then passed on to a 3-
layered multi-layer perceptron (MLP) with a 3-way softmax classifier. The first two
layers of the MLP both utilize dropout and a ReLU activation function.
We use a variant of ReLU called Leaky ReLU (Maas, Hannun, and Ng 2013),
defined by:
LeakyReLU (x) = max(0, x) + y ∗ min(0, x)
where we set y = 0.01 as the negative slope for x < 0. This prevents the gradient
from dying when x < 0.
Fig. 1. Overall NLI Architecture
For the sentence representations we first embed the individual words with pre-
trained word embeddings. The sequence of the embedded words is then passed on
to the sentence encoder which utilizes BiLSTM with max pooling. Given a sequence
T of words (w1 . . . , wT ), the output of the bi-directional LSTM is a set of vectors
(h1, . . . , hT ), where each ht ∈ (h1, . . . , hT ) is the concatenation
ht = [
−→
h t,
←−
h t]
4
Talman, Yli-Jyra and Tiedemann
of a forward and backward LSTMs
−→
h t =
←−
h t =
−−−−→
LST M t(w1, . . . , wt)
←−−−−
LST M t(wT , . . . , wt).
The max pooling layer produces a vector of the same dimensionality as ht, returning,
for each dimension, its maximum value over the hidden units (h1, . . . , hT ).
Motivated by the strong results of the BiLSTM max pooling network by Conneau
et al. (2017), we experimented with combining BiLSTM max pooling networks in
a hierarchy-like structure.1 To improve the BiLSTM layers' ability to remember
the input words, we let each layer of the network re-read the input embeddings
instead of stacking the layers in a strict hierarchical model. In this way, our model
acts as an iterative refinement architecture that reconsiders the input in each layer
while being informed by the previous layer through initialisation. This creates a
hierarchy of refinement layers and each of them contributes to the NLI classification
by max pooling the hidden states. In the following we refer to that architecture
with the abbreviation HBMP. Max pooling is defined in the standard way of taking
the highest value over each dimension of the hidden states and the final sentence
embedding is the concatenation of those vectors coming from each BiLSTM layer.
The overall architecture is illustrated in Figure 2.
To summarize the differences between our model and traditional stacked BiLSTM
architectures we can list the following three main aspects:
1. Each layer in our model is a separate BiLSTM initialized with the hidden and
cell states of the previous layer.
2. Each layer in our model receives the same word embeddings as its input.
3. The final sentence representation is the concatenation of the max pooled
output of each layer in the encoder network.
In order to study the effect of our architecture we conduct a comparison of HBMP
with the following alternative models:
1. BiLSTM-Ens: Ensemble of three BiLSTMs with max pooling, all getting
the same embeddings as the input.
2. BiLSTM-Ens-Train: Ensemble of three BiLSTMs with max pooling, with
the hidden and cell states of each BiLSTM being trainable parameters of the
whole network.
3. BiLSTM-Ens-Tied: Ensemble of three BiLSTMs with max pooling, where
the weights of the BiLSTMs are tied.
4. BiLSTM-Stack: A strictly hierarchical model with three BiLSTM layers
where the second and third layer receive the output of the previous layer as
their input.
In the first model (BiLSTM-Ens) we contrast our architecture with a similar
1 Conneau et al. (2017) explore a similar architecture using convolutional neural networks,
called Hierarchical ConvNet.
Sentence Embeddings in NLI with Iterative Refinement Encoders
5
Fig. 2. Architecture of the HBMP sentence encoder (where T = 4).
setup that does not transfer knowledge between layers but also combines infor-
mation from three separate BiLSTM layers for the final classification. The second
model (BiLSTM-Ens-Train) adds a trainable initialization to each layer to study
the impact of the hierarchical initialization that we propose in our architecture. The
third model (BiLSTM-Ens-Tied) connects the three layers by tying parameters to
each other. Finally, the fourth model (BiLSTM-Stack) implements a standard hi-
erarchical network with stacked layers that do not re-read the original input.
We apply the standard SNLI data for the comparison of these different architec-
tures (see Section 5 for more information about the SNLI benchmark). Table 1 lists
the results of the experiment.
Model
600D HBMP (our model)
600D BiLSTM-Ens
600D BiLSTM-Ens-Train
600D BiLSTM-Ens-Tied
600D BiLSTM-Stack
Accuracy Confidence Interval (95%)*
86.6
86.3
86.3
86.1
86.3
[84.6%, 88.7%]
[84.4%, 88.3%]
[84.3%, 88.4%]
[83.8%, 87.9%]
[84.2%, 88.3%]
Table 1. SNLI test accuracies (%) of different architectures. *Confidence intervals
calculated over 1000 random samples of 1000 sentence pairs.
The results show that HBMP performs better than each of the other models,
6
Talman, Yli-Jyra and Tiedemann
which supports the use of our setup in favor of alternative architectures. Further-
more, we can see that the different components all contribute to the final score.
Ensembling information from three separate BiLSTM layers (with independent
parameters) improves the performance as we can see in the comparison between
BiLSTM-Ens and BiLSTM-Ens-Tied. Trainable initialization does not seem to add
to the model's capacity and indicates that the hierarchical initialization that we
propose is indeed beneficial. Finally, feeding the same input embeddings to all Bi-
LSTMs of HBMP leads to an improvement over the stacked model that does not
re-read the input information.
Using these initial findings, we will now look at a more detailed analyses of the
performance of HBMP on various datasets and tasks. But before, we first give some
more details about the implementation of the model and the training procedures
we use. Note, that the same specifications also apply to the experiments that we
already discussed above.
4 Training Details
The architecture was implemented using PyTorch. We have published our code in
GitHub: https://github.com/Helsinki-NLP/HBMP.
For all of our models we used a gradient descent optimization algorithm based
on the Adam update rule (Kingma and Ba 2015), which is pre-implemented in
PyTorch. We used a learning rate of 5e-4 for all our models. The learning rate was
decreased by the factor of 0.2 after each epoch if the model did not improve. We used
a batch size of 64. The models were evaluated with the development data after each
epoch and training was stopped if the development loss increased for more than 3
epochs. The model with the highest development accuracy was selected for testing.
We use pre-trained GloVe word embeddings of size 300 dimensions (GloVe 840B
300D; Pennington et al. 2014), which were fine-tuned during training. The sentence
embeddings have hidden size of 600 for both direction (except for SentEval test,
where we test models with 600D and 1200D per direction) and the 3-layer multi-
layer perceptron (MLP) have the size of 600 dimensions. We use a dropout of 0.1
between the MLP layers (except just before the final layer). Our models were trained
using one NVIDIA Tesla P100 GPU.
5 Evaluation Benchmarks
To further study the performance of HBMP, we train our architecture with three
common NLI datasets:
• the Stanford Natural Language Inference (SNLI) corpus,
• the Multi-Genre Natural Language Inference (MultiNLI) corpus,
• the Textual Entailment Dataset from Science Question Answering (SciTail).
Note that we treat them as separate tasks and do not mix any of the training,
development and test data in our NLI experiments. We further perform additional
linguistic error analyses using the MultiNLI Annotation Dataset and the Breaking
Sentence Embeddings in NLI with Iterative Refinement Encoders
7
NLI dataset. Finally, in order to test the ability of the model to learn general-
purpose representations, we apply the downstream tasks that are bundled in the
SentEval package for sentence embedding evaluation. Note that we combine SNLI
and MultiNLI data in those experiments in order to be compatible with related
work. Below we provide a few more details about each of the evaluation frameworks.
SNLI: The Stanford Natural Language Inference (SNLI) corpus (Bowman et al.
2015) is a dataset of 570k human-written sentence pairs manually labeled with
the gold labels entailment, contradiction, and neutral. The dataset is divided into
training (550,152 pairs), development (10,000 pairs) and test sets (10,000 pairs).
The source for the premise sentences in SNLI were image captions taken from the
Flickr30k corpus (Young, Lai, Hodosh, and Hockenmaier 2014).
MultiNLI: The Multi-Genre Natural Language Inference (MultiNLI) corpus
(Williams et al. 2018) is a broad-coverage corpus for natural language inference,
consisting of 433k human-written sentence pairs labeled with entailment, contra-
diction and neutral. Unlike the SNLI corpus, which draws the premise sentence
from image captions, MultiNLI consists of sentence pairs from ten distinct genres
of both written and spoken English. The dataset is divided into training (392,702
pairs), development (20,000 pairs) and test sets (20,000 pairs).
Only five genres are included in the training set. The development and test sets
have been divided into matched and mismatched, where the former includes only
sentences from the same genres as the training data, and the latter includes sen-
tences from the remaining genres not present in the training data.
In addition to the training, development and test sets, MultiNLI provides a
smaller annotation dataset, which contains approximately 1000 sentence pairs an-
notated with linguistic properties of the sentences and is split between the matched
and mismatched datasets.2 This dataset provides a simple way to assess what kind
of sentence pairs an NLI system is able to predict correctly and where it makes
errors. We use the annotation dataset to perform linguistic error analysis of our
model and compare the results to results obtained with InferSent. For our ex-
periment with the annotation dataset we use the annotations for the MultiNLI
mismatched dataset.
SciTail: SciTail (Khot et al. 2018) is an NLI dataset created from multiple-choice
science exams consisting of 27k sentence pairs. Each question and the correct answer
choice have been converted into an assertive statement to form the hypothesis. The
dataset is divided into training (23,596 pairs), development (1,304 pairs) and test
sets (2,126 pairs). Unlike the SNLI and MultiNLI datasets, SciTail uses only two
labels: entailment and neutral.
2 The annotated dataset and description of the annotations are available at http://www.
nyu.edu/projects/bowman/multinli/multinli_1.0_annotations.zip
8
Talman, Yli-Jyra and Tiedemann
Breaking NLI: Breaking NLI (Glockner, Shwartz, and Goldberg 2018) is a test set
(8,193 pairs) which is constructed by taking premises from the SNLI training set and
constructing several hypotheses from them by changing at most one word within
the premise. It was constructed to highlight how poorly current neural network
models for NLI can handle lexical meaning.
SentEval: SentEval (Conneau et al. 2017, Conneau and Kiela 2018) is a library
for evaluating the quality of sentence embeddings.3 It contains 17 downstream
tasks as well as 10 probing tasks. The downstream datasets included in the tests
were MR movie reviews, CR product reviews, SUBJ subjectivity status, MPQA
opinion-polarity, SST binary sentiment analysis, TREC question-type classification,
MRPC paraphrase detection, SICK-Relatedness (SICK-R) semantic textual simi-
larity, SICK-Entailment (SICK-E) natural language inference and STS14 semantic
textual similarity. The probing tasks evaluate how well the sentence encodings are
able to capture the following linguistic properties: Length prediction, Word Content
analysis, Tree depth prediction, Top Constituents prediction, Word order analysis,
Verb tense prediction, Subject number prediction, Object number prediction, Se-
mantic odd man out and Coordination Inversion.
For the SentEval tasks we trained our model on NLI data consisting of the con-
catenation of the SNLI and MultiNLI training sets consisting of 942,854 sentence
pairs in total. This allows us to compare our results to the InferSent results which
were obtained using a model trained on the same data (Conneau et al. 2017). Con-
neau et al. (2017) have shown that including all the training data from SNLI and
MultiNLI improves significantly the model performance on transfer learning tasks,
compared to training the model only on SNLI data.
6 Model Performance on the NLI task
In this section, we discuss the performance of the proposed sentence-encoding ap-
proach in common natural language inference benchmarks. From the experiments,
we can conclude that the model provides strong results on all of the three NLI
datasets. It clearly outperforms the similar but non-hierarchical BiLSTM models
reported in the literature and fares well in comparison to other state of the art
architectures in the sentence encoding category. In particular, our results are close
to the current state of the art on SNLI in this category and strong on both, the
matched and mismatched test sets of MultiNLI. Finally, on SciTail, we achieve the
new state of the art with an accuracy of 86.0%.
Below, we provide additional details on our results for each of the benchmarks. We
compare our model only with other state-of-the-art sentence encoding models and
exclude cross-sentence attention models, except for SciTail where previous sentence
encoding model-based results have not been published.
3 The SentEval test suite is available online at https://github.com/facebookresearch/
SentEval.
Sentence Embeddings in NLI with Iterative Refinement Encoders
9
6.1 SNLI
For the SNLI dataset, our model provides the test accuracy of 86.6% after 4 epochs
of training. The comparison of our results with the previous state of the art and
selected other sentence embedding based results are reported in Table 2.
Model
BiLSTM Max Pool (InferSent)a
Distance-based Self-Attentionb
ReSAc
600D BiLSTM with generalized poolingb
600D Dynamic Self-Attention Modelc
2400D Multiple-Dynamic Self-Attention Modelc
600D HBMP (our model)
Accuracy
84.5
86.3
86.3
86.6
86.8
87.4
86.6
Table 2. SNLI test accuracies (%). Results marked with a by Conneau et al.
(2017), b by Chen, Ling, and Zhu (2018) and c by Yoon, Lee, and Lee (2018).
6.2 MultiNLI
For the MultiNLI matched test set (MultiNLI-m) our model achieves a test accuracy
of 73.7% after 3 epochs of training, which is 0.8% points lower than the state of the
art 74.5% by Nie and Bansal (2017). For the mismatched test set (MultiNLI-mm)
our model achieves a test accuracy of 73.0% after 3 epochs of training, which is
0.6% points lower than the state of the art 73.6% by Chen, Zhu, Ling, Wei, Jiang,
and Inkpen (2017b).
A comparison of our results with the previous state of the art and selected other
approaches are reported in Table 3.
Although we did not achieve state of the art results for the MultiNLI dataset, we
believe that a systematic study of different BiLSTM max pooling structures could
reveal an architecture providing the needed improvement.
6.3 SciTail
On the SciTail dataset we compared our model also against non-sentence
embedding-based models, as no results have been previously published which are
based on independent sentence embeddings. We obtain a score of 86.0% after 4
epochs of training, which is +2.7% points absolute improvement on the previous
published state of the art by Tay et al. (2018). Our model also outperforms In-
ferSent which achieves an accuracy of 85.1% in our experiments. The comparison
of our results with the previous state of the art results are reported in Table 4.
The results achieved by our proposed model are significantly higher than the
previously published results. It has been argued that the lexical similarity of the
sentences in SciTail sentence pairs make it a particularly difficult dataset (Khot
et al. 2018). If this is the case, we hypothesize that our model is indeed better
10
Talman, Yli-Jyra and Tiedemann
Model
CBOWa
BiLSTMa
BiLSTM + enh embed + max poolingb
BiLSTM + Inner-attentionc
Deep Gated Attn. BiLSTM encodersd
Shortcut-Stacked BiLSTMe
600D HBMP
Accuracy
Accuracy
(MultiNLI-m) (MultiNLI-mm)
66.2
67.5
70.7
72.1
73.5
74.5
73.7
64.6
67.1
70.8
72.1
73.6
73.5
73.0
Table 3. MultiNLI test accuracies (%). Results marked with a are baseline results
by Williams et al. (2018), b by Vu (2017), c by Balazs, Marrese-Taylor, Loyola,
and Matsuo (2017), d by Chen et al. (2017b) and e by Nie and Bansal (2017). Our
results for the MultiNLI test sets were obtained by submitting the predictions to
the respective Kaggle competitions.
Model
DecompAtta
ESIMa
Ngrama
DGEM w/o edgesa
DGEMa
CAFEb
InferSent
600D HBMP
Accuracy
72.3
70.6
70.6
70.8
77.3
83.3
85.1
86.0
Table 4. SciTail test accuracies (%). Results marked with a are baseline results
reported by Khot et al. (2018) and b by Tay et al. (2018).
at identifying entailment relations beyond focusing on the lexical similarity of the
sentences.
7 Error Analysis of NLI Predictions
To better understand what kind of inferential relationships our model is able to
identify, we conducted an error analysis for the three datasets. We report the results
below.
Table 5 shows the accuracy of predictions per label (in terms of F-scores) for
the HBMP model and compares them to the InferSent model. This analysis shows
that our model leads to a significant improvement over the outcome of the non-
hierarchical model from previous work in almost all categories on all the three
benchmarks. The only exception is the entailment score on SciTail, which is slightly
below the performance of InferSent.
To see in more detail how our HBMP model is able to classify sentence pairs with
different labels and what kind of errors it makes, we summarize error statistics as
confusion matrices for the different datasets. They highlight the HBMP model's
strong performance across all the labels.
Sentence Embeddings in NLI with Iterative Refinement Encoders
11
SNLI
MultiNLI-m MultiNLI-mm
SciTail
HBMP InferSent HBMP InferSent HBMP InferSent HBMP InferSent
entailment
88.5
contradiction 89.1
neutral
81.9
77.2
75.3
68.2
77.9
75.6
68.6
86.8
86.2
80.9
74.9
71.5
65.4
74.4
71.8
67.1
88.9
81.3
88.1
-
81.0
-
Table 5. Model performance by F-score, comparing HBMP to InferSent (Conneau
et al. 2017) (our implementation).
Predicted - HBMP
contradict neutral
entail
3047
117
357
58
2840
240
recall
Predicted - InferSent
entail
263 90.5% 2967
280 87.7% 154
2622 81.5% 346
2756
302
contradict neutral
recall
306 88.1%
327 85.1%
2571 79.9%
95
85.6% 87.4% 80.2%
d entail
l
o
G
contradict
neutral
precision 86.5% 90.5% 82.8%
Table 6. SNLI confusion matrices for HBMP and InferSent.
On the SNLI dataset our model clearly outperforms InferSent on all labels
in terms of precision and recall. Table 6 contains the confusion matrices for that
dataset comparing HBMP to InferSent. The precision on contradiction exceeds 90%
for our model and reaches high recall values for both, entailment and contradiction.
The performance is lower for neutral and the confusion of that label with both,
contradiction and entailment is higher. However, HBMP still outperforms InferSent
by a similar margin as for the other two labels.
Unlike for the SNLI and both of the MultiNLI datasets, on the SciTail dataset
our model is most accurate on sentence pairs labeled neutral, having an F-score
88.9% compared to pairs marked with entailment, where the F-score was 81.0%.
InferSent has slightly higher accuracy on entailment, whereas HBMP outperforms
InferSent on neutral. Table 7 contains the confusion matrices for the SciTail dataset
comparing the HBMP to InferSent. This analysis reveals that our model mainly
suffers in recall on entailment detection whereas it performs well for neutral with
respect to recall. It is difficult to say what the reason might be for the mismatch
between the two systems but the overall performance of our architecture suggests
that it is superior to the InferSent model even though the balance between precision
and recall on individual labels is different.
The error analysis of the MultiNLI dataset is not standard as it cannot be
based on test data. As the labeled test data is not openly available for MultiNLI,
we analyzed the error statistics for this dataset based on the development data.
For the matched dataset (MultiNLI-m) our model had a development accuracy of
74.1%. For MultiNLI-m our model has the best accuracy on sentence pairs labeled
with entailment, having an F-score of 77.2%. The model is also almost as accurate
in predicting contradictions, with an F-score of 75.3%. Similar to SNLI, our model
is less effective on sentence pairs labeled with neutral, having an F-score of 68.2%
but, again, the HBMP model outperforms the InferSent on all the labels. Table 8
contains the confusion matrices for the MultiNLI matched dataset comparing the
12
Talman, Yli-Jyra and Tiedemann
HBMP
InferSent
entail neutral
recall
entail neutral
d entail
l
o
neutral
G
precision 88.0% 85.0%
632
88
210 75.0% 673
1196 93.1% 140
82.8% 87.1%
recall
169 79.9%
1144 89.1%
Table 7. SciTail confusion matrices for HBMP and InferSent based on the
development set.
d entail
l
o
G
contradict
entail
2781
372
528
196
2354
443
neutral
precision 75.6% 78.7% 68.3%
Predicted - HBMP
contradict neutral
recall
Predicted - InferSent
entail
486 80.3% 2614
514 72.7% 449
2158 69.0% 477
278
2241
507
contradict neutral
recall
587 75.1%
523 69.7%
2139 68.5%
73.8% 74.1% 65.8%
Table 8. MultiNLI-matched confusion matrices for HBMP and InferSent based on
the development set.
HBMP to InferSent. Our model improves upon InferSent in all values of precision
and recall, in some cases by a wide margin.
For the MultiNLI mismatched dataset (MultiNLI-mm) our model had a develop-
ment accuracy of 73.7%. or MultiNLI-mm our model has very similar performance
as with the MultiNLI-m dataset, having the best accuracy on sentence pars labeled
with entailment, having an F-score of 77.9%. The model is also almost as accurate
in predicting contradictions, with an F-score of 75.6%. Our model is less effective
on sentence pairs labeled with neutral, having an F-score of 68.6%. Table 9 contains
the confusion matrices for the MultiNLI Mismatched dataset comparing the HBMP
to InferSent and the picture is similar to the result of the matched dataset. Substan-
tial improvements can be seen again, in particular in the precision of contradiction
detection.
8 Evaluation of Linguistic Abstractions
The most interesting part of the sentence encoder approach to NLI is the ability of
the system to learn generic sentence embeddings that capture abstractions, which
can be useful for other downstream tasks as well. In order to understand the capa-
bilities of our model we first look at the type of linguistic reasoning that the NLI
system is able to learn using the MultiNLI annotation set and the Breaking NLI
test set. Thereafter, we evaluate downstream tasks using the SentEval library to
study the use of our NLI-based sentence embeddings in transfer learning.
8.1 Linguistic Error Analysis of NLI Classifications
The MultiNLI annotation set makes it possible to conduct a detailed analysis of
different linguistic phenomena when predicting inferential relationships. We use this
to compare our model to InferSent with respect to the type of linguistic properties
Sentence Embeddings in NLI with Iterative Refinement Encoders
13
d entail
l
o
G
contradict
entail
2841
438
613
163
2279
387
neutral
precision 73.0% 81.0% 68.4%
Predicted - HBMP
contradict neutral
recall
Predicted - InferSent
entail
459 82.0% 2731
523 70.3% 491
3111 68.0% 611
246
2226
510
contradict neutral
recall
486 78.9%
523 68.7%
2008 64.2%
71.2% 74.6% 66.6%
Table 9. MultiNLI-mismatched confusion matrices for HBMP and InferSent.
that are present in the given sentence pairs. Table 10 contains the comparison for
the MultiNLI-mm dataset. The analysis shows that our HBMP model outperforms
InferSent with antonyms, coreference links, modality, negation, paraphrases and
tense differences. It also produces improved scores for most of the other categories
in entailment detection. InferSent gains especially with conditionals in contradic-
tion and in the word overlap catehory for entailments. This seems to suggest that
InferSent relies a lot on matching words to find entailment and specific construc-
tions indicating contradictions. HBMP does not seem to use word overlap as an
indication for entailment that much and is better on detecting neutral sentences
in this category. This outcome may indicate that our model works with stronger
lexical abstractions than InferSent. However, due to the small number of examples
per annotation category and small differences in the scores in general, it is hard to
draw reliable conclusions from this experiment.
Entailment
Contradiction
Neutral
HBMP InferSent HBMP InferSent HBMP InferSent
-
100.0
active/passive (10)
anto (16)
88.2
belief (44)
81.8
conditional (16)
75.0
coref (22)
80.6
long sentence (77)
80.9
modal (98)
negation (78)
76.0
89.2
paraphrase (33)
75.0
quantifier (104)
quantity/time (15)
33.3
tense difference (14) 100.0
90.5
word overlap (26)
Total
80.6
100.0
-
82.4
81.8
75.0
77.4
78.7
64.0
86.5
72.5
50.0
75.0
95.2
83.0
100.0
76.9
66.7
37.5
71.4
58.3
68.6
81.8
-
73.1
41.7
0.0
41.7
66.3
100.0
69.2
61.1
62.5
64.3
61.1
68.6
76.4
-
73.1
41.7
0.0
41.7
68.5
-
85.7
73.9
57.1
81.8
73.8
81.8
58.3
75.0
33.3
83.3
50.0
73.8
-
71.4
78.3
71.4
81.8
71.4
70.5
45.8
-
77.1
33.3
75.0
0.0
72.7
Table 10. MultiNLI-mm linguistic error analysis (accuracy %), comparing our
HBMP results to the InferSent Conneau et al. (2017) results (our implementation).
Number of sentence pairs with the linguistic label in brackets after the label name.
14
Talman, Yli-Jyra and Tiedemann
8.2 Tests with the Breaking NLI dataset
In the second experiment we conducted testing of the proposed sentence embedding
architecture using the Breaking NLI test set recently published by Glockner et al.
(2018). The test set is designed to highlight the lack of lexical reasoning capability
of NLI systems.
For the Breaking NLI experiment, we trained our HBMP model and the InferSent
model using the SNLI training data. We compare our results with the results pub-
lished by Glockner et al. (2018) and to results obtained with InferSent sentence
encoder (our implementation).
The results show that our HBMP model outperforms the InferSent model in 7
out of 14 categories, receiving an overall score of 65.1% (InferSent: 65.6%). Our
model is especially strong with handling antonyms, which shows a good level of
semantic abstraction on the lexical level. InferSent fares well in narrow categories
like drinks, instruments and planets, which may indicate a problem of overfitting to
prominent examples in the training data. The strong result on the synonyms class
may also come from a significant representation of related examples in training.
However, more detailed investigations are necessary to verify this hypothesis.
Our model also compares well against the other models, outperforming Decom-
posable Attention model (51.90%) (Parikh, Tackstrom, Das, and Uszkoreit 2016)
and Residual Encoders (62.20%) (Nie and Bansal 2017) in the overall score. As
these models are not based purely on sentence embeddings, the obtained result
highlights that sentence embedding approaches can be competitive when handling
inferences requiring lexical information. The results of the comparison are summa-
rized in Table 11.
8.3 Transfer Learning
In this section, we focus on transfer learning experiments that apply sentence em-
beddings trained on NLI to other downstream tasks. In order to better understand
how well the sentence encoding model generalizes to different tasks, we conducted
various tests implemented in the SentEval sentence embedding evaluation library
(Conneau et al. 2017) and compared our results to the results published for In-
ferSent and SkipThought (Kiros et al. 2015).
We used the SentEval library with the default settings recommended on their
website, with a logistic regression classifier, Adam optimizer with learning rate of
0.001, batch size of 64 and epoch size of 4. Table 12 lists the transfer learning results
for our models with 600D and 1200D hidden dimensionality and compares it to the
InferSent and SkipThought scores reported by Conneau et al. (2017). Our 1200D
model outperforms the InferSent model on 7 out of 10 tasks. The model achieves
higher score on 8 out of 9 tasks reported for SkipThought, having equal score on
the SUBJ dataset. No MRPC results have been reported for SkipThought.
To study in more detail the linguistic properties of our proposed model, we also
ran the recently published SentEval probing tasks (Conneau et al. 2018). Our 1200D
Sentence Embeddings in NLI with Iterative Refinement Encoders
15
Category
antonyms
antonyms(wordnet)
cardinals
colors
countries
drinks
instruments
materials
nationalities
ordinals
planets
rooms
synonyms
vegetables
Total
Decomp.
WordNet
Infer- 600D
Attn* ESIM* Baseline* KIM* Sent HBMP
41.6
55.1
53.5
85.0
15.2
52.9
96.9
65.2
37.5
2.1
31.7
59.2
97.5
43.1
51.9
95.5
94.5
98.6
98.7
100.0
94.8
67.7
75.3
78.5
40.7
100.0
89.9
70.5
86.2
85.8
51.6
63.7
49.4
90.6
77.2
85.1
98.5
81.6
47.3
7.4
75.0
76.3
99.6
39.5
65.6
54.7
69.1
58.8
90.4
81.2
81.3
96.9
82.6
49.8
4.5
45.0
72.1
84.5
40.4
65.1
70.4
74.6
75.5
96.1
25.4
63.7
90.8
89.7
35.9
21.0
3.3
69.4
99.7
31.2
65.6
86.5
78.8
93.4
98.3
70.8
96.6
96.9
98.7
73.5
56.6
5.0
77.6
92.1
79.8
83.5
Table 11. Breaking NLI scores (accuracy %). Results marked with * as reported by
Glockner et al. (2018). InferSent results obtained with our implementation using
the training set-up described in (Conneau et al. 2017). Scores highlighted with bold
are top scores when comparing the InferSent and our HBMP model.
InferSent SkipThought 600D HBMP 1200D HBMP
81.1
86.3
92.4
90.2
84.6
88.2
Task
MR
CR
SUBJ
MPQA
SST
TREC
MRPC 76.2/83.1
SICK-R 0.884
SICK-E
86.3
STS14
.70/.67
79.4
83.1
93.7
89.3
82.9
88.4
-
0.858
79.5
.44/.45
81.5
86.4
92.7
89.8
83.6
86.4
81.7
87.0
93.7
90.3
84.0
88.8
74.6/82.0
76.7/83.4
0.876
85.3
.70/.66
0.876
84.7
.71/.68
Table 12. Transfer learning test results for the HBMP model on a number of Sent-
Eval downstream sentence embedding evaluation tasks. InferSent and SkipThought
results as reported by Conneau et al. (2017). To remain consistent with other work
using SentEval, we report the accuracies as they are provided by the SentEval
library.
model outperforms the InferSent model in 8 out of 10 probing tasks. The results
are listed in Table 13.
Looking at both the downstream and the probing tasks we can observe strong
results of our model compared to the InferSent model that already demonstrated
good general abstractions on the sentence level according to the original publication
by Conneau et al. (2017). Hence, HBMP does not only provide competitive NLI
16
Talman, Yli-Jyra and Tiedemann
Task
SentLen
WC
TreeDepth
TopConst
BShift
Tense
SubjNum
ObjNum
SOMO
CoordInv
InferSent 600D HBMP 1200D HBMP
71.7
87.3
41.6
70.5
65.1
86.7
80.7
80.3
62.1
66.8
75.9
84.1
42.9
76.6
64.3
86.2
83.7
79.3
58.9
68.5
75.0
85.3
43.8
77.2
65.6
88.0
87.0
81.8
59.0
70.8
Table 13. SentEval probing task results (accuracy %). InferSent results are
BiLSTM Max (NLI) results as reported by Conneau et al. (2018).
scores but also produces improved sentence embeddings that are useful for other
tasks.
9 Conclusion
In this paper we have introduced an iterative refinement architecture (HBMP)
based on BiLSTM layers with max pooling that achieves a new state of the art for
SciTail and strong results in the SNLI and MultiNLI sentence-encoding category.
We carefully analyzed the performance of our model with respect to the label cat-
egories and the errors it produces in the various NLI benchmarks. We demonstrate
that our model outperforms InferSent in nearly all cases with substantially reduced
confusion between classes of inferential relationships. The linguistic analysis on
MultiNLI also reveals that our approach is robust across the various categories and
outperforms InferSent on, for example, antonyms and negations that require a good
level of semantic abstraction.
Furthermore, we tested our model using the SentEval sentence embedding eval-
uation library, showing that it achieves great generalization capability. The model
outperforms InferSent on 7 out of 10 downstream and 8 out of 10 probing tasks,
and SkipThought on 8 out of 9 downstream tasks. Overall, our model performs well
across all the conducted experiments, which highlights its applicability for various
NLP tasks and further demonstrates the general abstractions that it is able to pick
up from the NLI training data.
Although the neural network approaches to NLI have been hugely successful,
there has also been a number of concerns raised about the quality of current NLI
datasets. Gururangan, Swayamdipta, Levy, Schwartz, Bowman, and Smith (2018)
and Poliak, Naradowsky, Haldar, Rudinger, and Van Durme (2018) show that
datasets like SNLI and MultiNLI contain annotation artifacts which help neural
network models in classification, allowing decisions only based on the hypothesis
sentences as their input. On a theoretical and methodological level, there is an on-
going discussion on the nature of various NLI datasets, as well as the definition
of what counts as NLI and what does not. For example, Chatzikyriakidis, Cooper,
Sentence Embeddings in NLI with Iterative Refinement Encoders
17
Dobnik, and Larsson (2017) present an overview of the most standard datasets for
NLI and show that the definitions of inference in each of them are actually quite
different. Talman and Chatzikyriakidis (2019) further highlight this by testing dif-
ferent state-of-the-art neural network models by training them on one dataset and
then testing on another, leading to a significant drop in performance for all models.
In addition to the concerns related to the quality of NLI datasets, the success
of the proposed architecture raises a number of other interesting questions. First
of all, it would be important to understand what kind of semantic information the
different layers are able to capture and how they differ from each other. Secondly,
we would like to ask whether other architecture configurations could lead to even
stronger results in NLI and other downstream tasks. A third question is concerned
with other languages and cross-lingual settings. Does the result carry over to multi-
lingual setups and applications? The final question is whether NLI-based sentence
embeddings could successfully be combined with other supervised and also unsu-
pervised ways of learning sentence-level representations. We will look at all those
questions in our future work.
Acknowledgments
The work in this paper was supported by the Academy of Finland through project
314062 from the ICT 2023 call on Computation, Machine Learning and Artificial
Intelligence, and through projects 270354/273457/313478.
This project has also received funding from the Eu-
ropean Research Council (ERC) under the European
Union's Horizon 2020 research and innovation pro-
gramme (grant agreement No 771113).
We would also like to acknowledge NVIDIA and their
GPU grant.
References
Balazs, J., E. Marrese-Taylor, P. Loyola, and Y. Matsuo 2017. Refining raw sentence repre-
sentations for textual entailment recognition via attention. In Workshop on Evaluating
Vector Space Representations for NLP. ACL.
Bowman, S. R., G. Angeli, C. Potts, and C. D. Manning 2015. A large annotated corpus
for learning natural language inference. In EMNLP.
Bowman, S. R., J. Gauthier, A. Rastogi, R. Gupta, C. D. Manning, and C. Potts 2016. A
fast unified model for parsing and sentence understanding. In ACL.
Chatzikyriakidis, S., R. Cooper, S. Dobnik, and S. Larsson 2017. An overview of natural
language inference data collection: The way forward? In Computing Natural Language
Inference Workshop.
Chen, Q., Z.-H. Ling, and X. Zhu 2018. Enhancing Sentence Embedding with Generalized
Pooling. In COLING.
Chen, Q., X. Zhu, Z.-H. Ling, S. Wei, H. Jiang, and D. Inkpen 2017a. Enhanced lstm for
natural language inference. In ACL.
Chen, Q., X. Zhu, Z.-H. Ling, S. Wei, H. Jiang, and D. Inkpen 2017b. Recurrent neural
network-based sentence encoder with gated attention for natural language inference. In
Workshop on Evaluating Vector Space Representations for NLP. ACL.
18
Talman, Yli-Jyra and Tiedemann
Conneau, A. and D. Kiela 2018, May 7 -- 12. SentEval: An evaluation toolkit for universal
sentence representations.
In N. Calzolari (Ed.), LREC 2018, Eleventh International
Conference on Language Resources and Evaluation, Phoenix Seagaia Conference Center,
Miyazaki, Japan, pp. 1699 -- 1704.
Conneau, A., D. Kiela, H. Schwenk, L. Barrault, and A. Bordes 2017. Supervised learning
of universal sentence representations from natural language inference data. In EMNLP.
Conneau, A., G. Kruszewski, G. Lample, L. Barrault, and M. Baroni 2018. What you
can cram into a single vector: Probing sentence embeddings for linguistic properties. In
ACL.
Glockner, M., V. Shwartz, and Y. Goldberg 2018. Breaking nli systems with sentences
that require simple lexical inferences. In ACL.
Gururangan, S., S. Swayamdipta, O. Levy, R. Schwartz, S. Bowman, and N. A. Smith
2018. Annotation artifacts in natural language inference data. In NAACL. ACL.
Hill, F., K. Cho, and A. Korhonen 2016. Learning distributed representations of sentences
from unlabelled data. In NAACL.
Khot, T., A. Sabharwal, and P. Clark 2018. Scitail: A textual entailment dataset from
science question answering. In AAAI.
Kingma, D. P. and J. Ba 2015. Adam: A method for stochastic optimization. In ICLR.
Kiros, R., Y. Zhu, R. Salakhutdinov, R. S. Zemel, R. Urtasun, A. Torralba, and S. Fidler
2015. Skip-thought vectors. In NeurIPS.
Maas, A. L., A. Y. Hannun, and A. Y. Ng 2013. Rectifier nonlinearities improve neural
network acoustic models. In Intl. Conf. on Machine Learning.
Mikolov, T., I. Sutskever, K. Chen, G. Corrado, and J. Dean 2013. Distributed represen-
tations of words and phrases and their compositionality. In NeurIPS, USA.
Mou, L., R. Men, G. Li, Y. Xu, L. Zhang, R. Yan, and Z. Jin 2016. Natural language
inference by tree-based convolution and heuristic matching. In ACL.
Nie, Y. and M. Bansal 2017. Shortcut-stacked sentence encoders for multi-domain infer-
ence. In Workshop on Evaluating Vector Space Representations for NLP. ACL.
Parikh, A. P., O. Tackstrom, D. Das, and J. Uszkoreit 2016. A decomposable attention
model for natural language inference. In EMNLP.
Pennington, J., R. Socher, and C. D. Manning 2014. Glove: Global vectors for word
representation. In EMNLP.
Poliak, A., J. Naradowsky, A. Haldar, R. Rudinger, and B. Van Durme 2018. Hypoth-
esis only baselines in natural language inference. In Joint Conference on Lexical and
Computational Semantics. ACL.
Talman, A. and S. Chatzikyriakidis 2019. Testing the generalization power of neural
In Proceedings of the 2019 ACL Workshop
network models across nli benchmarks.
BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP.
Tay, Y., L. A. Tuan, and S. C. Hui 2018. Compare, compress and propagate: Enhancing
In
neural architectures with alignment factorization for natural language inference.
EMNLP.
Vendrov, I., R. Kiros, S. Fidler, and R. Urtasun 2016. Order-embeddings of images and
language.
Vu, H. 2017. Lct-malta's submission to repeval 2017 shared task. In Workshop on Evalu-
ating Vector Space Representations for NLP. ACL.
Williams, A., N. Nangia, and S. R. Bowman 2018. A broad-coverage challenge corpus for
sentence understanding through inference. In NAACL.
Yoon, D., D. Lee, and S. Lee 2018. Dynamic Self-Attention : Computing Attention over
Words Dynamically for Sentence Embedding. arXiv:1808.07383 .
Young, P., A. Lai, M. Hodosh, and J. Hockenmaier 2014. From image descriptions to
visual denotations: New similarity metrics for semantic inference over event descriptions.
TACL 2.
|
1907.03233 | 1 | 1907 | 2019-07-07T07:03:09 | NIESR: Nuisance Invariant End-to-end Speech Recognition | [
"cs.CL",
"cs.SD",
"eess.AS"
] | Deep neural network models for speech recognition have achieved great success recently, but they can learn incorrect associations between the target and nuisance factors of speech (e.g., speaker identities, background noise, etc.), which can lead to overfitting. While several methods have been proposed to tackle this problem, existing methods incorporate additional information about nuisance factors during training to develop invariant models. However, enumeration of all possible nuisance factors in speech data and the collection of their annotations is difficult and expensive. We present a robust training scheme for end-to-end speech recognition that adopts an unsupervised adversarial invariance induction framework to separate out essential factors for speech-recognition from nuisances without using any supplementary labels besides the transcriptions. Experiments show that the speech recognition model trained with the proposed training scheme achieves relative improvements of 5.48% on WSJ0, 6.16% on CHiME3, and 6.61% on TIMIT dataset over the base model. Additionally, the proposed method achieves a relative improvement of 14.44% on the combined WSJ0+CHiME3 dataset. | cs.CL | cs | NIESR: Nuisance Invariant End-to-end Speech Recognition
I-Hung Hsu, Ayush Jaiswal, Premkumar Natarajan
USC Information Sciences Institute, Marina del Rey, CA, USA
{ihunghsu, ajaiswal, pnataraj}@isi.edu
9
1
0
2
l
u
J
7
]
L
C
.
s
c
[
1
v
3
3
2
3
0
.
7
0
9
1
:
v
i
X
r
a
Abstract
Deep neural network models for speech recognition have
achieved great success recently, but they can learn incorrect
associations between the target and nuisance factors of speech
(e.g., speaker identities, background noise, etc.), which can lead
to overfitting. While several methods have been proposed to
tackle this problem, existing methods incorporate additional in-
formation about nuisance factors during training to develop in-
variant models. However, enumeration of all possible nuisance
factors in speech data and the collection of their annotations is
difficult and expensive. We present a robust training scheme
for end-to-end speech recognition that adopts an unsupervised
adversarial invariance induction framework to separate out es-
sential factors for speech-recognition from nuisances without
using any supplementary labels besides the transcriptions. Ex-
periments show that the speech recognition model trained with
the proposed training scheme achieves relative improvements
of 5.48% on WSJ0, 6.16% on CHiME3, and 6.61% on TIMIT
dataset over the base model. Additionally, the proposed method
achieves a relative improvement of 14.44% on the combined
WSJ0+CHiME3 dataset.
Index Terms: invariant representation learning, speech recog-
nition, adversarial learning
1. Introduction
With the aid of recent advances in neural networks, end-to-end
deep learning systems for automatic speech recognition (ASR)
have gained popularity and achieved extraordinary performance
on a variety of benchmarks [1, 2, 3, 4]. End-to-end ASR
models typically consist of Recurrent Neural Networks (RNNs)
with Sequence-to-Sequence (Seq2Seq) architectures and atten-
tion mechanisms [5], RNN transducers [6], or transformer net-
works [3]. These systems learn a direct mapping from an au-
dio signal sequence to a sequence of text transcriptions. How-
ever, the input audio sequence often contains nuisance factors
that are irrelevant to the recognition task and the trained model
can incorrectly learn to associate some of these factors with
target variables, which leads to overfitting. For example, be-
sides linguistic content, speech data contains nuisance informa-
tion about speaker identities, background noise, etc., which can
hurt the recognition performance if the distributions of these at-
tributes are mismatched between training and testing.
A common method for combatting the vulnerability of deep
neural networks to nuisance factors is the incorporation of in-
variance induction during model training. For example, invari-
ant deep models have achieved considerable success in com-
puter vision [7, 8, 9] and speech recognition [10, 11, 12, 13].
Serdyuk et al. [10] obtain noise-invariant representations by em-
ploying noise-condition annotations and the gradient reversal
layer [14] for acoustic modeling. Similarly, Meng et al. [11]
utilize speaker information to train a speaker-invariant model
for senone prediction. Hsu et al. [12] extract domain-invariant
features using a factorized hierarchical variational autoencoder.
Liang et al. [13] force their end-to-end ASR model to learn sim-
ilar representations for clean input instances and their syntheti-
cally generated noisy counterparts.
While these methods work well at handling discrepancies
between training and testing datasets for ASR systems, they re-
quire domain knowledge [12], supplementary nuisance infor-
mation during training (e.g., speaker identities [11], recording
environments [10], etc.), or pairwise data [13]. However, these
requirements are difficult and expensive to fulfill in real world,
e.g., it is hard to enumerate all possible nuisance factors and
collect corresponding annotations.
In this work, we propose a new training scheme, namely
NIESR, which adopts the unsupervised adversarial invariance
learning framework (UAI) [7] for end-to-end speech recog-
nition. Without incorporating supervised information of nui-
sances for the input signal features, the proposed method is ca-
pable of separating the underlying elements of speech data into
two series of latent embeddings -- one containing all the infor-
mation that is essential for ASR, and the other containing in-
formation that is irrelevant to the recognition task (e.g. accents,
background noises, etc.). Experimental results show that the
proposed training method boosts the end-to-end ASR perfor-
mance on WSJ0, CHiME3, and TIMIT datasets. We also show
the effectiveness of combining NIESR with data augmentation.
2. Methodology
In this section, we present the proposed NIESR model for
nuisance-invariant end-to-end speech recognition, where the in-
variance is achieved by adopting the UAI framework [7]. We
begin by describing the base Seq2Seq ASR model. Subse-
quently, we introduce the UAI framework for unsupervised ad-
versarial invariance induction. Finally, we present the complete
design of the proposed NIESR model.
2.1. Base Sequence-to-sequence Model
We are interested in learning a mapping from a sequence of
acoustic spectra features x = (x1, x2, . . . , xT ) to a series
of textual characters y = (y1, y2, . . . , yS), given a dataset
D ≡ {(x, y)i}N
i=1, following the formulation of Chan et al. [5].
We employ a Seq2Seq model for this task, which estimates the
probability of each character output yi by conditioning over the
previous characters y1:(i−1) and the input sequence x. Thus,
the conditional probability of the entire output y is:
(cid:89)
p(yx) =
p(yix, y1:(i−1))
(1)
i
A Seq2Seq model is composed of two modules: an encoder
Enc and a decoder Dec. Enc transforms the input features
x into a high-level representation h = (h1, h2, . . . , hT ), i.e.
h = Enc(x) and Dec infers the output sequence y from h. We
model Enc as a stack of Bidirectional Long-Short Term Mem-
ory (BLSTM) layers with interspersed projected-subsampling
layers [15]. The subsampling layer projects a pair of consec-
utive input frames (u2i−1, u2i) to a single lower-dimensional
frame vi. We model Dec as an attention-based LSTM trans-
ducer [16], which employs h to produce the output character
sequence. At every time step, Dec generates a probability dis-
tribution of yi over character sequences, which is a function of
a transducer state si and an attention context ci. We denote this
function as CharDist, which is implemented as a single layer
perceptron with softmax activation:
si = LSTM([yi−1, ci−1], si−1)
p(yix, y1:(i−1)) = CharDist(si, ci)
(2)
(3)
In order to calculate the attention context ci, we employ the
hybrid location-aware content-based attention mechanism pro-
posed by [17]. Specifically, the attention energy ei,j for frame
j at time-step i takes previous attention alignment αi−1 into
account through the convolution operation:
(cid:124)
ei,j = w
tanh(W si + V hj + U (F ∗ αi−1) + b)
(4)
where w, b, W , V , U, and F are learned parameters and ∗
depicts the convolution operation. The attention alignment αi,j
and the attention context ci is then calculated as:
ci =(cid:80)L
,
j=1 αi,jhj
(5)
αi,j =
exp(ei,j)
k=1 exp(ei,k)
(cid:80)L
Ly = −(cid:88)
The base model is trained by minimizing the cross-entropy loss:
log p(yix, y1:(i−1))
(6)
i
2.2. Unsupervised Adversarial Invariance Induction
Deep neural networks (DNNs) often learn incorrect associations
between nuisance factors in the raw data and the final target,
leading to poor generalization [7]. In the case of ASR, the net-
work can link accents, speaker-specific information, or back-
ground noise with the transcriptions, resulting in overfitting. In
order to cope with this issue, we adopt the unsupervised ad-
versarial invariance (UAI) [7] framework for learning invariant
representations that eliminate factors irrelevant to the recogni-
tion task without requiring any knowledge of nuisance factors.
The working principle of UAI is to learn a split representa-
tion of data as h1 and h2, where h1 contains information rel-
evant to the prediction task (here ASR) and h2 holds all other
information about the input data. The underlying mechanism
for learning such a split representation is to induce competition
between the main prediction task and an auxiliary task of data
reconstruction. In order to achieve this, the framework uses h1
for the prediction task and a noisy version(cid:101)h1 of h1 along with
h2 for reconstruction. In addition, a disentanglement constraint
enforces that h1 and h2 contain independent information. The
prediction task tries to pull relevant factors into h1, while the
reconstruction task drives h2 to store all the information about
input data because (cid:101)h1 is unreliable. However, the disentan-
glement constraint forces the two embeddings to not contain
overlapping information, thus leading to competition. At con-
vergence, this results in a nuisance-free h1 that contains only
those factors that are essential for the prediction task.
Figure 1: NIESR: The two encoders Enc1 and Enc2 are
BLSTM-based feature extractors that encode the input sequence
x into representations h1 and h2. The two encodings are disen-
tangled by adversarially training the two disentanglers, Dis1
and Dis2, which aim to predict one embedding from another.
Dec is an attention-based decoder that generates the target y
characters from h1. Recon is a BLSTM-based reconstructor
that decodes h2 and the noisy(cid:101)h1 back to the input-sequence x
2.3. NIESR Model Design and Optimization
The NIESR model comprises five types of modules: (1) en-
coders Enc1 and Enc2 that map input data to the encodings
h1 and h2, respectively, (2) a decoder Dec that infers target
y from h1, (3) a dropout layer that converts h1 into its noisy
version (cid:101)h1, (4) a reconstructor Recon that reconstructs input
data from [(cid:101)h1, h2], and (5) two adversarial disentanglers Dis1
and Dis2 that try to infer each embedding (h1 or h2) from the
other. Figure 1 shows the complete NIESR model.
The encoder Enc1 and decoder Dec follow the base model
design as described in Section 2.1,
i.e., an attention-based
Seq2Seq model for the speech recognition task. Enc2 is de-
signed to have exactly the same structure as Enc1. The dropout
layer is introduced to make (cid:101)h1 an unreliable source of infor-
mation for reconstruction, which influences the reconstruction
task to extract all information about x into h2 [7]. Recon is
modeled as a stack of BLSTM layers interspersed with novel
upsampling layers, which perform decompression by splitting
information in each time-frame to two frames. This is the in-
verse of the subsampling layers [15] used in Enc1 and Enc2.
The upsampling operation is formulated as:
[u2i−1, u2i] = BLSTM([(cid:102)h1
,
(7)
(8)
where [·,·] represents concatenation, o is the output, and P is a
learned projection matrix.
o2i−1 = P u2i−1
o2i = P u2i
i ], si−1)
i , h2
The adversarial disentanglers Dis1 and Dis2 model the
UAI disentanglement constraint discussed in Section 2.2 fol-
lowing previous works [7, 8, 9]. Dis1 tries to predict h2 from
……ℎ12ℎ22ℎ𝐿2𝑬𝒏𝒄𝟐𝑥1𝑥2𝑥3𝑥4……𝑥T……ℎ11ℎ21ℎ𝐿1𝑬𝒏𝒄𝟏𝑥1𝑥2𝑥3𝑥4……𝑥T𝒉1=(ℎ11,ℎ21,…,ℎ𝐿1)𝒉2=(ℎ12,ℎ22,…,ℎ𝐿2)𝑿𝒀𝑹𝒆𝒄𝒐𝒏𝑿′𝐷𝑟𝑜𝑝𝑜𝑢𝑡෪𝒉1=(෪ℎ11,෪ℎ21,…,෪ℎ𝐿1)…𝑥1′[෪ℎ11;ℎ12]𝑥2′𝑥3′𝑥4′𝑥T−1′𝑥T′…[෪ℎ21;ℎ22][෪ℎ𝐿1;ℎ𝐿2]…ℎ12′ℎ11ℎ21ℎ31ℎ𝐿1ℎ22′ℎ32′ℎ𝐿2′𝑫𝒊𝒔𝟏𝒉𝟐′…ℎ11′ℎ12ℎ22ℎ32ℎ𝐿2ℎ21′ℎ31′ℎ𝐿1′𝑫𝒊𝒔𝟐𝒉𝟏′…𝑦1𝑫𝒆𝒄𝐵𝑂𝑆𝑠1𝑐1𝑦2𝑦1𝑠2𝑐2𝑦𝑆𝑐𝑆𝑠𝑆𝐸𝑂𝑆……1, h2
2, . . . , h2
h1 and Dis2 tries to do the inverse. This is directly opposite
to the desired independence between h1 and h2. Thus, training
Dis1 and Dis2 adversarially against the rest of the model helps
achieve the independence goal. Unlike previous works [7, 8, 9],
the encodings h1 and h2 for this work are vector-sequences
instead of single vectors: h1 = (h1
L) and h2 =
L). Naıve instantiations of the disentanglers
(h2
would perform frame-specific predictions of h2
i and
vice versa. However, each pair of h1
i generated at the
time-step i contains information not only from frame i but also
from other frames across the time-span. This is because Enc1
and Enc2 are modeled as RNNs. Therefore, a better method
to perform disentanglement for sequential representations is to
use the whole series of h1 or h2 to estimate every element of
the other. Hence, we model Dis1 and Dis2 as BLSTMs.
i from h1
2, . . . , h1
1, h1
i and h2
The proposed NIESR model is optimized by adopting the
UAI training strategy [7, 9], i.e., playing a game where we treat
Enc1, Enc2, Dec, and Recon as one player P1, and Dis1
and Dis2 as the other player P2. The model is trained using
a scheduled update scheme where we freeze the weights of one
player model when we update the weights of the other. The
training objective comprises three tasks: (1) predicting tran-
scriptions from the input signal, (2) reconstruction of the input,
and (3) adversarial prediction of each of h1 and h2 from the
other. The objective of the first task is written as Equation 6.
The goal for the reconstruction task is to minimize the mean
squared error (MSE) between x and the reconstructed x(cid:48):
Lx = MSE(Recon([ψ(Enc1(x)), Enc2(x)]), x)
(9)
where ψ means dropout. The training objective for the disen-
tanglers is to minimize the MSE between embeddings predicted
by the disentenglers and the embeddings generated from the en-
coder. However, that of the encoders is to generate h1 and h2
that are not predictive of each other. Hence, in the scheduled
update scheme, the targets t1 and t2 for the disentanglers are
different when updating the player models P1 versus P2, fol-
lowing [9]. The loss can be written as:
Ld = MSE(Dis1(Enc1(x)), t1)
+ MSE(Dis2(Enc2(x)), t2))
(10)
(11)
where t1 and t2 are set as h2 and h1, respectively, when updat-
ing P2 but are set to random vectors when updating P1.
Overall, the model is trained through backpropagation by
optimizing the objective described in Equation 12, where the
loss-weights α, β, and γ are hyperparameters, which are de-
cided by the performance on the development set.
L = αLy + βLx + γLd
(12)
Inference with NIESR involves a forward pass of data through
Enc1 followed by Dec. Hence, the usage and computational
cost of NIESR for inference is the same as the base model.
3. Experiments
The effectiveness of NIESR is quantified through the perfor-
mance improvement achieved by adopting the invariant learning
framework. We provide experimental results on speech recog-
nition on three benchmark datasets: the Wall Street Journal Cor-
pus (WSJ0) [18], CHiME3 [19], and TIMIT [20]. We addition-
ally provide results on the combined WSJ0+CHiME3 dataset.
Table 1: Hyperparameters for the base model.
Setting
Item
200
Enc and Dec LSTM Dimension
200
Subsampling Projected Dimension
Attention Dimension
200
10
Attention Convolution Channel
100
Attention Convolution Kernel Size
Adam
Optimizer
Learning Rate
5e-4
3.1. Datasets
WSJ0: This dataset is a collection of readings of the Wall Street
Journal.
It contains 7,138 utterances in the training set, 410
in the development set, and 330 in the test set. We use 40-
dimensional log Mel filterbank features as the model input, and
normalize the transcriptions to capitalized character sequences.
CHiME3: CHiME3 dataset contains: (1) WSJ0 sentences spo-
ken in challenging noisy environments (real data) and (2) WSJ0
readings mixed with four different background noise (simulated
data). The real speech data was recorded in five noisy envi-
ronments using a six-channel tablet-based microphone array.
Training data consists of 1,999 real noisy utterances from four
speakers, and 7,138 simulated noisy utterances from 83 speak-
ers in the WSJ0 training set. In total, there are 3,280 utterances
in the development set, and 2,640 utterances in the test set con-
taining both real and simulated data. The speakers in training,
development, and test set are mutually different. In our experi-
ments, we follow [11] to use far-field speech from the fifth mi-
crophone channel for all sets. We adopt the same input-output
setting for CHiME3 as WSJ0.
TIMIT: This corpus contains a total of 6,300 sentences, with
10 sentences spoken by 630 speakers each with 8 different di-
alects. Among them, utterances from 168 different speakers
are held-out as the test set. We further select sentences from 4
speakers of each dialect group, i.e., 32 speakers in total, from
the remaining data to form the development set. Thus, all speak-
ers in training, development, and test sets are different. Models
were trained on 80 log Mel filterbank features and capitalized
character sequences were treated as targets.
3.2. Experiment Setup
We train the base model without using invariance induction, i.e.,
the model consisting of Enc and Dec (Section 2.1), as a base-
line. We feed the whole sequence of spectra features to Enc
and get the predicted character sequence from Dec. We use a
stack of two BLSTMs with a subsampling layer (as described in
Section 2.1) in between for Enc. Dec is implemented as a sin-
gle layer LSTM combined with attention modules introduced
in Section 2.1. All the models were trained with early stopping
with 30 epochs of patience and the best model is selected based
on the performance on the development set. Other model and
training hyperparameters are listed in Table 1.
We augment the base model with Enc2, Recon, Dis1,
and Dis2, while treating Enc as Enc1, to form the NIESR
model. Enc2 has the same hyperparameter setting and structure
as Enc1. Recon is modeled as a cascade of a BLSTM layer, an
upsampling layer, and another BLSTM layer. Dis1 and Dis2
are implemented as BLSTMs followed by two fully-connected
layers. We update the player models P1 and P2 in the fre-
quency ratio of 1 : 5 in our experiments. Hyperparameters for
Enc1 and Dec are the same as the base model. Additional hy-
perparameters for NIESR are summarized in Table 2.
Table 2: Hyperparameters for the NIESR model.
Item
Recon LSTM Dimension
Upsampling Projected Dimension
Dis1, Dis2 Dimension
Dropout layer rate
Optimizer
Learning Rate for P1
Learning Rate for P2
α, β, γ for WSJ0
α, β, γ for CHiME3
α, β, γ for TIMIT
Setting
300
200
200
0.4
Adam
5e-4
1e-3
100, 10, 1
100, 1, 0.5
100, 50, 1
Table 3: Speech recognition performance as CER (%). Values
in parentheses show relative improvement (%) over Base model.
Model
Base
Spk-Inv
Env-Inv
Dial-Inv
NIESR
WSJ0
12.95
12.31 (4.94)
--
--
12.24 (5.48)
CHiME3
44.61
43.93 (1.52)
42.61 (4.48)
--
41.86 (6.16)
TIMIT
28.76
28.45 (1.08)
--
28.29 (1.63)
26.86 (6.61)
We further provide results of a stronger baseline model that
utilizes labeled nuisances z (speakers for WSJ0, speakers and
noise environment condition for CHiME3, speakers and dialect
groups for TIMIT) with the gradient reversal layer (GRL) [14]
to learn invariant representations. Specifically, the model con-
sists of Enc, Dec, and a classifier with a GRL between the
embedding learned from Enc and the classifier, following the
standard setup in [14]. The target for the classifier is to pre-
dict z from the embedding while the direction of the training
gradient to Enc is flipped. We denote this model as Spk-Inv
for speaker-invariance, Env-Inv for environment-invariance in
CHiME3, and Dial-Inv for dialect-invariance in TIMIT.
3.3. ASR Performance on Benchmark Datasets
Table 3 summarizes the results at end-to-end ASR on WSJ0,
CHiME3, and TIMIT datasets. Results show that NIESR
achieves 5.48%, 6.16%, and 6.61% relative improvements over
base model on WSJ0, CHiME3, and TIMIT, respectively, and
demonstrates the best CER among all methods.
3.4. Invariance to Nuisance Factors
In order to examine whether a latent embedding is invariant to
nuisance factors z, we calculate the accuracy of predicting the
factor z from the encoding. Specifically, this is calculated by
training classification networks (BLSTM followed by two fully-
connected layers) to predict z from the generated embeddings.
Table 4 presents results of this experiment, showing that the h1
embedding of the NIESR model, which is used for ASR, con-
tains less nuisance information than the h encoding of the base,
Spk-Inv, and Env-Inv models. In contrast, the h2 embedding of
NIESR contains most of the nuisance information, showing that
nuisance factors migrate to this embedding, as expected.
3.5. Additional Robustness through Data Augmentation
Training with additional data that reflects multiple variations
of nuisance factors helps models generalize better. In this ex-
periment, we treat the CHiME3 dataset, which contains WSJ0
Table 4: Results of predicting nuisance factor z from learned
representations as accuracy. Env stands for environment.
Dataset
WSJ0
CHiME3
Predict z from
h in Base Model
h in Spk-Inv
h1 in NIESR
h2 in NIESR
h in Base Model
h in Spk-Inv
h in Env-Inv
h1 in NIESR
h2 in NIESR
Accuracy
z : Speaker
z : Env
67.91
65.60
63.35
97.92
38.52
37.91
38.84
35.87
92.28
--
--
--
--
69.24
69.11
66.44
63.45
97.05
Table 5: Test results of models trained on the WSJ0+CHiME3
augmented dataset as CER (%). Values in parentheses show the
relative improvement (%) over Base model.
Model
Base
Spk-Inv
Env-Inv
NIESR
WSJ0
9.35
8.62 (7.81)
9.17 (1.93)
8.00 (14.44)
CHiME3
41.55
40.77 (1.88)
40.27 (3.08)
38.35 (7.7)
recordings with four different types of noise, as a noisy aug-
mentation for WSJ0. We train the base model and NIESR on the
augmented dataset, i.e. WSJ0+CHiME3, and test on the origi-
nal CHiME3 and WSJ0 test sets separately. Table 5 summarizes
the results on this experiment, showing that training with data
augmentation provides improvements on both CHiME3 and
WSJ0 datasets compared to the results in Table 3. It is important
to note that the NIESR model trained on the augmented dataset
achieves 14.44% relative improvement on WSJ0 as compared
to the base model trained on the same. This is because data
augmentation provides additional information about potential
nuisance factors to the NIESR model and, consequently, helps it
ignore these factors for the ASR task, even though pairwise data
is not provided to the model like [13]. Hence, results show that
the NIESR model can be easily combined with data augmenta-
tion to further enhance the robustness and nuisance-invariance
of the learned features.
4. Conclusion
We presented NIESR, an end-to-end speech recognition model
that adopts the unsupervised adversarial invariance framework
for invariance to nuisances without requiring any knowledge of
potential nuisance factors. The model works by learning a split
representation of data through competition between the recog-
nition and an auxiliary data reconstruction task. Results of
experimental evaluation demonstrate that the proposed model
achieves significant boosts in performance on ASR.
5. Acknowledgements
This material is based on research sponsored by DARPA un-
der agreement number FA8750-18-2-0014. The U.S. Gov-
ernment is authorized to reproduce and distribute reprints for
Governmental purposes notwithstanding any copyright notation
thereon. The views and conclusions contained herein are those
of the authors and should not be interpreted as necessarily rep-
resenting the official policies or endorsements, either expressed
or implied, of DARPA or the U.S. Government.
[20] J. S. Garofolo, L. F. Lamel, W. M. Fisher, J. G. Fiscus, D. S.
Pallett, and N. L. Dahlgren, "Darpa timit acoustic phonetic con-
tinuous speech corpus cdrom," 1993.
6. References
[1] R. Prabhavalkar, K. Rao, T. N. Sainath, B. Li, L. Johnson, and
N. Jaitly, "A comparison of sequence-to-sequence models for
speech recognition." 2017.
[2] C.-C. Chiu, T. N. Sainath, Y. Wu, R. Prabhavalkar, P. Nguyen,
Z. Chen, A. Kannan, R. J. Weiss, K. Rao, E. Gonina et al., "State-
of-the-art speech recognition with sequence-to-sequence models,"
in 2018 IEEE International Conference on Acoustics, Speech and
Signal Processing (ICASSP).
IEEE, 2018, pp. 4774 -- 4778.
[3] S. Zhou, L. Dong, S. Xu, and B. Xu, "Syllable-based sequence-
to-sequence speech recognition with the transformer in mandarin
chinese," arXiv preprint arXiv:1804.10752, 2018.
[4] N. Jaitly, Q. V. Le, O. Vinyals, I. Sutskever, D. Sussillo, and
S. Bengio, "An online sequence-to-sequence model using partial
conditioning," in Advances in Neural Information Processing Sys-
tems, 2016, pp. 5067 -- 5075.
[5] W. Chan, N. Jaitly, Q. V. Le, and O. Vinyals, "Listen, attend and
spell," arXiv preprint arXiv:1508.01211, 2015.
[6] K. Rao, H. Sak, and R. Prabhavalkar, "Exploring architectures,
data and units for streaming end-to-end speech recognition with
rnn-transducer," in 2017 IEEE Automatic Speech Recognition and
Understanding Workshop (ASRU).
IEEE, 2017, pp. 193 -- 199.
[7] A. Jaiswal, R. Y. Wu, W. Abd-Almageed, and P. Natarajan, "Un-
supervised Adversarial Invariance," in Advances in Neural Infor-
mation Processing Systems, 2018, pp. 5097 -- 5107.
[8] A. Jaiswal, S. Xia, I. Masi, and W. AbdAlmageed, "RoPAD: Ro-
bust Presentation Attack Detection through Unsupervised Adver-
sarial Invariance," in 12th IAPR International Conference on Bio-
metrics (ICB), 2019.
[9] A. Jaiswal, Y. Wu, W. AbdAlmageed, and P. Natarajan, "Unified
adversarial invariance," 2019.
[10] D. Serdyuk, K. Audhkhasi, P. Brakel, B. Ramabhadran,
S. Thomas, and Y. Bengio, "Invariant representations for noisy
speech recognition," arXiv preprint arXiv:1612.01928, 2016.
[11] Z. Meng, J. Li, Z. Chen, Y. Zhao, V. Mazalov, Y. Gang, and B.-
H. Juang, "Speaker-invariant training via adversarial learning," in
2018 IEEE International Conference on Acoustics, Speech and
Signal Processing (ICASSP).
IEEE, 2018, pp. 5969 -- 5973.
[12] W.-N. Hsu and J. Glass, "Extracting domain invariant features by
unsupervised learning for robust automatic speech recognition,"
in 2018 IEEE International Conference on Acoustics, Speech and
Signal Processing (ICASSP).
IEEE, 2018, pp. 5614 -- 5618.
[13] D. Liang, Z. Huang, and Z. C. Lipton, "Learning noise-invariant
representations for robust speech recognition," arXiv preprint
arXiv:1807.06610, 2018.
[14] Y. Ganin and V. Lempitsky, "Unsupervised domain adaptation by
backpropagation," arXiv preprint arXiv:1409.7495, 2014.
[15] Y. Zhang, W. Chan, and N. Jaitly, "Very deep convolutional net-
works for end-to-end speech recognition," in 2017 IEEE Inter-
national Conference on Acoustics, Speech and Signal Processing
(ICASSP).
IEEE, 2017, pp. 4845 -- 4849.
[16] D. Bahdanau, K. Cho, and Y. Bengio, "Neural machine trans-
lation by jointly learning to align and translate," arXiv preprint
arXiv:1409.0473, 2014.
[17] J. K. Chorowski, D. Bahdanau, D. Serdyuk, K. Cho, and Y. Ben-
gio, "Attention-based models for speech recognition," in Ad-
vances in neural information processing systems, 2015, pp. 577 --
585.
[18] D. B. Paul and J. M. Baker, "The design for the wall street journal-
based csr corpus," in Proceedings of the workshop on Speech and
Natural Language. Association for Computational Linguistics,
1992, pp. 357 -- 362.
[19] J. Barker, R. Marxer, E. Vincent, and S. Watanabe, "The third
chimespeech separation and recognition challenge: Dataset, task
and baselines," in 2015 IEEE Workshop on Automatic Speech
Recognition and Understanding (ASRU).
IEEE, 2015, pp. 504 --
511.
|
1504.02162 | 2 | 1504 | 2015-06-18T13:19:39 | Concentric network symmetry grasps authors' styles in word adjacency networks | [
"cs.CL"
] | Several characteristics of written texts have been inferred from statistical analysis derived from networked models. Even though many network measurements have been adapted to study textual properties at several levels of complexity, some textual aspects have been disregarded. In this paper, we study the symmetry of word adjacency networks, a well-known representation of text as a graph. A statistical analysis of the symmetry distribution performed in several novels showed that most of the words do not display symmetric patterns of connectivity. More specifically, the merged symmetry displayed a distribution similar to the ubiquitous power-law distribution. Our experiments also revealed that the studied metrics do not correlate with other traditional network measurements, such as the degree or betweenness centrality. The effectiveness of the symmetry measurements was verified in the authorship attribution task. Interestingly, we found that specific authors prefer particular types of symmetric motifs. As a consequence, the authorship of books could be accurately identified in 82.5% of the cases, in a dataset comprising books written by 8 authors. Because the proposed measurements for text analysis are complementary to the traditional approach, they can be used to improve the characterization of text networks, which might be useful for related applications, such as those relying on the identification of topical words and information retrieval. | cs.CL | cs | epl draft
5
1
0
2
n
u
J
8
1
]
L
C
.
s
c
[
2
v
2
6
1
2
0
.
4
0
5
1
:
v
i
X
r
a
Concentric network symmetry grasps authors' styles in word ad-
jacency networks
Diego R. Amancio1, Filipi N. Silva2 and Luciano da F. Costa2
1 Institute of Mathematics and Computer Science
University of Sao Paulo, Sao Carlos, Sao Paulo, Brazil
2 Sao Carlos Institute of Physics
University of Sao Paulo, Sao Carlos, Sao Paulo, Brazil
PACS 89.75.Hc -- Networks and genealogical trees
PACS 02.40.Pc -- General topology
PACS 02.50.-r -- Probability theory, stochastic processes, and statistics
Abstract -- Several characteristics of written texts have been inferred from statistical analysis
derived from networked models. Even though many network measurements have been adapted
to study textual properties at several levels of complexity, some textual aspects have been disre-
garded. In this paper, we study the symmetry of word adjacency networks, a well-known represen-
tation of text as a graph. A statistical analysis of the symmetry distribution performed in several
novels showed that most of the words do not display symmetric patterns of connectivity. More
specifically, the merged symmetry displayed a distribution similar to the ubiquitous power-law
distribution. Our experiments also revealed that the studied metrics do not correlate with other
traditional network measurements, such as the degree or betweenness centrality. The effective-
ness of the symmetry measurements was verified in the authorship attribution task. Interestingly,
we found that specific authors prefer particular types of symmetric motifs. As a consequence,
the authorship of books could be accurately identified in 82.5% of the cases, in a dataset com-
prising books written by 8 authors. Because the proposed measurements for text analysis are
complementary to the traditional approach, they can be used to improve the characterization of
text networks, which might be useful for applications such as identification of topical words and
information retrieval.
Introduction. -- In recent years, network science has
become commonplace. Many real systems such as the In-
ternet, social networks and transportation systems have
increasingly been studied via networked models [1]. Be-
cause language is organized by rules and relationships be-
tween words in a complex way, it can also be represented
as networks. In this case, words are connected according
to syntactical or semantical relationships [2]. The use of
the network framework not only allowed for a better un-
derstanding of the origins and organization of language [2],
but also improved the performance of several natural pro-
cessing language tasks, including e.g. the automatic sum-
marization of texts [3], the identification of word senses [4]
and the classification of syntactical complexity [5].
Many measurements proposed for analyzing complex
networks have been reinterpreted when applied to analyze
linguistic features. Centrality measurements, for exam-
ple, have been useful to identify core concepts and key-
words, which in turn have allowed the improvement of
summarization and classification tasks [3]. While a myr-
iad of measurements have been adapted to probe tex-
tual patterns, only a limited number of studies have been
devoted to devise novel network measurements that are
able to identify more complex linguistic patterns. Par-
ticularly, a relevant pattern that has not been addressed
by networked-linguistic models is the quantification of the
heterogeneity of specific textual distributions. This is the
case of the spatial distribution of words along the text,
which has been mainly studied in terms of the burstiness
(or intermittency) of time series [6]. Another interest-
p-1
Diego R. Amancio1 Filipi N. Silva2 Luciano da F. Costa2
ing pattern concerns the uneven distribution of the num-
ber of distinct neighbors of words [7].
In this context,
we introduce two network measurements to quantify the
heterogeneity of accessing words neighbors in word adja-
cency networks. As we shall show, the adopted measure-
ments, henceforth referred to as symmetry measurements,
are able to characterize authors' stylistic marks, since dis-
tinct authors display specific bias towards particular net-
work motifs. In addition to being useful to improve the
characterization of word adjacency networks, we found out
that the symmetry measurements do not correlate with
other traditional network measurements. Therefore, they
could be useful to complement the characterization of text
networks in its several levels of complexity.
Methods. -- In this section, we describe the formation
word adjacency networks from raw books. The symmetry
measurements, namely backbone and merged symmetry
are then described. Furthermore, we present a short in-
troduction to the pattern recognition methods employed
in this study.
Word adjacency networks. Written texts can be mod-
eled as networks in several ways [2]. If one aims at grasping
stylistic textual features, networks generated from syntac-
tical analysis can be employed [3, 8]. Another possibility
is to map texts into a word adjacency network (WAN),
which links adjacent words [9, 11, 12]. Actually, WANs
can be considered as an extension of the syntactical model
since most of the syntactical links occur between adjacent
words [8]. Because syntax depends upon the language,
WANs have also proven useful to capture language depen-
dent features [13].
To construct a word adjacency network, some pre-
processing steps are usually applied. First, stopwords
such as articles and prepositions are removed because such
words convey no semantic information. Therefore, they
can be modeled as edges in the WAN model because stop-
words usually play the role of linking content words. In
order to represent as a single node the words that refer
to the same concept, the text undergoes a lemmatization
process. Hence, nouns and verbs are mapped to their sin-
gular and infinitive forms, respectively. To minimize the
errors arising from the lemmatization, before this step,
all words are labeled with their part-of-speech [14].
In
the current study, the maximum-entropy model devised
in [15] was used to perform the part-of-speech labeling.
After the lemmatization and the removal of the stopwords,
each distinct word is mapped into a node and edges are
created between adjacent words. Further details regarding
the WAN model can be found in [9].
Symmetry in networks.
Symmetry is one of the most
fundamental aspects of complex systems, naturally emerg-
ing from physical spatial restrictions and laws [16], self
organization [17], biological structures [18], and chemical
reactions [19], etc. Written texts bear no exception to
this rule, presenting intrinsic patterns of symmetry. In a
sentence, for instance, some words can be exchanged by
synonyms without compromising its original meaning. In
a similar fashion, some grammatical constructions are also
interchangeable. Aside from restrictions conveying seman-
tic relationships and grammatical rules, authors also tend
to employ additional restrictions in their works, which in
turn affects their written style. Whenever texts are repre-
sented by networks, it is expected that such styles may be
reflected on the symmetrical characteristics of its topolog-
ical structure.
While the concept of symmetry in graph theory is
tightly related to the problem of finding and counting au-
tomorphisms, this approach cannot be straightforwardly
extended to study most of real complex networks [20]. Re-
cently, practical definitions of symmetries for real networks
have been proposed in the literature. They include path
similarity techniques [20], the methods based on quantum
walks [21] and concentric rings [22]. The latter presents
some advantages over the other strategies. For example,
the symmetry can be calculated locally around nodes in
a multiscale fashion, defined in terms of node centered
subgraphs referred to as concentric patterns conceptually
linked to the concentric levels of a node. The concentric
level Γh(i) is defined as the set of nodes h hops away from
the original node i and the concentric l-pattern is the sub-
graph comprising only nodes located l or less hops away
from i, i.e., nodes in the set(cid:83)l
h=0 Γh(i).
The concentric symmetry approach is based on the ac-
cessibility measurement [23], which is calculated as a nor-
malization of the entropy obtained from the transition
probabilities for a network walk dynamics, such as the
traditional random walk or self-avoiding random walk. In
particular, the symmetry is obtained considering a very
special case of walk dynamics in which an agent never
goes back to a node belonging to a lower concentric level.
However, to account for the degeneracy caused by con-
nections between nodes in the same concentric level, two
transformations of concentric patterns were proposed, re-
sulting in two types of symmetry measurements: backbone
and merged symmetries. The backbone symmetry, Sb, is
loosely based on the concept of radial symmetry, in which
edges among nodes in the same concentric level are re-
moved for the pattern. Differently, the merged symmetry,
Sm, that bears some resemblance with angular symmetry,
is obtained from patterns by effectively merging nodes in
the same concentric level.
In both cases, the symmetry
measurements Sh for level h centered on i are calculated
from the Shannon entropy Hh of the transition probabili-
ties Ph(i → j). More specifically,
(cid:41)
(cid:40) (cid:80)
j ∈ Γh(i)
exp
Sh(i) =
Ph(i → j) ln[Ph(i → j)]
Γh(i) +(cid:80)h−1
r=0 Ξr
,
(1)
where Ξr stands for the number of dead ends in level r (i.e.,
nodes with no connections to any node in the next con-
centric level). Fig. 1 illustrates the backbone and merged
p-2
Network symmetry reveals authors' styles in word adjacency networks
Fig. 1: Example illustrating the calculation of the backbone and merged symmetries for two concentric 2-patterns. The numbers
next to each node account for the transition probabilities and colors indicate the respective concentric level of a node (blue
for level 0, orange for level 1 and green for level 2) [10]. Red self loops indicate a dead end. Both transformations of patterns
are shown. The backbone pattern is obtained by removing edges connecting nodes at the same level from the original pattern,
whereas merged patterns are weighted subgraphs created by merging nodes originally connected at the same concentric level.
In this case, the weight corresponds to the number of connections spanning from the nodes that were merged to each node in
other concentric levels. Note that the pattern in the left panel only presents merged asymmetry, while the pattern in the right
panel presents both types of asymmetry, which is also confirmed by the symmetry values.
transformations for two patterns alongside the transition
probabilities and calculated symmetries.
Pattern Recognition Methods.
Pattern recognition
methods are useful to identify patterns and infer classi-
fiers [24]. Particularly, in this study, pattern recognition
methods were applied to recognize patterns in the distri-
bution of symmetry measurements across distinct authors.
Four pattern recognition methods were employed: support
vector machines (SVM), multilayer perceptron (MLP),
nearest neighbors (KNN) and naive Bayes (NBY). These
four methods were chosen because they usually display a
good overall performance [25]. An introduction to these
methods can be found in [25, 26]. We also provide a very
short introduction to these methods in the Supplementary
Information1.
Results and discussion. -- This section is divided
in two subsections. Firstly, we study the statistical prop-
erties of symmetry measurements in word adjacency net-
works. We then show how the symmetry of specific words
can be employed to discriminate authors' styles. The list
of books employed in the experiments is shown in Table
S1 of the Supplementary Information.
Properties of merged and backbone symmetry in word
adjacency networks. We start the investigation of the
statistical properties of symmetry measurements in tex-
tual networks by analyzing the distribution of symmetry
values in real networks formed from books. Here we focus
our discussion on the book "Adventures of Sally", by P.G.
Wodehouse. Notwithstanding, all discussion henceforth
applies to the other books of the dataset. Concerning the
merged symmetry, all books displayed a probability den-
1The Supplementary Information is available from https://dl.
dropboxusercontent.com/u/2740286/symmetry.pdf
sity function with the following logistic form:
P (Sm) (cid:39) A1 − A2
1 + (Sm/S0)p + A2,
(2)
where A1, A2, S0 and p are constant. According to the
equation 2, high values of symmetry are very rare. This is
similar to other well-known distributions in texts, such as
the frequency distribution given by the Zipf's law [27].
Fig. 2 illustrates the histogram of symmetry distribu-
tion obtained for the book "Adventures of Sally", by P.W.
Wodehouse. For this book in particular, the p.d.f of the
merged symmetry in equation 2 can be written as
P (Sm) (cid:39)
A
1 + (Sm/S0)p ,
(3)
where A = 1.0136, S0 = 0.0136 and p = 1.25348. The high
value of adjusted Pearson (R2 = 0.99181) and low value
of chi-square (χ2 = 1.43261· 10−5) confirm the adehenrece
of the fitting.
Unlike the merged symmetry, the backbone counterpart
displayed a distribution of values with two typical peaks,
as revealed by Fig. 2 (see left panel). The first peak of
distribution occurs around Sb (cid:39) 0.3. While low values
of backbone symmetry are very rare, high values are fre-
quent, especially on the less frequent words. This occurs
because smaller (or lowly connected) concentric patterns
are more unlikely to accumulate enough imperfections over
the concentric levels to attain very low symmetry values.
On the other hand, larger patterns do not present such
constraints and can attain many distinct levels of symme-
try.
While several traditional centrality network measure-
ments correlate with the node degree, the proposed sym-
metry measurements for text analysis usually do not yield
a strong correlation with the connectivity of nodes. In Ta-
bles 1 and 2, we show, in the same row, words with sim-
ilar degree taking very discrepant values of merged and
p-3
BackboneOriginal PatternMerged3161651236142626262616161616161616Sb2 = 1.00Sb1 = 1.00Sm2 = 0.98Sm1 = 0.87BackboneMerged22217171717175757171727271717172717Original PatternSb2 = 0.56Sb1 = 1.00Sm2 = 0.61Sm1 = 0.92Diego R. Amancio1 Filipi N. Silva2 Luciano da F. Costa2
Fig. 2: Histograms of the distribution of the backbone Sb and
merged symmetries Sm (computed at the second level) for the
book "Adventures of Sally". The merged symmetry computed
at the second level seems to follow a logistic function (see equa-
tions 2 and 3). A similar distribution was found for the other
books of the dataset.
backbone symmetries. For example, in Table 2, the words
bathing and mother occur with the same frequency; how-
ever, the respective values of backbone symmetry are quite
discrepant. As a matter of fact, the access to the second
level neighbors is much more regular for the word mother,
as it backbone symmetry is close to the maximum possible
value, i.e. max(Sb) = 1.
Table 1: Merged symmetry (second level) computed for se-
lected words in the book "Adventures of Sally", a novel by
P.G. Wodehouse. Note that words with similar degree k (the
words in the same line) may take distinct values of symmetry.
Word
Cracknell
heart
gentleman
revue
notice
cold
luck
meditate
Sm
0.011
0.012
0.012
0.012
0.013
0.014
0.017
0.020
k Word
31
27
26
21
17
11
6
5
hotel
corner
conversation
rise
blow
tongue
wealth
banquet
Sm
0.024
0.029
0.041
0.062
0.080
0.094
0.331
0.259
k
33
27
24
21
17
10
6
5
The correlation between symmetry and other tradi-
tional topological measurements were also investigated.
According to Fig. 3, there is no consistent, significant
correlation between symmetry and other network mea-
surements. This means that the values of both merged
and backbone symmetry cannot be mimicked by other well
known network measurements. Therefore, the symmetry
measurements provide novel information for network anal-
ysis.
Authorship recognition via network symmetry.
In this
section, we exemplify the discriminability power of sym-
metry measurements in word adjacency networks. More
specifically, we show that the symmetry os specific words is
able to identify the writing style of distinct authors. In the
Table 2: Backbone symmetry (second level) computed for se-
lected words in the book "Adventures of Sally", a novel by P.G.
Wodehouse. Note that words with similar degree k (the words
in the same line) may take distinct values of symmetry.
Word
hair
heart
manner
chapter
water
note
memory
bathing
Sb
0.196
0.211
0.190
0.127
0.132
0.052
0.089
0.071
k Word
hotel
30
corner
27
conversation
26
york
22
16
disappear
10 mysterious
6
secure
5 mother
Sb
0.472
0.412
0.544
0.579
0.610
0.709
0.904
0.932
k
33
27
24
19
14
8
6
5
Fig. 3: Pearson correlation coefficients between symmetry and
other traditional network measurements. Note that, in general,
there is a weak correlation between symmetry and other mea-
surements. The correlations were obtained from the word adja-
cency network obtained from the book "Adventures of Sally",
by P.G. Wodehouse.
context of information sciences, the authorship recognition
task is relevant because it can be useful to classify liter-
ary manuscripts [28] and intercept terrorist messages [29].
Traditional features employed for stylometric analysis in-
clude simple statistics such as the average length and fre-
quency of words [30], richness of vocabulary size [30] and
burstiness indexes [7].
To evaluate the ability of the symmetry measurements
to recognize particular authors' styles, we used a dataset
of 40 books written by 8 authors (see Table S1 of the
Supplementary Information). As features for the classi-
fication task, both merged and backbone symmetry were
computed for the 229 words appearing in all books of the
dataset. To automatically recognize and classify the pat-
terns displayed by each author, we used the four pattern
recognition techniques described in the methodology. The
accuracy rates in identifying the correct author are shown
in Table 3. With regard to the performance of the pat-
tern recognition methods, the best results were obtained
with the SVM and MLP methods. When the symmetry
was computed considering the second level of neighbors
p-4
600500400300200Number of OccurencesNumber of OccurencesBackbone SymmetryMerged Symmetry1000.00.20.40.60.81.00.00.20.40.60.81.0002004006008001000120014001600Merged h=4Node DegreeStress centralityBetweennessClusteringMerged h=3Backbone h=3Backbone h=4Merged h=2Backbone h=2Node DegreeStress centralityBetweennessClusteringMerged h=4Backbone h=4Merged h=3Backbone h=3Merged h=2Backbone h=2Network symmetry reveals authors' styles in word adjacency networks
(h = 2), the best accuracy rate achieved was 75.0% (this
corresponds to a p-value lower than 1.0·10−15). Both sym-
metries measurements calculated at the third level did not
increase the best classification performance obtained with
h = 2. A minor improvement in performance occurred
when the fourth level was included in the analysis. The
best accuracy rate increased from 75.0% to 82.5%. We also
probed the performance of the classification by combining
different levels as features. In this case, the performance
did not improve (result not shown). All in all, these re-
sults confirms the suitability of symmetry measurements
to identify the subtleties of authors' styles in terms of the
homogeneity of accessibility of neighbors.
Table 3: Accuracy rate found for the authorship recognition
task. The best accuracy rate found to recognize the authorship
in a dataset comprising 8 authors was 82.5%.
Symmetry
Merged h = 2
Merged h = 3
Merged h = 4
Backbone h = 2
Backbone h = 3
Backbone h = 4
SVM MLP KNN NBY
75.0% 72.5% 55.0% 42.5%
70.0% 62.5% 65.0% 40.0%
82.5% 82.5% 57.5% 42.5%
32.5% 32.5% 20.0% 20.0%
70.0% 72.5% 57.5% 27.5%
70.0% 82.5% 57.5% 42.5%
symmetry measurements are robust in the sense that they
do not mimic the behavior of other traditional topological
measurements. Thus, because symmetry measurements
do not strongly correlate with other traditional network or
textual features, they could be combined with other mea-
surements to improve the characterization of texts rep-
resented as graphs and related networked systems. The
proposed symmetry measurements were also evaluated in
the context of the authorship recognition task. The re-
sults revealed that the symmetry of specific words is able
to identify the authorship of books with high accuracy
rates. This result confirms the suitability of the measure-
ments to detect the subtleties of authors' styles reflected
on the organization of word adjacency networks. In future
works, we intend to study the suitability of both backbone
and merged symmetry in semantical networks, which may
ultimately lead to the improvement of several semantical-
related applications.
∗ ∗ ∗
DRA acknowledges financial
from Sao
Paulo Research Foundation (FAPESP) (grant number
2014/20830-0). FNS thanks CAPES for support. LdFC
is grateful to FAPESP (grant number 2011/50761-2),
CNPq (Brazil) and NAP-PRP-USP.
support
To understand the patterns behind the high discrim-
inability rates found in Table 3 we show some visualiza-
tions obtained for two words, "time" and "indeed", in
Fig. 4. We chose these words because they were able
discriminate among a few groups of authors while also
presenting a wide range of symmetry values. The pat-
terns obtained for the word "time" are arranged along the
top of the corresponding axis according to their respective
merged symmetry, which was found to separate Arthur
Conan Doyle, Thomas Hardy and Charles Darwin. Note
that the nodes with low merged symmetry presented sev-
eral edges crossing over the internal shell of its patterns.
Additionally, connections between nodes lying at the third
concentric level are much less organized, hence the low
values of symmetry. Conversely, nodes taking high values
of symmetry displayed more organized connections, lead-
ing to higher uniformity of connections among nodes lying
at the farthest concentric level. The same observations
can be made for the patterns obtained for the word "in-
deed", which discriminated between Hector Hugh Munro
and the group of authors encompassing Arthur Conan
Doyle, Bram Stoker, Thomas Hardy and Charles Dickens.
Still, however, these patterns are much more symmetric,
which is once again reflected in the visualizations by their
higher organization on the last concentric level.
Conclusion. -- In this paper, we have introduced the
concept of symmetry to study the connectivity patterns
of word association networks. By defining symmetry as a
function of particular random walks, we showed that the
REFERENCES
[1] Costa L.F. et al., Adv. Phys., 60 (2011) 329 -- 412.
[2] Cong J. and Liu H., Phys. Life Rev., 11 (2014) 598 -- 618.
[3] Amancio D.R., Nunes M.G.V., Oliveira Jr. O.N. and
Costa L.F., Physica A, 391 (2012) 1855 -- 1864.
[4] Amancio D.R., Oliveira Jr. O.N. and Costa L.F., Eu-
rophys. Lett., 98 (2012) 18002
[5] Amancio D.R., Aluisio S.M., Oliveira Jr. O.N. and
Costa L.F., Europhys. Lett., 100 (2012) 58002
[6] Ortuno M., Carpena P., Bernaola-Galvan P.,
Munoz E. and Somoza A.M., Europhys. Lett., 57 (2002)
759
[7] Amancio D.R., J. Stat. Mech., (2015) P03005.
[8] Ferrer i Cancho R., Sol´e R.V. and Kohler R., Phys.
Rev. E, 69 (2004) 1 -- 8.
[9] Amancio D.R., Oliveira Jr. O.N. and Costa L.F., New
J. Phys., 14 (2012) 043029.
[10] Costa, L.da F., Tognetti, M.A.R. and Silva, F.N.,
Physica A, 24(387) (2008) 6201-6214.
[11] Amancio D.R., PLoS ONE, 10 (2015) e0118394.
[12] Roxas R.M. and Tapang G., Int. J. Mod. Phys. C, 21
(2010) 503.
[13] Amancio D.R., Altmann E.G., Rybski D., Oliveira
Jr. O.N. and Costa L.F., PLoS ONE, 8 (2013) e67310.
[14] Manning C.D. and Schutze H., Foundations of Statis-
tical Natural Language Processing (MIT Press) 1999.
[15] Ratnaparki A., Proceedings of the Empirical Methods in
Natural Language Processing Conference 1996.
[16] Debs T. and Redhead M., Objectivity, Invariance, and
Convention: Symmetry in Physical Science (Harvard Univ.
Press) 2007
p-5
Diego R. Amancio1 Filipi N. Silva2 Luciano da F. Costa2
Fig. 4: Merged symmetry values for considered books and visualizations of a few concentric patterns obtained by considering
the words "time" and "indeed". Each bar over the axis correspond to a book and the colors indicate their respective authors
according to the legend. The patterns visualizations was accomplished by using a modified force directed method [31] where
nodes connected in the same level are more likely to be close together. Words shared among all books are also shown next to
the respective nodes with the opacity proportional to its frequency.
[17] MacArthur B.D. and Anderson J.W., arXiv: cond-
mat/0609274, (2006)
[18] Finnerty J.R., Int. J. Dev. Biol., 47 (2003) 5239
[19] Longuet-Higgins H.C., Mol. Phys., 6:5 (1963) 445 -- 460
[20] Holmes P., Phys. Rev. E, 74 (2006) 036107
[21] Rossi L., Torsello A., Hancock E.R. and Wilson
R.C., Phys. Rev. E, 88 (2013) 032806
[22] Silva F.N., Comin C.H., Peron T.K.D., Rodrigues
F.A., Ye C., Wilson R.C., Hancock E. and Costa
L.F., arXiv: 1407.0224, (2014)
[23] Viana M.P., Batista J.L.B. and Costa L.F., Phys.
Rev. E, 85 (2012) 036105
[24] Duda R.O., Hart P.E. and Stork D.G., Pattern Clas-
sification, Vol. 2 (Wiley-Interscience) 2000
[25] Amancio D.R., Comin C.H., Casanova D., Travieso
G., Bruno O.M., Rodrigues F.A. and Costa L.F.,
PLoS ONE, 9 (2014) e94137.
[26] Bishop C.M., Pattern Recognition and Machine Learning
(Springer-Verlag New York, Inc. Secaucus, NJ, USA) 2006.
[27] Zipf G.K., Human behavior and the principle of least ef-
fort (Addison-Wesley, Reading MA, USA) 1949
[28] Ebrahimpour M., Putnins T.J., Berryman M.J., Al-
lison A., Ng BW-H. and Derek A., PLoS ONE , 8
(2013) e54998.
[29] Abbasi A. and Chen H. , IEEE Intell. Syst., 20 (2005)
67 -- 75.
[30] Stamatatos E., J. Assoc. Inf. Sci. Technol., 60 (2009)
538 -- 556.
[31] Fruchterman T.M.J. and Reingold E.M., Softw:
Pract. Exper., 11(21) (1991) 1129 -- 1164
p-6
SbSm0.1440.033"indeed" in Beasts and SupebeastsSbSm0.3650.01"indeed" in A Paiof Blue EyesSbSm0.3880.02"indeed" in Draculas GuestSbSm0.6830.068"indeed" in When William CameSbSm0.3920.006"time" in Jude the ObscureSbSm0.4330.05"time" in Volcanic IslandsSbSm0.4460.01"time" in The Great BoewarSbSm0.4350.023"time" in Coral ReefsArthur Conan DoyleBram StokerCharles DickensThomas HardyP.G. WodehouseHector Hugh Munro (Saki)Charlies DarwinHerman Melville0.010.1Merged Symmetry (h=2)Merged Symmetry (h=2)0.010.11"Time""Indeed" |
1601.01705 | 4 | 1601 | 2016-06-07T23:25:51 | Learning to Compose Neural Networks for Question Answering | [
"cs.CL",
"cs.CV",
"cs.NE"
] | We describe a question answering model that applies to both images and structured knowledge bases. The model uses natural language strings to automatically assemble neural networks from a collection of composable modules. Parameters for these modules are learned jointly with network-assembly parameters via reinforcement learning, with only (world, question, answer) triples as supervision. Our approach, which we term a dynamic neural model network, achieves state-of-the-art results on benchmark datasets in both visual and structured domains. | cs.CL | cs | Learning to Compose Neural Networks for Question Answering
Jacob Andreas and Marcus Rohrbach and Trevor Darrell and Dan Klein
Department of Electrical Engineering and Computer Sciences
{jda,rohrbach,trevor,klein}@eecs.berkeley.edu
University of California, Berkeley
6
1
0
2
n
u
J
7
]
L
C
.
s
c
[
4
v
5
0
7
1
0
.
1
0
6
1
:
v
i
X
r
a
Abstract
We describe a question answering model that
applies to both images and structured knowl-
edge bases. The model uses natural lan-
guage strings to automatically assemble neu-
ral networks from a collection of composable
modules. Parameters for these modules are
learned jointly with network-assembly param-
eters via reinforcement learning, with only
(world, question, answer) triples as supervi-
sion. Our approach, which we term a dynamic
neural module network, achieves state-of-the-
art results on benchmark datasets in both vi-
sual and structured domains.
Introduction
1
This paper presents a compositional, attentional
model for answering questions about a variety of
world representations, including images and struc-
tured knowledge bases. The model translates from
questions to dynamically assembled neural net-
works, then applies these networks to world rep-
resentations (images or knowledge bases) to pro-
duce answers. We take advantage of two largely
independent lines of work: on one hand, an exten-
sive literature on answering questions by mapping
from strings to logical representations of meaning;
on the other, a series of recent successes in deep
neural models for image recognition and captioning.
By constructing neural networks instead of logical
forms, our model leverages the best aspects of both
linguistic compositionality and continuous represen-
tations.
Our model has two components, trained jointly:
first, a collection of neural "modules" that can be
freely composed (Figure 1a); second, a network lay-
out predictor that assembles modules into complete
deep networks tailored to each question (Figure 1b).
Figure 1: A learned syntactic analysis (a) is used to assemble a
collection of neural modules (b) into a deep neural network (c),
and applied to a world representation (d) to produce an answer.
Previous work has used manually-specified modular
structures for visual learning (Andreas et al., 2016).
Here we:
• learn a network structure predictor jointly with
module parameters themselves
• extend visual primitives from previous work to
reason over structured world representations
Training data consists of (world, question, answer)
triples: our approach requires no supervision of net-
work layouts. We achieve state-of-the-art perfor-
mance on two markedly different question answer-
ing tasks: one with questions about natural im-
ages, and another with more compositional ques-
tions about United States geography.1
2 Deep networks as functional programs
We begin with a high-level discussion of the kinds
of composed networks we would like to learn.
1We have released our code at http://github.com/
jacobandreas/nmn2
What cities are in Georgia?AtlantaandlookupGeorgiafindcityGeorgiaAtlantaMontgomeryKnowledge sourcerelateinNetwork layout (Section 4.2)find[city]lookup[Georgia]relate[in]and(b)Module inventory (Section 4.1)findlookupandrelate(a)(c)(d)Andreas et al. (2016) describe a heuristic ap-
proach for decomposing visual question answering
tasks into sequence of modular sub-problems. For
example, the question What color is the bird? might
be answered in two steps: first, "where is the bird?"
(Figure 2a), second, "what color is that part of the
image?" (Figure 2c). This first step, a generic mod-
ule called find, can be expressed as a fragment of
a neural network that maps from image features and
a lexical item (here bird) to a distribution over pix-
els. This operation is commonly referred to as the
attention mechanism, and is a standard tool for ma-
nipulating images (Xu et al., 2015) and text repre-
sentations (Hermann et al., 2015).
The first contribution of this paper is an exten-
sion and generalization of this mechanism to enable
fully-differentiable reasoning about more structured
semantic representations. Figure 2b shows how the
same module can be used to focus on the entity
Georgia in a non-visual grounding domain; more
generally, by representing every entity in the uni-
verse of discourse as a feature vector, we can obtain
a distribution over entities that corresponds roughly
to a logical set-valued denotation.
Having obtained such a distribution, existing neu-
ral approaches use it to immediately compute a
weighted average of image features and project back
into a labeling decision-a describe module (Fig-
ure 2c). But the logical perspective suggests a num-
ber of novel modules that might operate on atten-
tions: e.g. combining them (by analogy to conjunc-
tion or disjunction) or inspecting them directly with-
out a return to feature space (by analogy to quantifi-
cation, Figure 2d). These modules are discussed in
detail in Section 4. Unlike their formal counterparts,
they are differentiable end-to-end, facilitating their
integration into learned models. Building on previ-
ous work, we learn behavior for a collection of het-
erogeneous modules from (world, question, answer)
triples.
The second contribution of this paper is a model
for learning to assemble such modules composition-
ally.
Isolated modules are of limited use-to ob-
tain expressive power comparable to either formal
approaches or monolithic deep networks, they must
be composed into larger structures. Figure 2 shows
simple examples of composed structures, but for
realistic question-answering tasks, even larger net-
Figure 2: Simple neural module networks, corresponding to
the questions What color is the bird? and Are there any states?
(a) A neural find module for computing an attention over
pixels. (b) The same operation applied to a knowledge base.
(c) Using an attention produced by a lower module to identify
the color of the region of the image attended to. (d) Performing
quantification by evaluating an attention directly.
works are required. Thus our goal is to automati-
cally induce variable-free, tree-structured computa-
tion descriptors. We can use a familiar functional
notation from formal semantics (e.g. Liang et al.,
2011) to represent these computations.2 We write
the two examples in Figure 2 as
(describe[color] find[bird])
and
(exists find[state])
respectively. These are network layouts: they spec-
ify a structure for arranging modules (and their lex-
ical parameters) into a complete network. Andreas
et al. (2016) use hand-written rules to deterministi-
cally transform dependency trees into layouts, and
are restricted to producing simple structures like the
above for non-synthetic data. For full generality, we
will need to solve harder problems, like transform-
ing What cities are in Georgia? (Figure 1) into
(and
find[city]
(relate[in] lookup[Georgia]))
In this paper, we present a model for learning to se-
lect such structures from a set of automatically gen-
erated candidates. We call this model a dynamic
neural module network.
2But note that unlike formal semantics, the behavior of the
primitive functions here is itself unknown.
black and whiteGeorgiaAtlantaMontgomeryGeorgiaAtlantaMontgomeryexiststruefindbirddescribecolorfindstate(a)(b)(c)(d)3 Related work
There is an extensive literature on database ques-
tion answering, in which strings are mapped to log-
ical forms, then evaluated by a black-box execu-
tion model to produce answers. Supervision may be
provided either by annotated logical forms (Wong
and Mooney, 2007; Kwiatkowski et al., 2010; An-
dreas et al., 2013) or from (world, question, answer)
triples alone (Liang et al., 2011; Pasupat and Liang,
2015).
In general the set of primitive functions
from which these logical forms can be assembled is
fixed, but one recent line of work focuses on induc-
ing new predicates functions automatically, either
from perceptual features (Krishnamurthy and Kol-
lar, 2013) or the underlying schema (Kwiatkowski
et al., 2013). The model we describe in this paper
has a unified framework for handling both the per-
ceptual and schema cases, and differs from existing
work primarily in learning a differentiable execution
model with continuous evaluation results.
Neural models for question answering are also a
subject of current interest. These include approaches
that model the task directly as a multiclass classifi-
cation problem (Iyyer et al., 2014), models that at-
tempt to embed questions and answers in a shared
vector space (Bordes et al., 2014) and attentional
models that select words from documents sources
(Hermann et al., 2015). Such approaches generally
require that answers can be retrieved directly based
on surface linguistic features, without requiring in-
termediate computation. A more structured ap-
proach described by Yin et al. (2015) learns a query
execution model for database tables without any nat-
ural language component. Previous efforts toward
unifying formal logic and representation learning in-
clude those of Grefenstette (2013), Krishnamurthy
and Mitchell (2013), Lewis and Steedman (2013),
and Beltagy et al. (2013).
The visually-grounded component of this work
relies on recent advances in convolutional net-
works for computer vision (Simonyan and Zisser-
man, 2014), and in particular the fact that late convo-
lutional layers in networks trained for image recog-
nition contain rich features useful for other vision
tasks while preserving spatial information. These
features have been used for both image captioning
(Xu et al., 2015) and visual QA (Yang et al., 2015).
Most previous approaches to visual question an-
swering either apply a recurrent model to deep rep-
resentations of both the image and the question (Ren
et al., 2015; Malinowski et al., 2015), or use the
question to compute an attention over the input im-
age, and then answer based on both the question and
the image features attended to (Yang et al., 2015;
Xu and Saenko, 2015). Other approaches include
the simple classification model described by Zhou
et al. (2015) and the dynamic parameter prediction
network described by Noh et al. (2015). All of
these models assume that a fixed computation can
be performed on the image and question to compute
the answer, rather than adapting the structure of the
computation to the question.
As noted, Andreas et al. (2016) previously con-
sidered a simple generalization of these attentional
approaches in which small variations in the net-
work structure per-question were permitted, with
the structure chosen by (deterministic) syntactic pro-
cessing of questions. Other approaches in this gen-
eral family include the "universal parser" sketched
by Bottou (2014), the graph transformer networks
of Bottou et al. (1997), the knowledge-based neu-
ral networks of Towell and Shavlik (1994) and the
recursive neural networks of Socher et al. (2013),
which use a fixed tree structure to perform further
linguistic analysis without any external world rep-
resentation. We are unaware of previous work that
simultaneously learns both parameters for and struc-
tures of instance-specific networks.
4 Model
Recall that our goal is to map from questions and
world representations to answers. This process in-
volves the following variables:
1. w a world representation
2. x a question
3. y an answer
4. z a network layout
5. θ a collection of model parameters
Our model is built around two distributions: a lay-
out model p(zx; θ(cid:96)) which chooses a layout for a
sentence, and a execution model pz(yw; θe) which
applies the network specified by z to w.
For ease of presentation, we introduce these mod-
els in reverse order. We first imagine that z is always
observed, and in Section 4.1 describe how to evalu-
ate and learn modules parameterized by θe within
fixed structures. In Section 4.2, we move to the real
scenario, where z is unknown. We describe how to
predict layouts from questions and learn θe and θ(cid:96)
jointly without layout supervision.
4.1 Evaluating modules
Given a layout z, we assemble the corresponding
modules into a full neural network (Figure 1c), and
apply it to the knowledge representation. Interme-
diate results flow between modules until an answer
is produced at the root. We denote the output of the
network with layout z on input world w as (cid:74)z(cid:75)w;
can alternatively write (cid:74)m(h1, h2)(cid:75) for a top-level
when explicitly referencing the substructure of z, we
module m with submodule outputs h1 and h2. We
then define the execution model:
pz(yw) = ((cid:74)z(cid:75)w)y
(1)
(This assumes that the root module of z produces
a distribution over labels y.) The set of possible
layouts z is restricted by module type constraints:
some modules (like find above) operate directly on
the input representation, while others (like describe
above) also depend on input from specific earlier
modules. Two base types are considered in this pa-
per are Attention (a distribution over pixels or enti-
ties) and Labels (a distribution over answers).
Parameters are tied across multiple instances of
the same module, so different instantiated networks
may share some parameters but not others. Modules
have both parameter arguments (shown in square
brackets) and ordinary inputs (shown in parenthe-
ses). Parameter arguments, like the running bird
example in Section 2, are provided by the layout,
and are used to specialize module behavior for par-
ticular lexical items. Ordinary inputs are the re-
sult of computation lower in the network.
In ad-
dition to parameter-specific weights, modules have
global weights shared across all instances of the
module (but not shared with other modules). We
write A, a, B, b, . . . for global weights and ui, vi for
weights associated with the parameter argument i.
⊕ and (cid:12) denote (possibly broadcasted) elementwise
addition and multiplication respectively. The com-
plete set of global weights and parameter-specific
weights constitutes θe. Every module has access to
the world representation, represented as a collection
of vectors w1, w2, . . . (or W expressed as a matrix).
The nonlinearity σ denotes a rectified linear unit.
The modules used in this paper are shown below,
with names and type constraints in the first row and a
description of the module's computation following.
(→ Attention)
Lookup
lookup[i] produces an attention focused entirely at the
index f (i), where the relationship f between words
and positions in the input map is known ahead of time
(e.g. string matches on database fields).
(cid:74)lookup[i](cid:75) = ef (i)
(2)
where ei is the basis vector that is 1 in the ith position
and 0 elsewhere.
(→ Attention)
Find
find[i] computes a distribution over indices by con-
catenating the parameter argument with each position
of the input feature map, and passing the concatenated
vector through a MLP:
(cid:74)find[i](cid:75) = softmax(a (cid:12) σ(Bvi ⊕ CW ⊕ d)) (3)
(Attention → Attention)
Relate
relate directs focus from one region of the input to
another. It behaves much like the find module, but
also conditions its behavior on the current region of
k hkwk, where hk is the
attention h. Let ¯w(h) = (cid:80)
kth element of h. Then,
(cid:74)relate[i](h)(cid:75) = softmax(a (cid:12)
σ(Bvi ⊕ CW ⊕ D ¯w(h) ⊕ e))
(4)
(Attention* → Attention)
And
and performs an operation analogous to set intersec-
tion for attentions. The analogy to probabilistic logic
suggests multiplying probabilities:
(cid:74)and(h1, h2, . . .)(cid:75) = h1 (cid:12) h2 (cid:12) ···
(5)
(Attention → Labels)
Describe
describe[i] computes a weighted average of w under
the input attention. This average is then used to predict
an answer representation. With ¯w as above,
(cid:74)describe[i](h)(cid:75) = softmax(Aσ(B ¯w(h) + vi)) (6)
(Attention → Labels)
Exists
exists is the existential quantifier, and inspects the
incoming attention directly to produce a label, rather
than an intermediate feature vector like describe:
(cid:16)(cid:0) max
k
(cid:17)
(cid:1)a + b
hk
(cid:74)exists](h)(cid:75) = softmax
(7)
mapped onto a (possibly smaller) set of semantic
primitives. Second, these semantic primitives must
be combined into a structure that closely, but not ex-
actly, parallels the structure provided by syntax. For
example, state and province might need to be identi-
fied with the same field in a database schema, while
all states have a capital might need to be identified
with the correct (in situ) quantifier scope.
While we cannot avoid the structure selection
problem, continuous representations simplify the
lexical selection problem. For modules that accept
a vector parameter, we associate these parameters
with words rather than semantic tokens, and thus
turn the combinatorial optimization problem asso-
ciated with lexicon induction into a continuous one.
Now, in order to learn that province and state have
the same denotation, it is sufficient to learn that their
associated parameters are close in some embedding
space-a task amenable to gradient descent. (Note
that this is easy only in an optimizability sense,
and not an information-theoretic one-we must still
learn to associate each independent lexical item with
the correct vector.) The remaining combinatorial
problem is to arrange the provided lexical items into
the right computational structure.
In this respect,
layout prediction is more like syntactic parsing than
ordinary semantic parsing, and we can rely on an
off-the-shelf syntactic parser to get most of the way
there. In this work, syntactic structure is provided by
the Stanford dependency parser (De Marneffe and
Manning, 2008).
The construction of layout candidates is depicted
in Figure 3, and proceeds as follows:
1. Represent the input sentence as a dependency
tree.
2. Collect all nouns, verbs, and prepositional
phrases that are attached directly to a wh-word
or copula.
3. Associate each of these with a layout frag-
ment: Ordinary nouns and verbs are mapped
to a single find module. Proper nouns to a sin-
gle lookup module. Prepositional phrases are
mapped to a depth-2 fragment, with a relate
module for the preposition above a find mod-
ule for the enclosed head noun.
4. Form subsets of this set of layout fragments.
For each subset, construct a layout candidate by
Figure 3: Generation of layout candidates. The input sentence
(a) is represented as a dependency parse (b). Fragments of this
dependency parse are then associated with appropriate modules
(c), and these fragments are assembled into full layouts (d).
With z observed, the model we have described
so far corresponds largely to that of Andreas et al.
(2016), though the module inventory is different-
in particular, our new exists and relate modules
do not depend on the two-dimensional spatial struc-
ture of the input. This enables generalization to non-
visual world representations.
Learning in this simplified setting is straightfor-
ward. Assuming the top-level module in each layout
is a describe or exists module, the fully- instan-
(cid:80)
tiated network corresponds to a distribution over la-
bels conditioned on layouts. To train, we maximize
(w,y,z) log pz(yw; θe) directly. This can be under-
stood as a parameter-tying scheme, where the deci-
sions about which parameters to tie are governed by
the observed layouts z.
4.2 Assembling networks
Next we describe the layout model p(zx; θ(cid:96)). We
first use a fixed syntactic parse to generate a small
set of candidate layouts, analogously to the way
a semantic grammar generates candidate semantic
parses in previous work (Berant and Liang, 2014).
A semantic parse differs from a syntactic parse
in two primary ways. First, lexical items must be
What cities are in Georgia?whatcitybeinGeorgiafind[city]relate[in]lookup[Georgia]relate[in]...lookup[Georgia]find[city]and(a)(b)(c)(d)relate[in]lookup[Georgia]joining all fragments with an and module, and
inserting either a measure or describe module
at the top (each subset thus results in two parse
candidates.)
All layouts resulting from this process feature a
relatively flat tree structure with at most one con-
junction and one quantifier. This is a strong sim-
plifying assumption, but appears sufficient to cover
most of the examples that appear in both of our
tasks. As our approach includes both categories, re-
lations and simple quantification, the range of phe-
nomena considered is generally broader than pre-
vious perceptually-grounded QA work (Krishna-
murthy and Kollar, 2013; Matuszek et al., 2012).
Having generated a set of candidate parses, we
need to score them. This is a ranking problem;
as in the rest of our approach, we solve it using
standard neural machinery.
In particular, we pro-
duce an LSTM representation of the question, a
feature-based representation of the query, and pass
both representations through a multilayer perceptron
(MLP). The query feature vector includes indicators
on the number of modules of each type present, as
well as their associated parameter arguments. While
one can easily imagine a more sophisticated parse-
scoring model, this simple approach works well for
our tasks.
Formally, for a question x, let hq(x) be an LSTM
encoding of the question (i.e. the last hidden layer of
an LSTM applied word-by-word to the input ques-
tion). Let {z1, z2, . . .} be the proposed layouts for
x, and let f (zi) be a feature vector representing the
ith layout. Then the score s(zix) for the layout zi is
s(zix) = a(cid:62)σ(Bhq(x) + Cf (zi) + d)
(8)
i.e. the output of an MLP with inputs hq(x) and
f (zi), and parameters θ(cid:96) = {a, B, C, d}. Finally,
we normalize these scores to obtain a distribution:
p(zix; θ(cid:96)) = es(zix)(cid:46) n(cid:88)
es(zjx)
(9)
a
and
Having defined a layout
network
j=1
selection module
p(zx; θ(cid:96))
execution model
pz(yw; θe), we are ready to define a model
for predicting answers given only (world, question)
pairs. The key constraint is that we want to min-
imize evaluations of pz(yw; θe) (which involves
expensive application of a deep network to a large
input representation), but can tractably evaluate
p(zx; θ(cid:96)) for all z (which involves application
of a shallow network to a relatively small set of
candidates). This is the opposite of the situation
usually encountered semantic parsing, where calls
to the query execution model are fast but the set of
candidate parses is too large to score exhaustively.
In fact, the problem more closely resembles the
scenario faced by agents in the reinforcement learn-
ing setting (where it is cheap to score actions, but
potentially expensive to execute them and obtain re-
wards). We adopt a common approach from that lit-
erature, and express our model as a stochastic pol-
icy. Under this policy, we first sample a layout z
from a distribution p(zx; θ(cid:96)), and then apply z to
the knowledge source and obtain a distribution over
answers p(yz, w; θe).
After z is chosen, we can train the execution
model directly by maximizing log p(yz, w; θe) with
respect to θe as before (this is ordinary backprop-
agation). Because the hard selection of z is non-
differentiable, we optimize p(zx; θ(cid:96)) using a policy
gradient method. The gradient of the reward surface
J with respect to the parameters of the policy is
∇J(θ(cid:96)) = E[∇ log p(zx; θ(cid:96)) · r]
(10)
(this is the REINFORCE rule (Williams, 1992)). Here
the expectation is taken with respect to rollouts of
the policy, and r is the reward. Because our goal is
to select the network that makes the most accurate
predictions, we take the reward to be identically the
negative log-probability from the execution phase,
i.e.
E[(∇ log p(zx; θ(cid:96))) · log p(yz, w; θe)]
(11)
Thus the update to the layout-scoring model at each
timestep is simply the gradient of the log-probability
of the chosen layout, scaled by the accuracy of that
layout's predictions. At training time, we approxi-
mate the expectation with a single rollout, so at each
step we update θ(cid:96) in the direction (∇ log p(zx; θ(cid:96)))·
log p(yz, w; θe) for a single z ∼ p(zx; θ(cid:96)). θe and
θ(cid:96) are optimized using ADADELTA (Zeiler, 2012)
with ρ = 0.95, ε = 1e−6 and gradient clipping at a
norm of 10.
test-dev
test-std
Yes/No Number Other
Zhou (2015) 76.6
Noh (2015)
80.7
Yang (2015) 79.3
81.2
NMN
D-NMN
81.1
35.0
37.2
36.6
38.0
38.6
42.6
41.7
46.1
44.0
45.5
All
55.7
57.2
58.7
58.6
59.4
All
55.9
57.4
58.9
58.7
59.4
Table 1: Results on the VQA test server. NMN is the
parameter-tying model from Andreas et al. (2015), and D-NMN
is the model described in this paper.
best if the candidate layouts were relatively simple:
only describe, and and find modules are used, and
layouts contain at most two conjuncts.
One weakness of this basic framework is a diffi-
culty modeling prior knowledge about answers (of
the form most bears are brown). This kinds of lin-
guistic "prior" is essential for the VQA task, and
easily incorporated. We simply introduce an extra
hidden layer for recombining the final module net-
work output with the input sentence representation
hq(x) (see Equation 8), replacing Equation 1 with:
log pz(yw, x) = (Ahq(x) + B(cid:74)z(cid:75)w)y
(12)
(Now modules with output
type Labels should
be understood as producing an answer embedding
rather than a distribution over answers.) This allows
the question to influence the answer directly.
Results are shown in Table 1. The use of dynamic
networks provides a small gain, most noticeably on
"other" questions. We achieve state-of-the-art re-
sults on this task, outperforming a highly effective
visual bag-of-words model (Zhou et al., 2015), a
model with dynamic network parameter prediction
(but fixed network structure) (Noh et al., 2015), a
more conventional attentional model (Yang et al.,
2015), and a previous approach using neural mod-
ule networks with no structure prediction (Andreas
et al., 2016).
Some examples are shown in Figure 4. In general,
the model learns to focus on the correct region of the
image, and tends to consider a broad window around
the region. This facilitates answering questions like
Where is the cat?, which requires knowledge of the
surroundings as well as the object in question.
What is in the sheep's ear?
What color is she
wearing?
What is the man
dragging?
(describe[what]
(describe[color]
(describe[what]
(and find[sheep]
find[ear]))
find[wear])
find[man])
tag
white
boat (board)
Figure 4: Sample outputs for the visual question answering
task. The second row shows the final attention provided as in-
put to the top-level describe module. For the first two exam-
ples, the model produces reasonable parses, attends to the cor-
rect region of the images (the ear and the woman's clothing),
and generates the correct answer. In the third image, the verb is
discarded and a wrong answer is produced.
5 Experiments
The framework described in this paper is general,
and we are interested in how well it performs on
datasets of varying domain, size and linguistic com-
plexity. To that end, we evaluate our model on tasks
at opposite extremes of both these criteria: a large
visual question answering dataset, and a small col-
lection of more structured geography questions.
5.1 Questions about images
Our first task is the recently-introduced Visual Ques-
tion Answering challenge (VQA) (Antol et al.,
2015). The VQA dataset consists of more than
200,000 images paired with human-annotated ques-
tions and answers, as in Figure 4.
We use the VQA 1.0 release, employing the de-
velopment set for model selection and hyperparam-
eter tuning, and reporting final results from the eval-
uation server on the test-standard set. For the ex-
periments described in this section, the input feature
representations wi are computed by the the fifth con-
volutional layer of a 16-layer VGGNet after pooling
(Simonyan and Zisserman, 2014). Input images are
scaled to 448×448 before computing their represen-
tations. We found that performance on this task was
Accuracy
Model
GeoQA GeoQA+Q
LSP-F
LSP-W
NMN
D-NMN
48
51
51.7
54.3
–
–
35.7
42.9
Table 2: Results on the GeoQA dataset, and the GeoQA
dataset with quantification. Our approach outperforms both a
purely logical model (LSP-F) and a model with learned percep-
tual predicates (LSP-W) on the original dataset, and a fixed-
structure NMN under both evaluation conditions.
5.2 Questions about geography
The next set of experiments we consider focuses
on GeoQA, a geographical question-answering
task first introduced by Krishnamurthy and Kollar
(2013). This task was originally paired with a vi-
sual question answering task much simpler than the
one just discussed, and is appealing for a number
of reasons. In contrast to the VQA dataset, GeoQA
is quite small, containing only 263 examples. Two
baselines are available: one using a classical se-
mantic parser backed by a database, and another
which induces logical predicates using linear clas-
sifiers over both spatial and distributional features.
This allows us to evaluate the quality of our model
relative to other perceptually grounded logical se-
mantics, as well as strictly logical approaches.
The GeoQA domain consists of a set of entities
(e.g. states, cities, parks) which participate in vari-
ous relations (e.g. north-of, capital-of). Here we take
the world representation to consist of two pieces: a
set of category features (used by the find module)
and a different set of relational features (used by the
relate module). For our experiments, we use a sub-
set of the features originally used by Krishnamurthy
et al. The original dataset includes no quantifiers,
and treats the questions What cities are in Texas?
and Are there any cities in Texas? identically. Be-
cause we are interested in testing the parser's ability
to predict a variety of different structures, we intro-
duce a new version of the dataset, GeoQA+Q, which
distinguishes these two cases, and expects a Boolean
answer to questions of the second kind.
Results are shown in Table 2. As in the orig-
inal work, we report
the results of leave-one-
environment-out cross-validation on the set of 10 en-
Is Key Largo an island?
(exists (and lookup[key-largo] find[island]))
yes: correct
What national parks are in Florida?
(and find[park] (relate[in] lookup[florida]))
everglades: correct
What are some beaches in Florida?
(exists (and lookup[beach]
(relate[in] lookup[florida])))
yes (daytona-beach): wrong parse
What beach city is there in Florida?
(and lookup[beach] lookup[city]
(relate[in] lookup[florida]))
[none] (daytona-beach): wrong module behavior
Figure 5: Example layouts and answers selected by the model
on the GeoQA dataset. For incorrect predictions, the correct
answer is shown in parentheses.
vironments. Our dynamic model (D-NMN) outper-
forms both the logical (LSP-F) and perceptual mod-
els (LSP-W) described by (Krishnamurthy and Kol-
lar, 2013), as well as a fixed-structure neural mod-
ule net (NMN). This improvement is particularly
notable on the dataset with quantifiers, where dy-
namic structure prediction produces a 20% relative
improvement over the fixed baseline. A variety of
predicted layouts are shown in Figure 5.
6 Conclusion
We have introduced a new model, the dynamic neu-
ral module network, for answering queries about
both structured and unstructured sources of informa-
tion. Given only (question, world, answer) triples
as training data, the model learns to assemble neu-
ral networks on the fly from an inventory of neural
models, and simultaneously learns weights for these
modules so that they can be composed into novel
structures. Our approach achieves state-of-the-art
results on two tasks. We believe that the success of
this work derives from two factors:
Continuous representations improve the expres-
siveness and learnability of semantic parsers: by re-
placing discrete predicates with differentiable neural
network fragments, we bypass the challenging com-
binatorial optimization problem associated with in-
duction of a semantic lexicon. In structured world
representations, neural predicate representations al-
low the model to invent reusable attributes and re-
lations not expressed in the schema. Perhaps more
importantly, we can extend compositional question-
answering machinery to complex, continuous world
representations like images.
Semantic structure prediction improves general-
ization in deep networks: by replacing a fixed net-
work topology with a dynamic one, we can tailor the
computation performed to each problem instance,
using deeper networks for more complex questions
and representing combinatorially many queries with
comparatively few parameters. In practice, this re-
sults in considerable gains in speed and sample effi-
ciency, even with very little training data.
These observations are not limited to the question
answering domain, and we expect that they can be
applied similarly to tasks like instruction following,
game playing, and language generation.
Acknowledgments
JA is supported by a National Science Foundation
Graduate Fellowship. MR is supported by a fellow-
ship within the FIT weltweit-Program of the German
Academic Exchange Service (DAAD). This work
was additionally supported by DARPA, AFRL, DoD
MURI award N000141110688, NSF awards IIS-
1427425 and IIS-1212798, and the Berkeley Vision
and Learning Center.
References
Jacob Andreas, Andreas Vlachos, and Stephen Clark.
2013. Semantic parsing as machine translation.
In
Proceedings of the Annual Meeting of the Association
for Computational Linguistics, Sofia, Bulgaria.
Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and
Dan Klein. 2016. Neural module networks. In Pro-
ceedings of the Conference on Computer Vision and
Pattern Recognition.
Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Mar-
garet Mitchell, Dhruv Batra, C Lawrence Zitnick, and
Devi Parikh. 2015. VQA: Visual question answer-
In Proceedings of the International Conference
ing.
on Computer Vision.
Islam Beltagy, Cuong Chau, Gemma Boleda, Dan Gar-
rette, Katrin Erk, and Raymond Mooney. 2013. Mon-
tague meets markov: Deep semantics with probabilis-
tic logical form. Proceedings of the Joint Conference
on Distributional and Logical Semantics, pages 11–
21.
Jonathan Berant and Percy Liang. 2014. Semantic pars-
In Proceedings of the Annual
ing via paraphrasing.
Meeting of the Association for Computational Linguis-
tics, volume 7, page 92.
Antoine Bordes, Sumit Chopra, and Jason Weston. 2014.
Question answering with subgraph embeddings. Pro-
ceedings of the Conference on Empirical Methods in
Natural Language Processing.
L´eon Bottou, Yoshua Bengio, and Yann Le Cun. 1997.
Global training of document processing systems us-
ing graph transformer networks. In Proceedings of the
Conference on Computer Vision and Pattern Recogni-
tion, pages 489–494. IEEE.
L´eon Bottou. 2014. From machine learning to machine
reasoning. Machine learning, 94(2):133–149.
Marie-Catherine De Marneffe and Christopher D Man-
ning. 2008. The Stanford typed dependencies repre-
sentation. In Proceedings of the International Confer-
ence on Computational Linguistics, pages 1–8.
Edward Grefenstette. 2013. Towards a formal distribu-
tional semantics: Simulating logical calculi with ten-
sors. Joint Conference on Lexical and Computational
Semantics.
Karl Moritz Hermann, Tomas Kocisky, Edward Grefen-
stette, Lasse Espeholt, Will Kay, Mustafa Suleyman,
and Phil Blunsom. 2015. Teaching machines to read
and comprehend. In Advances in Neural Information
Processing Systems, pages 1684–1692.
Mohit Iyyer, Jordan Boyd-Graber, Leonardo Claudino,
Richard Socher, and Hal Daum´e III. 2014. A neu-
ral network for factoid question answering over para-
graphs. In Proceedings of the Conference on Empiri-
cal Methods in Natural Language Processing.
Jayant Krishnamurthy and Thomas Kollar. 2013. Jointly
learning to parse and perceive: connecting natural lan-
guage to the physical world. Transactions of the Asso-
ciation for Computational Linguistics.
Jayant Krishnamurthy and Tom Mitchell. 2013. Vec-
tor space semantic parsing: A framework for compo-
In Proceedings of the
sitional vector space models.
ACL Workshop on Continuous Vector Space Models
and their Compositionality.
Tom Kwiatkowski, Luke Zettlemoyer, Sharon Goldwa-
ter, and Mark Steedman. 2010. Inducing probabilis-
tic CCG grammars from logical form with higher-
In Proceedings of the Conference
order unification.
on Empirical Methods in Natural Language Process-
ing, pages 1223–1233, Cambridge, Massachusetts.
Tom Kwiatkowski, Eunsol Choi, Yoav Artzi, and Luke
Zettlemoyer. 2013. Scaling semantic parsers with on-
the-fly ontology matching. In Proceedings of the Con-
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho,
Aaron Courville, Ruslan Salakhutdinov, Richard
Zemel, and Yoshua Bengio.
2015. Show, attend
and tell: Neural image caption generation with visual
In International Conference on Machine
attention.
Learning.
Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng,
and Alex Smola.
Stacked attention net-
works for image question answering. arXiv preprint
arXiv:1511.02274.
2015.
Pengcheng Yin, Zhengdong Lu, Hang Li, and Ben Kao.
2015. Neural enquirer: Learning to query tables.
arXiv preprint arXiv:1512.00965.
Matthew D Zeiler.
2012.
adaptive learning rate method.
arXiv:1212.5701.
ADADELTA: An
arXiv preprint
Bolei Zhou, Yuandong Tian, Sainbayar Sukhbaatar,
Arthur Szlam, and Rob Fergus. 2015. Simple base-
arXiv preprint
line for visual question answering.
arXiv:1512.02167.
ference on Empirical Methods in Natural Language
Processing.
Mike Lewis and Mark Steedman. 2013. Combining
distributional and logical semantics. Transactions of
the Association for Computational Linguistics, 1:179–
192.
Percy Liang, Michael Jordan, and Dan Klein.
2011.
Learning dependency-based compositional semantics.
In Proceedings of the Human Language Technology
Conference of the Association for Computational Lin-
guistics, pages 590–599, Portland, Oregon.
Mateusz Malinowski, Marcus Rohrbach, and Mario Fritz.
2015. Ask your neurons: A neural-based approach to
answering questions about images. In Proceedings of
the International Conference on Computer Vision.
Cynthia Matuszek, Nicholas FitzGerald, Luke Zettle-
moyer, Liefeng Bo, and Dieter Fox. 2012. A joint
model of language and perception for grounded at-
tribute learning. In International Conference on Ma-
chine Learning.
Hyeonwoo Noh, Paul Hongsuck Seo, and Bohyung Han.
2015. Image question answering using convolutional
neural network with dynamic parameter prediction.
arXiv preprint arXiv:1511.05756.
Panupong Pasupat and Percy Liang. 2015. Composi-
tional semantic parsing on semi-structured tables. In
Proceedings of the Annual Meeting of the Association
for Computational Linguistics.
Mengye Ren, Ryan Kiros, and Richard Zemel. 2015. Ex-
ploring models and data for image question answer-
In Advances in Neural Information Processing
ing.
Systems.
K Simonyan and A Zisserman. 2014. Very deep con-
volutional networks for large-scale image recognition.
arXiv preprint arXiv:1409.1556.
Richard Socher, John Bauer, Christopher D. Manning,
and Andrew Y. Ng. 2013. Parsing with compositional
vector grammars. In Proceedings of the Annual Meet-
ing of the Association for Computational Linguistics.
1994.
Knowledge-based artificial neural networks. Artificial
Intelligence, 70(1):119–165.
Geoffrey G Towell and Jude W Shavlik.
Ronald J Williams. 1992. Simple statistical gradient-
following algorithms for connectionist reinforcement
learning. Machine learning, 8(3-4):229–256.
Yuk Wah Wong and Raymond J. Mooney. 2007. Learn-
ing synchronous grammars for semantic parsing with
lambda calculus. In Proceedings of the Annual Meet-
ing of the Association for Computational Linguistics,
volume 45, page 960.
Huijuan Xu and Kate Saenko.
2015. Ask, attend
and answer: Exploring question-guided spatial atten-
arXiv preprint
tion for visual question answering.
arXiv:1511.05234.
|
1802.09189 | 1 | 1802 | 2018-02-26T07:52:30 | Language Distribution Prediction based on Batch Markov Monte Carlo Simulation with Migration | [
"cs.CL"
] | Language spreading is a complex mechanism that involves issues like culture, economics, migration, population etc. In this paper, we propose a set of methods to model the dynamics of the spreading system. To model the randomness of language spreading, we propose the Batch Markov Monte Carlo Simulation with Migration(BMMCSM) algorithm, in which each agent is treated as a language stack. The agent learns languages and migrates based on the proposed Batch Markov Property according to the transition matrix T and migration matrix M. Since population plays a crucial role in language spreading, we also introduce the Mortality and Fertility Mechanism, which controls the birth and death of the simulated agents, into the BMMCSM algorithm. The simulation results of BMMCSM show that the numerical and geographic distribution of languages varies across the time. The change of distribution fits the world cultural and economic development trend. Next, when we construct Matrix T, there are some entries of T can be directly calculated from historical statistics while some entries of T is unknown. Thus, the key to the success of the BMMCSM lies in the accurate estimation of transition matrix T by estimating the unknown entries of T under the supervision of the known entries. To achieve this, we first construct a 20 by 20 by 5 factor tensor X to characterize each entry of T. Then we train a Random Forest Regressor on the known entries of T and use the trained regressor to predict the unknown entries. The reason why we choose Random Forest(RF) is that, compared to Single Decision Tree, it conquers the problem of over fitting and the Shapiro test also suggests that the residual of RF subjects to the Normal distribution. | cs.CL | cs | Language Distribution Prediction based on Batch
Markov Monte Carlo Simulation with Migration
XingYu Fu
ZiYi Yang
XiuWen Duan
Sun Yat_sen University
{fuxy28, yangzy7, duanxw3}@mail2.sysu.edu.cn
Abstract
Language spreading is a complex mechanism that involves issues like culture, economics,
migration, population etc. In this paper, we propose a set of methods to model the dynamics of
the spreading system. To model the randomness of language spreading, we propose the Batch
Markov Monte Carlo Simulation with Migration(BMMCSM) algorithm, in which each agent is
treated as a language stack. The agent learns languages and migrates based on the proposed
Batch Markov Property according to the transition matrix 𝑇 and migration matrix 𝑀. Since
population plays a crucial role in language spreading, we also introduce the Mortality and
Fertility Mechanism, which controls the birth and death of the simulated agents, into the
BMMCSM algorithm. The simulation results of BMMCSM show that the numerical and
geographic distribution of languages varies across the time. The change of distribution fits the
world's cultural and economic development trend. Next, when we construct Matrix 𝑇, there are
some entries of 𝑇 can be directly calculated from historical statistics while some entries of 𝑇 is
unknown. Thus, the key to the success of the BMMCSM lies in the accurate estimation of
transition matrix 𝑇 by estimating the unknown entries of 𝑇 under the supervision of the known
entries. To achieve this, we first construct a 20 × 20 × 5 factor tensor 𝑋⃑ to characterize each
entry of 𝑇. Then we train a Random Forest Regressor on the known entries of 𝑇 and use the
trained regressor to predict the unknown entries. The reason why we choose Random Forest (RF)
is that, compared to Single Decision Tree, it conquers the problem of over-fitting and the Shapiro
test also suggests that the residual of RF subjects to the Normal distribution.
Keywords: Language Spreading; Batch Markov Chain; Monte Carlo Simulation; Machine
Learning; Classification and Regression Tree; Random Forest;
The implementation of our work is available at:
https://github.com/fxy96/Batch-Markov-Monte-Carlo-for-Language-Distribution
1 Mechanisms for Learning Languages
Supposing there are 𝑁 languages 𝐿 = {𝑙1, 𝑙2, … , 𝑙𝑁} to be modelled, we treat 𝐿 as the states set
in the classical Stochastic Markov theory where each agent learns new language 𝑙𝑗 based on the
batch of languages he(her) has already mastered and the transition matrix 𝑇 = (𝑡𝑖𝑗)
of 𝐿, in
which:
𝑁×𝑁
𝑡𝑖𝑗 = 𝑃{𝑎𝑔𝑒𝑛𝑡 𝑤𝑖𝑙𝑙 𝑙𝑒𝑎𝑟𝑛 𝑙𝑗 𝑎𝑔𝑒𝑛𝑡 ℎ𝑎𝑠 𝑚𝑎𝑠𝑡𝑒𝑟𝑒𝑑 𝑙𝑖}.
The construction of transition matrix 𝑇 depends on a thorough research on a selection of
factors which determine the learning trend for different languages speakers. Some Regression
techniques are applied to make an accurate prediction of each 𝑡𝑖𝑗. We will cover the details of the
construction in section 4.
One thing to note is that, the Markov property in traditional Stochastic Markov theory [1]:
𝑃{𝑋𝑡+1 = 𝑖𝑋𝑡, 𝑋𝑡−1, … , 𝑋0} = 𝑃{𝑋𝑡+1 = 𝑖𝑋𝑡}
no longer holds in our case, and therefore we propose the Batch Markov Property(BMP) in
which the next language each agent is going to learn is dependent on the whole batch of
languages he(her) has already mastered. Figure1 illustrates the intuition of BMP:
Figure1: a batch of learned languages behaves as an integrated unit
To make the concept of BMP clear, imagine 𝐿 = {𝑙1, 𝑙2, 𝑙3} , e.g. {𝐾𝑜𝑟𝑒𝑎𝑛, 𝐸𝑛𝑔𝑙𝑖𝑠ℎ, 𝐺𝑒𝑟𝑚𝑎𝑛},
and there is a specific agent who has already mastered languages 𝑙1 and 𝑙3. We now calculate the
probability of the event that the agent masters 𝑙2 in the next round by assuming that the agent is
currently uniformly distributed among the batch {𝑙1, 𝑙3} , by total probability rule [2], that is:
𝑃{𝑎𝑔𝑒𝑛𝑡 𝑤𝑖𝑙𝑙 𝑙𝑒𝑎𝑟𝑛 𝑙2 𝑎𝑔𝑒𝑛𝑡 ℎ𝑎𝑠 𝑚𝑎𝑠𝑡𝑒𝑟𝑒𝑑 𝑙1 𝑎𝑛𝑑 𝑙3 } = (𝑡12 + 𝑡32) ∕ 2.
Another mechanism of interest in our work is the Language Stack Mechanism(LSM), where we
imagine each learning agent as an ever-updating stack which is pushed into a language at each
round while the layer is deleted from the top if it turns out to be the same language as another
already inserted layer. Figure2 shows an example of LSM:
2
Figure2: an agent can be deemed as an ever-updating stack
The 𝑛𝑡ℎ layer of the stack represents the 𝑛𝑡ℎ language of the agent from the bottom up (first
layer is native language) and the deleting mechanism guarantees that the agent can stop learning
new languages, which is quite common for most of us, and there are no repeated languages in the
language stack for each agent
2 Batch Markov Monte Carlo Simulation
To study the distribution of various language speaker over time, we propose the Batch Markov
Monte Carlo Simulation(BMMCS) algorithm to model the collective learning behaviors of a
sample of agents as time develops.
We run the algorithm multiple times (100 times, in our case) with rather large initial sample
number (1 million, in our case). By the Law of Large Numbers [2], we form a stable and
accurate statistical prediction of the future languages distribution.
In our Monte Carlo Simulation, we first sample an initial group of language learning agents
whose languages subject to the initial distribution of various languages. [18]
At each year, some of the sampled agents will learn new languages based on the BMP
mechanism that we have just discussed in section1 and some of the sampled agents will not learn
new languages, which is rather common since language learning process is painful for most of
us. By simulating like this, we can see the dynamics of how languages spread over a group of
people whose first and second languages are quite diverse.
One phenomenon we need to pay special attention to is that some languages that are not that
international are actually spoken by a large number of population, e.g. Chinese (Rank 1st in
native languages) and Hindi (Rank 3rd in native languages) [3]. The reason for this phenomenon
is obvious since it turns out China and India are the countries of most population on Earth [4]
and therefore such languages are spoken most. Figure3 visualize the distribution of world
population by country in 2017 [4]
3
Figure3: World Population Percentage by country
From above, we can see that the factors closely related to population distribution and
population distribution itself can influence the languages distribution profoundly. Hence, we
adopt two methods to take this into consideration. First, the initial sampling has already
contained the population information. Second, we implement the Mortality and Fertility
Mechanism (MFM) in the BMMCS algorithm to simulate the dynamics of population
distribution over time. The parameters involved in MFM is described below:
We download the database of the prediction of the population pattern of each country in the
coming 50 years which is modeled and predicted by the Department of Economic and Social
Affairs of the UN [19]. We take 5 years as a term (10 terms for 50 years) and summarize
countries' population of each term to get each term's language zone population distribution.
When running BMMCS, we update the population through the time to get a more practical
stimulation. Figure4 shows the pipeline of BMMCS algorithm:
Figure4: the pipeline of BMMCS
4
To summarize the discussion above, we write the algorithm here:
Algorithm1 (BMMCS):
# Establish the initial society
• Sample an initial group of language stacks (learning agents) according to the initial
distribution of various languages at the starting time.
for the length of time do
# BMP Learning
• Let each stack learns language based on the transition matrix 𝑇 and the BMP mechanism.
# MFM
• Delete a proportion of stacks based on the death rate 𝛼0 of different zones in that time.
• Add new stacks into the system whose native languages (first layer of stack) subject to
the birth rate 𝛼1 and population of different language regions in that time.
end for
3 Batch Markov Monte Carlo Simulation with Migration
In section 2, we proposed the so-called Batch Markov Monte Carlo Simulation algorithm
where each agent (language stack) is learning new languages as time develops and some of the
agent may pass away while some new agent may be born by the mortality and fertility
mechanism we proposed in BMMCS. To summarize, BMMCS takes the spread of languages and
the population changes into consideration.
However, BMMCS doesn't include the human migration, which is intuitively crucial for the
geographic distribution of languages, and therefore we add the migration mechanism in this
section. We name the final simulation strategy which consider human migration as Batch
Markov and Monte Carlo Simulation with Migration (BMMCSM).
In BMMCSM, we first construct the migration preference matrix 𝑀 = (𝑚𝑖𝑗)
, where:
𝑁×𝑁
𝑚𝑖𝑗 = 𝑃{ 𝑎𝑔𝑒𝑛𝑡 𝑤𝑖𝑙𝑙 𝑚𝑖𝑔𝑟𝑎𝑡𝑒 𝑡𝑜 𝑙𝑎𝑛𝑔𝑢𝑎𝑔𝑒 𝑧𝑜𝑛𝑒 𝑗 𝑎𝑔𝑒𝑛𝑡 𝑠𝑡𝑎𝑦 𝑖𝑛 𝑙𝑎𝑛𝑔𝑢𝑎𝑔𝑒 𝑧𝑜𝑛𝑒 𝑖}.
While, note that the migration pattern for each agent relies on not only the agent's current living
location but also has a strong connection to the mother land (i.e. the language zone of the native
language) of the agent. Thus, for an agent whose mother land is in language zone 𝑘 and currently
5
living in language zone 𝑖, we calculate the distribution of his(her) next living language zone as
following:
(𝑚𝑖 + 𝑚𝑘)/2.
, where 𝑚𝑖 denotes the 𝑖𝑡ℎ row of 𝑀. The intuition for the above equation is that the agent
uniformly distributes between his(her) birth place and currently living place by the total
probability rule [2].
To summarize the above discussion, we write the algorithm here:
Algorithm2 (BMMCSM):
# Establish the initial society
• Sample an initial group of language stacks (learning agents) according to the distribution
of various languages at the starting time. We assume the current location for each agent is
his(her) mother land.
for the length of time do
# BMP Learning
• Let each stack learn language based on the transition matrix 𝑇 and the BMP mechanism.
# Migration (Difference between BMMCS and BMMCSM)
• Each agent changes their current living location subjecting to (𝑚𝑚𝑜𝑡ℎ𝑒𝑟 + 𝑚𝑐𝑢𝑟𝑟𝑒𝑛𝑡)/2.
# MFM
• Delete a proportion of stacks based on the death rate 𝛼0 of the time.
• Add new stacks into the system whose native languages (first layer of stack) subject to
the birth rate 𝛼1 and population of different language regions of the time.
•
end for
After the simulation, we end up with a group of agents spread over each language zone and we
know exactly what languages are in the language stack for each agent. Hence, we can know the
languages distribution for each language zone after years' migration, languages spread, and
population change.
6
4 Estimation of transition matrix 𝑻
4.1 Sketch of Section 4
So far, we have shown how the BMMCS and BMMCSM algorithms work under the
assumption that the transition matrix 𝑇 = (𝑡𝑖𝑗)
the pipeline of building matrix 𝑇 specifically.
has been given. In this section, we will show
𝑁×𝑁
To recap, we write the definition of 𝑡𝑖𝑗 here again:
𝑡𝑖𝑗 = 𝑃{𝑎𝑔𝑒𝑛𝑡 𝑤𝑖𝑙𝑙 𝑙𝑒𝑎𝑟𝑛 𝑙𝑗 𝑎𝑔𝑒𝑛𝑡 ℎ𝑎𝑠 𝑚𝑎𝑠𝑡𝑒𝑟𝑒𝑑 𝑙𝑖}
For some 𝑡𝑖𝑗 ∈ 𝑇 , we can tell the value of it directly from historical statistical data, while for
some other 𝑡𝑖𝑗 ∈ 𝑇 , this value can't be known directly. Therefore, we result in a sparse matrix 𝑇
like this:
0.9
(
0.2
0.1
)
What remains to be solved is estimating the unknown 𝑡𝑖𝑗 from the known ones, which falls into
the classical supervised learning paradigm.
To implement regression, for each 𝑡𝑖𝑗 ∈ 𝑇, we look for factors that determine the willingness
(𝑛)) for 𝑡𝑖𝑗,
of language 𝑖 speakers to learn language 𝑗. Say we have 𝑛 factors (𝑥𝑖𝑗
then we want to find a decision function 𝑓: 𝑅𝑛 → 𝑅 such that:
(2), . . . , 𝑥𝑖𝑗
(1), 𝑥𝑖𝑗
𝑡𝑖𝑗 = 𝑓(𝑥𝑖𝑗
(1), 𝑥𝑖𝑗
(2), . . . , 𝑥𝑖𝑗
(𝑛)) + 𝜀𝑖𝑗 , ∀(𝑖, 𝑗) ∈ 𝐿 × 𝐿
where 𝜀𝑖𝑗 is a Normal(Gaussian) random noise:
𝜀𝑖𝑗~𝑁(0, 𝜎2)
In our work, we compare two models to approximate decision function 𝑓, i.e. Classification
And Regression Tree(CART) [5] and Random Forest(RF) [6], which turns out that CART results
in serious over-fitting problem while RF can elegantly overcome it by its Random Sampling,
Random Split and Ensemble Mechanism [6]. The comparison will be discussed in detail in
section 1.4.4. Figure5 visualize the pipeline of Random Forest learning algorithm [7]:
7
Figure5: Random Forest
We train our model on the set of known 𝑡𝑖𝑗(training dataset), and then predict the unknown 𝑡𝑖𝑗
by the already well-trained model. The construction of matrix 𝑇 is completed here.
The key to the success of our estimation lies in the choice of factors which will be explained in
detail in next sub-section.
4.2 Construction of Factors
There are many aspects of factors influence the willingness of language 𝑖 speakers to learn
language 𝑗. To well estimate the unknown 𝑡𝑖𝑗, we now introduce the factors that we choose in
this work. It is also natural to add more factors into the framework which can be studied as future
research.
Set Up: Classification of Language Zone and Data Pre-Preparation
We studied 26 most used languages and clustered them into 20 language zones. Here, we give
each language zone an index, that is:
𝐿 = {𝑙0, 𝑙1, . . . , 𝑙19}
All data analyzed in our model is collected in terms of language zones.
Among the 26 languages, Mandarin Chinese, Wu Chinese and Yue Chinese are putted together
as Language zone Chinese while Telugu, Tamil, Marathi and Punjabi are considered as sub
branch of Hindi/Urdu Language family. The reason behind this clustering is that these languages
are most spread and spoken in a relatively close geographical area and the developments of these
languages are mostly influenced by the characteristics of the same countries and districts.
To construct the factors and transition matrix 𝑇, we collect data of different countries
concerned their official language, economic status and culture influence. Then, we match the
countries with their corresponding language zones and further processed the data to calculate our
factors and then use the factors to estimate the transition matrix 𝑇.
8
As for the countries we chosen, we consider the top 30 most populous countries and the top 30
countries with strongest culture soft power, since they are the most influential countries in the
language zones. The figure below shows the countries that we study for each language zone:
Figure6: 35 countries are selected and assigned to 20 language zones.
Factor1: Language similarity
Firstly, based on the Ethnology theory, Language Similarity is an important motivation for
people to acquire a new language, especially when the new language that the people try to learn
shares similar analogical syntax or grammar system with the language they have already
mastered [11]. For example, it is a common phenomenon in Europe that a person who takes
German as his native language prefer to learn Dutch than other people due to the similarity of
these two languages. We Thus, we introduce the factor 𝑆𝑖𝑚𝑖 (𝑖, 𝑗) to quantify any two
languages' similarity in the field of Ethnology Language family.
According to the data in appendix, most languages in our 20 language zones belong to 8
language families, excluding Japanese and Korean. (Japanese and Korean are two relatively
independent languages. [12]) Then, in our paper, we use the method of Hot-Encoding by
assigning each language zone a vector with 8 dimensions representing 8 language families. For
each language zone 𝑖 's language family vector, we assign 1 to the language families it belongs to
and 0 to other dimensions. While for Japanese and Korean, we assign their vectors with 0⃗ =
(0,0,0,0,0,0,0,0) .
Given any two languages 𝑖, 𝑗 ∈ 𝐿 , their similarity can be calculated by inner product, that is:
𝑆𝑖𝑚𝑖 (𝑖, 𝑗) = 𝑖 𝑗
where 𝑖 and 𝑗 represent the language family vectors for language 𝑖 and 𝑗 respectively.
If 𝑆𝑖𝑚𝑖 (𝑖, 𝑗) = 1, we say these two languages share similarity, otherwise we say the two have
no similarity.
9
Factor2: Foreign Direct Investment Net Outflows(FDINO)
The openness of countries can influence the popularities of their languages. We use the amount
of one zone's Foreign Direct Investment Net Outflows(FDINO) to quantify the openness. From
the FDINO, we can see the government's willingness to communication with other regions, so
we can call it the extroversion of one language zone. The data we use is from the World Bank
[13] [14], while the data were distinguished by countries. Thus, we use the above formulas to get
the data we want (i.e. distinguished by language zones), that is:
𝑒𝑥𝑡𝑟𝑜(𝑖) = ∑ 𝑒𝑥𝑝𝑜𝑟𝑡(𝑎) ∙ 𝑤𝑒𝑖𝑔ℎ𝑡(𝑎)
, 𝑖 ∈ 𝐿
𝑎∈𝑖
𝑤𝑒𝑖𝑔ℎ𝑡(𝑎) =
𝐺𝐷𝑃 𝑜𝑓 𝑐𝑜𝑢𝑛𝑡𝑟𝑦 𝑎
𝐺𝐷𝑃 𝑜𝑓 𝑙𝑎𝑛𝑔𝑢𝑎𝑔𝑒 𝑧𝑜𝑛𝑒 𝑖
(𝐺𝐷𝑃 𝑜𝑓 𝑙𝑎𝑛𝑔𝑢𝑎𝑔𝑒 𝑧𝑜𝑛𝑒 𝑖 = ∑ 𝐺𝐷𝑃 𝑜𝑓 𝑐𝑜𝑢𝑛𝑡𝑟𝑦 𝑘
)
𝑘∈𝑖
Further, for any 𝑖, 𝑗 ∈ 𝐿 , we assume that 𝑒𝑥𝑡𝑟𝑜(𝑖, 𝑗) = 𝑒𝑥𝑡𝑟𝑜(𝑗), which makes sense since the
willingness of learning language 𝑗 is mostly dependent on the situation of 𝑗, rather than 𝑖.
Factor3: Economic Interaction between Language Zones
As global communication increases, there emerges international business and global tourism,
which can impose influence on the spread of languages. We need to consider the interaction
between language zones as a factor, to illustrate, if one zone intends to do business with another
zone, then the people from the former zone have more motivation to learn the latter zone's
language, which is necessary for the buyer and the seller to communicate.
Therefore, we use the Export Percentage from one zone to another zone measure the
importance the former imposes on the latter, defined as 𝑒𝑥𝑝𝑜𝑟𝑡(𝑖, 𝑗), 𝑖, 𝑗 ∈ 𝐿. If this factor is
high, means that region 𝑖 has a large amount of export towards region 𝑗, then region 𝑗 seems
more connected to region 𝑖, and therefore there is a tendency for people in region 𝑖 to learn the
language in region 𝑗.
The data we use to calculate 𝑒𝑥𝑝𝑜𝑟𝑡(𝑖, 𝑗) is from a famous official business website in China
[15], and this dataset were based on Department of Statistics of each country. However, we can
only obtain data between countries, so we need to convert it into data between language zones.
Therefore, we calculate as follow:
𝑒𝑥𝑝𝑜𝑟𝑡(𝑖, 𝑗) = ∑ ∑ 𝑒𝑥𝑝𝑜𝑟𝑡 (𝑎, 𝑏)
∙ 𝑤𝑒𝑖𝑔ℎ𝑡(𝑎)
𝑎∈𝑖
𝑏∈𝑗
𝑤𝑒𝑖𝑔ℎ𝑡(𝑎) =
𝐺𝐷𝑃 𝑜𝑓 𝑐𝑜𝑢𝑛𝑡𝑟𝑦 𝑎
𝐺𝐷𝑃 𝑜𝑓 𝑙𝑎𝑛𝑔𝑢𝑎𝑔𝑒 𝑧𝑜𝑛𝑒 𝑖
10
Figure7 illustrates the intuition of this calculation:
Figure7: the circles with the same color represent countries in the same language zone and the
Economic Interaction between two language zones are calculated by summing up the exports
between all possible pairs
Factor4: Culture Soft Power
Culture soft power is also a key factor we considered in our model. Language of high culture
export countries enjoys higher language exposure rate. For these languages, foreigners can get
access to them easily through culture products like music, TV drama, movies and so on. Even
some pop culture may cause a hit to learn certain language. For example, many teenagers all over
the world have been attracted by Korean pop culture or Japanese anime to learn these countries'
languages. A rank with score officially provided by USC Center on Public Diplomacy [16]
shows us each country's soft power. Summarize the scores so that we get the assessment of
language zones' soft power (𝑠𝑜𝑓𝑡𝑝𝑜𝑤𝑒𝑟(𝑖), 𝑖 ∈ 𝐿 ). Here we assume that countries inside each
language zone contribute to the spread of its language independently and additively.
Since each zone's culture exports to countries all over the world, regardless of the speakers'
original zones, we therefore assume that 𝑠𝑜𝑓𝑡(𝑖, 𝑗) is independent of 𝑖, that is:
𝑠𝑜𝑓𝑡(𝑖, 𝑗) = 𝑠𝑜𝑓𝑡𝑝𝑜𝑤𝑒𝑟(𝑗), 𝑓𝑜𝑟 ∀𝑖, 𝑗 ∈ 𝐿
Factor 5: Migration Preference
The immigration and emigration patterns are good tools for us to predict the future distribution
of language. In our predictive model, we introduce Migration Preference which represents the
probability that people immigrate into another language zone from one language zone. Migration
Preference is derived from the 2017 the UN workbook of Migrant Stock by Origin and
Destination [17]. We summarize corresponding countries' data and know how many people
migrate from language zone 𝑖 and finally settle in language zone 𝑗, which we denote as 𝑒𝑖𝑗.
Then, we calculate each entry 𝑚𝑖𝑗 of Migration Matrix 𝑀 ,which represents the probability
people immigrate into language zone 𝑗 from language zone 𝑖 , by the following formula:
𝑚𝑖𝑗 =
𝑒𝑖𝑗
∑
𝑘∈𝐿
𝑒𝑖𝑘
, 𝑖, 𝑗 ∈ 𝐿
We not only consider 𝑚𝑖𝑗 as factor for predicting 𝑡𝑖𝑗, but also use it to simulate the population
migration in BMMCSM.
11
4.3 Estimation of 𝑻
For each pair (𝑖, 𝑗) ∈ 𝐿 × 𝐿, we construct the corresponding factor vector as we discussed in
section 4.2 :
𝑋⃑𝑖𝑗 = (𝑥𝑖𝑗
(5))
(1), 𝑥𝑖𝑗
(2), . . . , 𝑥𝑖𝑗
and therefore, we end up with a 20 × 20 × 5 factor tensor 𝑋⃑. Figure8 visualizes the structure of
𝑋⃑:
Figure8: Factor Tensor 𝑋⃑
To calculate all the entries in 𝑇, we first calculate the 𝑡𝑖𝑗 ∈ 𝑇 that can be directly known from
historical statistics, which end up with a sparse estimation of the transition matrix 𝑇, i.e. many of
the entries in 𝑇 are empty. The work we left now is to make an inference for the empty entries in
𝑇, which can't be directly estimated, based on the known (𝑋⃑𝑖𝑗, 𝑡𝑖𝑗), i.e. the supervised learning
paradigm. Formally, we define the training dataset and predicting dataset as follow:
𝑋⃑𝑡𝑟𝑎𝑖𝑛 = { (𝑋⃑𝑖𝑗, 𝑡𝑖𝑗) 𝑡𝑖𝑗 𝑖𝑠 𝑑𝑖𝑟𝑒𝑐𝑡𝑙𝑦 𝑒𝑠𝑡𝑖𝑚𝑎𝑡𝑒𝑑 𝑓𝑟𝑜𝑚 ℎ𝑖𝑠𝑡𝑜𝑟𝑖𝑐𝑎𝑙 𝑑𝑎𝑡𝑎}
𝑋⃑𝑝𝑟𝑒𝑑𝑖𝑐𝑡 = { 𝑋⃑𝑖𝑗 𝑡𝑖𝑗 𝑖𝑠 𝑒𝑚𝑝𝑡𝑦 }.
We train our models (CART and RF) on the training dataset 𝑋⃑𝑡𝑟𝑎𝑖𝑛 to approximate the decision
function 𝑓, which end up with two regressors: 𝑓𝐶𝐴𝑅𝑇 and 𝑓𝑅𝐹. Then we apply the two regressors
to 𝑋⃑𝑝𝑟𝑒𝑑𝑖𝑐𝑡 and completes the inference of transition matrix 𝑇. Figure9 shows our estimated 𝑇
predicted by Random Forest (with 100 trees and maximal depth of 4 to avoid over-fitting):
12
Figure9: 𝑇 predicted by Random Forest
In our work, we use scikit-learn [10], a popular open sourced implementation of many machine
learning algorithms in Python programming language community, to apply RF and CART
efficiently.
4.4 Result Analysis
We calculate the residual for both 𝑓𝐶𝐴𝑅𝑇 and 𝑓𝑅𝐹 on the training dataset respectively by:
⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ = { 𝜀𝑖𝑗 = (𝑡𝑖𝑗 − 𝑓(𝑋⃑𝑖𝑗) ) (𝑋⃑𝑖𝑗, 𝜀𝑖𝑗) ∈ 𝑋⃑𝑡𝑟𝑎𝑖𝑛}.
𝑅𝑒𝑠𝑖𝑑𝑢𝑎𝑙
Now we analyze the following two questions: 1) Can we estimate the generalization abilities for
the two models? 2) Does the residual subjects to the normal distribution? The former question
handles the tradeoff between bias and variance [8], which is a tricky problem in the Machine
Learning research community. The latter one is an examination of our statistical assumption that:
𝑡𝑖𝑗 = 𝑓(𝑥𝑖𝑗
(𝑛)) + 𝜀𝑖𝑗 , ∀(𝑖, 𝑗) ∈ 𝐿 × 𝐿
(1), 𝑥𝑖𝑗
(2), . . . , 𝑥𝑖𝑗
13
where:
⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗
We draw the histograms of 𝑅𝑒𝑠𝑖𝑑𝑢𝑎𝑙
⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗
𝑅𝐹 and 𝑅𝑒𝑠𝑖𝑑𝑢𝑎𝑙
𝐶𝐴𝑅𝑇 below:
𝜀𝑖𝑗~𝑁(0, 𝜎2)
Figure10: Histograms of residuals for RF and CART
We can directly see from the above figure that the residuals for RF roughly subject to the normal
distribution while the residuals for CART are almost 0, which means that CART over-fits the
dataset and loses the ability of generalization. The RF conquers the problem of over-fitting by its
clever designs of Random mechanism and Ensemble mechanism.
⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗
To further exam the normality of 𝑅𝑒𝑠𝑖𝑑𝑢𝑎𝑙
residual vector of RF and the 𝑝 − 𝑣𝑎𝑙𝑢𝑒 turns out to be 0.23942, which is above the significance
⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗
level 5%. Thus, we accept hypothesis 𝐻0 that 𝑅𝑒𝑠𝑖𝑑𝑢𝑎𝑙
the validity of our model.
𝑅𝐹, we apply the Shapiro-Wilk test [9] to the
𝑅𝐹 is normally distributed, which exams
Simulation Results
5
Section 1 to Section 4 describe specifically our methodology for modelling the distribution of
various languages over time dimension and over geography dimension. To summarize, we use
Random Forest Machine Learning technique to estimate the parameters (transition matrix 𝑇)
involved in our system, and then run the proposed Batch Markov Monte Carlo Simulation with
Migration(BMMCSM) algorithm to simulate the dynamics of language as time develops.
Our simulation result shows that the numerical and geographical distribution of different
languages will change in an insightful way in the future, which will be demonstrated in the
following sub-sections.
5.1 Numerical Distribution
In the next fifty years, the distribution of different language speakers will change notably in
several aspects including the total speakers number, first language speakers number and second
14
language speakers number based on our numerical simulation. Figure11 shows the future change
of distribution of total language speakers (including first, second, and third speakers etc.).
(For Figure 11,13, and 14. From left to right are: Chinese, English, Hindi, Spanish, Arabic,
Malay, Russian, Bengali, Portuguese, French, Hausa, Japanese, German, Persian, Swahili,
Javanese, Korean, Turkish, Vietnamese, Italian)
Figure11: Change of total language speakers in the next fifty years
Figure12: Change of Language Ranking
15
As for total speaker numbers, Figure 11 and Figure 12 clearly shows the Language Ranking
change in the next 50 years. Compared with initial top 10 most used language, the rank changes
while the components stay relative stable. English becomes the most common used language in
the word which may reveal the further progress of globalization with aspects of electronic
communication and social media. The rank change of Chinese and Hindi are mainly due to the
population pattern. Moreover, German takes place of Russian to be one of the top 10. It may be
explained that Germany may embrace high- speed development period after the Brexit.
Figure13: Change of first language speakers in the next fifty years
As for first language speaker, Hindi ranks the first while Chinese drops to the second place. It
meets the future population trend. According to the world population pattern, China will reach its
population peak in next 10 years and then decline. Meanwhile, India will exceed China with a
continuously population growth.
Figure14: Change of second language speakers in the next fifty years
As for second language, English remains to be the most popular choice since English is
regarded as an official language in transnational communication. The rise of other language
second speakers also indicates that much more people would like to acquire a second language
and their choices are diversified.
16
5.2 Geographic Distribution
With the help of Batch Markov Monte Carlo Simulation with Migration algorithm, we can
further study the geographic distribution of languages when take human migration into
consideration.
Figure15: Change of geographic language distribution
The two figures above demonstrate the geographic distribution of languages before or after the
migration. The value in the 𝑖𝑡ℎ row and 𝑗𝑡ℎ column of the matrix means the percentage of 𝑗
language speakers of total speakers living in language zone 𝑖. The color intensity of the 𝑖𝑡ℎ row
and 𝑗𝑡ℎ column of the matrix shows the percent of how many people in this area (language zone
𝑖) can speak language 𝑗 . So, as we can see from the left part of figure15, for any 𝑗, the speaker of
𝑗 centralizes on the diagonal line of the matrix, i.e. language zone 𝑗. But in the right part of
figure15, we can see the distribution becomes sparse, which implies the migration of people
advances the cultural collision and spread their native languages. To be specific, as there is a lot
of people flooded into the English language zone, this district reveals high language diversity.
Languages in Europe tend to assimilate each other and enlarge the speakers of each language.
Some languages spread to different countries of the world while they might be spoken only
within a small region previously.
17
Reference
[1] Sheldon M. Ross. Stochastic Process (Second Edition).
[2] Dimitri P. Bertsekas, John N. Tsitsiklis. Introduction to Probability (Second Edition).
[3] https://en.wikipedia.org/wiki/List_of_languages_by_total_number_of_speakers
[4] https://en.wikipedia.org/wiki/World_population
[5] Breiman, Leo, Friedman, J. H., Olshen, R. A. Stone, C. J. (1984). Classification and
regression trees. Monterey, CA: Wadsworth & Brooks/Cole Advanced Books & Software.
[6] Ho, Tin Kam (1995). Random Decision Forests (PDF). Proceedings of the 3rd International
Conference on Document Analysis and Recognition, Montreal, QC, 14–16 August 1995.
pp. 278–282.
[7] https://mapr.com/blog/predicting-loan-credit-risk-using-apache-spark-machine-learning-
random-forests/
[8] Trevor Hastie, Robert Tibshirani. The Elements of Statistical Learning (Second Edition).
[9] Michael H. Kutner, John Neter. Applied Linear Statistical Model (Fifth Edition).
[10] http://scikit-learn.org/stable/
[11] Carla. Contemori, Giuli. Dussias (2006), Referential choice in a second language, Second
Language Research, 22(3):339-368.
[12] https://en.wikipedia.org/wiki/Comparison_of_Japanese_and_Korean
[13] https://data.worldbank.org.cn/indicator/BM.KLT.DINV.WD.GD.ZS
[14] https://data.worldbank.org.cn/indicator/NY.GDP.MKTP.CD
[15] http://s.askci.com/
[16] https://softpower30.com
[17] http://www.un.org/en/development/desa/population/migration/data/estimates2/estimates17
[18] https://en.m.wikipedia.org/wiki/List_of_languages_by_total_number_of_speakers
[19] https://ourworldindata.org/world-population-growth
18
19
s
r
a
e
y
0
5
t
x
e
n
n
i
d
n
e
r
t
n
o
i
t
a
u
p
o
P
l
:
1
x
i
d
n
e
p
p
A
k
c
o
t
s
t
n
a
r
g
m
m
i
I
:
2
x
i
d
n
e
p
p
A
2
L
d
n
a
1
L
f
o
n
o
i
t
u
b
i
r
t
s
i
D
l
a
n
g
i
r
i
O
:
4
x
i
d
n
e
p
p
A
r
e
w
o
p
t
f
o
S
:
3
x
i
d
n
e
p
p
A
n
o
i
t
a
c
i
f
i
s
s
a
c
y
l
l
i
m
a
f
e
g
a
u
g
n
a
L
:
5
x
i
d
n
e
p
p
A
s
e
n
o
z
e
g
a
u
g
n
a
l
n
e
e
w
t
e
b
t
r
o
p
x
E
:
6
x
i
d
n
e
p
p
A
t
n
e
m
t
s
e
v
n
I
t
c
e
r
i
i
D
n
g
e
r
o
F
:
7
x
i
d
n
e
p
p
A
|
1805.06201 | 1 | 1805 | 2018-05-16T09:10:21 | Contextual Augmentation: Data Augmentation by Words with Paradigmatic Relations | [
"cs.CL",
"cs.LG"
] | We propose a novel data augmentation for labeled sentences called contextual augmentation. We assume an invariance that sentences are natural even if the words in the sentences are replaced with other words with paradigmatic relations. We stochastically replace words with other words that are predicted by a bi-directional language model at the word positions. Words predicted according to a context are numerous but appropriate for the augmentation of the original words. Furthermore, we retrofit a language model with a label-conditional architecture, which allows the model to augment sentences without breaking the label-compatibility. Through the experiments for six various different text classification tasks, we demonstrate that the proposed method improves classifiers based on the convolutional or recurrent neural networks. | cs.CL | cs | Data Augmentation by Words with Paradigmatic Relations
Contextual Augmentation:
Sosuke Kobayashi
Preferred Networks, Inc.
[email protected]
8
1
0
2
y
a
M
6
1
]
L
C
.
s
c
[
1
v
1
0
2
6
0
.
5
0
8
1
:
v
i
X
r
a
Abstract
We propose a novel data augmentation for
labeled sentences called contextual augmen-
tation. We assume an invariance that sen-
tences are natural even if the words in the
sentences are replaced with other words with
paradigmatic relations. We stochastically re-
place words with other words that are pre-
dicted by a bi-directional language model at
the word positions. Words predicted accord-
ing to a context are numerous but appropri-
ate for the augmentation of the original words.
Furthermore, we retrofit a language model
with a label-conditional architecture, which al-
lows the model to augment sentences without
breaking the label-compatibility. Through the
experiments for six various different text clas-
sification tasks, we demonstrate that the pro-
posed method improves classifiers based on
the convolutional or recurrent neural networks.
1
Introduction
Neural network-based models for NLP have been
growing with state-of-the-art results in various
tasks, e.g., dependency parsing (Dyer et al., 2015),
text classification (Socher et al., 2013; Kim, 2014),
machine translation (Sutskever et al., 2014). How-
ever, machine learning models often overfit the
training data by losing their generalization. Gener-
alization performance highly depends on the size
and quality of the training data and regulariza-
tions. Preparing a large annotated dataset is very
time-consuming. Instead, automatic data augmen-
tation is popular, particularly in the areas of vi-
sion (Simard et al., 1998; Krizhevsky et al., 2012;
Szegedy et al., 2015) and speech (Jaitly and Hin-
ton, 2015; Ko et al., 2015). Data augmentation is
basically performed based on human knowledge
on invariances, rules, or heuristics, e.g., "even if a
picture is flipped, the class of an object should be
unchanged".
Figure 1:
Contextual augmentation with a bi-
directional RNN language model, when a sentence
"the actors are fantastic" is augmented by replacing
only actors with words predicted based on the context.
However, usage of data augmentation for NLP
has been limited. In natural languages, it is very
difficult to obtain universal rules for transforma-
tions which assure the quality of the produced data
and are easy to apply automatically in various do-
mains. A common approach for such a transfor-
mation is to replace words with their synonyms se-
lected from a handcrafted ontology such as Word-
Net (Miller, 1995; Zhang et al., 2015) or word sim-
ilarity calculation (Wang and Yang, 2015). Be-
cause words having exactly or nearly the same
meanings are very few, synonym-based augmen-
tation can be applied to only a small percentage
of the vocabulary. Other augmentation methods
are known but are often developed for specific do-
mains with handcrafted rules or pipelines, with the
loss of generality.
In this paper, we propose a novel data aug-
arethefantasticactorspositiveperformancesfilmsmoviesstories…the performances are fantasticthe films are fantasticthe movies are fantasticthe stories are fantastic…positivethe actors are fantasticpositivementation method called contextual augmenta-
tion. Our method offers a wider range of sub-
stitute words by using words predicted by a bi-
directional language model (LM) according to the
context, as shown in Figure 1. This contextual pre-
diction suggests various words that have paradig-
matic relations (Saussure and Riedlinger, 1916)
with the original words. Such words can also be
good substitutes for augmentation. Furthermore,
to prevent word replacement that is incompatible
with the annotated labels of the original sentences,
we retrofit the LM with a label-conditional archi-
tecture. Through the experiment, we demonstrate
that the proposed conditional LM produces good
words for augmentation, and contextual augmen-
tation improves classifiers using recurrent or con-
volutional neural networks (RNN or CNN) in var-
ious classification tasks.
2 Proposed Method
For performing data augmentation by replac-
ing words in a text with other words, prior
works (Zhang et al., 2015; Wang and Yang, 2015)
used synonyms as substitute words for the origi-
nal words. However, synonyms are very limited
and the synonym-based augmentation cannot pro-
duce numerous different patterns from the origi-
nal texts. We propose contextual augmentation, a
novel method to augment words with more varied
words. Instead of the synonyms, we use words that
are predicted by a LM given the context surround-
ing the original words to be augmented, as shown
in Figure 1.
2.1 Motivation
First, we explain the motivation of our pro-
posed method by referring to an example with a
sentence from the Stanford Sentiment Treebank
(SST) (Socher et al., 2013), which is a dataset of
sentiment-labeled movie reviews. The sentence,
"the actors are fantastic.", is annotated with a pos-
itive label. When augmentation is performed for
the word (position) "actors", how widely can we
augment it? According to the prior works, we can
use words from a synset for the word actor ob-
tained from WordNet (histrion, player, thespian,
and role player). The synset contains words that
have meanings similar to the word actor on aver-
age.1 However, for data augmentation, the word
1 Actually, the word actor has another synset containing
other words such as doer and worker. Thus, this synonym-
actors can be further replaced with non-synonym
words such as characters, movies, stories, and
songs or various other nouns, while retaining the
positive sentiment and naturalness. Considering
the generalization, training with maximum pat-
terns will boost the model performance more.
We propose using numerous words that have the
paradigmatic relations with the original words. A
LM has the desirable property to assign high prob-
abilities to such words, even if the words them-
selves are not similar to the original word to be
replaced.
2.2 Word Prediction based on Context
For our proposed method, we requires a LM for
calculating the word probability at a position i
based on its context. The context is a sequence of
words surrounding an original word wi in a sen-
tence S, i.e., cloze sentence S\{wi}. The calcu-
lated probability is p(·S\{wi}). Specifically, we
use a bi-directional LSTM-RNN (Hochreiter and
Schmidhuber, 1997) LM. For prediction at posi-
tion i, the model encodes the surrounding words
individually rightward and leftward (see Figure 1).
As well as typical uni-directional RNN LMs, the
outputs from adjacent positions are used for cal-
culating the probability at target position i. The
outputs from both the directions are concatenated
and fed into the following feed-forward neural net-
work, which produces words with a probability
distribution over the vocabulary.
In contextual augmentation, new substitutes for
word wi can be smoothly sampled from a given
probability distribution, p(·S\{wi}), while prior
works selected top-K words conclusively. In this
study, we sample words for augmentation at each
update during the training of a model. To control
the strength of augmentation, we introduce tem-
perature parameter τ and use an annealed distri-
bution pτ (·S\{wi}) ∝ p(·S\{wi})1/τ .
If the
temperature becomes infinity (τ → ∞), the words
are sampled from a uniform distribution. 2
If it
becomes zero (τ → 0), the augmentation words
are always words predicted with the highest prob-
ability. The sampled words can be obtained at one
time at each word position in the sentences. We re-
place each word simultaneously with a probability
based approach further requires word sense disambiguation
or some rules for selecting ideal synsets.
2 Bengio et al. (2015) reported that stochastic replace-
ments with uniformly sampled words improved a neural
encoder-decoder model for image captioning.
as well as Wang and Yang (2015) for efficiency.
2.3 Conditional Constraint
Finally, we introduce a novel approach to address
the issue that context-aware augmentation is not
always compatible with annotated labels. For un-
derstanding the issue, again, consider the exam-
ple, "the actors are fantastic.", which is annotated
with a positive label. If contextual augmentation,
as described so far, is simply performed for the
word (position of) fantastic, a LM often assigns
high probabilities to words such as bad or terrible
as well as good or entertaining, although they are
mutually contradictory to the annotated labels of
positive or negative. Thus, such a simple augmen-
tation can possibly generate sentences that are im-
plausible with respect to their original labels and
harmful for model training.
To address this issue, we introduce a condi-
tional constraint that controls the replacement of
words to prevent the generated words from revers-
ing the information related to the labels of the sen-
tences. We alter a LM to a label-conditional LM,
i.e., for position i in sentence S with label y, we
aim to calculate pτ (·y, S\{wi}) instead of the de-
fault pτ (·S\{wi}) within the model. Specifically,
we concatenate each embedded label y with a hid-
den layer of the feed-forward network in the bi-
directional LM, so that the output is calculated
from a mixture of information from both the label
and context.
3 Experiment
3.1 Settings
We tested combinations of three augmentation
methods for two types of neural models through
six text classification tasks. The corresponding
code is implemented by Chainer (Tokui et al.,
2015) and available 3.
The benchmark datasets used are as follows:
(1, 2) SST is a dataset for sentiment classifica-
tion on movie reviews, which were annotated with
five or two labels (SST5, SST2) (Socher et al.,
2013). (3) Subjectivity dataset (Subj) was anno-
tated with whether a sentence was subjective or
objective (Pang and Lee, 2004). (4) MPQA is an
opinion polarity detection dataset of short phrases
rather than sentences (Wiebe et al., 2005). (5) RT
is another movie review sentiment dataset (Pang
3https://github.com/pfnet-research/
contextual_augmentation
and Lee, 2005). (6) TREC is a dataset for clas-
sification of the six question types (e.g., person,
location) (Li and Roth, 2002). For a dataset with-
out development data, we use 10% of its training
set for the validation set as well as Kim (2014).
We tested classifiers using the LSTM-RNN or
CNN, and both have exhibited good performances.
We used typical architectures of classifiers based
on the LSTM or CNN with dropout (Hinton et al.,
2012) using hyperparameters found in preliminary
experiments. 4 The reported accuracies of the
models were averaged over eight models trained
from different seeds.
The tested augmentation methods are:
(1)
synonym-based augmentation, and (2, 3) con-
textual augmentation with or without a label-
conditional architecture. The hyperparameters of
the augmentation (temperature τ and probability
of word replacement) were also selected by a grid-
search using validation set, while retaining the
hyperparameters of the models. For contextual
augmentation, we first pretrained a bi-directional
LSTM LM without the label-conditional architec-
ture, on WikiText-103 corpus (Merity et al., 2017)
from a subset of English Wikipedia articles. After
the pretraining, the models are further trained on
each labeled dataset with newly introduced label-
conditional architectures.
3.2 Results
Table 1 lists the accuracies of the models with or
without augmentation. The results show that our
contextual augmentation improves the model per-
formances for various datasets from different do-
mains more significantly than the prior synonym-
based augmentation does. Furthermore, our label-
conditional architecture boosted the performances
on average and achieved the best accuracies. Our
methods are effective even for datasets with more
4 An RNN-based classifier has a single layer LSTM and
word embeddings, whose output is fed into an output affine
layer with the softmax function. A CNN-based classifier
has convolutional filters of size {3, 4, 5} and word embed-
dings (Kim, 2014). The concatenated output of all the fil-
ters are applied with a max-pooling over time and fed into
a two-layer feed-forward network with ReLU, followed by
the softmax function. For both the architectures, training was
performed by Adam (Kingma and Ba, 2015) and finished by
early stopping with validation at each epoch.
The hyperparameters of the models and training were se-
lected by a grid-search using baseline models without data
augmentation in each task's validation set individually. We
used the best settings from the combinations by changing the
learning rate, unit or filter size, embedding dimension, and
dropout ratio.
STT5 STT2 Subj MPQA RT TREC Avg.
Models
41.3 79.5 92.4
86.1 75.9 90.0 77.53
CNN
86.3 76.0 89.6 77.50
w/ synonym 40.7 80.0 92.4
w/ context
86.7 75.9 90.0 78.02
41.9 80.9 92.7
86.7 76.1 90.5 78.20
42.1 80.8 93.0
+ label
86.0 76.7 89.0 77.43
RNN
40.2 80.3 92.4
w/ synonym 40.5 80.2 92.8
86.4 76.6 87.9 77.40
86.4 77.0 89.3 77.62
40.9 79.3 92.8
w/ context
86.4 77.4 89.2 77.83
+ label
41.1 80.1 92.8
Table 1: Accuracies of the models for various bench-
marks. The accuracies are averaged over eight models
trained from different seeds.
than two types of labels, SST5 and TREC.
For
investigating our
label-conditional bi-
directional LM, we show in Figure 2 the top-10
word predictions by the model for a sentence from
the SST dataset. Each word in the sentence is fre-
quently replaced with various words that are not
always synonyms. We present two types of pre-
dictions depending on the label fed into the con-
ditional LM. With a positive label, the word "fan-
tastic" is frequently replaced with funny, honest,
good, and entertaining, which are also positive ex-
pressions. In contrast, with a negative label, the
word "fantastic" is frequently replaced with tired,
forgettable, bad, and dull, which reflect a negative
sentiment. At another position, the word "the" can
be replaced with "no" (with the seventh highest
probability), so that the whole sentence becomes
"no actors are fantastic.", which seems negative as
a whole. Aside from such inversions caused by
labels, the parts unrelated to the labels (e.g., "ac-
tors") are not very different in the positive or neg-
ative predictions. These results also demonstrated
that conditional architectures are effective.
4 Related Work
Some works tried text data augmentation by us-
ing synonym lists (Zhang et al., 2015; Wang and
Yang, 2015), grammar induction (Jia and Liang,
task-specific heuristic rules (Furstenau
2016),
and Lapata, 2009; Kafle et al., 2017; Silfver-
berg et al., 2017), or neural decoders of au-
toencoders (Bergmanis et al., 2017; Xu et al.,
2017; Hu et al., 2017) or encoder-decoder mod-
els (Kim and Rush, 2016; Sennrich et al., 2016;
Xia et al., 2017). The works most similar to our
research are Kolomiyets et al. (2011) and Fadaee
et al. (2017). In a task of time expression recog-
nition, Kolomiyets et al. replaced only the head-
words under a task-specific assumption that tem-
poral trigger words usually occur as headwords.
Figure 2: Words predicted with the ten highest prob-
abilities by the conditional bi-directional LM applied
to the sentence "the actors are fantastic". The squares
above the sentence list the words predicted with a pos-
itive label. The squares below list the words predicted
with a negative label.
They selected substitute words with top-K scores
given by the Latent Words LM (Deschacht and
Moens, 2009), which is a LM based on fixed-
length contexts. Fadaee et al. (2017), focusing
on the rare word problem in machine transla-
tion, replaced words in a source sentence with
only rare words, which both of rightward and left-
ward LSTM LMs independently predict with top-
K confidences. A word in the translated sentence
is also replaced using a word alignment method
and a rightward LM. These two works share the
idea of the usage of language models with our
method. We used a bi-directional LSTM LM
which captures variable-length contexts with con-
sidering both the directions jointly. More impor-
tantly, we proposed a label-conditional architec-
ture and demonstrated its effect both qualitatively
and quantitatively. Our method is independent
of any task-specific knowledge, and effective for
classification tasks in various domains.
We use a label-conditional fill-in-the-blank con-
text for data augmentation. Neural models us-
ing the fill-in-the-blank context have been invested
in other applications. Kobayashi et al. (2016,
2017) proposed to extract and organize informa-
tion about each entity in a discourse using the con-
text. Fedus et al. (2018) proposed GAN (Goodfel-
low et al., 2014) for text generation and demon-
hisotherallitsmostthosesomeboththesethestoriesstoryactorstwoperformancesfilmsmoviesmoviefilmcharacters the actors are fantasticgethaveseemfeelfindbeiswere'rearehilariousyoungcompellingenjoyableengagingfunentertaininggoodhonestfunnypositivethesomethesesuchitsallnohisbothothercharactersmoviefilmplotstoryfilmsthemesmoviesstoriessongs'rearewereseemfeelisbefindgethavetiredn'tforgettablebadgooddullunfunnyflatpretentiousblandnegativehigherprobabilityhigherprobability1098765432112345678910strated that the mode collapse and training insta-
bility can be relieved by in-filling-task training.
Melamud et al. (2016) and Peters et al. (2018) re-
ported that encoding the context with bidirectional
LM was effective for a broad range of NLP tasks.
5 Conclusion
We proposed a novel data augmentation using nu-
merous words given by a bi-directional LM, and
further introduced a label-conditional architecture
into the LM. Experimentally, our method pro-
duced various words compatibly with the labels
of original texts and improved neural classifiers
more than the synonym-based augmentation. Our
method is independent of any task-specific knowl-
edge or rules, and can be generally and easily used
for classification tasks in various domains.
On the other hand, the improvement by our
method is sometimes marginal. Future work will
explore comparison and combination with other
generalization methods exploiting datasets deeply
as well as our method.
Acknowledgments
I would like to thank the members of Preferred
Networks, Inc., especially Takeru Miyato and Yuta
Tsuboi, for helpful comments. I would also like to
thank anonymous reviewers for helpful comments.
References
Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and
Noam Shazeer. 2015. Scheduled sampling for se-
quence prediction with recurrent neural networks.
In NIPS, pages 1171–1179.
Toms Bergmanis, Katharina Kann, Hinrich Schutze,
and Sharon Goldwater. 2017. Training data aug-
mentation for low-resource morphological inflec-
tion. In CoNLL SIGMORPHON, pages 31–39.
Koen Deschacht and Marie-Francine Moens. 2009.
Semi-supervised semantic role labeling using the la-
tent words language model. In EMNLP, pages 21–
29.
Chris Dyer, Miguel Ballesteros, Wang Ling, Austin
Matthews, and Noah A. Smith. 2015. Transition-
based dependency parsing with stack long short-
term memory. In ACL, pages 334–343.
Marzieh Fadaee, Arianna Bisazza, and Christof Monz.
2017. Data augmentation for low-resource neural
machine translation. In ACL, pages 567–573.
William Fedus, Ian Goodfellow, and Andrew M. Dai.
2018. MaskGAN: Better text generation via filling
in the
. In ICLR.
Hagen Furstenau and Mirella Lapata. 2009. Semi-
supervised semantic role labeling. In EACL, pages
220–228.
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza,
Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron
Courville, and Yoshua Bengio. 2014. Generative ad-
versarial nets. In NIPS, pages 2672–2680.
Geoffrey E. Hinton, Nitish Srivastava, Alex
Krizhevsky, Ilya Sutskever, and Ruslan Salakhut-
dinov. 2012.
Improving neural networks by
preventing co-adaptation of
feature detectors.
CoRR, abs/1207.0580.
Sepp Hochreiter and Jurgen Schmidhuber. 1997.
Long short-term memory. Neural computation,
9(8):1735–1780.
Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan
Salakhutdinov, and Eric P. Xing. 2017. Toward con-
In ICML, pages 1587–
trolled generation of text.
1596.
Navdeep Jaitly and Geoffrey E Hinton. 2015. Vo-
cal tract length perturbation (vtlp) improves speech
recognition. In ICML.
Robin Jia and Percy Liang. 2016. Data recombination
for neural semantic parsing. In ACL, pages 12–22.
Kushal Kafle, Mohammed Yousefhussien, and Christo-
pher Kanan. 2017. Data augmentation for visual
question answering. In INLG, pages 198–202.
Yoon Kim. 2014. Convolutional neural networks for
In EMNLP, pages 1746–
sentence classification.
1751.
Yoon Kim and Alexander M. Rush. 2016. Sequence-
In EMNLP, pages
level knowledge distillation.
1317–1327.
Diederik Kingma and Jimmy Ba. 2015. Adam: A
method for stochastic optimization. In ICLR.
Tom Ko, Vijayaditya Peddinti, Daniel Povey, and
Sanjeev Khudanpur. 2015. Audio augmentation
In INTERSPEECH, pages
for speech recognition.
3586–3589.
Sosuke Kobayashi, Naoaki Okazaki, and Kentaro Inui.
2017. A neural language model for dynamically rep-
resenting the meanings of unknown words and enti-
ties in a discourse. In IJCNLP, pages 473–483.
Sosuke Kobayashi, Ran Tian, Naoaki Okazaki, and
Kentaro Inui. 2016. Dynamic entity representation
with max-pooling improves machine reading.
In
NAACL-HLT, pages 850–855.
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre
Sermanet, Scott Reed, Dragomir Anguelov, Du-
mitru Erhan, Vincent Vanhoucke, and Andrew Ra-
binovich. 2015. Going deeper with convolutions. In
CVPR.
Seiya Tokui, Kenta Oono, Shohei Hido, and Justin
Clayton. 2015. Chainer: a next-generation open
source framework for deep learning. In Proceedings
of Workshop on LearningSys in NIPS 28.
William Yang Wang and Diyi Yang. 2015. That's
so annoying!!!: A lexical and frame-semantic em-
bedding based data augmentation approach to au-
tomatic categorization of annoying behaviors using
#petpeeve tweets. In EMNLP, pages 2557–2563.
Janyce Wiebe, Theresa Wilson, and Claire Cardie.
2005. Annotating expressions of opinions and emo-
tions in language. Language Resources and Evalu-
ation, 39(2):165–210.
Yingce Xia, Tao Qin, Wei Chen, Jiang Bian, Nenghai
Yu, and Tie-Yan Liu. 2017. Dual supervised learn-
ing. In ICML, pages 3789–3798.
Weidi Xu, Haoze Sun, Chao Deng, and Ying Tan.
2017. Variational autoencoder for semi-supervised
text classification. In AAAI, pages 3358–3364.
Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015.
Character-level convolutional networks for text clas-
sification. In NIPS, pages 649–657.
Oleksandr Kolomiyets, Steven Bethard, and Marie-
Francine Moens. 2011. Model-portability experi-
ments for textual temporal analysis. In ACL, pages
271–276.
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hin-
Imagenet classification with deep con-
In NIPS, pages 1097–
ton. 2012.
volutional neural networks.
1105.
Xin Li and Dan Roth. 2002. Learning question classi-
fiers. In COLING, pages 1–7.
Oren Melamud, Jacob Goldberger, and Ido Dagan.
2016. context2vec: Learning generic context em-
In CoNLL, pages
bedding with bidirectional lstm.
51–61.
Stephen Merity, Caiming Xiong, James Bradbury, and
Pointer sentinel mixture
Richard Socher. 2017.
models. In ICLR.
George A. Miller. 1995. Wordnet: A lexical database
for english. Commun. ACM, 38(11):39–41.
Bo Pang and Lillian Lee. 2004. A sentimental educa-
tion: Sentiment analysis using subjectivity summa-
rization based on minimum cuts. In ACL.
Bo Pang and Lillian Lee. 2005. Seeing stars: Exploit-
ing class relationships for sentiment categorization
In ACL, pages 115–
with respect to rating scales.
124.
Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt
Gardner, Christopher Clark, Kenton Lee, and Luke
Zettlemoyer. 2018. Deep contextualized word rep-
resentations. In NAACL-HLT.
Charles Bally Albert Sechehaye Saussure, Ferdi-
nand de and Albert Riedlinger. 1916. Cours de lin-
guistique generale. Lausanne: Payot.
Rico Sennrich, Barry Haddow, and Alexandra Birch.
2016. Improving neural machine translation models
with monolingual data. In ACL, pages 86–96.
Miikka Silfverberg, Adam Wiemerslage, Ling Liu, and
Lingshuang Jack Mao. 2017. Data augmentation
for morphological reinflection. In CoNLL SIGMOR-
PHON, pages 90–99.
Patrice Y. Simard, Yann A. LeCun, John S. Denker, and
Bernard Victorri. 1998. Transformation Invariance
in Pattern Recognition - Tangent Distance and Tan-
gent Propagation. Springer Berlin Heidelberg.
Richard Socher, Alex Perelygin, Jean Wu, Jason
Chuang, Christopher D. Manning, Andrew Ng, and
Christopher Potts. 2013. Recursive deep models
for semantic compositionality over a sentiment tree-
bank. In EMNLP, pages 1631–1642.
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. 2014.
Sequence to sequence learning with neural net-
works. In NIPS, pages 3104–3112.
|
1901.10746 | 1 | 1901 | 2019-01-30T10:21:04 | Reference-less Quality Estimation of Text Simplification Systems | [
"cs.CL"
] | The evaluation of text simplification (TS) systems remains an open challenge. As the task has common points with machine translation (MT), TS is often evaluated using MT metrics such as BLEU. However, such metrics require high quality reference data, which is rarely available for TS. TS has the advantage over MT of being a monolingual task, which allows for direct comparisons to be made between the simplified text and its original version. In this paper, we compare multiple approaches to reference-less quality estimation of sentence-level text simplification systems, based on the dataset used for the QATS 2016 shared task. We distinguish three different dimensions: gram-maticality, meaning preservation and simplicity. We show that n-gram-based MT metrics such as BLEU and METEOR correlate the most with human judgment of grammaticality and meaning preservation, whereas simplicity is best evaluated by basic length-based metrics. | cs.CL | cs | Reference-less Quality Estimation of Text Simplification Systems
Louis Martin
Facebook AI Research & Inria
[email protected]
Samuel Humeau
Facebook AI Research
[email protected]
Pierre-Emmanuel Mazar´e
Facebook AI Research
[email protected]
Antoine Bordes
Facebook AI Research
[email protected]
´Eric de La Clergerie
Inria
eric.de la [email protected]
[email protected]
Benoıt Sagot
Inria
9
1
0
2
n
a
J
0
3
]
L
C
.
s
c
[
1
v
6
4
7
0
1
.
1
0
9
1
:
v
i
X
r
a
Abstract
The evaluation of text simplification (TS)
systems remains an open challenge. As
the task has common points with machine
translation (MT), TS is often evaluated
using MT metrics such as BLEU. How-
ever, such metrics require high quality ref-
erence data, which is rarely available for
TS. TS has the advantage over MT of be-
ing a monolingual task, which allows for
direct comparisons to be made between
the simplified text and its original ver-
sion. In this paper, we compare multiple
approaches to reference-less quality esti-
mation of sentence-level text simplifica-
tion systems, based on the dataset used
for the QATS 2016 shared task. We dis-
tinguish three different dimensions: gram-
maticality, meaning preservation and sim-
plicity. We show that n-gram-based MT
metrics such as BLEU and METEOR cor-
relate the most with human judgment of
grammaticality and meaning preservation,
whereas simplicity is best evaluated by ba-
sic length-based metrics.
Introduction
1
Text simplification (hereafter TS) has received in-
creasing interest by the scientific community in
recent years. It aims at producing a simpler ver-
sion of a source text that is both easier to read
and to understand, thus improving the accessibil-
ity of text for people suffering from a range of dis-
abilities such as aphasia (Carroll et al., 1998) or
dyslexia (Rello et al., 2013), as well as for sec-
ond language learners (Xia et al., 2016) and peo-
ple with low literacy (Watanabe et al., 2009). This
topic has been researched for a variety of lan-
guages such as English (Zhu et al., 2010; Wubben
et al., 2012; Narayan and Gardent, 2014; Xu et al.,
2015), French (Brouwers et al., 2014), Spanish
(Saggion et al., 2011), Portuguese (Specia, 2010),
Italian (Brunato et al., 2015) and Japanese (Goto
et al., 2015).1
One of the main challenges in TS is finding
an adequate automatic evaluation metric, which
is necessary to avoid the time-consuming human
evaluation. Any TS evaluation metric should take
into account three properties expected from the
output of a TS system, namely:
• Grammaticality: how grammatically correct
is the TS system output?
• Meaning preservation: how well is the mean-
ing of the source sentence preserved in the TS
system output?
• Simplicity: how simple is the TS system out-
put?2
TS is often reduced to a sentence-level problem,
whereby one sentence is transformed into a sim-
pler version containing one or more sentences. In
this paper, we shall make use of the terms source
(sentence) and (TS system) output to respectively
denote a sentence given as an input to a TS system
and the simplified, single or multi-sentence output
produced by the system.
TS, seen as a sentence-level problem, is of-
ten viewed as a monolingual variant of (sentence-
level) MT. The standard approach to automatic TS
evaluation is therefore to view the task as a transla-
tion problem and to use machine translation (MT)
1Note that text simplification has also been used as a pre-
processing step for other natural language processing tasks
such as machine translation (Chandrasekar et al., 1996) and
semantic role labelling (Vickrey and Koller, 2008).
2There is no unique way to define the notion of simplicity
in this context. Previous works often rely on the intuition of
human annotators to evaluate the level of simplicity of a TS
system output.
evaluation metrics such as BLEU (Papineni et al.,
2002). However, MT evaluation metrics rely on
the existence of parallel corpora of source sen-
tences and manually produced reference transla-
tions, which are available on a large scale for many
language pairs (Tiedemann, 2012). TS datasets are
less numerous and smaller. Moreover, they are of-
ten automatically extracted from comparable cor-
pora rather than strictly parallel corpora, which
results in noisier reference data. For example,
the PWKP dataset (Zhu et al., 2010) consists of
100,000 sentences from the English Wikipedia au-
tomatically aligned with sentences from the Sim-
ple English Wikipedia based on term-based sim-
ilarity metrics.
It has been shown by Xu et al.
(2015) that many of PWKP's "simplified" sen-
tences are in fact not simpler or even not related to
their corresponding source sentence. Even if bet-
ter quality corpora such as Newsela do exist (Xu
et al., 2015), they are costly to create, often of lim-
ited size, and not necessarily open-access.
This creates a challenge for the use of reference-
based MT metrics for TS evaluation. However,
TS has the advantage of being a monolingual
translation-like task, the source being in the same
language as the output. This allows for new, non-
conventional ways to use MT evaluation metrics,
namely by using them to compare the output of a
TS system with the source sentence, thus avoid-
ing the need for reference data. However, such an
evaluation method can only capture at most two
of the three above-mentioned dimensions, namely
meaning preservation and, to a lesser extent, gram-
maticality.
Previous works on reference-less TS evaluation
include Stajner et al. (2014), who compare the be-
haviour of six different MT metrics when used
between the source sentence and the correspond-
ing simplified output. They evaluate these metrics
with respect to meaning preservation and gram-
maticality. We extend their work in two direc-
tions. Firstly, we extend the comparison to in-
clude the degree of simplicity achieved by the sys-
tem. Secondly, we compare additional features,
including those used by Stajner et al. (2016a), both
individually, as elementary metrics, and within
multi-feature metrics. To our knowledge, no pre-
vious work has provided as thorough a compari-
son across such a wide range and combination of
features for the reference-less evaluation of TS.
First we review available text simplification
evaluation methods and traditional quality estima-
tion features. We then present the QATS shared
task and the associated dataset, which we use for
our experiments. Finally we compare all methods
in a reference-less setting and analyze the results.
2 Existing evaluation methods
2.1 Using MT metrics to compare the output
and a reference
TS can be considered as a monolingual transla-
tion task. As a result, MT metrics such as BLEU
(Papineni et al., 2002), which compare the output
of an MT system to a reference translation, have
been extensively used for TS (Narayan and Gar-
dent, 2014; Stajner et al., 2015; Xu et al., 2016).
Other successful MT metrics include TER (Snover
et al., 2009), ROUGE (Lin, 2004) and METEOR
(Banerjee and Lavie, 2005), but they have not
gained much traction in the TS literature.
These metrics rely on good quality references,
something which is often not available in TS, as
discussed by Xu et al. (2015). Moreover, Stajner
et al. (2015) and Sulem et al. (2018a) showed that
using BLEU to compare the system output with a
reference is not a good way to perform TS evalua-
tion, even when good quality references are avail-
able. This is especially true when the TS sys-
tem produces more than one sentence for a single
source sentence.
2.2 Using MT metrics to compare the output
and the source sentence
As mentioned in the Introduction, the fact that
TS is a monolingual task means that MT metrics
can also be used to compare a system output with
its corresponding source sentence, thus avoiding
the need for reference data. Following this idea,
Stajner et al. (2014) found encouraging correla-
tions between 6 widely used MT metrics and hu-
man assessments of grammaticality and meaning
preservation. However MT metrics are not rele-
vant for the evaluation of simplicity, which is why
they did not take this dimension into account. Xu
et al. (2016) also explored the idea of compar-
ing the TS system output with its corresponding
source sentence, but their metric, SARI, also re-
quires to compare the output with a reference. In
fact, this metric is designed to take advantage of
more than one reference. It can be applied when
only one reference is available for each source sen-
tence, but its results are better when multiple ref-
erences are available.
Attempts to perform Quality Estimation on the
output of TS systems, without using references,
include the 2016 Quality Assessment for Text
Simplification (QATS) shared task (Stajner et al.,
2016b), to which we shall come back in section 3.
Sulem et al. (2018b) introduce another approach,
named SAMSA. The idea is to evaluate the struc-
tural simplicity of a TS system output given the
corresponding source sentence. SAMSA is max-
imized when the simplified text is a sequence of
short and simple sentences, each accounting for
one semantic event in the original sentence. It re-
lies on an in-depth analysis of the source sentence
and the corresponding output, based on a semantic
parser and a word aligner. A drawback of this ap-
proach is that good quality semantic parsers are
only available for a handful of languages. The
intuition that sentence splitting is an important
sub-task for producing simplified text motivated
Narayan et al. (2017) to organize the Split and
Rephrase shared task, which was dedicated to this
problem.
2.3 Other metrics
One can also estimate the quality of a TS system
output based on simple features extracted from it.
For instance, the QUEST framework for qual-
ity estimation in MT gives a number of useful
baseline features for evaluating an output sentence
(Specia et al., 2013). These features range from
simple statistics, such as the number of words
in the sentence, to more sophisticated features,
such as the probability of the sentence according
to a language model. Several teams who par-
ticipated in the QATS shared task used metrics
based on this framework, namely SMH (Stajner
et al., 2016a), UoLGP (Rios and Sharoff, 2015)
and UoW (B´echara et al., 2015).
Readability metrics such as Flesch-Kincaid
Grade Level (FKGL) and Flesch Reading Ease
(FRE) (Kincaid et al., 1975) have been extensively
used for evaluating simplicity. These two metrics,
which were shown experimentally to give good
results, are linear combinations of the number of
words per sentence and the number of syllables per
word, using carefully adjusted weights.
3 Methodology
Our goal is to compare a large number of ways
to perform TS evaluation without a reference. To
Figure 1: Label repartition on the QATS Shared
task
this end, we use the dataset provided in the QATS
shared task. We first compare the behaviour of
elementary metrics, which range from commonly
used metrics such as BLEU to basic metrics based
on a single low-level feature such as sentence
length. We then compare the effect of aggregating
these elementary metrics into more complex ones
and compare our results with the state of the art,
based on the QATS shared task data and results.
3.1 The QATS shared task
The data from the QATS shared task (Stajner et al.,
2016b) consists of a collection of 631 pairs of en-
glish sentences composed of a source sentence ex-
tracted from an online corpus and a simplified ver-
sion thereof, which can contain one or more sen-
tences. This collection is split into a training set
(505 sentence pairs) and a test set (126 sentence
pairs). Simplified versions were produced auto-
matically using one of several TS systems trained
by the shared task organizers. Human annotators
labelled each sentence pair using one of the three
labels Good, OK and Bad on each of the three
dimensions: grammaticality, meaning preserva-
tion and simplicity3. An overall quality label was
then automatically assigned to each sentence pair
based on its three manually assigned labels using
a method detailed in (Stajner et al., 2016b). Dis-
tribution of the labels and examples are presented
in FIGURE 1 and TABLE 1.
The goal of the shared task is, for each sentence
in the test set, to either produce a label (Good, OK,
3We were not able to find detailed information about the
annotation process. In particular, we do not know whether
each sentence was annotated only once or whether multiple
annotations were produced, followed by an adjudication step.
Version
Sentence
Original All three were arrested in the Toome area and have been taken
to the Serious Crime Suite at Antrim police station.
All three were arrested in the Toome area. All three have been
taken to the Serious Crime Suite at Antrim police station.
Simple
Original
Simple
Original
Simple
Original
Simple
For years the former Bosnia Serb army commander Ratko
Mladic had evaded capture and was one of the worlds most
wanted men, but his time on the run finally ended last year
when he was arrested near Belgrade.
For years the former Bosnia Serb army commander Ratko
Mladic had evaded capture.
Madrid was occupied by French troops during the Napoleonic
Wars, and Napoleons brother Joseph was installed on the
throne.
Madrid was occupied by French troops during the Napoleonic
Wars, and Napoleons brother Joseph was put on the throne.
Keeping articles with potential encourages editors, especially
unregistered users, to be bold and improve the article to allow it
to evolve over time.
Keeping articles with potential editors, especially unregistered
users, to be bold and improve the article to allow it to evolve
over time.
Aspect
M
S
O
G
Modification
good
good
good
good
syntactic
good
bad
ok
bad
content reduction
good
good
good
good
lexical
bad
bad
ok
bad
dropping
Table 1: Examples from the training dataset of QATS. Differences between the original and the simplified
version are presented in bold. This table is adapted from Stajner et al. (2016b).
Bad) or a raw score estimating the overall quality
of the simplification for each of the three dimen-
sions. Raw score predictions are evaluated using
the Pearson correlation with the ground truth la-
bels, while actual label prediction are evaluated
using the weighted F1-score. The shared task is
described in further details on the QATS website4.
3.2 Features
In our experiments, we compared about 60 ele-
mentary metrics, which can be organised as fol-
lows:
• MT metrics
-- BLEU, ROUGE, METEOR, TERp
-- Variants
of BLEU: BLEU 1gram,
BLEU 3gram,
BLEU 2gram,
BLEU 4gram and seven smoothing
methods5 from NLTK (Bird and Loper,
2004).
-- Intermediate components of TERp in-
spired by (Stajner et al., 2016a): e.g.
number of insertions, deletions, shifts...
4http://qats2016.github.io/shared.html
5https://www.nltk.org/api/nltk.
translate.html#nltk.translate.bleu_
score.SmoothingFunction
• Readability metrics and other sentence-level
features: FKGL and FRE, numbers of words,
characters, syllables...
• Metrics based on the baseline QUEST fea-
tures (17 features) (Specia et al., 2013), such
as statistics on the number of words, word
lengths, language model probability and n-
gram frequency.
• Metrics based on other features: frequency
table position, concreteness as extracted from
Brysbaert et al.'s 2014 list, language model
probability of words using a convolutional
sequence to sequence model from (Gehring
et al., 2017), comparison methods using pre-
trained fastText word embeddings (Mikolov
et al., 2018) or Skip-thought sentence embed-
dings (Kiros et al., 2015).
TABLE 2 lists 30 of the elementary metrics that
we compared, which are those that we found to
correlate the most with human judgments on one
or more of the three dimensions (grammaticality,
meaning preservation, simplicity).
3.3 Experimental setup
Evaluation of elementary metrics We rank all
features by comparing their behaviour with human
judgments on the training set. We first compute for
each elementary metric the Pearson correlation be-
tween its results and the manually assigned labels
for each of the three dimensions. We then rank our
elementary metrics according to the absolute value
of the Pearson correlation.6
Training and evaluation of a combined met-
ric We use our elementary metrics as features
to train classifiers on the training set, and evalu-
ate their performance on the test set. We therefore
scale them and reduce the dimensionality with a
25-component PCA7, then train several regression
algorithms8 and classification algorithms9 using
scikit-learn (Pedregosa et al., 2011). For each di-
mension, we keep the two models performing best
on the test set and add them in the leaderboard of
the QATS shared task (TABLE 4), naming them
with the name of the regression algorithm they
were built with.
4 Results
4.1 Comparing elementary metrics
FIGURE 3 ranks all elementary metrics given
their absolute Pearson correlation on each of the
three dimensions.
Grammaticality N-gram based MT metrics
have the highest correlation with human grammat-
icality judgments. METEOR seems to be the best,
probably because of its robustness to synonymy,
followed by smoothed BLEU (BLEUSmoothed
in 2). This indicates that relevant grammaticality
information can be derived from the source sen-
tence. We were expecting that information con-
tained in a language model would help achieving
better results (AvgLMProbsOutput), but MT met-
rics correlate better with human judgments. We
deduce that the grammaticality information con-
tained in the source is more specific and more
helpful for evaluation than what is learned by the
language model.
6The
code
is
available on Github at https:
//github.com/facebookresearch/
text-simplification-evaluation
7We used PCA instead of feature selection because it per-
formed better on the validation set. The number of compo-
nent was tuned on the validation set as well.
8Regressors: Linear regression, Lasso, Ridge, Linear
SVR (SVM regressor), Adaboost regressor, Gradient boost-
ing regressor and Random forest regressor.
9Classifiers: Logistic regression, MLP classifier (with
L2 penalty, alpha=1), SVC (linear SVM classifier), K-
nearsest neighbors classifier (k=3), Adaboost classifier, Gra-
dient boosting classifier and Random forest classifier.
Meaning preservation It is not surprising that
meaning preservation is best evaluated using MT
metrics that compare the source sentence to the
output sentence, with in particular smoothed
BLEU, BLEU 3gram and METEOR. Very simple
features such as the percentage of words in com-
mon between source and output also rank high.
Surprisingly, word embedding comparison meth-
ods do not perform as well for meaning preserva-
tion, even when using word alignment.
Simplicity Methods that give the best results are
the most straightforward for assessing simplicity,
namely word, character and syllable counts in the
output, averaged over the number of output sen-
tences. These simple features even outperform
the traditional, more complex metrics FKGL and
FRE. As could be expected, we find that met-
rics with the highest correlation to human simplic-
ity judgments only take the output into account.
Exceptions are the NBSourceWords and NBSour-
cePunct features. Indeed, if the source sentence
has a lot of words and punctuation, and is therefore
likely to be particularly complex, then the output
will most likely be less simple as well. We also ex-
pected word concreteness ratings and position in
the frequency table to be good indicators of sim-
plicity, but it does not seem to be the case here.
Structural simplicity might simply be more impor-
tant than such more sophisticated components of
the human intuition of simple text.
Discussion Even if counting the number of
words or comparing n-grams are good proxies for
the simplification quality, they are still very su-
perficial features and might miss some deeper and
more complex information. Moreover the fact that
grammaticality and meaning preservation are best
evaluated using n-gram-based comparison metrics
might bias the TS models towards copying the
source sentence and applying fewer modifications.
Syntactic parsing or language modelling might
capture more insightful grammatical information
and allow for more flexibility in the simplification
model. Regarding meaning preservation, seman-
tic analysis or paraphrase detection models would
also be good candidates for a deeper analysis.
Warning note We should be careful when inter-
preting these results as the QATS dataset is rel-
atively small. We compute confidence intervals
on our results, and find them to be non-negligible,
yet without putting our general observations into
Description
Number of punctuation tokens in source (QUEST)
Number of source words (QUEST)
Number of punctuation tokens in output (QUEST)
Type token ratio (QUEST)
Number of deletions (TERp component)
Number of total errors (TERp component)
Number of substitutions (TERp component)
TERp MT metric
BLEU MT metric with unigrams only
BLEU MT metric up to bigrams
BLEU MT metric up to trigrams
BLEU MT metric up to 4-grams
METEOR MT metric
ROUGE summarization metric
BLEU MT metric with smoothing (method 7 from nltk)
Cosine similarity between source and output pre-trained word embeddings
Number of characters in the output
Average number of characters per sentence in the output
Number of syllables in the output
Short name
NBSourcePunct
NBSourceWords
NBOutputPunct
TypeTokenRatio
TERp Del
TERp NumEr
TERp Sub
TERp
BLEU 1gram
BLEU 2gram
BLEU 3gram
BLEU 4gram
METEOR
ROUGE
BLEUSmoothed
AvgCosineSim
NBOutputChars
NBOutputCharsPerSent
NBOutputSyllables
NBOutputSyllablesPerSent Average number of syllables per sentence in the output
NBOutputWords
NBOutputWordsPerSent
AvgLMProbsOutput
MinLMProbsOutput
MaxPosInFreqTable
AvgConcreteness
OutputFKGL
OutputFRE
WordsInCommon
Number of words in the output
Average number of words per sentence in the output
Average log-probabilities of output words (Language Model)
Minimum log-probability of output words (Language Model)
Maximum position of output words in the frequency table
Average word concreteness Brysbaert et al.'s 2014 concreteness list
Flesch-Kincaid Grade Level
Flesch Reading Ease
Percentage of words in common between source and Output
Table 2: Brief description of 30 of our most relevant elementary metrics
Grammaticality
Short name
Best QATS team
METEOR
BLEUSmoothed
BLEU 4gram
BLEU 3gram
TERp NumEr
BLEU 2gram
TERp
ROUGE
AvgLMProbsOutput
BLEU 1gram
WordsInCommon
TERp Del
NBSourceWords
AvgCosineSim
MinLMProbsOutput
Train ↓
0.36
0.33
0.32
0.31
-0.30
0.30
-0.30
0.29
0.28
0.27
0.27
-0.27
-0.25
0.23
0.11
BLEU 2gram
BLEU 4gram
Meaning Preservation
Short name
Best QATS team
BLEUSmoothed
BLEU 3gram
Test
0.48
0.39
0.34
0.34 METEOR
0.34
-0.31
0.34 WordsInCommon
-0.32
0.29
0.34
0.33
0.30
-0.35 AvgCosineSim
-0.07 AvgLMProbsOutput
0.25 AvgConcreteness
-0.07 NBSourceWords
BLEU 1gram
ROUGE
TERp
TERp NumEr
TERp Del
Train ↓
0.59
0.57
0.57
0.57
0.57
0.55
0.55
0.55
-0.54
-0.53
-0.50
0.44
0.39
-0.28
-0.28
Simplicity
Short name
Best QATS team
Test
0.59
0.52 NBOutputCharsPerSent
0.52 NBOutputSyllablesPerSent
0.58 NBOutputWordsPerSent
0.52 NBOutputChars
0.51 NBOutputWords
0.50 NBOutputSyllables
0.52 NBOutputPunt
0.47 NBSourceWords
-0.48
-0.49 NBSourcePunct
-0.52
TypeTokenRatio
0.34 AvgConcreteness
0.36 MaxPosInFreqTable
-0.06 MinLMProbsOutput
-0.13 OutputFRE
outputFKGL
Train ↓
-0.52
-0.52
-0.51
-0.48
-0.47
-0.46
-0.42
-0.38
-0.36
-0.34
-0.22
0.21
-0.18
0.17
0.16
Test
0.38
-0.45
-0.49
-0.39
-0.37
-0.29
-0.42
-0.31
-0.21
-0.37
-0.18
-0.04
0.32
0.03
0.15
0.27
Table 3: Pearson correlation with human judgments of elementary metrics ranked by absolute value on
training set (15 best metrics for each dimension).
question. For instance, METEOR, which per-
forms best on grammaticality, has a 95% confi-
dence interval of 0.36 ± 0.08 on the training set.
These results are therefore preliminary and should
be validated on other datasets.
4.2 Combination of all features with trained
models
We also combine all elementary metrics and train
an evaluation models for each of the three dimen-
sions. TABLE 4a presents our two best regressors
in validation for each of the dimensions and TA-
BLE 4b for classifiers.
Pearson correlation for regressors (raw scor-
ing) Combining the features does not bring a
clear advantage over the elementary metrics ME-
TEOR and NBOutputSyllablesPerSent.
Indeed
our best models score respectively on grammati-
cality, meaning preservation and simplicity: 0.33
(Lasso), 0.58 (Ridge) and 0.49 (Ridge) versus 0.39
(METEOR), 0.58 (METEOR) and 0.49 (NBOut-
putSyllablesPerSent).
It is surprising to us that the aggregation of mul-
tiple elementary features would score worse than
the features themselves. However, we observe a
strong discrepancy between the scores obtained on
the train and test set, as illustrated by TABLE 3.
We also observed very large confidence intervals
in terms of Pearson correlation. For instance our
lasso model scores 0.33 ± 0.17 on the test set for
grammaticality. This should observe caution when
interpreting Pearson scores on QATS.
F1-score for classifiers (assigning labels) On
the classification task, our models seem to score
best for meaning preservation, simplicity and
overall, and third for grammaticality. This seems
to confirm the importance of considering a large
ensemble of elementary features including length-
based metrics to evaluate simplicity.
5 Conclusion
Finding accurate ways to evaluate text simplifica-
tion (TS) without the need for reference data is
a key challenge for TS, both for exploring new
approaches and for optimizing current models,
in particular those relying on unsupervised, often
MT-inspired models.
We explore multiple reference-less quality eval-
uation methods for automatic TS systems, based
on data from the 2016 QATS shared task. We rely
on the three key dimensions of the quality of a TS
system: grammaticality, meaning preservation and
simplicity.
Our results show that grammaticality and mean-
ing preservation are best assessed using n-gram-
based MT metrics evaluated between the output
and the source sentence. In particular, METEOR
and smoothed BLEU achieve the highest corre-
lation with human judgments. These approaches
even outperform metrics that make an extensive
use of external data, such as language models.
This shows that a lot of useful information can be
obtained from the source sentence itself.
Regarding simplicity, we observe that counting
the number of characters, syllables and words pro-
vides the best results. In other words, given the
currently available metrics, the length of a sen-
tence seems to remain the best available proxy for
its simplicity.
However, given the small size of the QATS
dataset and the high variance observed in our ex-
periments, these results must be taken with a pinch
of salt and will need to be confirmed on a larger
dataset. Creating a larger annotated dataset as well
as averaging multiple human annotations for each
pair of sentences would help reducing the variance
of the experiments and confirming our findings.
In future work, we shall explore richer and
more complex features extracted using syntactic
and semantic analyzers, such as those used by the
SAMSA metric, and paraphrase detection models.
Finally, it remains to be understood how we
can optimize the trade-off between grammatical-
ity, meaning preservation and simplicity, in or-
der to build the best possible comprehensive TS
metric in terms of correlation with human judg-
ments. Unsurprisingly, optimizing one of these
dimensions often leads to lower results on other
dimensions (Schwarzer and Kauchak, 2018). For
instance, the best way to guarantee grammatical-
ity and meaning preservation is to leave the source
sentence unchanged, thus resulting in no simplifi-
cation at all. Improving TS systems will require
better global TS evaluation metrics. This is es-
pecially true when considering that TS is in fact
a multiply defined task, as there are many differ-
ent ways of simplifying a text, depending on the
different categories of people and applications at
whom TS is aimed.
Grammaticality
0.482 OSVCML1
0.384 METEOR
0.344 BLEU
0.340 OSVCML
0.327 Lasso
0.323 TER
0.308 SimpleNets-MLP
0.308 WER
0.256 UoLGP-emb
0.256 UoLGP-combo
0.208 UoLGP-quest
0.118 GradientBoostingRegressor
0.064 SimpleNets-RNN3
0.056 SimpleNets-RNN2
Meaning Preservation
0.588 IIT-Meteor
0.585 OSVCML
0.575 Ridge
0.573 OSVCML2
0.555 Lasso
0.533 BLEU
0.527 METEOR
0.513 TER
0.495 WER
0.482 OSVCML1
0.465 SimpleNets-MLP
0.285 UoLGP-quest
0.262 SimpleNets-RNN2
0.262 SimpleNets-RNN3
0.250 UoLGP-combo
0.188 UoLGP-emb
Simplicity
0.487 Ridge
0.456 LinearSVR
0.382 OSVCML1
0.376 OSVCML2
0.339 OSVCML
0.320 SimpleNets-MLP
0.307 SimpleNets-RNN3
0.240 SimpleNets-RNN2
0.123 UoLGP-combo
0.120 UoLGP-emb
0.086 UoLGP-quest
0.052 IIT-S
-0.169 METEOR
-0.242 TER
-0.260 WER
-0.267 BLEU
Overall
0.423 Ridge
0.423 LinearRegression
0.343 OSVCML2
0.334 OSVCML
0.232 SimpleNets-RNN2
0.230 OSVCML1
0.205 UoLGP-emb
0.198 SimpleNets-MLP
0.196 METEOR
0.189 UoLGP-combo
0.144 UoLGP-quest
0.130 TER
0.112 SimpleNets-RNN3
0.111 WER
0.107 BLEU
(a) Pearson correlation for regressors (raw scoring)
Grammaticality
71.84 SMH-RandForest
71.64 SMH-IBk
70.43 LogisticRegression
69.96 SMH-RandForest-b
69.09 BLEU
68.82 SimpleNets-MLP
68.36 TER
67.60 GradientBoosting
67.53 MS-RandForest
67.50 IIT-LM
66.79 WER
66.75 MS-RandForest-b
65.89 DeepIndiBow
65.89 DeepBow
65.89 MT-baseline
65.89 Majority-class
65.72 METEOR
65.50 SimpleNets-RNN2
65.11 SimpleNets-RNN3
64.39 CLaC-RF-Perp
62.00 MS-IBk
46.32 UoW
Meaning Preservation
70.14 SVC
68.07 SMH-Logistic
65.60 MS-RandForest
64.40 SMH-RandForest
63.74 TER
63.54 SimpleNets-MLP
62.82 BLEU
62.72 MT-baseline
62.69 IIT-Meteor
61.71 MS-IBk-b
61.50 MS-IBk
60.38 GradientBoosting
60.12 METEOR
59.69 SMH-RandForest-b
59.06 WER
58.83 UoW
51.29 SimpleNets-RNN2
51.00 CLaC-RF
46.64 SimpleNets-RNN3
46.30 DeepBow
42.53 DeepIndiBow
42.51 Majority-class
Simplicity
61.60 SVC
56.95 AdaBoostClassifier
56.42 SMH-RandForest-b
53.02 SMH-RandForest
51.12 SMH-IBk
49.96 SimpleNets-RNN3
49.81 SimpleNets-MLP
48.31 MT-baseline
47.84 MS-IBk-b
47.82 MS-RandForest
47.47 SimpleNets-RNN2
43.46 IIT-S
42.57 DeepIndiBow
40.92 UoW
39.68 Majority-class
38.10 MS-IBk
35.58 DeepBow
34.88 CLaC-RF-0.5
34.66 CLaC-RF-0.6
34.48 WER
34.30 CLaC-RF-0.7
33.52 TER
33.34 METEOR
33.00 BLEU
Overall
49.61 LogisticRegression
48.57 SMH-RandForest-b
48.20 UoW
47.54 SMH-Logistic
46.06 SimpleNets-RNN2
45.71 AdaBoostClassifier
44.50 SMH-RandForest
40.94 METEOR
40.75 SimpleNets-RNN3
39.85 MS-RandForest
39.80 DeepIndiBow
39.30 IIT-Metrics
38.27 MS-IBk
38.16 MS-IBk-b
38.03 DeepBow
37.49 MT-baseline
34.08 TER
34.06 CLaC-0.5
33.69 SimpleNets-MLP
33.04 IIT-Default
32.92 BLEU
32.88 CLaC-0.7
32.20 CLaC-0.6
31.28 WER
26.53 Majority-class
(b) Weighted F1 Score for classifiers (assign the label Good, OK or Bad)
Table 4: QATS leaderboard. Results in bold are our additions to the original leaderboard. We only select
the two models that rank highest during cross-validation.
Acknowledgments
We would like to thank our anonymous reviewers
for their insightful comments.
References
Satanjeev Banerjee and Alon Lavie. 2005. Meteor: An
automatic metric for mt evaluation with improved
correlation with human judgments. In Proceedings
of the acl workshop on intrinsic and extrinsic evalu-
ation measures for machine translation and/or sum-
marization, pages 65 -- 72.
Hanna B´echara, Hernani Costa, Shiva Taslimipoor, Ro-
hit Gupta, Constantin Orasan, Gloria Corpas Pastor,
and Ruslan Mitkov. 2015. Miniexperts: An svm ap-
proach for measuring semantic textual similarity. In
Proceedings of the 9th international workshop on
semantic evaluation (SemEval 2015), pages 96 -- 101.
Steven Bird and Edward Loper. 2004. Nltk: the nat-
In Proceedings of the ACL
ural language toolkit.
2004 on Interactive poster and demonstration ses-
sions, page 31. Association for Computational Lin-
guistics.
Laetitia Brouwers, Delphine Bernhard, Anne-Laure
Ligozat, and Thomas Franc¸ois. 2014. Syntactic sen-
In Proceedings of
tence simplification for french.
the 3rd Workshop on Predicting and Improving Text
Readability for Target Reader Populations (PITR),
pages 47 -- 56.
Dominique Brunato, Felice Dell'Orletta, Giulia Ven-
turi, and Simonetta Montemagni. 2015. Design and
annotation of the first italian corpus for text simpli-
fication. In Proceedings of The 9th Linguistic Anno-
tation Workshop, pages 31 -- 41.
Marc Brysbaert, Amy Beth Warriner, and Victor Ku-
perman. 2014. Concreteness ratings for 40 thousand
generally known english word lemmas. Behavior
research methods, 46(3):904 -- 911.
John Carroll, Guido Minnen, Yvonne Canning, Siob-
han Devlin, and John Tait. 1998. Practical simpli-
fication of english newspaper text to assist aphasic
In Proceedings of the AAAI-98 Workshop
readers.
on Integrating Artificial Intelligence and Assistive
Technology, pages 7 -- 10.
Raman Chandrasekar, Christine Doran, and Bangalore
Srinivas. 1996. Motivations and methods for text
In Proceedings of the 16th confer-
simplification.
ence on Computational linguistics-Volume 2, pages
1041 -- 1044. Association for Computational Linguis-
tics.
Jonas Gehring, Michael Auli, David Grangier, De-
nis Yarats, and Yann N. Dauphin. 2017. Convolu-
tional sequence to sequence learning. arXiv preprint
arXiv:1705.03122.
Isao Goto, Hideki Tanaka, and Tadashi Kumano. 2015.
Japanese news simplification: Task design, data set
construction, and analysis of simplified text. Pro-
ceedings of MT Summit XV, 1:17 -- 31.
J. Peter Kincaid, Robert P Fishburne Jr., Richard L.
Rogers, and Brad S. Chissom. 1975. Derivation of
new readability formulas (automated readability in-
dex, fog count and flesch reading ease formula) for
navy enlisted personnel.
Ryan Kiros, Yukun Zhu, Ruslan R Salakhutdinov,
Richard Zemel, Raquel Urtasun, Antonio Torralba,
and Sanja Fidler. 2015. Skip-thought vectors.
In
Advances in neural information processing systems,
pages 3294 -- 3302.
Chin-Yew Lin. 2004. Rouge: A package for auto-
matic evaluation of summaries. Text Summarization
Branches Out.
Tomas Mikolov, Edouard Grave, Piotr Bojanowski,
Christian Puhrsch, and Armand Joulin. 2018. Ad-
vances in pre-training distributed word representa-
In Proceedings of the International Confer-
tions.
ence on Language Resources and Evaluation (LREC
2018).
Shashi Narayan and Claire Gardent. 2014. Hybrid sim-
plification using deep semantics and machine trans-
In Proceedings of the 52nd Annual Meet-
lation.
ing of the Association for Computational Linguistics
(Volume 1: Long Papers), volume 1, pages 435 -- 445.
Shashi Narayan, Claire Gardent, Shay B Cohen, and
Split and rephrase.
Anastasia Shimorina. 2017.
arXiv preprint arXiv:1707.06971.
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-
Jing Zhu. 2002. Bleu: a method for automatic eval-
In Proceedings of
uation of machine translation.
the 40th annual meeting on association for compu-
tational linguistics, pages 311 -- 318. Association for
Computational Linguistics.
Fabian Pedregosa, Gal Varoquaux, Alexandre Gram-
fort, Vincent Michel, Bertrand Thirion, Olivier
Grisel, Mathieu Blondel, Peter Prettenhofer, Ron
Weiss, Vincent Dubourg, Jake Vanderplas, Alexan-
dre Passos, David Cournapeau, Matthieu Brucher,
Matthieu Perrot, and douard Duchesnay. 2011.
Scikit-learn: Machine Learning in Python. Journal
of Machine Learning Research, 12:2825 -- 2830.
Luz Rello, Ricardo Baeza-Yates, Stefan Bott, and
Horacio Saggion. 2013. Simplify or help?:
text
simplification strategies for people with dyslexia.
In Proceedings of
the 10th International Cross-
Disciplinary Conference on Web Accessibility,
page 15. ACM.
Miguel Rios and Serge Sharoff. 2015. Large scale
In The Proceedings
translation quality estimation.
of the 1st Deep Machine Translation Workshop.
Evaluation, LREC'12, pages 2214 -- 2218, Istanbul,
Turkey.
David Vickrey and Daphne Koller. 2008. Sentence
simplification for semantic role labeling. Proceed-
ings of ACL-08: HLT, pages 344 -- 352.
Willian Massami Watanabe, Arnaldo Candido Junior,
Vin´ıcius Rodriguez Uzeda, Renata Pontin de Mat-
tos Fortes, Thiago Alexandre Salgueiro Pardo, and
Sandra Maria Alu´ısio. 2009. Facilita: reading as-
sistance for low-literacy readers. In Proceedings of
the 27th ACM international conference on Design of
communication, pages 29 -- 36. ACM.
Sander Wubben, Antal Van Den Bosch, and Emiel
Krahmer. 2012. Sentence simplification by mono-
lingual machine translation. In Proceedings of the
50th Annual Meeting of the Association for Compu-
tational Linguistics: Long Papers-Volume 1, pages
1015 -- 1024. Association for Computational Linguis-
tics.
Menglin Xia, Ekaterina Kochmar, and Ted Briscoe.
2016. Text readability assessment for second lan-
In Proceedings of the 11th Work-
guage learners.
shop on Innovative Use of NLP for Building Educa-
tional Applications, pages 12 -- 22.
Wei Xu, Chris Callison-Burch, and Courtney Napoles.
2015. Problems in current text simplification re-
search: New data can help. Transactions of the
Association of Computational Linguistics, 3(1):283 --
297.
Wei Xu, Courtney Napoles, Ellie Pavlick, Quanze
Chen, and Chris Callison-Burch. 2016. Optimizing
statistical machine translation for text simplification.
Transactions of the Association for Computational
Linguistics, 4:401 -- 415.
Zhemin Zhu, Delphine Bernhard, and Iryna Gurevych.
2010. A monolingual tree-based translation model
In Proceedings of the
for sentence simplification.
23rd international conference on computational lin-
guistics, pages 1353 -- 1361. Association for Compu-
tational Linguistics.
Horacio Saggion, Elena G´omez Mart´ınez, Esteban
Etayo, Alberto Anula, and Lorena Bourg. 2011.
Text simplification in simplext. making text more
accessible. Procesamiento del lenguaje natural,
47:341 -- 342.
Max Schwarzer and David Kauchak. 2018. Human
evaluation for text simplification: The simplicity-
adequacy tradeoff.
Matthew G Snover, Nitin Madnani, Bonnie Dorr, and
Richard Schwartz. 2009. Ter-plus: paraphrase, se-
mantic, and alignment enhancements to translation
edit rate. Machine Translation, 23(2-3):117 -- 127.
Lucia Specia. 2010. Translating from complex to sim-
In International Conference on
plified sentences.
Computational Processing of the Portuguese Lan-
guage, pages 30 -- 39. Springer.
Lucia Specia, Kashif Shah, Jose GC Souza, and Trevor
Cohn. 2013. Quest-a translation quality estimation
framework. In Proceedings of the 51st Annual Meet-
ing of the Association for Computational Linguis-
tics: System Demonstrations, pages 79 -- 84.
Sanja Stajner, Hannah B´echara, and Horacio Saggion.
2015. A deeper exploration of the standard pb-smt
approach to text simplification and its evaluation.
In Proceedings of the 53rd Annual Meeting of the
Association for Computational Linguistics and the
7th International Joint Conference on Natural Lan-
guage Processing (Volume 2: Short Papers), vol-
ume 2, pages 823 -- 828.
Sanja Stajner, Ruslan Mitkov, and Horacio Saggion.
2014. One step closer to automatic evaluation of text
In Proceedings of the 3rd
simplification systems.
Workshop on Predicting and Improving Text Read-
ability for Target Reader Populations (PITR), pages
1 -- 10.
Sanja Stajner, Maja Popovic, and Hanna B´echara.
2016a. Quality estimation for text simplification. In
Proceedings of the QATS Workshop, pages 15 -- 21.
Sanja Stajner, Maja Popovic, Horacio Saggion, Lucia
Specia, and Mark Fishel. 2016b. Shared task on
quality assessment for text simplification. Training,
218(95):192.
Elior Sulem, Omri Abend, and Ari Rappoport. 2018a.
Bleu is not suitable for the evaluation of text simpli-
fication.
Elior Sulem, Omri Abend, and Ari Rappoport. 2018b.
Semantic structural evaluation for text simplifica-
In Proceedings of the 2018 Conference of
tion.
the North American Chapter of the Association for
Computational Linguistics: Human Language Tech-
nologies, Volume 1 (Long Papers), volume 1, pages
685 -- 696.
Jrg Tiedemann. 2012. Parallel Data, Tools and In-
In Proceedings of the 8th In-
terfaces in OPUS.
ternational Conference on Language Resources and
|
1905.10892 | 1 | 1905 | 2019-05-26T21:50:15 | Extreme Multi-Label Legal Text Classification: A case study in EU Legislation | [
"cs.CL"
] | We consider the task of Extreme Multi-Label Text Classification (XMTC) in the legal domain. We release a new dataset of 57k legislative documents from EURLEX, the European Union's public document database, annotated with concepts from EUROVOC, a multidisciplinary thesaurus. The dataset is substantially larger than previous EURLEX datasets and suitable for XMTC, few-shot and zero-shot learning. Experimenting with several neural classifiers, we show that BIGRUs with self-attention outperform the current multi-label state-of-the-art methods, which employ label-wise attention. Replacing CNNs with BIGRUs in label-wise attention networks leads to the best overall performance. | cs.CL | cs | Extreme Multi-Label Legal Text Classification:
A case study in EU Legislation
Ilias Chalkidis*
Manos Fergadiotis*
Prodromos Malakasiotis*
Nikolaos Aletras**
Ion Androutsopoulos*
* Department of Informatics, Athens University of Economics and Business, Greece
** Computer Science Department, University of Sheffield, UK
9
1
0
2
y
a
M
6
2
]
L
C
.
s
c
[
1
v
2
9
8
0
1
.
5
0
9
1
:
v
i
X
r
a
[ihalk,fergadiotis,rulller,ion]@aueb.gr, [email protected]
Abstract
We consider the task of Extreme Multi-Label
Text Classification (XMTC) in the legal do-
main. We release a new dataset of 57k leg-
islative documents from EUR-LEX, the Euro-
pean Union's public document database, anno-
tated with concepts from EUROVOC, a multi-
disciplinary thesaurus. The dataset is substan-
tially larger than previous EUR-LEX datasets
and suitable for XMTC, few-shot and zero-shot
learning. Experimenting with several neural
classifiers, we show that BIGRUs with self-
attention outperform the current multi-label
state-of-the-art methods, which employ label-
wise attention. Replacing CNNs with BIGRUs
in label-wise attention networks leads to the
best overall performance.
1
Introduction
Extreme multi-label text classification (XMTC), is
the task of tagging documents with relevant la-
bels from an extremely large label set, typically
containing thousands of labels (classes). Ap-
plications include building web directories (Par-
talas et al., 2015),
labeling scientific publica-
tions with concepts from ontologies (Tsatsaronis
et al., 2015), product categorization (McAuley and
Leskovec, 2013), categorizing medical examina-
tions (Mullenbach et al., 2018; Rios and Kavu-
luru, 2018b), and indexing legal documents (Men-
cia and Frnkranz, 2007). We focus on legal text
processing, an emerging NLP field with many ap-
plications (Nallapati and Manning, 2008; Aletras
et al., 2016; Chalkidis et al., 2017), but limited
publicly available resources.
We release a new dataset, named EURLEX57K,
including 57,000 English documents of EU legis-
lation from the EUR-LEX portal. All documents
have been tagged with concepts from the Euro-
pean Vocabulary (EUROVOC), maintained by the
Publications Office of the European Union. Al-
though EUROVOC contains more than 7,000 con-
cepts, most of them are rarely used in practice.
Consequently, they are under-represented in EU-
RLEX57K, making the dataset also appropriate for
few-shot and zero-shot learning.
Experimenting on EURLEX57K, we explore the
use of various RNN-based and CNN-based neural
classifiers, including the state of the art Label-
Wise Attention Network of Mullenbach et al.
(2018), called CNN-LWAN here. We show that
both a simpler BIGRU with self-attention (Xu et al.,
2015) and the Hierarchical Attention Network
(HAN) of Yang et al. (2016) outperform CNN-
LWAN by a wide margin. Replacing the CNN en-
coder of CNN-LWAN with a BIGRU, which leads to
a method we call BIGRU-LWAN, further improves
performance. Similar findings are observed in the
zero-shot setting where Z-BIGRU-LWAN outper-
forms Z-CNN-LWAN.
2 Related Work
Liu et al. (2017) proposed a CNN similar to that
of Kim (2014) for XMTC. They reported re-
sults on several benchmark datasets, most no-
tably: RCV1 (Lewis et al., 2004), containing
news articles; EUR-LEX (Mencia and Frnkranz,
2007), containing legal documents; Amazon-12K
(McAuley and Leskovec, 2013), containing prod-
uct descriptions; and Wiki-30K (Zubiaga, 2012),
containing Wikipedia articles. Their proposed
method outperformed both tree-based methods
(e.g., FASTXML, (Prabhu and Varma, 2014)) and
target-embedding methods (e.g., SLEEC (Bha-
tia et al., 2015), FASTTEXT (Bojanowski et al.,
2016)).
RNNs with self-attention have been employed in
a wide variety of NLP tasks, such as Natural Lan-
guage Inference (Liu et al., 2016), Textual Entail-
ment (Rocktaschel et al., 2016), and Text Classifi-
cation (Zhou et al., 2016). You et al. (2018) used
RNNs with self-attention in XMTC comparing with
tree-based methods and deep learning approaches
including vanilla LSTMs and CNNs. Their method
outperformed the other approaches in three out of
four XMTC datasets, demonstrating the effective-
ness of attention-based RNNs.
Mullenbach et al. (2018) investigated the use of
label-wise attention mechanisms in medical code
prediction on the MIMIC-II and MIMIC-III datasets
(Johnson et al., 2017). MIMIC-II and MIMIC-III
contain over 20,000 and 47,000 documents tagged
with approximately 9,000 and 5,000 ICD-9 code
descriptors, respectively. Their best method, Con-
volutional Attention for Multi-Label Classifica-
tion, called CNN-LWAN here, includes multiple
attention mechanisms, one for each one of the
L labels. CNN-LWAN outperformed weak base-
lines, namely logistic regression, vanilla BIGRUs
and CNNs. Another important fact is that CNN-
LWAN was found to have the best interpretability
in comparison with the rest of the methods in hu-
man readers' evaluation.
Rios and Kavuluru (2018b) discuss the chal-
lenge of few-shot and zero-shot learning on the
MIMIC datasets. Over 50% of all ICD-9 labels
never appear in MIMIC-III, while 5,000 labels oc-
cur fewer than 10 times. The same authors pro-
posed a new method, named Zero-Shot Attentive
CNN, called Z-CNN-LWAN here, which is simi-
lar to CNN-LWAN (Mullenbach et al., 2018), but
also exploits the provided ICD-9 code descrip-
tors. The proposed Z-CNN-LWAN method was
compared with prior state-of-the-art methods, in-
cluding CNN-LWAN (Mullenbach et al., 2018) and
MATCH-CNN (Rios and Kavuluru, 2018a), a multi-
head matching CNN. While Z-CNN-LWAN did not
outperform CNN-LWAN overall on MIMIC-II and
MIMIC-III, it had exceptional results in few-shot
and zero-shot learning, being able to identify la-
bels with few or no instances at all in the train-
ing sets. Experimental results showed an improve-
ment of approximately four orders of magnitude in
comparison with CNN-LWAN in few-shot learning
and an impressive 0.269 R@5 in zero-shot learn-
ing, compared to zero R@5 reported for the other
models compared.1 Rios and Kavuluru (2018b)
also apply graph convolutions to hierarchical re-
lations of the labels, which improves the perfor-
1See Section 5.2 for a definition of R@K.
mance on few-shot and zero-shot learning. In this
work, we do not consider relations between labels
and do not discuss this method further.
Note that CNN-LWAN and Z-CNN-LWAN were
not compared so far with strong generic text clas-
sification baselines. Both Mullenbach et al. (2018)
and Rios and Kavuluru (2018b) proposed sophis-
ticated attention-based architectures, which intu-
itively are a good fit for XMTC, but they did not di-
rectly compare those models with RNNs with self-
attention (You et al., 2018) or even more complex
architectures, such as Hierarchical Attention Net-
works (HANs) (Yang et al., 2016).
3 EUROVOC & EURLEX57K
3.1 EUROVOC Thesaurus
EUROVOC is a multilingual thesaurus maintained
by the Publications Office of
the European
Union.2 It is used by the European Parliament, the
national and regional parliaments in Europe, some
national government departments, and other Eu-
ropean organisations. The current version of EU-
ROVOC contains more than 7,000 concepts refer-
ring to various activities of the EU and its Member
States (e.g., economics, health-care, trade, etc.).
It has also been used for indexing documents in
systems of EU institutions, e.g., in web legislative
databases, such as EUR-LEX and CELLAR. All EU-
ROVOC concepts are represented as tuples called
descriptors, each containing a unique numeric
identifier and a (possibly) multi-word description
of the concept concept, for example (1309, im-
port), (693, citrus fruit), (192, health control),
(863, Spain), (2511, agri-monetary policy).
3.2 EURLEX57K
EURLEX57K can be viewed as an improved ver-
sion of the EUR-LEX dataset released by Men-
cia and Frnkranz (2007), which included 19,601
documents tagged with 3,993 different EUROVOC
concepts. While EUR-LEX has been widely used
in XMTC research, it is less than half the size of
EURLEX57K and one of the smallest among XMTC
benchmarks.3 Over the past years the EUR-LEX
archive has been widely expanded. EURLEX57K is
a more up to date dataset including 57,000 pieces
2https://publications.europa.eu/en/
web/eu-vocabularies
3The most notable XMTC benchmarks can be found
http://manikvarma.org/downloads/XC/
at
XMLRepository.html.
of EU legislation from the EUR-LEX portal.4 All
documents have been annotated by the Publica-
tions Office of EU with multiple concepts from the
EUROVOC thesaurus. EURLEX57K is split in train-
ing (45,000 documents), development (6,000), and
validation (6,000) subsets (see Table 1).5
Subset Documents (D) Words/D Labels/D
Train
Dev.
Test
45,000
6,000
6,000
729
714
725
5
5
5
Table 1: Statistics of the EUR-LEX dataset.
All documents are structured in four major
zones: the header including the title and the name
of the legal body that enforced the legal act; the
recitals that consist of references in the legal back-
ground of the decision; the main body, which is
usually organized in articles; and the attachments
that usually include appendices and annexes. For
simplicity, we will refer to each one of header,
recitals, attachments and each of the main body's
articles as sections. We have pre-processed all
documents in order to provide the aforementioned
structure.
While EUROVOC includes over 7,000 concepts
(labels), only 4,271 (59.31%) of them are present
in EURLEX57K. Another important fact is that
most
labels are under-represented; only 2,049
(47,97%) have been assigned to more than 10 doc-
uments. Such an aggressive Zipfian distribution
(Figure 1) has also been noted in other domains,
like medical examinations (Rios and Kavuluru,
2018b) where XMTC has been applied to index
documents with concepts from medical thesauri.
The labels of EURLEX57K are divided in three
categories: frequent labels (746), which occur in
more than 50 training documents and can be found
in all three subsets (training, development, test);
few-shot labels (3,362), which appear in 1 to 50
training documents; and zero-shot labels (163),
which appear in the development and/or test, but
not in the training, documents.
4 Methods Considered
We experiment with a wide repertoire of methods
including linear and non-linear neural classifiers.
We also propose and conduct initial experiments
4https://eur-lex.europa.eu
5Our dataset
at http://nlp.cs.
available
aueb.gr/software_and_datasets/EURLEX57K,
reuse under European Union c(cid:13),
with permission of
https://eur-lex.europa.eu, 1998 -- 2019.
is
Figure 1: EUROVOC concepts frequency.
with two novel neural methods that aim to cope
with the extended length of the legal documents
and the information sparsity (for XMTC purposes)
across the sections of the documents.
4.1 Baselines
4.1.1 Exact Match
To demonstrate that plain label name matching
is not sufficient, our first weak baseline, Exact
Match, tags documents only with labels whose de-
scriptors appear verbatim in the documents.
4.1.2 Logistic Regression
To demonstrate the limitations of linear classifiers
with bag-of-words representations, we train a Lo-
gistic Regression classifier with TF-IDF scores for
the most frequent unigrams, bigrams, trigrams, 4-
grams, 5-grams across all documents. Logistic
regression with similar features has been widely
used for multi-label classification in the past.
4.2 Neural Approaches
We present eight alternative neural methods. In the
following subsections, we describe their structure
consisting of five main parts:
• word encoder (ENCw):
turns word embed-
dings into context-aware embeddings,
• section encoder (ENCs):
turns each section
(sentence) into a sentence embedding,
• document encoder (ENCd):
turns an entire
document into a final dense representation,
• section decoder (DECs) or document decoder
(DECd): maps the section or document repre-
sentation to a many-hot label assignment.
All parts except for ENCw and DECd are optional,
i.e., they may not be present in all methods.
Figure 2: Illustration of (a) BIGRU-ATT, (b) HAN, and (c) BIGRU-LWAN.
4.2.1 BIGRU-ATT
In the first deep learning method, BIGRU-ATT
(Figure 2a), ENCw is a stack of BIGRUs that con-
verts the pre-trained word embeddings (wt) to
context-aware ones (ht). ENCd employs a self at-
tention mechanism to produce the final represen-
tation d of the document as a weighted sum of ht:
(cid:80)
exp(h(cid:62)
t u)
j exp(h(cid:62)
T(cid:88)
atht
1
T
t=1
j u)
at =
d =
(1)
(2)
T is the document's length in words, and u is
a trainable vector used to compute the attention
scores at over ht. DECd is a linear layer with
L = 4, 271 output units and sigmoid (σ) activa-
tions that maps the document representation d to
L probabilities, one per label.
4.2.2 HAN
The Hierarchical Attention Network (HAN) (Yang
et al., 2016), exploits the structure of the doc-
uments by encoding the text in two consecutive
steps (Figure 2b). First, a BIGRU (ENCw) followed
by a self-attention mechanism (ENCs) turns the
word embeddings (wit) of each section si with Ti
words into a section embedding ci:
vit = tanh(W (s)hit + b(s))
a(s)
it =
ci =
(cid:80)
exp(v(cid:62)
j exp(v(cid:62)
Ti(cid:88)
it u(s))
ij u(s))
a(s)
it hit
1
Ti
t=1
(3)
(4)
(5)
where u(s) is a trainable vector. Next, ENCd, an-
other BIGRU with self-attention, converts the sec-
tion embeddings (S in total, as many as the sec-
tions) to the final document representation d:
vi = tanh(W (d)ci + b(d))
a(d)
i
=
d =
i u(d))
j u(d))
(cid:80)
exp(v(cid:62)
j exp(v(cid:62)
S(cid:88)
a(d)
i ci
1
S
i=1
(6)
(7)
(8)
where u(d) is a trainable vector. The final decoder
DECd of HAN is the same as in BIGRU-ATT.
4.3 MAX-HSS
Initial experiments we conducted indicated that
HAN is outperformed by the shallower BIGRU-
ATT. We suspected that the main reason was the
fact that the section embeddings ci that HAN's
ENCs produces contain useful information that is
later degraded by HAN's ENCd. Based on this as-
sumption, we experimented with a novel method,
named Max-Pooling over Hierarchical Attention
Scorers (MAX-HSS). MAX-HSS produces section
embeddings ci in the same way as HAN, but then
employs a separate DECs per section to produce
label predictions from each section embedding ci:
p(s)
i = σ(W (m)ci + b(m))
(9)
where pi is an L-dimensional vector containing
probabilities for all labels, derived from ci. DECd
aggregates the predictions for the whole document
with a MAXPOOL operator that extracts the highest
probability per label across all sections:
p(d) = MAXPOOL(p(s)
1 , . . . , p(s)
S )
(10)
Intuitively, each section tries to predict the labels
relying on its content independently, and DECd ex-
tracts the most probable labels across sections.
document representations dl = (cid:80)
4.3.1 CNN-LWAN and BIGRU-LWAN
The Label-wise Attention Network, LWAN (Mul-
lenbach et al., 2018), also uses a self-attention
mechanism, but here ENCd employs L indepen-
dent attention heads, one per label, generating L
t altht (l =
1, . . . , L) from the sequence of context aware
word embeddings h1, . . . , hT of each document d.
The intuition is that each attention head focuses
on possibly different aspects of h1, . . . , hT needed
to decide if the corresponding label should be as-
signed to the document or not. DECd employs L
linear layers with σ activation, each one operating
on a label-wise document representation dl to pro-
duce the probability for the corresponding label.
In the original LWAN (Mullenbach et al., 2018),
called CNN-LWAN here, ENCw is a vanilla CNN.
We use a modified version, BIGRU-LWAN, where
ENCw is a BIGRU (Figure 2c).
4.4 Z-CNN-LWAN and Z-BIGRU-LWAN
Following the work of Mullenbach et al. (2018),
Rios and Kavuluru (2018b) designed a similar ar-
chitecture in order to improve the results in docu-
ments that are classified with rare labels. In one of
their models, ENCd creates label representations,
ul, from the corresponding descriptors as follows:
E(cid:88)
e=1
ul =
1
E
wle
(11)
where wle is the word embedding of the e-th word
in the l-th label descriptor. The label representa-
tions are then used as alternative attention vectors:
vt = tanh(W (z)ht + b(z))
(cid:80)
exp(v(cid:62)
t ul)
j exp(v(cid:62)
T(cid:88)
altht
1
T
t=1
j ul)
alt =
dl =
(12)
(13)
(14)
where ht are the context-aware embeddings pro-
duced by a vanilla CNN (ENCw) operating on the
document's word embeddings, alt are the attention
scores conditioned on the corresponding label rep-
resentation ul, and dl is the label-wise document
representation. DECd also relies on label represen-
tations to produce each label's probability:
pl = σ(u(cid:62)
l dl)
(15)
Note that the representations ul of both encoun-
tered (during training) and unseen (zero-shot) la-
bels remain unchanged, because the word embed-
dings wle are not updated (Eq. 11). This keeps the
representations of zero-shot labels close to those
of encountered labels they share several descriptor
words with. In turn, this helps the attention mech-
anism (Eq. 13) and the decoder (Eq. 15), where the
label representations ul are used, cope with un-
seen labels that have similar descriptors with en-
countered labels. As with CNN-LWAN and BIGRU-
LWAN, we experiment with the original version of
the model of Rios and Kavuluru (2018b), which
uses a CNN ENCw (Z-CNN-LWAN), and a version
that uses a BIGRU ENCw (Z-BIGRU-LWAN).
4.5 LW-HAN
We also propose a new method, Label-Wise Hier-
archical Attention Network (LW-HAN), that com-
bines ideas from both HAN and LWAN. For each
section, LW-HAN employs an LWAN to produce L
probabilities. Then, like MAX-HSS, a MAXPOOL
operator extracts the highest probability per label
across all sections. In effect, LW-HAN exploits the
document structure to cope with the extended doc-
ument length of legal documents, while employing
multiple label-wise attention heads to deal with the
vast and sparse label set. By contrast, MAX-HSS
does not use label-wise attention.
5 Experimental Results
5.1 Experimental Setup
Hyper-parameters were tuned on development
data using HYPEROPT.6 We tuned for the fol-
lowing hyper-parameters and ranges: ENC output
units {200, 300, 400}, ENC layers {1, 2}, batch
size {8, 12, 16}, dropout rate {0.1, 0.2, 0.3, 0.4},
word dropout rate {0.0, 0.01, 0.02}. For the best
hyper-parameter values, we perform five runs and
report mean scores on test data. For statistical sig-
nificance, we take the run of each method with the
best performance on development data, and per-
form two-tailed approximate randomization tests
(Dror et al., 2018) on test data. We used 200-
dimensional pre-trained GLOVE embeddings (Pen-
nington et al., 2014) in all neural methods.
6https://github.com/hyperopt
5.2 Evaluation Measures
The most common evaluation measures in XMTC
are recall (R@K), precision (P @K), and nDCG
(nDCG@K) at the top K predicted labels, along
with micro-averaged F -1 across all labels. Mea-
sures that macro-average over labels do not con-
sider the number of instances per label, thus being
very sensitive to infrequent labels, which are many
more than frequent ones (Section 3.2). On the
other hand, ranking measures, like R@K, P @K,
nDCG@K, are sensitive to the choice of K.
In
EURLEX57K the average number of labels per
document is 5.07, hence evaluating at K = 5 is
a reasonable choice. We note that 99.4% of the
dataset's documents have at most 10 gold labels.
While R@K and P @K are commonly used,
we question their suitability for XMTC. R@K
leads to unfair penalization of methods when doc-
uments have more than K gold labels. Evaluating
at K = 1 for a document with N > 1 gold labels
returns at most R@1 = 1
N , unfairly penalizing
systems by not allowing them to return N labels.
This is shown in Figure 3, where the green lines
show that R@K decreases as K decreases, be-
cause of low scores obtained for documents with
more than K labels. On the other hand, P @K
leads to excessive penalization for documents with
fewer than K gold labels. Evaluating at K = 5
for a document with just one gold label returns at
most P @5 = 1
5 = 0.20, unfairly penalizing sys-
tems that retrieved all the gold labels (in this case,
just one). The red lines of Figure 3 decline as K
increases, because the number of documents with
fewer than K gold labels increases (recall that the
average number of gold labels is 5.07).
Similar concerns have led to the introduction
of R-Precision and nDCG@K in Information Re-
trieval (Manning et al., 2009), which we believe
are also more appropriate for XMTC. Note, how-
ever, that R-Precision requires that the number of
gold labels per document is known beforehand,
which is not realistic in practical applications.
Therefore we propose R-Precision@K (RP @K)
where K is the maximum number of retrieved
labels. Both RP @K and nDCG@K adjust to
the number of gold labels per document, without
unfairly penalizing systems for documents with
fewer than K or many more than K gold labels.
They are defined as follows:
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
1
2
3
BIGRU-ATT
HANs
BIGRU-LWANs
5
4
7
K top predictions
6
8
9
10
Figure 3: R@K (green lines), P @K (red), RP @K
(black) scores of the best methods (BIGRU-ATT, HANs,
BIGRU-LWAN), for K = 1 to 10. All scores macro-
averaged over test documents.
RP @K =
1
N
N(cid:88)
nDCG@K =
1
N
Rel(n, k)
min (K, Rn)
2Rel(n,k) − 1
log2 (1 + k)
(16)
(17)
N(cid:88)
n=1
ZKn
K(cid:88)
K(cid:88)
k=1
n=1
k=1
Here N is the number of test documents; Rel(n, k)
is 1 if the k-th retrieved label of the n-th test doc-
ument is correct, otherwise 0; Rn is the number of
gold labels of the n-th test document; and ZKn is a
normalization factor to ensure that nDCG@K = 1
for perfect ranking.
In effect, RP @K is a macro-averaged (over test
documents) version of P @K, but K is reduced to
the number of gold labels Rn of each test docu-
ment, if K exceeds Rn. Figure 3 shows RP @K
for the three best systems. Unlike P @K, RP @K
does not decline sharply as K increases, because
it replaces K by Rn (number of gold labels) when
K > Rn. For K = 1, RP @K is equivalent to
P @K, as confirmed by Fig. 3. For large values of
K that almost always exceed Rn, RP @K asymp-
totically approaches R@K (macro-averaged over
documents), as also confirmed by Fig. 3.
5.3 Overall Experimental Results
Table 2 reports experimental results for all meth-
ods and evaluation measures. As expected, Exact
Match is vastly outperformed by machine learning
methods, while Logistic Regression is also unable
to cope with the complexity of XMTC.
Exact Match
Logistic Regression
BIGRU-ATT
HAN
CNN-LWAN
BIGRU-LWAN
Z-CNN-LWAN
Z-BIGRU-LWAN
ENSEMBLE-LWAN
MAX-HSS
LW-HAN
ALL LABELS
FREQUENT
FEW
ZERO
RP @5 nDCG@5 Micro-F 1 RP @5 nDCG@5 RP @5 nDCG@5 RP @5 nDCG@5
0.097
0.710
0.758
0.746
0.716
0.766
0.684
0.718
0.766
0.737
0.721
0.219
0.767
0.799
0.789
0.761
0.805
0.730
0.764
0.805
0.784
0.766
0.074
0.470
0.580
0.544
0.557
0.618
0.454
0.510
0.618
0.443
0.402
0.194
0.011
0.040
0.051
0.036
0.029
0.321
0.438
0.438
0.039
0.039
0.186
0.011
0.027
0.034
0.023
0.019
0.264
0.345
0.345
0.028
0.026
0.099
0.741
0.789
0.778
0.746
0.796
0.717
0.752
0.796
0.773
0.761
0.120
0.539
0.689
0.680
0.642
0.698
0.618
0.652
0.698
0.671
0.669
0.201
0.781
0.813
0.805
0.772
0.819
0.745
0.780
0.819
0.803
0.790
0.111
0.508
0.631
0.597
0.613
0.662
0.495
0.561
0.662
0.463
0.412
Table 2: Results on EURLEX57K for all, frequent (> 50 training instances), few-shot (1 to 50 instances), and zero-
shot labels. All the differences between the best (bold) and other methods are statistically significant (p < 0.01).
In Section 2, we referred to the lack of pre-
vious experimental comparison between meth-
ods relying on label-wise attention and strong
generic text classification baselines. Interestingly,
for all, frequent, and even few-shot labels, the
generic BIGRU-ATT performs better than CNN-
LWAN, which was designed for XMTC. HAN also
performs better than CNN-LWAN for all and fre-
quent labels. However, replacing the CNN encoder
of CNN-LWAN with a BIGRU (BIGRU-LWAN) leads
to the best results overall, with the exception of
zero-shot labels, indicating that the main weak-
ness of CNN-LWAN is its vanilla CNN encoder.
5.4 Few-shot and Zero-shot Results
As noted by Rios and Kavuluru (2018b), de-
veloping reliable and robust classifiers for few-
shot and zero-shot tasks is a significant challenge.
Consider, for example, a test document referring
to concepts that have rarely (few-shot) or never
(zero-shot) occurred in training documents (e.g.,
'tropical disease', which exists once in the whole
dataset). A reliable classifier should be able to at
least make a good guess for such rare concepts.
As shown in Table 2, BIGRU-LWAN outper-
forms all other methods in both frequent and few-
shotlabels, but not in zero-shot labels, where Z-
CNN-LWAN (Rios and Kavuluru, 2018b) provides
exceptional results compared to other methods.
Again, replacing the vanilla CNN of Z-CNN-LWAN
with a BIGRU (Z-BIGRU-LWAN) improves perfor-
mance across all label types and measures.
All other methods, including BIGRU-ATT, HAN,
LWAN, fail to predict relevant zero-shot labels (Ta-
ble 2). This behavior is not surprising, because
the training objective, minimizing binary cross-
entropy across all labels, largely ignores infre-
quent labels. The zero-shot versions of CNN-
LWAN and BIGRU-LWAN outperform all other
methods on zero-shot labels, in line with the find-
ings of Rios and Kavuluru (2018b), because they
exploit label descriptors, which they do not update
during training (Section 4.4). Exact Match also
performs better than most other methods (exclud-
ing Z-CNN-LWAN and Z-BIGRU-LWAN) on zero-
shot labels, because it exploits label descriptors.
To better support all types of labels (frequent,
few-shot, zero-shot), we propose an ensemble of
BIGRU-LWAN and Z-BIGRU-LWAN, which outputs
the predictions of BIGRU-LWAN for frequent and
few-shot labels, along with the predictions of Z-
BIGRU-LWAN for zero-shot labels. The ensem-
ble's results for 'all labels' in Table 2 are the same
as those of BIGRU-LWAN, because zero-shot labels
are very few (163) and rare in the test set.
The two methods (MAX-HSS, LW-HAN) that ag-
gregate (via MAXPOOL) predictions across sec-
tions under-perform in all types of labels, sug-
gesting that combining predictions from individ-
ual sections is not a promising direction for XMTC.
5.5 Providing Evidence through Attention
Chalkidis and Kampas (2018) noted that self-
attention does not only lead to performance im-
provements in legal text classification, but might
also provide useful evidence for the predictions
(i.e., assisting in decision-making). On the left
side of Figure 4a, we demonstrate such indica-
tive results by visualizing the attention heat-maps
of BIGRU-ATT and BIGRU-LWAN. Recall that
BIGRU-LWAN uses a separate attention head per
label. This allows producing multi-color heat-
maps (a different color per label) separately indi-
cating which words the system attends most when
predicting each label. By contrast, BIGRU-ATT
uses a single attention head and, thus, the result-
ing heat-maps include only one color.
(a) COMMISSION DIRECTIVE (EEC) No 82/147
(b) COMMISSION REGULATION (EEC) No 3517/84
Figure 4: Attention heat-maps for BIGRU-ATT (left) and BIGRU-LWAN (right). Gold labels (concepts) are shown at
the top of each sub-figure, while the top 5 predicted labels are shown at the bottom. Correct predictions are shown
in bold. BIGRU-LWAN's label-wise attentions are depicted in different colors.
6 Conclusions and Future Work
We compared various neural methods on a new le-
gal XMTC dataset, EURLEX57K, also investigat-
ing few-shot and zero-shot learning. We showed
that BIGRU-ATT is a strong baseline for this XMTC
dataset, outperforming CNN-LWAN (Mullenbach
et al., 2018), which was especially designed for
XMTC, but that replacing the vanilla CNN of CNN-
LWAN by a BIGRU encoder (BIGRU-LWAN) leads
to the best overall results, except for zero-shot la-
bels. For the latter, the zero-shot version of CNN-
LWAN of Rios and Kavuluru (2018b) produces
exceptional results, compared to the other meth-
ods, and its performance improves further when
its CNN is replaced by a BIGRU (Z-BIGRU-LWAN).
Surprisingly HAN (Yang et al., 2016) and other
hierarchical methods we considered (MAX-HSS,
LW-HAN) are weaker compared to the other neu-
ral methods we experimented with, which do not
consider the structure (sections) of the documents.
The best methods of this work rely on GRUs and
thus are computationally expensive. The length
of the documents further affects the training time
of these methods. Hence, we plan to investigate
the use of Transformers (Vaswani et al., 2017; Dai
et al., 2019) and dilated CNNs (Kalchbrenner et al.,
2017) as alternative document encoders.
Given the recent advances in transfer learning
for natural language processing, we plan to ex-
periment with pre-trained neural language models
for feature extraction and fine-tuning using state-
of-the-art approaches such as ELMO (Peters et al.,
2018)), ULMFIT (Howard and Ruder, 2018) and
BERT (Devlin et al., 2019).
Finally, we also plan to investigate further the
extent to which attention heat-maps provide use-
ful explanations of the predictions made by legal
predictive models following recent work on atten-
tion explainability (Jain and Wallace, 2019).
References
Nikolaos Aletras et al. 2016. Predicting judicial de-
cisions of the European Court of Human Rights:
a Natural Language Processing perspective. PeerJ
Computer Science, 2:e93.
Kush Bhatia, Himanshu Jain, Purushottam Kar, Manik
Varma, and Prateek Jain. 2015. Sparse Local Em-
beddings for Extreme Multi-label Classification. In
Advances in Neural Information Processing Systems
28, pages 730 -- 738.
Piotr Bojanowski, Edouard Grave, Armand Joulin,
and Tomas Mikolov. 2016. Enriching Word Vec-
arXiv preprint
tors with Subword Information.
arXiv:1607.04606.
Ilias Chalkidis, Ion Androutsopoulos, and Achilleas
Michos. 2017. Extracting Contract Elements.
In
Proceedings of the 16th International Conference on
Artificial Intelligence and Law, pages 19 -- 28.
Ilias Chalkidis and Dimitrios Kampas. 2018. Deep
learning in law: early adaptation and legal word em-
beddings trained on large corpora. Artificial Intelli-
gence and Law.
Zihang Dai, Zhilin Yang, Yiming Yang, Jaime G.
Carbonell, Quoc V. Le, and Ruslan Salakhutdi-
nov. 2019. Transformer-XL: Attentive Language
Models Beyond a Fixed-Length Context. CoRR,
abs/1901.02860.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and
Kristina Toutanova. 2019. BERT: Pre-training of
Deep Bidirectional Transformers for Language Un-
derstanding. Proceedings of the Conference of the
NA Chapter of the Association for Computational
Linguistics.
Rotem Dror, Gili Baumer, Segev Shlomov, and Roi Re-
ichart. 2018. The Hitchhiker's Guide to Testing Sta-
tistical Significance in Natural Language Process-
ing. In Proceedings of the 56th Annual Meeting of
ACL (Long Papers), pages 1383 -- 1392.
Jeremy Howard and Sebastian Ruder. 2018. Universal
Language Model Fine-tuning for Text Classification.
In Proceedings of the 56th Annual Meeting of the As-
sociation for Computational Linguistics, pages 328 --
339.
Sarthak Jain and Byron C. Wallace. 2019. Attention is
not Explanation. CoRR, abs/1902.10186.
Alistair EW Johnson, David J. Stone, Leo A. Celi, and
Tom J. Pollard. 2017. MIMIC-III, a freely accessi-
ble critical care database. Nature.
Yoon Kim. 2014. Convolutional Neural Networks for
Sentence Classification. In Proceedings of the 2014
Conference on Empirical Methods in Natural Lan-
guage Processing (EMNLP), pages 1746 -- 1751.
David D. Lewis, Yiming Yang, Tony G. Rose, and Fan
Li. 2004. RCV1: A New Benchmark Collection
for Text Categorization Research. Journal Machine
Learning Research, 5:361 -- 397.
Jingzhou Liu, Wei-Cheng Chang, Yuexin Wu, and
Yiming Yang. 2017. Deep Learning for Extreme
In Proceedings
Multi-label Text Classification.
of the 40th International ACM SIGIR Conference
on Research and Development in Information Re-
trieval, SIGIR '17, pages 115 -- 124.
Yang Liu, Chengjie Sun, Lei Lin, and Xiaolong Wang.
2016. Learning Natural Language Inference us-
ing Bidirectional LSTM model and Inner-Attention.
arXiv preprint arXiv:1605.09090, abs/1605.09090.
Christopher D. Manning, Prabhakar Raghavan, and
Introduction to Information
Hinrich Schtze. 2009.
Retrieval. Cambridge University Press.
Julian McAuley and Jure Leskovec. 2013. Hidden
Factors and Hidden Topics: Understanding Rating
In Proceedings of
Dimensions with Review Text.
the 7th ACM Conference on Recommender Systems,
RecSys '13, pages 165 -- 172.
Eneldo Loza Mencia and Johannes Frnkranz. 2007.
Efficient Multilabel Classification Algorithms for
Large-Scale Problems in the Legal Domain. In Pro-
ceedings of the LWA 2007, pages 126 -- 132.
James Mullenbach, Sarah Wiegreffe, Jon Duke, Jimeng
Sun, and Jacob Eisenstein. 2018. Explainable Pre-
diction of Medical Codes from Clinical Text.
In
Proceedings of the 2018 Conference of the NA Chap-
ter of the Association for Computational Linguistics:
Human Language Technologies, pages 1101 -- 1111.
Ramesh Nallapati and Christopher D. Manning. 2008.
Legal Docket Classification: Where Machine Learn-
ing Stumbles. In EMNLP, pages 438 -- 446.
Ioannis Partalas, Aris Kosmopoulos, Nicolas Baskiotis,
Thierry Arti`eres, Georgios Paliouras, ´Eric Gaussier,
Ion Androutsopoulos, Massih-Reza Amini, and
Patrick Gallinari. 2015.
LSHTC: A Bench-
mark for Large-Scale Text Classification. CoRR,
abs/1503.08581.
Jeffrey Pennington, Richard Socher, and Christo-
pher D. Manning. 2014. GloVe: Global Vectors for
Word Representation. In Empirical Methods in Nat-
ural Language Processing (EMNLP), pages 1532 --
1543.
Nal Kalchbrenner, Lasse Espeholt, Karen Simonyan,
Aaron van den Oord, Alex Graves, and Koray
Kavukcuoglu. 2017. Neural Machine Translation
In Proceedings of Conference on
in Linear Time.
Empirical Methods in Natural Language Processing
(EMNLP).
Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt
Gardner, Christopher Clark, Kenton Lee, and Luke
Zettlemoyer. 2018. Deep contextualized word repre-
sentations. In Proceedings of the Conference of NA
Chapter of the Association for Computational Lin-
guistics.
Peng Zhou, Wei Shi, Jun Tian, Zhenyu Qi, Bingchen
Li, Hongwei Hao, and Bo Xu. 2016. Attention-
Based Bidirectional Long Short-Term Memory Net-
works for Relation Classification. In Proceedings of
the 54th Annual Meeting of the Association for Com-
putational Linguistics (Volume 2: Short Papers),
pages 207 -- 212.
Arkaitz Zubiaga. 2012.
Enhancing Navigation on
Wikipedia with Social Tags. CoRR, abs/1202.5469.
Yashoteja Prabhu and Manik Varma. 2014. FastXML:
A Fast, Accurate and Stable Tree-classifier for Ex-
treme Multi-label Learning. In Proceedings of the
20th ACM SIGKDD International Conference on
Knowledge Discovery and Data Mining, KDD '14,
pages 263 -- 272.
Anthony Rios and Ramakanth Kavuluru. 2018a. EMR
Coding with Semi-Parametric Multi-Head Matching
Networks. In Proceedings of the 2018 Conference
of the NA Chapter of the Association for Computa-
tional Linguistics: Human Language Technologies,
pages 2081 -- 2091.
Anthony Rios and Ramakanth Kavuluru. 2018b. Few-
Shot and Zero-Shot Multi-Label Learning for Struc-
In Proceedings of the 2018
tured Label Spaces.
Conference on Empirical Methods in Natural Lan-
guage Processing, pages 3132 -- 3142.
Tim Rocktaschel, Edward Grefenstette, Karl Moritz
Hermann, Tom´as Kocisk´y, and Phil Blunsom. 2016.
Reasoning about Entailment with Neural Attention.
In Proceedings of the 4th International Conference
on Learning Representations (ICLR).
George Tsatsaronis, Georgios Balikas, Prodromos
Malakasiotis, Ioannis Partalas, Matthias Zschunke,
Michael R. Alvers, Dirk Weissenborn, Anastasia
Krithara, Sergios Petridis, Dimitris Polychronopou-
los, Yannis Almirantis, John Pavlopoulos, Nico-
las Baskiotis, Patrick Gallinari, Thierry Arti`eres,
Axel-Cyrille Ngonga Ngomo, Norman Heino, ´Eric
Gaussier, Liliana Barrio-Alvers, Michael Schroeder,
Ion Androutsopoulos, and Georgios Paliouras. 2015.
An overview of the BIOASQ large-scale biomedical
semantic indexing and question answering competi-
tion. BMC Bioinformatics, 16(138).
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob
Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz
Kaiser, and Illia Polosukhin. 2017. Attention Is All
You Need. Proceedings of the 31th Annual Confer-
ence on Neural Information Processing Systems.
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho,
Aaron Courville, Ruslan Salakhudinov, Rich Zemel,
and Yoshua Bengio. 2015. Show, Attend and Tell:
Neural Image Caption Generation with Visual At-
In Proceedings of the 32nd International
tention.
Conference on Machine Learning, volume 37, pages
2048 -- 2057.
Zichao Yang, Diyi Yang, Chris Dyer, Xiaodong He,
Alex Smola, and Eduard Hovy. 2016. Hierarchical
Attention Networks for Document Classification. In
Proceedings of the 2016 Conference of the NA Chap-
ter of the Association for Computational Linguistics:
Human Language Technologies, pages 1480 -- 1489.
Ronghui You, Suyang Dai, Zihan Zhang, Hiroshi
Atten-
Mamitsuka, and Shanfeng Zhu. 2018.
tionXML: Extreme Multi-Label Text Classification
with Multi-Label Attention Based Recurrent Neural
Networks. CoRR, abs/1811.01727.
|
1709.03064 | 2 | 1709 | 2017-11-10T06:13:30 | AppTechMiner: Mining Applications and Techniques from Scientific Articles | [
"cs.CL"
] | This paper presents AppTechMiner, a rule-based information extraction framework that automatically constructs a knowledge base of all application areas and problem solving techniques. Techniques include tools, methods, datasets or evaluation metrics. We also categorize individual research articles based on their application areas and the techniques proposed/improved in the article. Our system achieves high average precision (~82%) and recall (~84%) in knowledge base creation. It also performs well in application and technique assignment to an individual article (average accuracy ~66%). In the end, we further present two use cases presenting a trivial information retrieval system and an extensive temporal analysis of the usage of techniques and application areas. At present, we demonstrate the framework for the domain of computational linguistics but this can be easily generalized to any other field of research. | cs.CL | cs | AppTechMiner: Mining Applications and Techniques from
Scientific Articles
Mayank Singh∗
Soham Dan
Sanyam Agarwal
Dept. of Computer Science and Engg.
Dept. of Computer Science and Engg.
Dept. of Computer Science and Engg.
IIT Kharagpur, India
[email protected]
IIT Kharagpur, India
[email protected]
IIT Kharagpur, India
[email protected]
7
1
0
2
v
o
N
0
1
]
L
C
.
s
c
[
2
v
4
6
0
3
0
.
9
0
7
1
:
v
i
X
r
a
Pawan Goyal
Animesh Mukherjee
Dept. of Computer Science and Engg.
Dept. of Computer Science and Engg.
IIT Kharagpur, India
[email protected]
IIT Kharagpur, India
[email protected]
ABSTRACT
(cid:140)is paper presents AppTechMiner, a rule-based information extrac-
tion framework that automatically constructs a knowledge base of
all application areas and problem solving techniques. Techniques
include tools, methods, datasets or evaluation metrics. We also
categorize individual research articles based on their application
areas and the techniques proposed/improved in the article. Our
system achieves high average precision (∼82%) and recall (∼84%) in
knowledge base creation. It also performs well in application and
technique assignment to an individual article (average accuracy
∼66%). In the end, we further present two use cases presenting a
trivial information retrieval system and an extensive temporal anal-
ysis of the usage of techniques and application areas. At present,
we demonstrate the framework for the domain of computational
linguistics but this can be easily generalized to any other (cid:128)eld of
research.
CCS CONCEPTS
•Information systems →Data mining;
KEYWORDS
Information extraction, application area, techniques, computational
linguistic
ACM Reference format:
Mayank Singh, Soham Dan, Sanyam Agarwal, Pawan Goyal, and Animesh
Mukherjee. 2017. AppTechMiner: Mining Applications and Techniques
from Scienti(cid:128)c Articles. In Proceedings of WOSP 2017, Toronto, ON, Canada,
June 19, 2017, 8 pages.
DOI: 10.1145/3127526.3127527
∗First three authors have equal contribution.
Permission to make digital or hard copies of all or part of this work for personal or
classroom use is granted without fee provided that copies are not made or distributed
for pro(cid:128)t or commercial advantage and that copies bear this notice and the full citation
on the (cid:128)rst page. Copyrights for components of this work owned by others than ACM
must be honored. Abstracting with credit is permi(cid:138)ed. To copy otherwise, or republish,
to post on servers or to redistribute to lists, requires prior speci(cid:128)c permission and/or a
fee. Request permissions from [email protected].
WOSP 2017, Toronto, ON, Canada
© 2017 ACM. 978-1-4503-5388-5/17/06...$15.00
DOI: 10.1145/3127526.3127527
1 INTRODUCTION
It is not uncommon for researchers to envisage an information
extraction system for scienti(cid:128)c articles that can answer queries like,
(i)What are all the techniques and tools used in Machine Transla-
tion?, (ii)Which are the subareas of Computational Linguistics, where
Malt Parser is frequently used? etc. However, the meta-information
necessary for constructing such a system is rarely available. Each
research domain consists of multiple application areas which are
typically associated with various techniques used to solve prob-
lems in these areas. For instance, two commonly used techniques
in Information Extraction are "Conditional Random Fields" and
"Hidden Markov Models". Wikipedia lists 32 popular NLP tasks
and sub-tasks1. However, to our surprise, we do not (cid:128)nd in this
list many trending applications areas, for example, Dialog and In-
teractive systems, Social Media, Cognitive Modeling and Psycholin-
guistics, etc. In addition, new techniques are continuously being
proposed/improved for an application area with time and changing
needs. (cid:140)is temporal aspect raises diverse research questions - for
example, how techniques for POS tagging varied over time, or, what
are the most important areas of Computational Linguistics that
have been addressed in the last (cid:128)ve years? (cid:140)is also should be of
huge interest for new researchers surveying for an application area.
Contributions: In this paper, we introduce AppTechMiner that
automatically constructs a knowledge base of all application ar-
eas and problem solving techniques using a rule-based approach.
Subsequently, the generated knowledge base can be employed in
several information retrieval systems to answer aforementioned
questions. We demonstrate the current framework construction for
the domain of computational linguistics because of the availability
of full-text research articles. However, the proposed construction
mechanism can be easily generalized to any other (cid:128)eld of research.
Next, we de(cid:128)ne two common keywords used in the current paper:
Area: Area represents an application area of a particular research
domain. Common application areas (herea(cid:137)er wri(cid:138)en in italics)
in Computational Linguistics include Machine Translation, Depen-
dency Parsing, POS Tagging, Information Extraction, etc.
Technique: A tecnhnique represents a tool or method used for
a task. (cid:140)is may also include evaluation tool/method. Common
examples (herea(cid:137)er wri(cid:138)en within quotes) include "Bleu Score",
1h(cid:138)ps://en.wikipedia.org/wiki/Natural language processing#Major tasks
WOSP 2017, June 19, 2017, Toronto, ON, Canada
Singh et al.
"Rouge Score", "Charniak Parser", "TnT Tagger", etc. Note that tech-
nique of one paper can potentially be an area of another paper. For
example, in "Training Nonde(cid:128)cient Variants of IBM-3 and IBM-4 for
Word Alignment" [23], "Word Alignment" is an area but in "Using
Word-Dependent Transition Models in HMM-Based Word Align-
ment for Statistical Machine Translation" [9], "Word Alignment" is
a technique for Machine Translation.
(cid:140)e entire framework is organized into four phases (Section 4):
(1) Creation of a ranked list of areas;
(2) Categorizing papers on the basis of areas;
(3) Creation of a ranked list of techniques;
(4) Categorizing papers on the basis of techniques.
Key results: We achieve high performance in each of the above
phases (see Section 5). (cid:140)e precision of the (cid:128)rst phase is 84% (for
top 30 areas) and recall is 87%. For the second phase, the accuracy
is 73.3%. (cid:140)e third phase results in a precision and recall of 80%
(for top 26 techniques) and 80.7% respectively. In the fourth phase,
our system achieves an accuracy of 60%.
Use cases: In Section 6, we present two use-cases: (i) construct-
ing an information retrieval system, and (ii) analysis of temporal
characteristics of techniques associated with an area. We also in-
vestigate the temporal variation of the popular areas for speci(cid:128)c
conferences, namely, acl and coling.
2 RELATED WORK
Extracting application area and techniques is primarily an infor-
mation extraction task. Information extraction (IE) from scienti(cid:128)c
articles combines approaches from natural language processing
and data mining and has generated substantial research interest
in recent times. In particular, there has been burgeoning research
interest in the domain of biomedical documents. Shah et al. [24]
extracted keywords from full text of biomedical articles and claim
that there exist a heterogeneity in the keywords from di(cid:130)erent sec-
tions. Muller et al. [19] have developed the Textpresso framework,
that leverage ontologies for information retrieval and extraction. In
a similar work, Fukuda et al. [5] proposed an IE system for protein
name extraction. (cid:140)ere has been signi(cid:128)cant work in information
extraction in the area of protein structure analysis. Gaizauskas et
al. [6] proposed PASTA, an IE system developed and evaluated for
the protein structure domain. Friedman et al. [4] have developed a
similar system to extract structure information about cellular path-
ways using a knowledge model. Biological information extraction
has seen extensive work covering diverse aspects with large num-
ber of survey papers. Cohen et al.'s [3] survey on biomedical text
mining, Krallinger et al.'s [15] survey on information extraction and
applications for biology and Wimalasuriya et al. [26] on ontology
based information extraction are examples of some of the popular
surveys on IE for biomedical domain.
Information extraction in other domains has also received an
equally strong a(cid:138)ention from researchers. Hyponym relations have
been extracted automatically in the celebrated work by Hearst et
al. [10]. Caraballo et al. [1] have extended previous work on auto-
matically building semantic lexicons to automatic construction of
a hierarchy of nouns and their hypernyms. Teufel [25] proposed
information management and information foraging for researchers
and introduced a new document analysis technique called argu-
mentative zoning which is useful for generating user-tailored and
task-tailored summaries. Kim et al. [13] and Lopez et al. [16] are
two popular works in automatic keyphrase extraction from scien-
ti(cid:128)c articles. (cid:139)azvinian et al. [20] have explored summarization
of scienti(cid:128)c papers using citation summary networks and citation
summarization through keyphrase extraction [21].
Jones [12] introduced an approach for entity extraction from la-
beled and unlabeled text. (cid:140)ey proposed algorithms that alternately
look at noun phrases and their local contexts to recognize members
of a semantic class in context. A relatively recent work by Gupta
et al. [8] developed a pa(cid:138)ern learning system with bootstrapped
entity extraction. In Gupta et al. [7], the authors investigated the
dynamics of a research community by extracting key aspects from
scienti(cid:128)c papers and showed how extracting key information helps
in analyzing the in(cid:131)uence of one community on another. Jin at
al. [11] proposed a supervised sequence labeling system that iden-
ti(cid:128)es scienti(cid:128)c terms and their accompanying de(cid:128)nition.
We believe that this is the (cid:128)rst a(cid:138)empt to speci(cid:128)cally mine ap-
plication areas and techniques from research articles. Instead of
complex statistical machine learning models, we employ rule-based
approach, preferred in commercial world for information extrac-
tion tasks [2]. (cid:140)e proposed construction mechanism can be easily
generalized to any other (cid:128)eld of research.
3 DATASET
We use ACL Anthology Network [22] dataset which consists of
21,213 full text papers from the domain of computational linguistics
and natural language processing. (cid:140)e dataset consists of papers
between the years 1965 -- 2013 from 342 ACL venues.
4 METHODOLOGY
In this section, we describe methods to construct knowledge base
of areas and techniques. As we already pointed out in Section 1,
the entire framework is organized in four phases: (1) creation of a
ranked list of areas, (2) categorizing papers on the basis of areas, (3)
creation of a ranked list of techniques, and (4) categorizing papers
on the basis of techniques. Next, we brie(cid:131)y describe these four
phases in further details.
4.1 Creation of a ranked list of areas
We employ paper title information to extract areas. We use hand-
wri(cid:138)en rules to extract phrases which are likely to contain the area
names. We observe that some functional keywords, such as, "for",
"via", "using" and "with" act as delimiters for such phrases. For
example, paper title, "Moses: Open source toolkit for statistical
machine translation" [14] represents an instance of the form X for
Y, where Y is the application area. We also observe that the phrase
succeeding "for" or preceding "using" or both (e.g., in "Decision
procedures for dependency parsing using graded constraints" [18])
are likely to contain the name of an area.
Seed set creation: We create a seed set of the above functional key-
words and use bootstrapped pa(cid:138)ern learning to gather more such
words along with areas. We had initially started with seven func-
tional keywords and by bootstrapped pa(cid:138)ern learning, augmented
this to a (cid:128)nal set of 11 functional keywords.
AppTechMiner: Mining Applications and Techniques from Scientific Articles
WOSP 2017, June 19, 2017, Toronto, ON, Canada
Ranking of the extracted phrases: Even though bootstrapped
pa(cid:138)ern learning identi(cid:128)ed potential area names, we observe large
amount of noisy phrases such as, "machine translation system
combination and evaluation". Here, "machine translation" must
be extracted from the surrounding noisy words. We notice that
empirical ranking algorithms produce good results in extraction of
the exact area names from long phrases. We employ three ranking
schemes, described below:
• Scheme 1: In this scheme, we rank according to individual
n-gram scores. (cid:140)e score of a given n-gram (N ) is calculated
as:
(1)
ScoreN = countN
j countj
where, countN represents occurrence count of the N
th
n-gram and the denominator represents total count of all
the n-grams.
• Scheme 2: (cid:140)is scheme is very similar to previous scheme
with an additional constraint that if the score of an n-gram
is greater than both of its border (n − 1) grams, then the
border (n − 1) grams are le(cid:137) out. (cid:140)e intuition behind this
is as follows: the trigram "word sense disambiguation" will
have a higher score than its border bigrams, "word sense"
and "sense disambiguation", causing both these bigrams to
be le(cid:137) out.
• Scheme 3: We improve upon the previous scheme by es-
timating di(cid:130)erent threshold scores for each n-gram. (cid:140)e
thresholds are selected manually by observing the individ-
ual n-gram lists. In Section 5.2, we shall compare the preci-
sion of each of these methods and we have (cid:128)nally adopted
Scheme 3 since it gives the best results. We present 24 of
the top 30 areas judged as accurate by domain experts:
Machine Translation, Natural Language Processing, Word Sense
Disambiguation, Speech Recognition, (cid:139)estion Answering, Depen-
dency Parsing, Information Extraction, Chinese Word Segmenta-
tion, Semantic Role Labeling, Information Retrieval, Entity Recog-
nition, Word Alignment, Conditional Random Fields, Maximum
Entropy, Coreference Resolution, Machine Learning, Dialogue
Systems, Textual Entailment, Natural Language Understanding,
Active Learning, POS Tagging, Relation Extraction, Sentiment
Analysis, Sense Induction
4.2 Categorizing papers on the basis of areas
In this phase, we assign individual papers to one of the discovered
areas. Individual papers are categorized to their corresponding
areas on the basis of two strategies -- direct match and relevance as
per the language models, de(cid:128)ned for various areas.
Direct match: In the direct match approach, we search for an
explicit string match between the title or abstract and one of the
areas. In case we do not (cid:128)nd a match in the title, we check for a
direct match with the abstract of the paper. If the abstract contains
only one such matching area then the paper is categorized to that
area. On the other hand, if the title or the abstract contains more
than one direct match with the set of area names then we further
use the language modeling approach (discussed next) to classify
that paper.
Language modeling: In this approach, we create a language
model for each area, and classify a document into one of these
areas. To create a language model for each area, we select the pa-
pers which could be classi(cid:128)ed on the basis of a single direct match.
(cid:140)e titles and abstracts of all the papers belonging to one area are
taken together to construct the language model of that area with
the Jelinek-Mercer (JM) smoothing.
A document not categorized using direct match is treated as
a query, consisting of the words in its title and abstract. A(cid:137)er
experimenting on a small set of sample papers, we (cid:128)xed λ for JM
smoothing to 0.7 [27]. (cid:140)e prior probability P(a) for an application
area a, is proportional to the number of papers which were assigned
to that area by a single direct match of either the title or the abstract.
Hence, given a query paper q, the area which scores the highest
arg max
a
P(aq) = arg max
a
P(qa)P(a)
(2)
is assigned as the area for the given paper.
4.3 Creation of a ranked list of techniques
(cid:140)is extraction phase is based on the idea of method papers. We
classify a paper as method paper, if it introduces a novel technique
or provides a toolkit in an area of computational linguistics. For
instance, the paper introducing the Stanford CoreNLP toolkit is one
such relevant example.
We observe two characteristics for these papers -- one, they are
expected to have been cited a number of times which is above some
threshold (k1) thus indicating that the technique introduced or
improved upon is frequently used and second, the fraction of times
they obtain their citations in the "methodology" section of other
papers is above some threshold (k2%), thereby, indicating that they
are primarily "method papers". In the current framework, we select
k1 = 15 and k2 = 50% based on extensive experiments on the AAN
dataset. We assume that when citing paper applies a technique
from the cited paper, it cites that paper and also mentions the name
of the technique in the citation context (i.e., the sentence where
the citation is made). Our objective is to extract all the techniques
a method paper is used for, from the citation context(s). We now
describe the algorithm in detail.
For every method paper in the corpora, we extract all the citation
contexts where this paper has been cited. We observe that usually
the techniques are represented as noun phrases in the citation
contexts. For example, in the citation context, "For English, we
used the Dan Bikel implementation of the Collins parser (Collins,
2003).", we obtain three noun phrases: 1) Dan Bikel implementation,
2) Collins parser, and 3) Collins. We build a global vector of noun
phrases across all citation contexts for all the method papers. We
consider this global vector as the ranked list of all the techniques
th component
used in the computational linguistics domain. (cid:140)e i
th noun phrase, ordered
of the vector is the raw count of the i
lexicographically, over the method citations of the entire corpora.
Some of the top ranking noun phrases are:
WOSP 2017, June 19, 2017, Toronto, ON, Canada
Singh et al.
Penn Treebank, Stanford Parser, Rate Training, Berkeley Parser,
Machine Translation, Statistical Machine Translation, Charniak
Parser, Moses Toolkit, Word Sense Disambiguation, Maximum
Entropy, IBM Model, Bleu Score, Perceptron Algorithm, Word
Alignment, Stanford POS Tagger, Collins Parser, Natural Language
Processing, Bleu Metric, Coreference Resolution, Moses Decoder,
Giza++ Toolkit, Brill Tagger, TnT Tagger,Anaphora Resolution,
MST Parser, CCG Parser, Malt Parser, Minimum Error Rate Train-
ing
4.4 Categorizing papers on the basis of
techniques
To identify the techniques for which a paper X is used, we extract
all the noun phrases present in all the citation context(s) where
this paper has been cited. We build a similar vector of these noun
th component of the vector is the raw count of
phrases where the i
that noun phrase drawn from the global vector introduced in the
previous section. If a particular noun phrase from the global vector
is missing in the citation contexts for X, its weight is set to zero.
We take dot product between this local vector of X and the global
vector to get a ranked list of possible techniques for X. Finally,
we choose top K techniques on this rank list as the techniques the
paper X is used for.
(cid:140)e four phases resulted into a knowledge base that consists
of a list of areas, a mapping between individual papers to the list
of areas, a list of techniques and a mapping between individual
papers to the list of techniques. We can employ this generated
knowledge base in multiple information retrieval tasks. Section 6.1
demonstrate construction of one such IR system.
5 EVALUATION RESULTS
In this section, we present extensive evaluations carried out on
our proposed system. Section 5.1 discusses general evaluation
guidelines along with summary of human judgment experiment
se(cid:138)ings.
5.1 Evaluation setup
As described in Section 4, the entire framework is organized into
four phases. (cid:140)erefore, we evaluate each phase individually using
human judgment experiments. For (cid:128)rst and third phase, two subject
experts (the (cid:128)rst and the second author) are employed. For second
and fourth phase, we (cid:131)oat an online survey among six subject ex-
perts (four PhD and two under-graduate students). Each subject
expert has evaluated 20 paper-area and ten paper-technique assign-
ments. In total, we evaluate 120 paper-area and 60 paper-technique
assignments.
5.2 Evaluation of the ranked list of areas
First, we conduct experiment to understand the relative perfor-
mances of the three schemes described in Section 4.1 for creation
of the ranked list. Scheme 3 (80%) outperforms scheme 1 (57%) and
2 (73%) in terms of precision. (cid:140)erefore, we employ scheme 3 for
the creation of the ranked list in the subsequent stages.
We evaluate the ranked list of the potential areas in the compu-
tational linguistics domain extracted from the ACL corpora. We
employ precision-recall measures for the purpose of evaluation. For
computing recall, however, due to limited human resource for this
challenging task of labeling areas for the entire corpus of papers, we
select a random set of 200 research papers and manually2 identi(cid:128)ed
each of their areas. In total, we (cid:128)nd 23 distinct areas (comparable
to Wikipedia list of 32 popular tasks3). Scheme 3 identi(cid:128)ed 20 out
of 23 areas, achieving a high recall of 87%.
Precision was computed by measuring fraction of correctly iden-
ti(cid:128)ed areas in the top K area list. Table 1 presents the values of
precision obtained for K = 25, 50, 75 and 100 top application areas.
As we can observe, majority of correct areas are ranked higher by
our ranking methodology.
Precision (%)
Areas Techniques
K
25
50
75
100
84
72
51
43
80
64
48
41
Table 1: (cid:135)e precision values for K = 25, 50, 75 and 100 for ex-
traction of the list of application areas (Scheme 3) and tech-
niques.
We also employed another domain expert to annotate (cid:128)rst 30
results independent of the (cid:128)rst judge. Inter-annotator agreement
(Cohen's kappa coe(cid:129)cient) was calculated and the value of κ came
out to be 0.79. (cid:140)e matrix with the agreement/disagreement count
between the experts is presented in Table 2.
Domain Expert 1 Yes
No
Total
Domain Expert 2
Yes
23
1
24
No
1
5
6
Total
24
6
30
Table 2: (cid:135)e matrix of agreement and disagreement between
two domain experts for annotation of area list.
5.3 Evaluating the extraction of areas from
individual papers
Next, we evaluate our area assignment phase. As described in Sec-
tion 5.1, out of the 120 expert assignments, 88 (73.3%) assignments
were marked as correct.
5.4 Evaluating the list of techniques
(cid:140)is evaluation task is similar to the evaluation of the ranked list
of application areas (see Section 5.2). However, in this case, recall
calculation is di(cid:129)cult if we work with the top K techniques for
each method paper. To simplify the task, we proceed to calculate
recall for only the highest ranked technique for each method paper.
Again, due to resource constraints, we select a small random set of
30 papers and aggregate all their citation contexts from the method
sections of the citing papers. Annotation of this random set resulted
into 26 introduced or improved distinct techniques. Technique
extraction algorithm obtained 21 out of 26 techniques resulting
2(cid:140)e second author participated in labeling task.
3h(cid:138)ps://en.wikipedia.org/wiki/Natural language processing#Major tasks
AppTechMiner: Mining Applications and Techniques from Scientific Articles
WOSP 2017, June 19, 2017, Toronto, ON, Canada
Domain Expert 1 Yes
No
Total
Domain Expert 2
Yes
18
1
19
No
2
4
6
Total
20
5
25
Table 3: (cid:135)e matrix of agreement and disagreement between
two domain experts for annotation of technique list.
in a recall of 80.7%. Table 1 shows the precision obtained for the
technique extraction algorithm for various values of K. As we can
observe, majority of the correct techniques are ranked higher by
our ranking algorithm.
Here again we asked another domain expert to annotate the
results independent of the (cid:128)rst judge. We also calculated the
inter-annotator agreement (Cohen's kappa coe(cid:129)cient) for the top
25 techniques and κ came out to be 0.65. (cid:140)e matrix of agree-
ment/disagreement counts is presented in Table 3.
5.5 Evaluating the extraction of techniques
from a method paper
For this evaluation, we employ subject experts as described in
Section 5.1. We achieve a moderate accuracy of 60% on set of
random 60 paper-techniques assignments.
6 USE CASE
In this section, we present two use cases. In the (cid:128)rst use case,
we demonstrate construction of an example information retrieval
system. In the second use case, we analyze the evolution of the
application areas and the corresponding techniques over a given
time-period.
6.1 An example information retrieval system
We demonstrate the construction of an information retrieval (IR)
system that takes area name as an input and outputs a list of tools
and techniques. An example of input/output of such IR system
could be: Machine Translation → "Word Alignment", "Gale Church
Algorithm", "Bleu Score", "Moses Toolkit" etc. We propose a count
update based algorithm to construct this IR system. More speci(cid:128)-
cally, for each paper P, we (cid:128)nd its area and all the techniques of the
method papers that it cites in its methodology section and append
all these techniques to the list corresponding to the extracted area
for this paper.
Result: list of techniques for that area
initialization T ← ϕ;
for P ∈ Corpus do
A ← Area(P) T ← ϕ MSet ← MethodPapersCitedBy(P)
for M ∈ MSet do
end
T(A) ← T(A) ∪ T
T ← T ∪ T echnique(M)
end
Algorithm 1: Algorithm to generate list of techniques given area
name.
Here, function Area(P) returns area of a paper P. Function Tech-
nique(M) returns techniques introduced or improved upon by a
method paper M. Function MethodPapersCitedBy(P) returns all the
method papers cited by paper P in its methodology section. A
simple variation of Algorithm 1 by keeping track of the number
of times a particular technique features in an area can potentially
trace most popular techniques for an area.
In Table 4, we present some of the input/output examples from
higher ranked areas of Computational Linguistics. As we see from
these examples, the techniques extracted consist of sub-tasks, tools
and datasets popularly used in an area. Also, it is interesting to
observe that the extracted techniques span a wide range of time,
for example, techniques like "Collins Parser", "Berkeley Parser",
"Charniak Parser", "Stanford Parser", "MST Parser" and "Malt Parser"
are introduced in Dependency Parsing at substantially di(cid:130)erent time
periods.
6.2 Temporal Analysis
We analyze evolution of application areas and techniques over a
given time-period. Below, we present three temporal scenarios.
6.2.1 Evolution of areas. From the list of popular areas (based on
the total number of papers published in an area) in aan, we present
six representative areas, namely, Machine Translation, Dependency
Parsing, Speech Recognition, Information extraction, Summarization
and Semantic Role Labeling, and study their popularity (percent-
age of papers in that area for that time period out of total papers
published in that time period) from 1980-2013 in 5-year windows.
Figure 1 demonstrates the temporal variations for these areas and
how they evolve with time.
Observations: While areas like Machine Translation and Depen-
dency Parsing are on the rise, Information extraction and Semantic
Role Labeling are on a decline. A further interesting observation is
that till 1994, the ACL community had a lot of interest in Speech
Recognition which then saw a sharp decline possibly because of the
fact that the speech community slowly separated out.
Figure 1: Evolution of di(cid:130)erent application areas over time
in terms of fraction of publications. Machine Translation
and dependency parsing are on the rise, information extrac-
tion and semantic role labeling are on a decline. ACL com-
munity gradually separates out from Speech community.
1980-19841985-19891990-19941995-19992000-20042005-20092010-2013024681012Papers(%)intheAreaMachineTranslationDependencyParsingSpeechRecognitionInformationExtractionSummarizationSemanticRoleLabelingWOSP 2017, June 19, 2017, Toronto, ON, Canada
Singh et al.
Area
Machine Translation
Dependency Parsing
Summariza-
Multi-document
tion
Word Sense
Disambiguation
Sense Induction
Opinion Mining
Chinese Word Segmentation
Techniques
Bleu Score, Rate Training, IBM Model, Word Alignment, Moses Toolkit, Inversion Transduction
Grammar, Bootstrap Resampling, Translation Model, PennTreebank, Translation (cid:139)ality, Language
Model, Gale Church Algorithm
Penn Treebank, Malt Parser, Berkeley Parser, MST Parser, Charniak Parser, Collins Parser, Maximum
Entropy, Nivre's Arc-Eager, Stanford Parser, Perceptron Algorithm
Topic Signatures, Information Extraction, Page Rank, Klsum Summarization System, Mead Summarizer,
Word Sense Disambiguation, Lexical Chains, Inverse Sentence Frequency
Coarse Senses, Semcor Corpus, Senseval Competitions, Cemantic Similarity, Micro Context, Maximum
Entropy, Mutual Information
Word Sense Disambiguation, SemEval Word Sense Induction, Chinese Whispers, Recursive Spectral
Clustering, Topic Models, Graded Sense Annotation, Ontonotes Project
Sentiment Analysis, Mutual Information, Spin Model, Subjectivity Lexicon, Semantic Role Analysis,
Multiclass Clasi(cid:128)er, Coreference Resolution, Latent Dirichlet
Entity Recognition, Conditional Random Fields, Segmentation Bakeo(cid:130), Stanford Chinese Word Seg-
menter, Perceptron Algorithm , Discourse Segmentation, CRF model
Table 4: Example application areas and corresponding techniques from AAN dataset
AAN
1975-1984
1985-1994
1995-2004
2005-2013
ACL
1975-1984
1985-1994
1995-2004
2005-2013
COLING
1965-1974
1975-1984
1985-1994
1995-2004
Figure 2: Phrase-Clouds representing the proportion of papers for an area across various time periods for the complete AAN
dataset as well as ACL and COLING conferences. ACL seems to be more interested in the areas such as Machine Translation
and Dependency Parsing over the recent decades. COLING community also seems more interested towards areas like Machine
Translation and Dependency Parsing along with Bilingual Lexicon Extraction in the recent decades.
6.2.2 Evolution of major areas in top conferences. We shortlist
two top-tier conferences in the computational linguistics domain,
namely, the Annual Meeting of the Association of Computational
Linguistics (ACL) and the International Conference on Compu-
tational Linguistics (COLING). We study 40 years of conference
history by dividing into four 10-year buckets. Next, for each con-
ference, we extract top ten most popular areas (based on citation
AppTechMiner: Mining Applications and Techniques from Scientific Articles
WOSP 2017, June 19, 2017, Toronto, ON, Canada
counts) for each 10-year bucket. Figure 2 presents phrase clouds rep-
resenting evolution of areas in these two conferences in comparison
to the full AAN dataset itself. Some of the interesting observations
from this analysis are:
• Full AAN dataset: Here, we observe that while in the
earlier decades, areas such as Semantic Role Labeling, Eval-
uation of Natural Language and Speech Recognition were
dominant, they fade away in the recent decades. On the
other hand, areas such as Machine Translation and Depen-
dency Parsing, which were less prevalent in the earlier
decades gain signi(cid:128)cant importance in the recent decades.
We also see Sentiment Analysis as one of the major areas
in the last decade.
• ACL: In the earlier decades, this community was interested
in areas like Linguistic Knowledge Sources and Semantic Role
Labeling. Over the recent decades, however, it seems to be
more interested in areas such as Machine Translation and
Dependency Parsing. Interestingly, in the time period 2005
-- 2013, an upcoming area of Social Media is found to gain
importance.
• COLING: Areas like Lexical Semantics and Linguistic Knowl-
edge Sources were of interest to the community in the earlier
decades. However, in the recent years, areas like Machine
Translation, Dependency Parsing and Bilingual Lexicon Ex-
traction have gained importance. An interesting observa-
tion here is that Semantic Role Labeling has been all through
a thrust area for this particular conference.
6.2.3 Evolution of techniques in areas. In the second use case,
we study evolution of techniques for a given area. For this analysis,
we divide the time-line into (cid:128)xed buckets of 4 − 5 years. Next, for
each bucket, we extract popular techniques (based on the number
of times any paper has cited that technique) using our proposed
system. Table 5 presents the popular techniques for (cid:128)ve example
areas. Some of the interesting trends from Table 5 are listed below:
• Dependency Parsing: New techniques like "Malt Parser",
"Minimum Spanning Tree (MST) Parser", etc. came into
existence in 2005 -- 2009. In the next year bucket, these
parsers overcome popularity of previous parsers such as
"Collin's Parser", "Berkeley Parser" and are almost at par
with "Charniak Parser". In addition, we observe that the
"Penn Treebank" is extensively used for Dependency Parsing
across almost all time periods.
• Machine Translation: We found that "Word Alignment"
and "Inversion Transduction Grammar" are popular tech-
niques for Machine Translation across all time periods. Also,
"Bleu Score" has been a popular technique since its intro-
duction in 2000 -- 2004. Similarly, "Moses Toolkit" and
"IBM Model" are both popular techniques across most time
periods.
• Sentiment Analysis: In this area, "Mutual Information"
and "Word Sense Disambiguation" are popular techniques
for most of the time periods. "Latent Dirichlet Allocation"
(introduced in 2003) found important use in Sentiment Anal-
ysis in 2005 -- 2009. Also the "Spin Model" got popularity
in 2005 -- 2009.
• Cross Lingual Textual Entailment: "Distributional Sim-
ilarity" and "Mutual Information" are important techniques
and are popular in multiple time periods. "Verb Ocean"
gets popular in 2005 -- 2009 and 2009 -- 2013. It is also very
interesting to note that "Machine Translation" is actually
an important tool for this area and is very popular in 2005 --
2009. However, in 2010 -- 2013 its popularity goes down. A
probable explanation for this could be the introduction of
techniques which perform Cross-lingual Textual Entailment
without "Machine Translation" [17].
• Grammatical Error Correction: Techniques to address
out-of-Vocabulary (OOV) words have become important in
recent times. Over the years, "Collins Parser" got replaced
by "Charniak Parser" and (cid:128)nally by "Berkeley Parser".
"Penn Treebank" is an important dataset for this area.
7 CONCLUSION AND FUTURE WORK
In this paper, we have proposed a rule-based information extraction
system to extract application areas and techniques from scienti(cid:128)c
articles. (cid:140)e system extracts ranked list of all application areas in
the computational linguistics domain. At a more granular level, it
also extracts application area for a given paper. We evaluate our
system with domain experts and prove that it performs reason-
ably well on both precision and recall. As a use case, we present
an extensive analysis of temporal variation in popularity of the
techniques for a given area. Some of the interesting observation
that we make here are that the areas like Machine Translation and
Dependency Parsing are on the rise of popularity while areas like
Speech Recognition, Linguistic Knowledge Sources and Evolution of
Natural Language are on the decline.
In future, we plan to work on constructing a multi-level map-
ping table that maps application areas to techniques and further
techniques to a set of parameters. For example, Machine Translation
(application area) has "Bleu Score" as one of its techniques. Bleu
Score is a algorithm that takes few input parameters. Changing
these parameters will change the outcome of the score. Example
of one such parameter is n, which represents the value of n for the
n-grams.
All our methods can be generalized to domains other than compu-
tational linguistics. We plan to build an online version of AppTech-
Miner in near future. We also plan to study temporal characteristics
of techniques for a given application area to observe if future pre-
dictions can be made for a technique - whether its popularity will
increase or decrease in the years come.
REFERENCES
[1] Sharon A Caraballo. 1999. Automatic construction of a hypernym-labeled noun
hierarchy from text. In Proceedings of the 37th annual meeting of the Associa-
tion for Computational Linguistics on Computational Linguistics. Association for
Computational Linguistics, 120 -- 126.
[2] Laura Chiticariu, Yunyao Li, and Frederick R. Reiss. 2013. Rule-Based Informa-
tion Extraction is Dead! Long Live Rule-Based Information Extraction Systems!.
In Proceedings of the 2013 Conference on Empirical Methods in Natural Language
Processing, EMNLP 2013, 18-21 October 2013, Grand Hya(cid:136) Sea(cid:136)le, Sea(cid:136)le, Wash-
ington, USA, A meeting of SIGDAT, a Special Interest Group of the ACL. 827 -- 832.
h(cid:138)p://aclweb.org/anthology/D/D13/D13-1079.pdf
[3] Aaron M Cohen and William R Hersh. 2005. A survey of current work in
biomedical text mining. Brie(cid:128)ngs in bioinformatics 6, 1 (2005), 57 -- 71.
[4] Carol Friedman, Pauline Kra, Hong Yu, Michael Krauthammer, and Andrey
Rzhetsky. 2001. GENIES: a natural-language processing system for the extraction
1995-1999
Penn Treebank, Probabilis-
tic Context Free Grammar,
Tree Substitution Grammar,
Conditional Random Fields,
Dependency Links, Collins
Parser
Inversion
IBM Model,
Transduction
Grammar,
Word Alignment, Sentence
Alignment, Moses Toolkit
Levenshtein Distance, Dis-
course Structure
Techniques
2000-2004
Penn Treebank, Collins
Parser, Berkeley Parser,
Charniak Parser, Maximum
Entropy, NEGRA Corpus
2005-2009
Penn Treebank, Charniak
Parser, Malt Parser, MST
Parser, Berkeley Parser,
Stanford
CCG
Parser, Nivre's arc-eager
Parser,
Word Alignment,
Bleu
Score, Inversion Transduc-
tion Grammar, Parse-parse-
match Approaches
Mutual Information, Infor-
mation Extraction, Penn
Treebank, Distributional
Similarity, Statistical Parser
Training,
Rate
IBM
Model, Bleu Score, Word
Inversion
Alignment,
Transduction
Grammar,
Moses Toolkit
Mutual Information, Word
Sense Disambiguation, Sub-
jectivity Lexicon, Latent
Dirichlet , Spin Model
Singh et al.
2010-2013
Penn Treebank, Malt Parser,
MST Parser,
Berkeley
Parser, Charniak Parser,
Stanford Parser, Percep-
tron Algorithm, Nivre's
arc-eager
Bleu Score, Rate Train-
ing, Moses Toolkit, Word
Alignment, Bootstrap Re-
sampling, IBM Model
Mutual Information, Word
Sense Disambiguation, Sub-
jectivity Lexicon, Latent
Dirichlet, Polarity Lexicons
WOSP 2017, June 19, 2017, Toronto, ON, Canada
Area
Dependency
Parsing
Machine Trans-
lation
Sentiment Anal-
ysis
Cross-lingual
Textual Entail-
ment
1990-1994
Dependency
Uni(cid:128)ca-
tion Grammar, Kasper
Algorithm,
Le(cid:137) Corner
Parser, Inheritence Systems,
Eurotra Project
Ap-
Parse-parse-match
Type
proaches,
Early
Deduction,
Bo(cid:138)om-up
Head Driven Algorithm,
Bilingual signs
Early
Type Deduction
Mechanisms, Uni(cid:128)cation
Grammars,
Sentence
Plan Language, Mutual
Information,
Taxonomy
Files
Ordinary Dictionary, Text
Generation, Dependency
Uni(cid:128)cation
Grammar,
Machine Translation
Mutual Information, Man-
ual Annotation, Distribu-
tional Similarity, Heuristic
Approaches
Word Sense Disambigua-
tion, Machine Translation,
Textual Entailment Chal-
lenge
Semantic Textual Similarity,
Verb Ocean, Moses Toolkit,
Machine Translation
Discourse
Structure,
Encode TFS, Temporal
Information, English Texts,
Kappa Coe(cid:129)cient, CUE
Phrases
Penn Treebank, Preposi-
tional Phrase A(cid:138)achment,
Collins Parser
Probabilistic Context Free
Grammars, Parseval Metric,
Brill POS Tagger
Grammatical
English corpus, CLC FCE
Error Correc-
dataset, OOV words, Berke-
tion
ley Parser, Charniak Parser
Table 5: A few examples of areas and their top techniques for di(cid:130)erent time periods. "Penn Treebank" is extensively used
for Dependency Parsing and Grammatical Error Correction across almost all time periods. "Moses Toolkit" and "IBM Model"
are both popular techniques across most time periods in Machine Translation. "Mutual information" found important use in
Sentiment Analysis.
Penn Treebank, Brill Tag-
ger, FNTBL Toolkit, Char-
niak Parser, Kappa Statistics
Penn Treebank, Word Sense
Disambiguation, Charniak
Parser, OOV words
[8] Sonal Gupta and Christopher D Manning. 2014. Spied: Stanford pa(cid:138)ern-based
[7] Sonal Gupta and Christopher D Manning. 2011. Analyzing the Dynamics of
of molecular pathways from journal articles. Bioinformatics 17, suppl 1 (2001),
S74 -- S82.
[5] Ken-ichiro Fukuda, Tatsuhiko Tsunoda, Ayuchi Tamura, Toshihisa Takagi, and
others. 1998. Toward information extraction: identifying protein names from
biological papers. In Pac symp biocomput, Vol. 707. Citeseer, 707 -- 718.
[6] Robert Gaizauskas, George Demetriou, Peter J. Artymiuk, and Peter Wille(cid:138). 2003.
Protein structures and information extraction from biological texts: the PASTA
system. Bioinformatics 19, 1 (2003), 135 -- 143.
Research by Extracting Key Aspects of Scienti(cid:128)c Papers.. In IJCNLP. 1 -- 9.
information extraction and diagnostics. Sponsor: Idibon 38 (2014).
[9] Xiaodong He. 2007. Using word dependent transition models in HMM based
word alignment for statistical machine translation. In Proceedings of the Second
Workshop on Statistical Machine Translation. Association for Computational
Linguistics, 80 -- 87.
[10] Marti A. Hearst. 1992. Automatic Acquisition of Hyponyms from Large Text
Corpora. In Proceedings of the 14th Conference on Computational Linguistics -
Volume 2 (COLING '92). Association for Computational Linguistics, Stroudsburg,
PA, USA, 539 -- 545. DOI:h(cid:138)p://dx.doi.org/10.3115/992133.992154
[11] Yiping Jin, Min-Yen Kan, Jun-Ping Ng, and Xiangnan He. 2013. Mining Scienti(cid:128)c
Terms and their De(cid:128)nitions: A Study of the ACL Anthology. In Proceedings
of the 2013 Conference on Empirical Methods in Natural Language Processing.
Association for Computational Linguistics, Sea(cid:138)le, Washington, USA, 780 -- 790.
h(cid:138)p://www.aclweb.org/anthology/D13-1073
Ph.D. Dissertation. Citeseer.
[12] Rosie Jones. 2005. Learning to extract entities from labeled and unlabeled text.
[13] Su Nam Kim, Olena Medelyan, Min-Yen Kan, and Timothy Baldwin. 2010.
Semeval-2010 task 5: Automatic keyphrase extraction from scienti(cid:128)c articles. In
Proceedings of the 5th International Workshop on Semantic Evaluation. Association
for Computational Linguistics, 21 -- 26.
[14] Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello
Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard
Zens, and others. 2007. Moses: Open source toolkit for statistical machine
translation. In Proceedings of the 45th annual meeting of the ACL on interactive
poster and demonstration sessions. Association for Computational Linguistics,
177 -- 180.
[15] Martin Krallinger, Alfonso Valencia, and Lyne(cid:138)e Hirschman. 2008. Linking genes
to literature: text mining, information extraction, and retrieval applications for
biology. Genome biology 9, Suppl 2 (2008), 1 -- 14.
[16] Patrice Lopez and Laurent Romary. 2010. HUMB: Automatic key term extraction
from scienti(cid:128)c articles in GROBID. In Proceedings of the 5th international workshop
on semantic evaluation. Association for Computational Linguistics, 248 -- 251.
[17] Yashar Mehdad, Ma(cid:138)eo Negri, and Jos´e Guilherme C de Souza. 2012. FBK: cross-
lingual textual entailment without translation. In Proceedings of the First Joint
Conference on Lexical and Computational Semantics-Volume 1: Proceedings of
the main conference and the shared task, and Volume 2: Proceedings of the Sixth
International Workshop on Semantic Evaluation. Association for Computational
Linguistics, 701 -- 705.
[18] Wolfgang Menzel and Ingo Schroder. 1998. Decision procedures for dependency
parsing using graded constraints. In in proceedings of ACL'90. Citeseer.
[19] Hans-Michael Muller, Arun Rangarajan, Tracy K Teal, and Paul W Sternberg.
2008. Textpresso for neuroscience: searching the full text of thousands of
neuroscience research papers. Neuroinformatics 6, 3 (2008), 195 -- 204.
[20] Vahed Qazvinian and Dragomir R Radev. 2008. Scienti(cid:128)c paper summarization
using citation summary networks. In Proceedings of the 22nd International Con-
ference on Computational Linguistics-Volume 1. Association for Computational
Linguistics, 689 -- 696.
[21] Vahed Qazvinian, Dragomir R Radev, and Arzucan Ozgur. 2010. Citation sum-
marization through keyphrase extraction. In Proceedings of the 23rd International
Conference on Computational Linguistics. Association for Computational Linguis-
tics, 895 -- 903.
[22] Dragomir R. Radev, Pradeep Muthukrishnan, and Vahed Qazvinian. 2009. (cid:140)e
ACL Anthology Network Corpus. In Proceedings, ACL Workshop on Natural
Language Processing and Information Retrieval for Digital Libraries. Singapore.
[23] (cid:140)omas Schoenemann. 2013. Training Nonde(cid:128)cient Variants of IBM-3 and IBM-4
for Word Alignment.. In ACL (1). 22 -- 31.
[24] Parantu K. Shah, Carolina Perez-Iratxeta, Peer Bork, and Miguel A. Andrade.
2003. Information extraction from full text scienti(cid:128)c articles: Where are the
keywords? BMC Bioinformatics 4, 1 (2003), 1 -- 9. DOI:h(cid:138)p://dx.doi.org/10.1186/
1471-2105-4-20
[25] Simone Teufel and others. 2000. Argumentative zoning: Information extraction
from scienti(cid:128)c text. Ph.D. Dissertation. Citeseer.
[26] Daya C Wimalasuriya and Dejing Dou. 2010. Ontology-based information
extraction: An introduction and a survey of current approaches. Journal of
Information Science (2010).
[27] Chengxiang Zhai and John La(cid:130)erty. 2004. A study of smoothing methods for lan-
guage models applied to information retrieval. ACM Transactions on Information
Systems (TOIS) 22, 2 (2004), 179 -- 214.
|
1903.07917 | 1 | 1903 | 2019-03-19T10:18:57 | CVIT-MT Systems for WAT-2018 | [
"cs.CL"
] | This document describes the machine translation system used in the submissions of IIIT-Hyderabad CVIT-MT for the WAT-2018 English-Hindi translation task. Performance is evaluated on the associated corpus provided by the organizers. We experimented with convolutional sequence to sequence architectures. We also train with additional data obtained through backtranslation. | cs.CL | cs |
CVIT-MT Systems for WAT-2018
Jerin Philip†, Vinay P. Namboodiri‡ and C.V. Jawahar†
† CVIT, IIIT Hyderabad, ‡ IIT-Kanpur
[email protected]
[email protected], [email protected]
Abstract
This document describes the machine trans-
lation system used in the submissions of
IIIT-Hyderabad (CVIT-MT) for the WAT-2018
English-Hindi translation task. Performance
is evaluated on the associated corpus provided
by the organizers. We experimented with con-
volutional sequence to sequence architectures.
We also train with additional data obtained
through backtranslation.
for
for
2018(Nakazawa et al., 2018)
the Hindi-
English and English-Hindi translation tasks of the
mixed domain tasks.
In Section 2, we describe
the components constituting our pipeline, following
which in Section 3 we provide the details of the data
used and procedure used for the training. Section 4
summarizes our results for WAT-2018. Finally in
Section 5 we include additional results using newer
architectures. We conclude our observations in Sec-
tion 6.
1 Introduction
2 System Description
Innovations in Neural Machine Translation (NMT)
have led to success in many machine transla-
tion tasks, often outperforming Statistical Ma-
chine Translation (SMT) techniques.
Similar to
many other language pairs, NMT based approaches
have been attempted for the English-Hindi
lan-
guage pair as well (e.g. the WAT-2017 submission
(Wang et al., 2017)). Hindi continue to remain as a
low resource language demanding further attention
from Natural Language Processing (NLP, Machine
Learning ML and other related communities. The
Hindi-English pair has limited availability of sen-
tence level aligned bitext as parallel corpora.
Lack of sufficient data for Indian languages mo-
tivated us to explore techniques that can help in
low-resource situations. Recent works (such as
(Edunov et al., 2018; Lample et al., 2018)) point to
the use of iterative backtranslation to improve trans-
lation in low resource languages or under the un-
availability of parallel corpora.
This paper describes an overview of the sub-
mission from IIIT Hyderabad (CVIT-MT) in WAT-
In this section, we describe the details associated
with the tokenization, architecture and data augmen-
tation. These are the three components that helped
in obtaining superior results on the corpus provided
by the organizers of WAT-2018.
2.1 Tokenization
A popular method of addressing rare-words with-
out compromising coverage of the entire corpus was
Byte Pair Encoding (BPE) (Sennrich et al., 2016b),
which used a deterministic greedy compression
based algorithm to bring the vocabulary down to a
finite feasible value.
SentencePiece (Kudo, 2018) builds on top of byte
pair encoding. Unlike BPE, which is agnostic to lan-
guage, SentencePiece gives the most likely deriva-
tion of a sentence composed of subword units. This
setting reduces to character level in case a com-
pletely unknown sentence/word is provided, and the
translation model also learns to transliterate. We use
SentencePiece for its merits mentioned above.
2.2 Convolutional Sequence to Sequence
3 Experimental Setup
Learning
In our submission, we employ the Convolutional
Sequence to Sequence architecture (CONVS2S)
(Gehring et al., 2017).
CONVS2S follows an en-
coder decoder architecture. This has the advan-
tage of being faster than the popular Recurrent Neu-
ral Network (RNN) based encoder decoder architec-
tures with attention. This is because the context is
built through multiple inputs stacking k convolution
blocks (O( n
k )) with the ability to build in parallel
representations for multiple parts of the sentence,
unlike through time in the RNN (O(n)).
A 1-D convolutional filter of width w with two
the output sliding over the embed-
channels at
dings of the text
inputs constitute a basic con-
volutional block. Output of one channel builds
up context representation and the other is used to
enable gating through Gated Linear Units (GLUs)
(Dauphin et al., 2017). The encoder is constructed
by stacking k of the above setup, creating a receptive
field controlled by w and k. The decoder is similar
to the encoder in architecture, with a fully connected
layer projecting output to vocabulary size.
2.3 Backtranslation
Backtranslation is a widely tried and tested data
augmentation method, proposed for aiding NMT in
languages low on parallel resources using available
monolingual data by Sennrich et. al (2016a). The
method works by first training a model in the low
to high resource direction followed by using this
model on monolingual data. The process provides
more authentic sentences in the resource-scarce lan-
guage and close approximation of its translation in
the high resource language. It has been empirically
shown that synthetic data alone generated through
backtranslation can attain upto 83% of the perfor-
mance using proper bitext (Edunov et al., 2018).
3.1 Dataset
In our experiments, we use the training data pro-
vided by organizers. In addition, we also use data
obtained from translated Hindi content available on
Internet. Top level statistics of the data used are pro-
vided in Table 1.
Dataset
Pairs
Tokens
IITB train
IITB train†
National News
Backtranslated
IITB dev
IITB test
1,492,827
923,377
2,495,129
5,653,644
505
2,507
hi
en
22.2M 20.6M
20.3M 18.9M
41.2M 39.0M
77.5M 91.9M
10,174
10,656
49,394
57,037
Table 1: Descriptions of the corpora used, IITB train† is
a filtered version of the IITB train corpus.
The training corpus provided by the organizers,
hereafter denoted by IITB-corpus consists of data
from mixed domains. There are roughly 1.5M sam-
ples in training data from diverse sources, while
the development and test sets are from newspaper
crawls.
In addition to this, monolingual data col-
lected by the organizers from several sources are
used in our backtranslation enabled attempts at train-
ing an NMT system. There are 45M samples in the
monolingual corpus provided.
We enhanced the training data with additional
pairs, but automatically translated. Note that no
manual translation was used to create additional
data. We obtain 2.5M Hindi sentences automatically
translated to English from newspapers and similar
resources, obtained from Internet. This data is some
what domain specific. They are primarily, from
news articles related to national news. This is men-
tioned as National News in Table 1.
In the next section, we describe how the compo-
nents explained above are implemented and used in
training - including generating dataset, preprocess-
ing and filtering the training samples, hyperparame-
ters of the architectures in place and evaluations.
We also create a parallel corpus through back-
translation using the organizers monolingual Hindi
data hereafter denoted by Backtranslated, the details
of which are also included in Table 1 and the meth-
ods of creation elaborated in Section 3.3.
3.2 Data Processing
We train separate SentencePiece models using offi-
cial implementation available online 1 with vocabu-
lary restricted to 8000 units to function as a learned
tokenizer for both English and Hindi. We use the un-
igram model, which gives language aware tokeniza-
tion.
To filter any noisy content from IITB corpus,
langdetect2 and removed every pair which had prob-
ability of being in the respective language less than
0.95. This gave us roughly 0.92M pairs for train-
ing, from IITB corpus and is indicated as IITB train†
in Table 1. English data is kept true-cased, which
we found to have better results consistently with our
NMT model.
3.3 Training
In our experiments we use the fairseq 3 toolkit. For
the tasks in this submission we use the CONVS2S
model.
The encoder and decoder embeddings have a di-
mension of 512. The hidden units in the encoder
and decoder are also 512 dimensional, following
Gehring et. al (2017). We use convolutional filters
of width 3 and 20 layers stacked for both the en-
coder and decoder. A dropout with probability 0.1
is put in-place right after the embeddings layer for
better generalization. The training is run in batches
of maximum 4000 tokens at a time, which is on an
average 140 sample sentences per batch. The model
is trained to minimize the categorical cross-entropy
loss at the token level using Nestorov accelerated
gradient descent. Decoding is performed through
beam search with a beam width of 10.
We run training using four NVIDIA 1080Ti-s
until validation loss hasn't improved for 3 epochs
straight. The training time was roughly 2 days and
stopping around 30-40 epochs.
We keep our model hyperparameters constant as
specified across experiments and work with different
combinations of corpora created from augmenting
the National News dataset and official parallel cor-
pora. For creating the Backtranslated corpus, we use
a model trained to translate from Hindi to English
1https://github.com/google/sentencepiece
2https://github.com/Mimino666/langdetect
3http://github.com/pytorch/fairseq
(for-
merly fairseq-py)
using both National News and IITB corpus. We fil-
ter the obtained pairs using confidence of translation
obtained from the beam-score and further to pairs
with a length between 10 and 30 tokens.
3.4 Evaluations
(Papineni et al., 2002),
report Bilingual Evaluation Understudy
Rank-based
(RIBES)
Adequacy-fluency met-
for all our
from WAT-2018 human
We
(BLEU)
Intuitive Bilingual Evaluation Score
(Isozaki et al., 2010),
rics (AM-FM)
attempts
evaluations(Human in Table 2) when available.
(Banchs et al., 2015)
and scores
BLEU is computed as the geometric mean of un-
igram, bigram, trigram and 4-gram precision multi-
plied by a brevity penalty (BP). BLEU ranges from
0 to 1, but the values reported in Tables 2 and 3 are in
percentages. RIBES, also giving a value in [0, 1] was
proposed to tackle shortcomings of BLEU in distant
language pairs, where changes in word ordering de-
teriorates BLEU.
4 Discussions
The results using our systems for WAT-2018 are pre-
sented in Table 2 (see some additional results in Ta-
ble 3). The first part of the table consists of results
on combinations of datasets and augmentations. All
values are for models trained from scratch. In the
second part, the current leader board is indicated for
comparison. Note that entries in this part don't cor-
respond to a single submission, but the values corre-
sponding to the best in the respective metric.
Our submission based on the combination Na-
tional News and IITB corpus tops human evalua-
tion in Hindi to English, and ranks second in En-
glish to Hindi. We demonstrate the possibility of
distilling knowledge of online available sources into
a usable translation model. We successfully use the
CONVS2S architecture along with SentencePiece to
obtain results comparable to the top submissions.
Our experiments also indicates data augmentation
using backtranslation positively works for the Hindi-
English pair.
5 Additional Transformer Experiments
In this section, we present a set of experiments and
results post WAT-2018 involving the Transformer
Dataset
en-hi
hi-en
IITB train†
National News
+IITB train†
Backtranslated
2017 Best
2018 Best
BLEU
13.25
18.77
19.69
16.77
21.39
20.28
RIBES
0.695113
0.748008
0.758365
0.714197
0.749660
0.761582
AM-FM Human BLEU
11.83
0.647220
19.53
0.697630
0.699810
20.63
0.664330
69.50
50.50
-
-
-
RIBES
0.675462
0.745764
0.751883
AM-FM Human
0.572900
0.614260
0.623240
72.25
-
-
-
-
0.688770
0.704220
64.50
77.00
22.44
17.80
0.750921
0.731727
0.629530
0.611090
-
68.25
67.25
Table 2: Quantitative results of translating English to Hindi and vice versa.
Architecture (Vaswani et al., 2017). Two variants of
the architecture - Transformer Base and Transformer
Big outperformed then state of the art CONVS2S
models in the WMT German-English and French-
English translation tasks.
We used the Transformer-Base architecture in fur-
ther experiments with the National News + IITB cor-
pus where CONVS2S performed the best, with the
rest of the pipeline being kept same as described be-
fore. We went with the default hyperparameters pro-
vided by fairseq framework - which did not give us
impressive results.
Following Popel and Bojar (2018), we modified
the hyperparameters for initial warm-up steps of
16000 without any learning rate decay, starting from
a learning rate of 0.25, followed by an exponen-
tial decay of learning rate. We also had to enable
delayed gradient updates (Ott et al., 2018) to simu-
late a larger batch on smaller GPU before the model
demonstrated any learning. During inference time,
we averaged checkpoints of the model at different
epochs once the loss on the development set had
plateaued to obtain better results than a single check-
point.
Architecture BLEU
19.69
CONVS2S
21.10
Transformer
21.57
+Averaging
RIBES
0.758365
0.771549
0.773923
AM-FM
0.699810
0.712200
0.712110
Table 3: Transformer-Base vs CONVS2S on National
News + IITB corpus, for English to Hindi direction.
In Table 3, we compare the performance of the
transformer with that CONVS2S. Consistent with
observations in languages like German-English and
French-English, the transformer network produces
better results than CONVS2S on all metrics. The av-
eraged model performs the best in all metrics in En-
glish to Hindi translation task, at the time of writing
this paper.
6 Observations
We believe that NMT is a promising approach for
Indian language machine translation for obtaining
reasonably accurate solutions. Our initial results re-
ported here confirms this. In addition, we believe,
the popular data augmentation methods are effective
and feasible for many low-resource machine trans-
lation settings. We see the direct utility of the ad-
vances in NMT for many western language pairs on
English-Hindi in terms of ideas and architectures. At
the same time, we also believe, there is much more
to do for making them effective on Indian languages.
Acknowledgments
We thank the organizers for systematically setting
up this task, and for the very useful resources. We
also thank the larger language processing group at
IIIT Hyderabad for the encouragement, support and
insights.
References
[Banchs et al.2015] Rafael E Banchs, Luis F D'Haro, and
Haizhou Li. 2015. Adequacy-fluency metrics: Eval-
uating MT in the continuous space model framework.
IEEE/ACM Transactions on Audio, Speech and Lan-
guage Processing (TASLP), 23(3):472 -- 482.
[Dauphin et al.2017] Yann N Dauphin, Angela Fan,
Michael Auli, and David Grangier. 2017. Language
Modeling with Gated Convolutional Networks. In In-
ternational Conference on Machine Learning, pages
933 -- 941.
tion for Computational Linguistics (Volume 1: Long
Papers), volume 1, pages 86 -- 96.
[Sennrich et al.2016b] Rico Sennrich, Barry Haddow, and
Alexandra Birch. 2016b. Neural Machine Translation
of Rare Words with Subword Units. In Proceedings of
the 54th Annual Meeting of the Association for Com-
putational Linguistics (Volume 1: Long Papers), vol-
ume 1, pages 1715 -- 1725.
[Vaswani et al.2017] Ashish Vaswani, Noam Shazeer,
Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N
Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017.
Attention is all you need. In Advances in Neural In-
formation Processing Systems, pages 5998 -- 6008.
[Wang et al.2017] Boli Wang, Zhixing Tan, Jinming Hu,
Yidong Chen, et al. 2017. XMU neural machine trans-
lation systems for WAT 2017. In Proceedings of the
4th Workshop on Asian Translation (WAT2017), pages
95 -- 98.
[Edunov et al.2018] Sergey Edunov, Myle Ott, Michael
Auli, and David Grangier.
2018. Understanding
Back-Translation at Scale. In Proceedings of the 2018
Conference on Empirical Methods in Natural Lan-
guage Processing, pages 489 -- 500.
[Gehring et al.2017] Jonas Gehring, Michael Auli, David
Grangier, Denis Yarats, and Yann N Dauphin. 2017.
Convolutional Sequence to Sequence Learning. In In-
ternational Conference on Machine Learning, pages
1243 -- 1252.
[Isozaki et al.2010] Hideki
Isozaki, Tsutomu Hirao,
Kevin Duh, Katsuhito Sudoh, and Hajime Tsukada.
2010. Automatic evaluation of translation quality
for distant language pairs.
In Proceedings of the
2010 Conference on Empirical Methods in Natural
Language Processing, pages 944 -- 952. Association
for Computational Linguistics.
2018.
Subword regulariza-
tion:
Improving neural network translation models
with multiple subword candidates. In Proceedings of
the 56th Annual Meeting of the Association for Com-
putational Linguistics (Volume 1: Long Papers), pages
66 -- 75. Association for Computational Linguistics.
[Kudo2018] Taku Kudo.
[Lample et al.2018] Guillaume Lample, Alexis Conneau,
Ludovic Denoyer, and Marc'Aurelio Ranzato. 2018.
Unsupervised machine translation using monolingual
corpora only. In International Conference on Learn-
ing Representations (ICLR).
[Nakazawa et al.2018] Toshiaki Nakazawa, Shohei Hi-
gashiyama, Chenchen Ding, Raj Dabre, Anoop
Kunchukuttan, Win Pa Pa, Isao Goto, Hideya Mino,
Katsuhito Sudoh, and Sadao Kurohashi.
2018.
Overview of the 5th workshop on asian translation. In
Proceedings of the 5th Workshop on Asian Translation
(WAT2018), Hong Kong, China, December.
[Ott et al.2018] Myle Ott, Sergey Edunov, David Grang-
ier, and Michael Auli. 2018. Scaling neural machine
translation.
In Proceedings of the Third Conference
on Machine Translation: Research Papers, pages 1 -- 9.
Association for Computational Linguistics.
[Papineni et al.2002] Kishore Papineni, Salim Roukos,
Todd Ward, and Wei-Jing Zhu.
2002. BLEU: a
method for automatic evaluation of machine transla-
tion.
In Proceedings of the 40th annual meeting on
association for computational linguistics, pages 311 --
318. Association for Computational Linguistics.
[Popel and Bojar2018] Martin Popel and Ondrej Bojar.
2018. Training Tips for the Transformer Model. The
Prague Bulletin of Mathematical Linguistics, pages
43 -- 70.
[Sennrich et al.2016a] Rico Sennrich, Barry Haddow, and
Alexandra Birch. 2016a. Improving Neural Machine
Translation Models with Monolingual Data.
In Pro-
ceedings of the 54th Annual Meeting of the Associa-
|
1807.11243 | 2 | 1807 | 2018-10-25T08:54:52 | Active Learning for Interactive Neural Machine Translation of Data Streams | [
"cs.CL"
] | We study the application of active learning techniques to the translation of unbounded data streams via interactive neural machine translation. The main idea is to select, from an unbounded stream of source sentences, those worth to be supervised by a human agent. The user will interactively translate those samples. Once validated, these data is useful for adapting the neural machine translation model.
We propose two novel methods for selecting the samples to be validated. We exploit the information from the attention mechanism of a neural machine translation system. Our experiments show that the inclusion of active learning techniques into this pipeline allows to reduce the effort required during the process, while increasing the quality of the translation system. Moreover, it enables to balance the human effort required for achieving a certain translation quality. Moreover, our neural system outperforms classical approaches by a large margin. | cs.CL | cs | Active Learning for Interactive Neural
Machine Translation of Data Streams
´Alvaro Peris and Francisco Casacuberta
Pattern Recognition and Human Language Technology Research Center
Universitat Polit`ecnica de Val`encia, Val`encia, Spain
{lvapeab, fcn}@prhlt.upv.es
8
1
0
2
t
c
O
5
2
]
L
C
.
s
c
[
2
v
3
4
2
1
1
.
7
0
8
1
:
v
i
X
r
a
Abstract
We study the application of active learning
techniques to the translation of unbounded
data streams via interactive neural machine
translation. The main idea is to select, from an
unbounded stream of source sentences, those
worth to be supervised by a human agent. The
user will interactively translate those samples.
Once validated, these data is useful for adapt-
ing the neural machine translation model.
We propose two novel methods for selecting
the samples to be validated. We exploit the
information from the attention mechanism of
a neural machine translation system. Our ex-
periments show that the inclusion of active
learning techniques into this pipeline allows
to reduce the effort required during the pro-
cess, while increasing the quality of the trans-
lation system. Moreover, it enables to balance
the human effort required for achieving a cer-
tain translation quality. Moreover, our neural
system outperforms classical approaches by a
large margin.
1 Introduction
The translation industry is a high-demand field.
Large amounts of data must be translated on a reg-
ular basis. Machine translation (MT) techniques
greatly boost the productivity of the translation
agencies (Arenas, 2008). However, despite the re-
cent advances achieved in this field, MT systems
are still far to be perfect and make errors. The
correction of such errors is usually done in a post-
processing step, called post-editing. This requires
a great effort, as it needs from expert human su-
pervisors.
The requirements of the translation industry
have increased in the last years. We live in a global
world, in which large amounts of data must be pe-
riodically translated. This is the case of the Euro-
pean Parliament, whose proceedings must be reg-
ularly translated; or the Project Syndicate1 plat-
form, which translates editorials from newspapers
to several languages. In these scenarios, the sen-
tences to be translated can be seen as unbounded
streams of data (Levenberg et al., 2010).
When dealing with such massive volumes of
data, it is prohibitively expensive to manually re-
vise all the translations. Therefore, it is manda-
tory to spare human effort, at the expense of some
translation quality. Hence, when facing this sit-
uation, we have a twofold objective: on the one
hand, we aim to obtain translations with the high-
est quality possible. On the other hand, we are
constrained by the amount of human effort spent
in the supervision and correction process of the
translations proposed by an MT system.
The active learning (AL) framework is well-
suited for these objectives. The application of
AL techniques to MT involve to ask a human or-
acle to supervise a fraction of the incoming data
(Bloodgood and Callison-Burch, 2010). Once the
human has revised these samples, they are used
for improving the MT system, via incremental
learning. Therefore, a key element of AL is the
so-called sampling strategy, which determines the
sentences that should be corrected by the human.
Aiming to reduce the human effort required
during post-editing, other alternative frameworks
have been study.
A successful one is the
interactive-predictive machine translation (IMT)
paradigm (Foster et al., 1997; Barrachina et al.,
2009).
In IMT, human and MT system jointly
collaborate for obtaining high-quality translations,
while reducing the human effort spent in this pro-
cess.
In this work, we explore the application of NMT
to the translation of unbounded data streams. We
apply AL techniques for selecting the instances to
1www.project-syndicate.org
be revised by a human oracle. The correction pro-
cess is done by means of an interactive-predictive
NMT (INMT) system, which aims to reduce the
human effort of this process. The supervised sam-
ples will be used for the NMT system to incremen-
tally improve its models. To the best of our knowl-
edge, this is the first work that introduces an INMT
system into the scenario involving the translation
of unbounded data. Our main contributions are:
• We study the application of AL on an INMT
framework when dealing with large data
streams. We introduce two sampling strate-
gies for obtaining the most useful samples to
be supervised by the human. We compare
these techniques with other classical, well-
performing strategies.
• We conduct extensive experiments, analyzing
the different sampling strategies and studying
the amount of effort required for obtaining a
certain translation quality.
• The results show that AL succeeds at improv-
ing the translation pipeline. The translation
systems featuring AL have better quality and
require less human effort in the IMT process
than static systems. Moreover, the applica-
tion of the AL framework allows to obtain
a balance between translation quality and ef-
fort required for achieving such quality. This
balance can be easily tuned, according to the
needs of the users.
• We open-source our code2 and use publicly-
available corpora, fostering further research
on this area.
2 Related work
The translation of large data streams is a prob-
lem that has been thoroughly studied. Most
works aim to continuously modify the MT sys-
tem as more data become available. These mod-
ifications are usually performed in an incremen-
tal way (Levenberg et al., 2010; Denkowski et al.,
2014; Turchi et al., 2017),
learning from user
post-edits. This incremental learning has also
been applied to IMT, either
to phrase-based
statistical machine translation (SMT) systems
(Nepveu et al., 2004; Ortiz-Mart´ınez, 2016) or
NMT (Peris and Casacuberta, 2018b).
2The source code can be found at:
http://github.com/lvapeab/nmt-keras.
The translation of large volumes of data is
a scenario very appropriate for the AL frame-
work (Cohn et al., 1994; Olsson, 2009; Settles,
2009).
The application of AL to SMT
has been studied for pool-based (Haffari et al.,
2009; Bloodgood and Callison-Burch, 2010) and
stream-based (Gonz´alez-Rubio et al., 2011) se-
tups. Later works (Gonz´alez-Rubio et al., 2012;
Gonz´alez-Rubio and Casacuberta, 2014),
com-
bined AL together with IMT, showing that AL can
effectively reduce the human effort required for
achieving a certain translation quality.
All
these works were based on SMT sys-
tems. However,
the recently introduced NMT
paradigm (Sutskever et al., 2014; Bahdanau et al.,
2015) has irrupted as the current state-of-the-art
for MT (Bojar et al., 2017). Several works aimed
at building more productive NMT systems. Re-
lated to our work, studies on interactive NMT
systems (Knowles and Koehn, 2016; Peris et al.,
2017; Hokamp and Liu, 2017) proved the effi-
cacy of this framework. A body of work has
been done aiming to build adaptive NMT systems,
which continuously learn from human correc-
tions (Turchi et al., 2017; Peris and Casacuberta,
2018b). Recently, Lam et al. (2018) applied AL
techniques to an INMT system,
for deciding
whether the user should revise a partial hypothe-
sis or not. However, to our knowledge, a study on
the use of AL for NMT in a scenario of translation
of unbounded data streams is still missing.
3 Neural machine translation
the goal
NMT is a particular case of sequence-to-sequence
learning: given a sequence of words from the
is to generate an-
source language,
other sequence of words in the target
lan-
guage.
This is usually done by means of
an encoder -- decoder architecture (Sutskever et al.,
In this work,
2014; Vaswani et al., 2017).
we use a recurrent encoder -- decoder
system
with long short-term memory (LSTM) units
(Hochreiter and Schmidhuber, 1997) and an atten-
tion mechanism (Bahdanau et al., 2015).
Each element from the input sequence is pro-
jected into a continuous space by means of
an embedding matrix.
The sequence of em-
beddings is then processed by a bidirectional
(Schuster and Paliwal, 1997) LSTM network, that
concatenates the hidden states from forward and
backward layers and produces a sequence of an-
notations.
The decoder is a conditional LSTM (cLSTM)
network (Peris and Casacuberta, 2018b).
A
cLSTM network is composed of several LSTM
transition blocks with an attention mechanism in
between. We use two LSTM blocks.
The output of the decoder is combined to-
gether with the attended representation of the in-
put sentence and with the word embedding of
the word previously generated in a deep output
layer (Pascanu et al., 2014). Finally, a softmax
layer computes a probability distribution over the
target language vocabulary.
is
descent
gradient
The model
stochastic
jointly trained by means
of
(SGD)
(Robbins and Monro, 1951), aiming to mini-
mize the cross-entropy over a bilingual training
corpus. SGD is usually applied to mini-batches of
data; but it can be also applied sample-to-sample,
allowing the training of the NMT system in an
incremental way (Turchi et al., 2017).
For decoding, the model uses a beam search
method (Sutskever et al., 2014) for obtaining the
most probable target sentence y, given a source
sentence x:
y = arg max
p(y x)
(1)
y
Source (x):
They are lost forever .
Target (y):
Ils sont perdus `a jamais .
IT-0 MT
Ils sont perdus pour toujours .
IT-1
User
Ils sont perdus `a pour toujours .
MT Ils sont perdus `a jamais .
IT-2
User
Ils sont perdus `a jamais .
Figure 1: IMT session to translate a sentence from
English to French. IT- is the number of iterations
of the process. The MT row shows the MT hy-
pothesis in the current iteration. In the User row is
the feedback introduced by the user: the corrected
character (boxed). We color in green the prefix
that the user inherently validated with the charac-
ter correction.
where yp is the validated prefix provided by the
user and x is the source sentence. Note that this
expression is similar to Eq. (1). The difference is
that now, the search space is the set of suffixes that
complete yp.
For NMT systems, Eq. (2) is implemented
constrained by the pre-
(Peris et al., 2017;
as a beam search,
fix provided by the user
Peris and Casacuberta, 2018b).
3.1
Interactive machine translation
4 Active learning in machine translation
As previously discussed, MT systems are not per-
fect. Their outputs must be corrected by a human
agent in a post-editing stage, in order to achieve
high-quality translations.
The IMT framework constitutes a more effi-
In a
cient alternative to the regular post-editing.
nutshell, IMT consists in an iterative process in
which, at each iteration, the user introduces a cor-
rection to the system hypothesis. The system takes
into account the correction and provides an alter-
native hypothesis, considering the feedback from
the user.
In this work, we use a prefix-based IMT pro-
tocol: the user corrects the left-most wrong char-
acter of the hypothesis. With this action, the user
has also validated a correct prefix. Then, the sys-
tem must complete the provided prefix, generating
a suitable suffix. Fig. 1 shows an example of the
prefix-based IMT protocol.
More formally, the expression for computing
the most probable suffix (ys) is:
ys = arg max
p(ys x, yp)
(2)
ys
potentially
dealing with
unbounded
When
it becomes prohibitively expensive to
datasets,
manually supervise all the translations. Aiming
to address this problem, in the AL framework, a
sampling strategy selects a subset of sentences
worth to be supervised by the user. Once cor-
rected,
the MT system adapts its models with
these samples.
data
is
streams
Therefore,
applied
as
the AL protocol
to
follows
unbounded
(Gonz´alez-Rubio et al., 2012):
first, we re-
trieve from the data stream S a block B
of consecutive sentences, with the function
getBlockFromStream(S). According to the
sampling(B, ε) function, we select from B a
subset V of ε instances, worth to be supervised
by the user. See Section 5 for deeper insights on
the sampling functions used in this work. These
sampled sentences are interactively translated
together with the user (Section 3.1). This process
is done in the function INMT(θ, x, y). Once the
user translates via INMT a source sentence x,
a correct translation y is obtained. Then, we
Algorithm 1: Active learning for unbounded
data streams with interactive neural machine
translation.
input
: θ (NMT model)
S (stream of source sentences)
ε (effort level desired)
auxiliar : B (block of source sentences)
V ⊆ B (sentences to be supervised
by the user)
1 begin
2
3
4
5
6
7
8
9
10
11
12
13
14
15
repeat
B = getBlockFromStream(S);
V = sampling(B, ε);
foreach x ∈ B do
y = translate(θ, x);
if x ∈ V then
y = INMT(θ, x, y);
θ = update(θ, (x, y));
output(y);
else
output(y);
end
end
until S 6= ∅;
16 end
use the pair (x, y) to retrain the parameters θ
from the NMT model, via SGD. This is done
with the function update(θ, (x, y)). Therefore,
the NMT system is incrementally adapted with
new data. The sentences considered unworthy
to be supervised are automatically translated
according to according Eq. (1), with the function
translate(θ, x). Once we finish the translation
of the current block B, we start the process again.
Algorithm 1 details the full procedure.
5 Sentence sampling strategies
One of the key elements of AL is to have a mean-
ingful strategy for obtaining the most useful sam-
ples to be supervised by the human agent. This re-
quires an evaluation of the informativeness of un-
labeled samples. The sampling strategies used in
this work belong to two major frameworks: un-
certainty sampling (Lewis and Catlett, 1994) and
query-by-committee (Seung et al., 1992).
As baseline, we use a random sampling strat-
egy: sentences are randomly selected from the
data stream S. Although simple, this strategy usu-
ally works well in practice. In the rest of this sec-
tion, we describe the sampling strategies used in
this work.
5.1 Uncertainty sampling
The idea behind this family of methods is to se-
lect those instances for which the model has the
least confidence to be properly translated. There-
fore, all techniques compute, for each sample, an
uncertainty score. The selected sentences will be
those with the highest scores.
Quality estimation sampling
A common and effective way for measuring
the uncertainty of a MT system is to use con-
fidence estimation (Gandrabur and Foster, 2003;
Blatz et al., 2004; Ueffing et al., 2007). The idea
is to estimate the quality of a translation according
to confidence scores of the words.
More specifically, given a source sentence x =
x1, . . . , xJ and a translation hypothesis y =
y1, . . . , yI , a word confidence score (Cw) as com-
puted as (Ueffing and Ney, 2005):
Cw(x, yi) = max
0≤j≤J
p(yixj)
(3)
where p(yixj) is the alignment probability of yi
and xj, given by an IBM Model 2 (Brown et al.,
1993). x0 denotes the empty source word. The
choice of the IBM Model 2 is twofold: on the one
hand, it is a very fast method, which only requires
to query in a dictionary. We are in an interactive
framework, therefore speed becomes a crucial re-
quirement. On the other hand, its performance
is close to more complex methods (Blatz et al.,
2004; Dyer et al., 2013).
Following Gonz´alez-Rubio et al. (2012),
the
uncertainty score for the quality estimation sam-
pling is defined as:
Cqe(x, y) = 1 −
{yi ∈ yCw(x, yi) > τw}
y
(4)
where τw is a word confidence threshold, adjusted
· denotes
according to a development corpus.
the size of a sequence or set.
Coverage sampling
One of the main issues suffered by NMT sys-
tems is the lack of coverage:
the NMT system
may not translate all words from a source sen-
tence. This results in over-translation or under-
translation problems (Tu et al., 2016).
We propose to use the translation coverage
as a measure of the uncertainty suffered by the
NMT system when translating a sentence. There-
fore, we modify the coverage penalty proposed by
Wu et al. (2016), for obtaining a coverage-based
uncertainty score:
Ccov(x, y) =
Px
j=1 log (cid:0) min(Py
i=1 αi,j, 1)(cid:1)
x
(5)
where αi,j is attention probability of the i-th target
word and the j-th source word.
Attention distraction sampling
When generating a target word, an attentional
NMT system should attend on meaningful parts
of the source sentence. If the system is translating
an uncertain sample, its attention mechanism will
be distracted. That means, dispersed throughout
the source sequence. A sample with a great dis-
traction will feature an attention probability distri-
bution with heavy tails (e.g. a uniform distribu-
tion). Therefore, for the attention distraction sam-
pling strategy, the sentences to select will be those
with highest attention distraction.
For computing a distraction score, we compute
the kurtosis of the weights given by the attention
model for each target word yi:
Kurt(yi) =
1
x Px
x Px
(cid:0) 1
j=1(αi,j − 1
j=1(αi,j − 1
x )4
x )2(cid:1)2
(6)
being, as above, αi,j the weight assigned by the
attention model to the j-th source word when de-
coding the i-th target word. Note that, by construc-
tion of the attention model, 1
x is equivalent to the
mean of the attention weights of the word yi.
Since we want to obtain samples with heavy
tails, we average the minus kurtosis values for all
words in the target sentence, obtaining the atten-
tion distraction score Cad:
Cad(x, y) =
Py
i=1 −Kurt(yi)
y
(7)
5.2 Query-by-committee
This framework maintains a committee of mod-
els, each one able to vote for the sentences to
be selected.
The query-by-committee (QBC)
method selects the samples with the largest dis-
agreement among the members of the commit-
tee. The level of disagreement of a sample x
measured according to the vote-entropy function
(Dagan and Engelson, 1995):
Cqbc(x) = −
#V (x)
C
+ log
#V (x)
C
(8)
where #V (x) is the number of members of the
committee that voted x to be worth to be super-
vised and C is the number of members of the
committee. If #V (x) is zero, we set the value of
Cqbc(x) to −∞.
Our committee was composed by the four un-
certainty sampling strategies, namely quality es-
timation, coverage, attention distraction and ran-
dom sampling. The inclusion of the latter into the
committee can be seen as a way of introducing
some noise, aiming to prevent overfitting.
6 Experimental framework
In order
to assess the effectiveness of AL
for INMT, we conducted a similar experimen-
tation than the latter works in AL for IMT
(Gonz´alez-Rubio and Casacuberta, 2014):
we
started from a NMT system trained on a general
corpus and followed Algorithm 1. This means that
the sampling strategy selected those instances to
be supervised by the human agent, who interac-
tively translated them. Next, the NMT system was
updated in an incremental way with the selected
samples.
Due to the prohibitive cost that an experimen-
tation with real users conveys, in our experiments,
the users were simulated. We used the references
from our corpus as the sentences the users would
like to obtain.
6.1 Evaluation
An IMT scenario with AL requires to assess two
different criteria: translation quality of the system
and human effort spent during the process.
For evaluating the quality of the translations, we
used the BLEU (bilingual evaluation understudy)
(Papineni et al., 2002) score. BLEU computes an
average mean of the precision of the n-grams (up
to order 4) from the hypothesis that appear in the
reference sentence.
It also has a brevity penalty
for short translations.
For estimating the human effort, we simulated
the actions that the human user would perform
when using the IMT system. Therefore, at each
iteration the user must search in the hypothesis the
next error, and position the mouse pointer on it.
Once the pointer is positioned, the user would in-
troduce the correct character. These actions corre-
spond to a mouse-action and a keystroke, respec-
tively.
It
Therefore, we use a commonly-used met-
interac-
ric that accounts for both types of
the keystroke mouse-action ratio (KSMR)
tion:
is defined as the
(Barrachina et al., 2009).
number of keystrokes plus the number of mouse-
actions required for obtaining the desired sen-
tence, divided by the number of characters of such
sentence. We add a final mouse-action, account-
ing for action of accepting the translation hypoth-
esis. Although keystrokes and mouse-actions are
different and require a different amount of effort
(Macklovitch et al., 2005), KSMR makes an ap-
proximation and assumes that both actions require
a similar effort.
6.2 Corpora
applied
to
ensure
a
comparison with
fair
of AL
the
To
IMT
latter works
2014), we
(Gonz´alez-Rubio and Casacuberta,
used the same datasets: our training data was
the Europarl corpus (Koehn, 2005), with the
development set provided at the 2006 workshop
on machine translation (Koehn and Monz, 2006).
As test set, we used the News Commentary corpus
(Callison-Burch et al., 2007). This test set is suit-
able to our problem at hand because i. it contains
data from different domains (politics, economics
and science), which represent challenging out-
of-domain samples, but account for a real-life
situation in a translation agency; and ii. it is large
enough to properly simulate long-term evolution
of unbounded data streams. All data are publicly
available. We conducted the experimentation in
the Spanish to English language direction. Table 1
shows the main figures of our data.
6.3 NMT systems and AL setup
Our NMT system was built using NMT-Keras
(Peris and Casacuberta, 2018a) and featured a
bidirectional LSTM encoder and a decoder with
cLSTM units. Following Britz et al. (2017), we
set the dimension of the LSTM, embeddings and
attention model to 512. We applied batch nor-
malizing transform (Ioffe and Szegedy, 2015) and
Gaussian noise during training (Graves, 2011).
The L2 norm of the gradients was clipped to
5,
for avoiding the exploiting gradient effect
Table 1: Corpora main figures, in terms of number
of sentences (S), number of running words (W )
and vocabulary size (V ). k and M stand for thou-
sands and millions of elements, respectively.
Corpus
Usage
S
W
V
Europarl
News
Commentary
Train
Dev.
Test
En
Es
En
Es
En
Es
2M
2k
51k
46M 106k
48M 160k
6.1k
58k
61k
7.7k
1.2M
1.5M
35k
49k
(Pascanu et al., 2012). We applied joint byte pair
encoding (BPE) (Sennrich et al., 2016) to all cor-
pora. For training the system, we used Adam
(Kingma and Ba, 2014), with a learning rate of
0.0002 and a batch size of 50. We early-stopped
the training according to the BLEU on our devel-
opment set. For decoding, we used a beam of 6.
We incrementally update the system (Line 9 in
Algorithm 1), with vanilla SGD, with a learning
rate of 0.0005. We chose this configuration ac-
cording to an exploration on the validation set.
The rest of hyperparameters were set according
to previous works. The blocks retrieved from the
data stream contained 500 samples (according to
Gonz´alez-Rubio et al. (2012), the performance is
similar regardless the block size). For the quality
estimation method, the IBM Model 2 was obtained
with fast align (Dyer et al., 2013) and τw was
set to 0.4 (Gonz´alez-Rubio et al., 2010).
7 Results and discussion
A system with AL involves two main facets to
evaluate:
the improvement on the quality of the
system and the amount of human effort required
for achieving such quality.
In this section, we
compare and study our AL framework for all our
sampling strategies: quality estimation sampling
(QES), coverage sampling (CovS), attention dis-
traction sampling (ADS), random sampling (RS)
and query-by-committee (QBC).
7.1 Active learning evaluation
First, we evaluated the effectiveness of the ap-
plication of AL in the NMT system, in terms of
translation quality. Fig. 2 shows the BLEU of the
initial hypotheses proposed by the NMT system
(Line 6 in Algorithm 1), as a function of the per-
centage of sentences supervised by the user (ε in
Algorithm 1). That means, the percentage of sen-
tences used to adapt the system. The BLEU of
a static system without AL was 34.6. Applying
AL, we obtained improvements up to 4.1 points of
BLEU.
QES
ADS
CovS
QBC
RS
39
38
37
36
35
]
%
[
U
E
L
B
0
20
40
60
80
100
Sentences supervised [%]
Figure 2: BLEU of the initial hypotheses pro-
posed by the the NMT system as a function of the
amount of data used to adapt it. The percentage of
sentences supervised refers to the value of ε with
respect to the block size.
As expected, the addition of the new knowledge
had a larger impact when applied to a non-adapted
system. Once the system becomes more special-
ized, a larger amount of data was required to fur-
ther improve.
The sampling strategies helped the system to
learn faster. Taking RS as a baseline, the learning
curves of the other techniques were better, espe-
cially when using few (up to a 30%) data for fine-
tuning the system. The strategies that achieved a
fastest adaptation were those involving the atten-
tion mechanism (ADS, CovS and QBC). This in-
dicates that the system is learning from the most
useful data. The QES and RS required more su-
pervised data for achieving the comparable BLEU
results. When supervising high percentages of
the data, we observed BLEU differences. This
is due to the ordering in which the selected sen-
tences were presented to the learner. The sampling
strategies performed a sort of curriculum learning
(Bengio et al., 2009).
7.2
Introducing the human into the loop
From the point of view of a user, it is important to
assess not only the quality of the MT system, but
also the effort spent to obtain such quality. Fig. 3
relates both, showing the amount of effort required
for obtaining a certain translation quality. We
compared the results of system with AL against
the same NMT system without AL and with two
other SMT systems, with and without AL, from
Gonz´alez-Rubio and Casacuberta (2014).
Results in Fig. 3 show consistent positive re-
sults of the AL framework. In all cases, AL re-
duced the human effort required for achieving a
certain translation quality. Compared to a static
NMT system, approximately a 25% of the human
effort can be spent using AL techniques.
QES
CovS
ADS
QBC
Static-NMT
AL-SMT†
Static-SMT†
RS
100
80
60
40
20
]
%
[
U
E
L
B
0
5
10
15
20
25
KSMR
(KSMR)
the human effort
Translation quality (BLEU) as a
Figure 3:
function of
re-
quired. Static-NMT relates to the same NMT
system without AL. † denotes systems from
Gonz´alez-Rubio and Casacuberta (2014): Static-
SMT is a SMT system without AL and AL-SMT
is the coverage augmentation SMT system.
Regarding the different sampling strategies, all
of them behaviored similarly. They provided con-
sistent and stable improvements, regardless the
level of effort desired (ε). This indicates that, al-
though the BLEU of the system may vary (Fig. 2),
this had small impact on the effort required for cor-
recting the samples. All sampling strategies out-
performed the random baseline, which had a more
unstable behavior.
Compared to classical SMT systems, NMT per-
formed surprisingly well. Even the NMT sys-
tem without AL largely outperformed the best AL-
SMT system. This is due to several reasons: on the
one hand, the initial NMT system was much bet-
ter than the original SMT system (34.6 vs. 14.9
BLEU points). Part of this large difference were
presumably due to the BPE used in NMT: the
data stream contained sentences from different do-
mains, but they can be effectively encoded into
known sequences via BPE. The SMT system was
unable to handle well such unseen sentences. On
the other hand, INMT systems usually respond
much better to the human feedback than inter-
active SMT systems (Knowles and Koehn, 2016;
Peris et al., 2017). Therefore, the differences be-
tween SMT and NMT were enlarged even more.
Finally, it should be noted that all our sampling
strategies can be computed speedily. They involve
analysis of the NMT attention weights, which are
computed as a byproduct of the decoding process;
or queries to a dictionary (in the case of QES). The
update of NMT system is also fast, taking approx-
imately 0.1 seconds. This makes AL suitable for a
real-time scenario.
8 Conclusions and future work
We studied the application of AL methods to
INMT systems. The idea was to supervise the
most useful samples from a potentially unbounded
data stream, while automatically translating the
rest of samples. We developed two novel sam-
pling strategies, able to outperform other well-
established methods, such as QES, in terms of
translation quality of the final system.
We evaluated the capabilities and usefulness
of the AL framework by simulating real-life sce-
nario,
involving the aforementioned large data
streams. AL was able to enhance the performance
of the NMT system in terms of BLEU. More-
over, we obtained consistent reductions of approx-
imately a 25% of the effort required for reaching
a desired translation quality. Finally, it is worth
noting that NMT outperformed classical SMT sys-
tems by a large margin.
We want to explore several lines of work in a
future. First, we intend to apply our method to
other datasets, involving linguistically diverse lan-
guage pairs and low-resource scenarios, in order to
observe whether the results obtained in this work
hold. We also aim to devise more effective sam-
pling strategies. To take into account the cogni-
tive effort or time required for interactively trans-
lating a sentence seem promising objective func-
tions. Moreover, these sampling strategies can be
used as a data selection technique. It would be in-
teresting to assess their performance on this task.
We also want to study the addition of reinforce-
ment or bandit learning into our framework. Re-
cent works (Nguyen et al., 2017; Lam et al., 2018)
already showed the usefulness of these learning
paradigms, which are orthogonal to our work. Fi-
nally, we intend to assess the effectiveness of our
proposals with real users in a near future.
Acknowledgments
The research leading this work received funding
from grants PROMETEO/2018/004 and CoMUN-
HaT - TIN2015-70924-C2-1-R. We also acknowl-
edge NVIDIA Corporation for the donation of
GPUs used in this work.
References
Ana Guerberof Arenas. 2008. Productivity and quality
in the post-editing of outputs from translation mem-
ories and machine translation. Localisation Focus,
7(1):11 -- 21.
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben-
gio. 2015. Neural machine translation by jointly
learning to align and translate. arXiv:1409.0473.
Sergio Barrachina, Oliver Bender, Francisco Casacu-
berta, Jorge Civera, Elsa Cubel, Shahram Khadivi,
Antonio Lagarda, Hermann Ney, Jes´us Tom´as, En-
rique Vidal, and Juan-Miguel Vilar. 2009. Statistical
approaches to computer-assisted translation. Com-
putational Linguistics, 35(1):3 -- 28.
Yoshua Bengio, J´erome Louradour, Ronan Collobert,
and Jason Weston. 2009. Curriculum learning. In
Proceedings of the 26th annual international con-
ference on machine learning, pages 41 -- 48.
John Blatz, Erin Fitzgerald, George Foster, Simona
Gandrabur, Cyril Goutte, Alex Kulesza, Alberto
Sanchis, and Nicola Ueffing. 2004. Confidence es-
timation for machine translation. In Proceedings of
the international conference on Computational Lin-
guistics, pages 315 -- 321.
Michael Bloodgood and Chris Callison-Burch. 2010.
Bucking the trend: Large-scale cost-focused active
learning for statistical machine translation. In Pro-
ceedings of the 48th Annual Meeting of the Associa-
tion for Computational Linguistics, pages 854 -- 864.
Ondrej Bojar, Christian Buck, Rajen Chatterjee, Chris-
tian Federmann, Yvette Graham, Barry Haddow,
Matthias Huck, Antonio Jimeno Yepes, Philipp
Koehn, and Julia Kreutzer. 2017. In Proceedings of
the Second Conference on Machine Translation.
Denny Britz, Anna Goldie, Minh-Thang Luong, and
Quoc Le. 2017. Massive exploration of neural ma-
chine translation architectures.
In Proceedings of
the 2017 Conference on Empirical Methods in Nat-
ural Language Processing, pages 1442 -- 1451.
Jes´us Gonz´alez-Rubio, Daniel Ortiz-Mart´ınez, and
Francisco Casacuberta. 2012. Active learning for in-
teractive machine translation. In Proceedings of the
Conference of the European Chapter of the Associa-
tion for Computational Linguistics, pages 245 -- 254.
Peter F. Brown, Vincent J. Della Pietra, Stephen
A. Della Pietra, and Robert L. Mercer. 1993. The
mathematics of statistical machine translation: Pa-
rameter estimation.
Computational Linguistics,
19(2):263 -- 311.
Chris Callison-Burch, Cameron Fordyce, Philipp
Koehn, Christof Monz, and Josh Schroeder. 2007.
(Meta-) evaluation of machine translation. In Pro-
ceedings of the Workshop on Statistical Machine
Translation, pages 136 -- 158.
David Cohn, Les Atlas, and Richard Ladner. 1994. Im-
proving generalization with active learning. Ma-
chine learning, 15(2):201 -- 221.
Ido Dagan and Sean P Engelson. 1995. Committee-
based sampling for training probabilistic classifiers.
In Machine Learning Proceedings 1995, pages 150 --
157. Elsevier.
Michael Denkowski, Chris Dyer, and Alon Lavie.
2014. Learning from post-editing: Online model
adaptation for statistical machine translation.
In
Proceedings of the 14th Conference of the European
Chapter of the Association for Computational Lin-
guistics, pages 395 -- 404.
Chris Dyer, Victor Chahuneau, and Noah A Smith.
2013. A simple, fast, and effective reparameteriza-
tion of IBM Model 2. In Proceedings of the 2013
Conference of the North American Chapter of the
Association for Computational Linguistics: Human
Language Technologies, pages 644 -- 648.
Alex Graves. 2011. Practical variational inference for
neural networks. In Advances in Neural Information
Processing Systems, pages 2348 -- 2356.
Gholamreza Haffari, Maxim Roy, and Anoop Sarkar.
2009. Active learning for statistical phrase-based
machine translation. In Proceedings of Human Lan-
guage Technologies: The 2009 Annual Conference
of the North American Chapter of the Association
for Computational Linguistics, pages 415 -- 423.
Sepp Hochreiter and Jurgen Schmidhuber. 1997.
Long short-term memory. Neural Computation,
9(8):1735 -- 1780.
Chris Hokamp and Qun Liu. 2017. Lexically con-
strained decoding for sequence generation using grid
beam search.
In Proceedings of the 55th Annual
Meeting of the Association for Computational Lin-
guistics (Volume 1: Long Papers), volume 1, pages
1535 -- 1546.
Sergey Ioffe and Christian Szegedy. 2015. Batch nor-
malization: Accelerating deep network training by
reducing internal covariate shift. arXiv:1502.03167.
Diederik Kingma and Jimmy Ba. 2014.
Adam:
optimization.
method
A
arXiv:1412.6980.
for
stochastic
Rebecca Knowles and Philipp Koehn. 2016. Neural
interactive translation prediction.
In Proceedings
of the Association for Machine Translation in the
Americas, pages 107 -- 120.
George Foster, Pierre Isabelle, and Pierre Plamon-
don. 1997. Target-text mediated interactive machine
translation. Machine Translation, 12:175 -- 194.
Philipp Koehn. 2005. Europarl: A parallel corpus for
statistical machine translation. In Proceedings of the
Machine Translation Summit, pages 79 -- 86.
Simona Gandrabur and George Foster. 2003. Confi-
dence estimation for text prediction. In Proceedings
of the Conference on Computational Natural Lan-
guage Learning, pages 315 -- 321.
Philipp Koehn and Christof Monz, editors. 2006. Pro-
ceedings on the Workshop on Statistical Machine
Translation. Association for Computational Lin-
guistics.
Jes´us Gonz´alez-Rubio and Francisco Casacuberta.
2014. Cost-sensitive active learning for computer-
assisted translation. Pattern Recognition Letters,
37:124 -- 134.
Jes´us Gonz´alez-Rubio, Daniel Ortiz-Mart´ınez, and
Francisco Casacuberta. 2010. Balancing user effort
and translation error in interactive machine trans-
lation via confidence measures. In Proceedings of
the Annual Meeting of the Association for Computa-
tional Linguistics, pages 173 -- 177.
Jes´us Gonz´alez-Rubio, Daniel Ortiz-Mart´ınez, and
Francisco Casacuberta. 2011. An active learning
scenario for interactive machine translation. In Pro-
ceedings of the 13th international conference on
multimodal interfaces, pages 197 -- 200.
Tsz Kin Lam, Julia Kreutzer, and Stefan Riezler. 2018.
A reinforcement learning approach to interactive-
predictive neural machine translation. In Proceed-
ings of the European Association for Machine Trans-
lation conference, pages 169 -- 178.
Abby Levenberg, Chris Callison-Burch, and Miles Os-
borne. 2010. Stream-based translation models for
statistical machine translation.
In Human Lan-
guage Technologies: The 2010 Annual Conference
of the North American Chapter of the Association
for Computational Linguistics, pages 394 -- 402.
David D Lewis and Jason Catlett. 1994. Heteroge-
neous uncertainty sampling for supervised learning.
In Machine Learning Proceedings 1994, pages 148 --
156.
Elliot Macklovitch, Nam-Trung Nguyen, and Roberto
Silva. 2005. User evaluation report. Technical re-
port. Transtype2 (ISR-2001-32091).
B. Settles. 2009. Active learning literature survey.
Computer Sciences Technical Report 1648, Univer-
sity of Wisconsin -- Madison.
H Sebastian Seung, Manfred Opper, and Haim Som-
polinsky. 1992. Query by committee. In Proceed-
ings of the fifth annual workshop on Computational
learning theory, pages 287 -- 294.
Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. 2014.
Sequence to sequence learning with neural net-
works.
In Proceedings of the Advances in Neural
Information Processing Systems, volume 27, pages
3104 -- 3112.
Zhaopeng Tu, Zhengdong Lu, Yang Liu, Xiaohua Liu,
and Hang Li. 2016. Modeling coverage for neural
machine translation. In Proceedings of the Annual
Meeting of the Association for Computational Lin-
guistics, volume 1, pages 76 -- 85.
Marco Turchi, Matteo Negri, M Amin Farajian, and
Marcello Federico. 2017. Continuous learning from
human post-edits for neural machine translation.
The Prague Bulletin of Mathematical Linguistics,
108(1):233 -- 244.
Nicola Ueffing, Gholamreza Haffari, Anoop Sarkar,
et al. 2007. Transductive learning for statistical
machine translation. In Proceedings of the Annual
Meeting of the Association for Computational Lin-
guistics, pages 25 -- 35.
Nicola Ueffing and Hermann Ney. 2005. Application
of word-level confidence measures in interactive sta-
tistical machine translation.
In Proceedings of the
European Association for Machine Translation con-
ference, pages 262 -- 270.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob
Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz
Kaiser, and Illia Polosukhin. 2017. Attention is all
you need. In Advances in Neural Information Pro-
cessing Systems, pages 5998 -- 6008.
Y. Wu, M. Schuster, Z. Chen, Q. V. Le, M. Norouzi,
W. Macherey, M. Krikun, Y. Cao, Q. Gao,
K. Macherey, J. Klingner, A. Shah, M. Johnson,
X. Liu, Ł. Kaiser, S. Gouws, Y. Kato, T. Kudo,
H. Kazawa, K. Stevens, G. Kurian, N. Patil,
W. Wang, C. Young, J. Smith, J. Riesa, A. Rudnick,
O. Vinyals, G. Corrado, M. Hughes, and J. Dean.
2016. Google's neural machine translation system:
Bridging the gap between human and machine trans-
lation. arXiv:1609.08144.
Laurent Nepveu, Guy Lapalme, Philippe Langlais, and
George Foster. 2004. Adaptive language and trans-
lation models for interactive machine translation. In
Proceedings of the Conference on Empirical Method
in Natural Language Processing, pages 190 -- 197.
Khanh Nguyen, Hal Daum´e III, and Jordan Boyd-
Graber. 2017. Reinforcement learning for bandit
neural machine translation with simulated human
feedback. In Proceedings of the 2017 Conference on
Empirical Methods in Natural Language Process-
ing, pages 1464 -- 1474.
Fredrik Olsson. 2009. A literature survey of active
machine learning in the context of natural language
processing. Technical report, Swedish Institute of
Computer Science.
Daniel Ortiz-Mart´ınez. 2016. Online learning for sta-
tistical machine translation. Computational Linguis-
tics, 42(1):121 -- 161.
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-
Jing Zhu. 2002. BLEU: a method for automatic
evaluation of machine translation.
In Proceedings
of the Annual Meeting of the Association for Com-
putational Linguistics, pages 311 -- 318.
Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho,
and Yoshua Bengio. 2014. How to construct deep
recurrent neural networks. arXiv:1312.6026.
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio.
2012. On the difficulty of training recurrent neural
networks. arXiv:1211.5063.
´Alvaro Peris and Francisco Casacuberta. 2018a. NMT-
Keras: a very flexible toolkit with a focus on interac-
tive NMT and online learning. The Prague Bulletin
of Mathematical Linguistics, 111:113 -- 124.
´Alvaro Peris and Francisco Casacuberta. 2018b. On-
line learning for effort reduction in interactive neural
machine translation. arXiv:1802.03594.
´Alvaro Peris, Miguel Domingo, and Francisco Casacu-
berta. 2017. Interactive neural machine translation.
Computer Speech & Language, 45:201 -- 220.
Herbert Robbins and Sutton Monro. 1951. A stochastic
approximation method. The Annals of Mathemati-
cal Statistics, pages 400 -- 407.
Mike Schuster and Kuldip K. Paliwal. 1997. Bidirec-
tional recurrent neural networks. IEEE Transactions
on Signal Processing, 45(11):2673 -- 2681.
Rico Sennrich, Barry Haddow, and Alexandra Birch.
2016. Improving neural machine translation models
with monolingual data.
In Proceedings of the An-
nual Meeting of the Association for Computational
Linguistics, pages 86 -- 96.
|
1811.06096 | 1 | 1811 | 2018-11-14T22:19:03 | Automatic Grammar Augmentation for Robust Voice Command Recognition | [
"cs.CL",
"cs.SD",
"eess.AS"
] | This paper proposes a novel pipeline for automatic grammar augmentation that provides a significant improvement in the voice command recognition accuracy for systems with small footprint acoustic model (AM). The improvement is achieved by augmenting the user-defined voice command set, also called grammar set, with alternate grammar expressions. For a given grammar set, a set of potential grammar expressions (candidate set) for augmentation is constructed from an AM-specific statistical pronunciation dictionary that captures the consistent patterns and errors in the decoding of AM induced by variations in pronunciation, pitch, tempo, accent, ambiguous spellings, and noise conditions. Using this candidate set, greedy optimization based and cross-entropy-method (CEM) based algorithms are considered to search for an augmented grammar set with improved recognition accuracy utilizing a command-specific dataset. Our experiments show that the proposed pipeline along with algorithms considered in this paper significantly reduce the mis-detection and mis-classification rate without increasing the false-alarm rate. Experiments also demonstrate the consistent superior performance of CEM method over greedy-based algorithms. | cs.CL | cs | AUTOMATIC GRAMMAR AUGMENTATION FOR ROBUST VOICE COMMAND RECOGNITION
Yang Yang†, Anusha Lalitha (cid:63), Jinwon Lee†, Chris Lott†
(cid:63) Department of Electrical and Computer Engineering, University of California San Diego
† Qualcomm Research, San Diego
8
1
0
2
v
o
N
4
1
]
L
C
.
s
c
[
1
v
6
9
0
6
0
.
1
1
8
1
:
v
i
X
r
a
ABSTRACT
This paper proposes a novel pipeline for automatic grammar aug-
mentation that provides a significant improvement in the voice com-
mand recognition accuracy for systems with small footprint acoustic
model (AM). The improvement is achieved by augmenting the user-
defined voice command set, also called grammar set, with alternate
grammar expressions. For a given grammar set, a set of potential
grammar expressions (candidate set) for augmentation is constructed
from an AM-specific statistical pronunciation dictionary that cap-
tures the consistent patterns and errors in the decoding of AM in-
duced by variations in pronunciation, pitch, tempo, accent, ambigu-
ous spellings, and noise conditions. Using this candidate set, greedy
optimization based and cross-entropy-method (CEM) based algo-
rithms are considered to search for an augmented grammar set with
improved recognition accuracy utilizing a command-specific dataset.
Our experiments show that the proposed pipeline along with algo-
rithms considered in this paper significantly reduce the mis-detection
and mis-classification rate without increasing the false-alarm rate.
Experiments also demonstrate the consistent superior performance
of CEM method over greedy-based algorithms.
Index Terms -- voice command recognition, CTC, grammar
augmentation, cross entropy method, statistical pronunciation dic-
tionary
1. INTRODUCTION
Voice UI is becoming ubiquitous for all types of devices, from smart-
phones to automobiles. Although we have seen substantial improve-
ment in speech recognition accuracy reported in the literature since
the advent of deep neural network based solutions [1, 2, 3, 4], design-
ing robust voice UI system for low memory/power footprint embed-
ded devices without a cloud-based back-end still remains a challeng-
ing problem. Compared to its cloud-based counterpart, on-device in-
ference, despite being limited by computation power, memory size,
and power consumption, remains appealing for several reasons: (i)
there are less privacy concerns as user voice data need not be up-
loaded to the cloud; (ii) it reduces the latency as it does not involve
network access delay; (iii) its usage is not restricted by internet avail-
ability, and can be applied in devices with no built-in communication
module.
In this work, we focus on improving the recognition accuracy of
on-device voice UI systems designed to respond to a limited set of
pre-defined voice commands. Such voice UI systems are commonly
used in modern IoT/embedded devices such as bluetooth speaker,
portable camcorder, hearables, home appliances, etc. Specially, we
assume a fixed audio front-end and only look at the pipeline of map-
ping acoustic features to voice commands.
As illustrated in Fig. 1, we focus on the voice command recog-
nition system composed of an acoustic model (AM) encoder that
Fig. 1. Voice command recognition pipeline
converts the acoustic features into phoneme/grapheme-based proba-
bilistic output, followed by a decoder (e.g., FST) that maps the prob-
abilistic output from AM to one of the voice commands. State of the
art acoustic model utilizes either CTC [5], RNN-transducer [4], or
Attention Model [6] (see [7, 8] for a good summary). They gener-
ate probabilistic outputs, which are fed to a decoder that generates
the posterior probability of the corresponding phoneme or grapheme
label. Even though these model architectures and training method-
ologies lead to satisfactory and even super-human transcription ac-
curacy, the best models obtained are often too large for their de-
ployment in small portable devices, e.g., even the smallest model
considered in [9] (Table 11 therein) has 18M parameters.
In this work, we utilize a 211K parameter unidirectional-RNN-
based acoustic model trained with CTC criterion using Librispeech
and a few other datasets, which output probabilities on grapheme tar-
gets. Due to the small model size, its transcription accuracy is low:
the greedy decoding word-error-rate (WER) without any language
model is 48.6% on Libri-speech test-clean dataset. Hence, one of the
challenges addressed by our work is, given a small acoustic model
trained with general speech dataset, how can one improve the com-
mand recognition accuracy utilizing limited command-specific data.
Such small footprint AMs have been considered for keyword detec-
tion in [10] and [11]. Our work extends these by improving the com-
mand command recognition accuracy with a small footprint AM.
In Table 1, we list a few samples of the greedy decoding results
from the 211K parameter acoustic model. It is worth noting that even
though the word-error-rate is high, the error that it makes tends to be
a phonetically plausible rendering of the correct word [1]. Running
through a large dataset, we also observe that the error patterns tend
to be consistent across different utterances. This leads to a useful in-
sight: for the recognition of a limited set of voice commands (a.k.a.
grammar of the decoder), one could improve recognition accuracy
AM greedy decoding
the recter pawsd and den
shaking his classto hands
before him went on
tax for wone o thease
and itees he other
Ground truth
the rector paused and then
shaking his clasped hands
before him went on
facts form one of these
and ideas the other
Table 1. Greedy decoding samples from the acoustic encoder. Word
errors are labeled in bold.
by adding variations that capture common and consistent errors from
the acoustic model to original command set. We define grammar as a
set of valid voice commands (e.g., the grammar can be {play music,
stop music, . . .}) and we refer to this technique of adding variations
to the original grammar as grammar augmentation. Effective gram-
mar augmentation is the focus of this work.
The main contribution of this paper is the design of effective
grammar augmentation framework which provides significant im-
provement over the baseline system. Next, we highlight our main
contributions in detail: (a) For any given set of original voice com-
mands, we propose the design of a candidate set of all grammar
variations which captures the consistent errors for a given AM (b)
We propose a technique for fast evaluation of command recognition
accuracy along with false-alarm and mis-detection rate for any aug-
mented grammar set and finally (c) We devise various algorithms to
automatically identify an improved augmented grammar set by suit-
ably adding variations from the candidate set to the original gram-
mar.
Our novel pipeline using the above techniques is illustrated in
Fig. 2. The rest of the paper is organized as the following: In Sec-
tion 2, we give an overview of the proposed grammar augmenta-
tion pipeline and dive into the generation of a candidate set and fast
grammar evaluation techniques. In Section 3 algorithms via greedy
optimization and CEM algorithm are utilized to automate the gram-
mar augmentation process. The experiment results are presented in
Section 4 and we discussion on future directions in Section 5.
2. PIPELINE FOR AUTOMATIC GRAMMAR
AUGMENTATION
Our AM is trained with CTC loss [5], and can thus assign a posterior
probability PCTC(gu) for each command g in a command set, for an
input utterance u. For a given test utterance, our system picks the
command with the highest probability, or rejects the utterance if the
highest probability is below a pre-defined confidence threshold (see
Section 2.3) [12][13].
Command decoding errors happen if the AM output deviates
from the ground truth to the extent that it can no longer success-
fully discriminate against other grammar sequences. The idea be-
hind grammar augmentation is to restore the discriminative power of
the acoustic model by including in the grammar the sequence vari-
ations that capture pronunciation variations or consistent AM error
patterns. To do that, we begin with generation of a candidate set
containing meaningful variations.
2.1. AM-specific statistical pronunciation dictionary
The augmentation candidates should ideally capture consistent error
patterns from the AM, induced by variations in pronunciation, pitch,
tempo, accent, ambiguous spellings, or even inherent mistakes made
by the AM. For example, if any command includes words that have
homophones, then it is necessary to consider adding those homo-
phones into the grammar. To capture these word-level variations,
we introduce a novel concept named AM-specific statistical pronun-
ciation dictionary, obtained by the following steps: First, we run
the AM through a large general speech dataset (e.g., the training
set of AM). For each utterance, we obtain its greedy decoding se-
quence by outputting the character with the maximum probability
at each time frame, followed by the CTC squashing function [5] to
collapse repeated output graphemes and remove blanks. Given that
most utterances from a general speech dataset correspond to a sen-
tence rather than a single word, we use Levenshtein algorithm to find
the minimum-edit-path of the ground-truth to the decoding, and by
doing so obtain a mapping of each word to its corresponding max-
imum probability decoding. For each word, we gather the statistics
regarding the frequencies of its maximum-probability decoding out-
puts. Here we sample a few entries from the dictionary obtained
using our 211K-parameter AM:
set
pause
two
set
said
sat
sait
sed
32.2% pause
16.6% pose
11.4% pase
8.15% porse
4.71% pas
15.7% to
14.9% two
7.68% do
7.31% tu
7.31% too
53.3%
34.7%
1.0%
0.7%
0.3%
2.2. Candidate set for grammar augmentation
Utilizing this statistical dictionary, we build a candidate set contain-
ing potential grammar variations by repeatedly replacing each word
in the original grammar by its top-k likely max-decoding outputs.
Consider a voice UI application for a small bluetooth player, one
could have the following five commands forming the original gram-
mar.
command
(C)
play music
stop music
pause music
previous song
next song
original
grammar1
play music
stop music
pause music
previous song
next song
candidate set for
grammar augmentation (G)
pla music, ply music, play mesic, . . .
stap music, stup music, stup mesic, . . .
pose music, pase mesic, pause mesic, . . .
previs song, previous son, . . .
nex song, lext song, nex son, . . .
By looking up in the statistical dictionary the words contained in
the original grammar, one can form an array of alternate expressions
for the original commands as shown above. For each command,
the set of candidates is the cartesian product of the top-k decoding
list from the statistical pronunciation dictionary for each word in the
command. The value of k can be different for different words, and
is chosen to capture at least a certain fraction of all the variations.
2.3. Evaluation of command recognition accuracy
Let us denote the set of commands as C, the set of all grammar candi-
dates G, and the mapping function from G to C as f. A grammar G is
a subset of G. For the purpose of evaluating the recognition accuracy
of any grammar, we need a command-specific dataset containing au-
dio waveforms and the corresponding target commands. We denote
such dataset as (u, t) ∈ D with u and t denoting an utterance and its
corresponding target command. To evaluate the false alarm rate, we
also need an out-of-domain dataset u ∈ Dood that contains a set of
utterances that do not correspond to any of the commands.
As mentioned before, the acoustic decoder compares the poste-
rior probabilities PCTC(gu) of all the grammar candidates g included
in grammar set G ⊂ G given the audio waveform u, and output the
PCTC(gu). This calcu-
command f (g∗) where g∗ = argmaxg∈G
lation is done by running a forward-only dynamic programming al-
gorithm on the AM output. In order to avoid having to repeat the
calculation of the probability scores for every choice of grammar
1Here we assume that AM is trained with grapheme as target, and as a result the
grammar is exact the same as the command. Note that the same grammar augmentation
pipeline introduced here can be applied to AM trained with phoneme target as well, in
which case the grammar is a set of phoneme sequences, and the statistical pronunciation
dictionary contains variations of each word in phoneme representation.
Fig. 2. Grammar augmentation pipeline.
set G ⊆ G, we pre-compute and store the probability scores for
all the candidate grammar, and all the utterances in both command-
specific dataset D and out-of-domain dataset Dood. Precisely, as a
pre-processing steps of the grammar augmentation search algorithm,
we obtain the following probability scores:
PCTC(gu),
∀g ∈ G,∀u ∈ D ∪ Dood.
(1)
To achieve a false alarm rate (FAR) target of α, the confidence
threshold for the probability score can be computed as below,
(cid:12)(cid:12)(cid:8)u ∈ Dood : max
PCTC(gu) > τ(cid:9)(cid:12)(cid:12)
(cid:41)
τ (G, α) = min
g∈G
Dood
The decoded command for an utterance u is
τ :
τ
< α
.
(cid:40)
(cid:40) φ,
d(G, α, u) =
argmax
c∈C
if maxg∈G PCTC(gu) < τ (G, α),
otherwise.
max
PCTC(gu),
g∈G,f (g)=c
φ denotes decoding being out-of-domain.
With a fixed false-alarm rate, there are two types of error event:
mis-detection and mis-classification. Mis-detection refers to the case
where a voice command is issued but not detected (i.e., decoded
as being out-of-domain), whereas mis-classification happens where
a voice command is issued and detected, but the wrong command
is decoded. Precisely, the mis-detection-rate (MDR) and the mis-
classification-rate (MCR) are defined as below
MDR(G, α) ={(u, t) ∈ D : d(G, α, u) = φ}/D,
MCR(G, α) ={(u, t) ∈ D : d(G, α, u) (cid:54)∈ {φ, t}}/D.
3. AUGMENTATION SEARCH ALGORITHMS
The grammar augmentation algorithms we consider search for the
grammar set G among all subsets of a candidate set G that minimizes
a weighted sum of the mis-detection-rate and mis-classification-rate
with a fixed false-alarm target α,
G⊆G MCR(G, α) + βMDR(G, α).
min
(2)
Here the weight factor β controls the significance of mis-detection
versus mis-classification. Since we pre-compute the probabilities as
shown in Equation (1), for each grammar G ⊆ G the objective func-
tion can be evaluated without invoking the AM, which significantly
speeds up the search algorithms.
It is important to note that adding candidate to the grammar does
not always improve performance: (i) With a fixed false-alarm tar-
get, adding more candidates only increase the confidence threshold
τ (G, α), which could potentially result in degraded mis-detection
rate. (ii) distinguishability of the commands has a complex inter-
dependency, hence adding grammar candidate for one command
may reduce the recognition rate of other commands, as it may alter
the classification boundary amongst the set of commands.
,
3.1. Augmentation via greedy optimization methods
We consider the following three methods based on greedy optimiza-
tion:
Naive greedy search: Start with the original grammar, iteratively
go through all the candidates from G.
In each iteration, add the
candidate that best improves the objective function and update the
confidence threshold to maintain target FAR, until no candidate can
improve further.
Greedy search with refinement: This algorithm is similar to
greedy search except for every time a candidate is added to the
grammar, we remove those candidates among the remaining ones
which contain the added candidate as a subsequence. For example,
for pause music command, if candidate pose music is added to the
grammar, then porse music is removed from subsequent iterations.
Trimming the candidate set in this manner increases the diversity of
variations in the grammar.
Beam-search: In each iteration a list of l best grammar sets is
maintained. This degenerates to the naive greedy algorithm when
l = 1.
3.2. Augmentation via cross entropy method (CEM)
Cross entropy method (CEM) is a widely used combinatorial opti-
mization algorithm and has been successfully applied in some rein-
forcement learning problems [14, 15]. The main idea is rooted from
rare event sampling, for which the algorithm tries to minimize the
KL divergence between a proposed sampling distribution and the
optimal zero-variance importance sampling distribution [15]. Go-
ing back to the grammar augmentation objective function in Equa-
tion (2), the search space is the power set of the candidate set G,
which can be represented by {0, 1}G, with each grammar choice
represented by a G-dimensional binary vector.
Applying the idea of CEM, we start with an initial probability
distribution on {0, 1}G, and iteratively tune its parameter so that it
assigns most of the probability mass in the region towards the min-
imization of the objection function. In our design, the distribution
on this discrete space is induced by the sign of a G-dimensional in-
dependent Gaussian distributions, parameterized by their mean and
variance in each dimension. For each iteration, we start with a pop-
ulation of s samples from the current distribution, each representing
a feasible candidate choice. We evaluate the objective function of
MDR + βMCR for each of sample candidate choice, and keep the
best γ fraction. We then update the parameter of the distribution
using the sample mean and variance of the top γs candidates (also
called elite set), and iterate the procedure by obtaining s samples
from the updated distribution.
4. EXPERIMENTS
In this section, we present some experiments which illustrate the im-
provement that can obtained in recognition accuracy by applying our
grammar augmentation algorithm. All the results are obtained with a
dataset containing 5 commands: play music, pause music, stop mu-
sic, next song and previous song. This dataset contains utterances
with varying gender, pitch, volume, noise types and accents, and
are split into training, validation, and testing datasets. The training
dataset is used to train the augmentation search algorithms to min-
imize the objective defined in (2). The validation dataset is used to
compare performances of grammar sets obtained and decide which
one to take. Finally, we report the results of the final grammar
set on a test dataset. For the training objective function in Equa-
tion (2), we pick β = 1, in which case minimizing the sum of MDR
and MCR is equivalent to maximizing the command success rate
1−MCR(G, α)−MDR(G, α). A candidate set is obtained from run-
ning the 211K parameter AM with a 2000-hour dataset using steps
discussed in Section 2.1 and 2.2. We consider 150 grammar candi-
dates (G = 150) using our statistical pronunciation dictionary.
4.1. Performance Evaluation
We analyze the grammar augmentation algorithms described in Sec-
tion 3 with a fixed FAR target of α = 0.1% and compare the aug-
mentation grammar output by each algorithm in terms. Fig. 3 shows
the command success rate and the decomposition of the error in
terms of mis-detection and mis-classification. Note that CEM algo-
rithm provides most improvement in command success rate unlike
greedy-optimization based algorithms which may commit to sub-
optimal grammar sets early on. As discussed previously, adding
more variations to the grammar set makes it more susceptible to
mis-detection errors.
In fact, adding all 150 grammar expression
reduces the command success rate to 80% and increases the MDR
to 13.76%. However, Fig 3 shows that performing augmentation in
a principled manner can greatly reduce the mis-classification error
without increasing the mis-detection errors.
naive greedy. The greedy algorithm refinement reaches its best per-
formance in the least number of grammar evaluations. This suggests
that incentivizing diversity over exploration may provide better im-
provement in command success rate and in fewer evaluations.
Fig. 4. Test dataset performance vs. number of grammar evaluations
4.3. Effect of Candidate Set Size on Performance
So far we considered a candidate set size of 150 (G = 150). Next,
we investigate the effect of varying the candidate set size on the per-
formance of the augmentation algorithms. We vary the candidate
size by varying the number of words k we choose from the top-k
likely max-decoding outputs for every word in the statistical pronun-
ciation dictionary. Hence, a larger candidate size captures a larger
probability of max-decoding outputs. We repeat our experiments by
altering the candidate set size from 25 to 150. Table 2 shows the
performance the augmentation algorithms for various candidate set
sizes. In particular, it shows that CEM improves as we increase the
candidate set and is consistently better than greedy based algorithms.
Candidate
Set Size G
25
50
75
100
150
Greedy Greedy
(refinement)
91.79
92.74
93.16
92.65
94.02
92.31
93.16
93.08
92.82
93.76
Beamsearch
(width 5)
92.31
93.50
92.99
92.05
93.85
CEM
93.25
93.59
93.68
94.02
94.44
Fig. 3. Performance of grammar augmentation algorithms.
4.2. Complexity of Grammar Augmentation Algorithms
We evaluate the complexity of the augmentation algorithms consid-
ered in Section 3. The most computationally expensive step in im-
plementing our augmentation algorithms is the evaluation of MCR
and MDR for any candidate grammar set. Hence, we measure the
complexity of our augmentation algorithms in terms of number of
grammar evaluations needed to output their best augmented gram-
mar set. Fig. 4 illustrates the variation/improvement in command
success rate (1-MDR-MCR) as the number of grammar evaluations
increases. Note that CEM takes only marginally more evaluations
while providing the maximum reduction in the sum of MCR and
MDR. While beamsearch explores more and requires more gram-
mar evaluation, it provides only marginally better improvement over
Table 2. 1-MDR - MCR (%) for different algorithms with different
candidate set size G.
5. CONCLUSION AND FUTURE WORK
In this work, we focus on a small-footprint voice command recogni-
tion system composed of a CTC-based small-capacity acoustic en-
coder, and a corresponding maximum a posteriori decoder for the
recognition of a limited set of fixed commands. With a command
specific dataset, we proposed a novel pipeline that automatically
augments the command grammar for improved mis-detection and
mis-classification rate. We achieved this by adapting the decoder to
the consistent decoding variations of the acoustic model. An impor-
tant direction of future work is to extend our grammar augmentation
pipeline to provide personalization, i.e., to improve the recognition
accuracy for a specific user by adapting the decoder to better fit both
the AM and the user's pronunciation pattern.
OriginalGreedyGreedy(with refinement)Beam-search(width=5)CEM86889092949698100% (FAR=0.1%)90.345.903.7693.764.022.2294.023.502.4893.853.502.6594.442.313.25Command Success RateMCRMDR0100020003000400050006000700080009000Number of grammar evaluations8990919293941-MCR-MDR (%)CEMGreedy (with refinement)GreedyBeamsearch (width = 5)Original Grammar[12] Y. Miao, M. Gowayyed, and F. Metze,
"EESEN: End-to-
end speech recognition using deep RNN models and WFST-
based decoding," in 2015 IEEE Workshop on Automatic Speech
Recognition and Understanding (ASRU), Dec 2015, pp. 167 --
174.
[13] Naoyuki Kanda, Xugang Lu, and Hisashi Kawai, "Maximum a
posteriori based decoding for ctc acoustic models," in INTER-
SPEECH, 2016.
[14] Istv´an Szita and Andr´as Lorincz, "Learning Tetris Using the
Noisy Cross-entropy Method," Cambridge, MA, USA, Dec.
2006, vol. 18, pp. 2936 -- 2941, MIT Press.
[15] Pieter-Tjerk de Boer, Dirk P. Kroese, Shie Mannor, and
"A Tutorial on the Cross-Entropy
Reuven Y. Rubinstein,
Method," Feb 2005, vol. 134, pp. 19 -- 67.
6. REFERENCES
[1] Awni Y. Hannun, Carl Case, Jared Casper, Bryan Catanzaro,
Greg Diamos, Erich Elsen, Ryan Prenger, Sanjeev Satheesh,
Shubho Sengupta, Adam Coates, and Andrew Y. Ng, "Deep
Speech: Scaling up end-to-end speech recognition," 2014, vol.
abs/1412.5567.
[2] Dario Amodei, Sundaram Ananthanarayanan, Rishita Anub-
hai, Jingliang Bai, Eric Battenberg, Carl Case, Jared Casper,
Bryan Catanzaro, Qiang Cheng, Guoliang Chen, Jie Chen,
Jingdong Chen, Zhijie Chen, Mike Chrzanowski, Adam
Coates, Greg Diamos, and et al, "Deep Speech 2 : End-to-End
Speech Recognition in English and Mandarin," in Proceed-
ings of The 33rd International Conference on Machine Learn-
ing, Maria Florina Balcan and Kilian Q. Weinberger, Eds., New
York, New York, USA, 20 -- 22 Jun 2016, vol. 48 of Proceedings
of Machine Learning Research, pp. 173 -- 182, PMLR.
[3] Ronan Collobert, Christian Puhrsch, and Gabriel Synnaeve,
"Wav2Letter: an End-to-End ConvNet-based Speech Recog-
nition System," 2016, vol. abs/1609.03193.
[4] Alex Graves, "Sequence Transduction with Recurrent Neural
Networks," 2012, vol. abs/1211.3711.
[5] Alex Graves, Santiago Fern´andez, Faustino Gomez, and Jurgen
Schmidhuber,
"Connectionist Temporal Classification: La-
belling Unsegmented Sequence Data with Recurrent Neural
Networks," in Proceedings of the 23rd International Confer-
ence on Machine Learning, New York, NY, USA, 2006, ICML
'06, pp. 369 -- 376, ACM.
[6] Jan Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk,
KyungHyun Cho, and Yoshua Bengio, "Attention-Based Mod-
els for Speech Recognition," 2015, vol. abs/1506.07503.
[7] Rohit Prabhavalkar, Kanishka Rao, Tara N. Sainath, Bo Li, Leif
Johnson, and Navdeep Jaitly, "A Comparison of Sequence-
in INTER-
to-Sequence Models for Speech Recognition,"
SPEECH, 2017.
[8] E. Battenberg, J. Chen, R. Child, A. Coates, Y. G. Y. Li,
H. Liu, S. Satheesh, A. Sriram, and Z. Zhu, "Exploring neural
transducers for end-to-end speech recognition," in 2017 IEEE
Automatic Speech Recognition and Understanding Workshop
(ASRU), Dec 2017, pp. 206 -- 213.
[9] Dario Amodei, Rishita Anubhai, Eric Battenberg, Carl
Case, Jared Casper, Bryan Catanzaro, Jingdong Chen, Mike
Chrzanowski, Adam Coates, Greg Diamos, and et al, "Deep
Speech 2: End-to-End Speech Recognition in English and
Mandarin," 2015, vol. abs/1512.02595.
[10] Tara N. Sainath and Carolina Parada, "Convolutional neural
in INTER-
networks for small-footprint keyword spotting,"
SPEECH. 2015, pp. 1478 -- 1482, ISCA.
[11] G. Chen, C. Parada, and G. Heigold, "Small-footprint keyword
spotting using deep neural networks," in 2014 IEEE Interna-
tional Conference on Acoustics, Speech and Signal Processing
(ICASSP), May 2014, pp. 4087 -- 4091.
|
1805.02442 | 1 | 1805 | 2018-05-07T11:14:07 | Paraphrase to Explicate: Revealing Implicit Noun-Compound Relations | [
"cs.CL"
] | Revealing the implicit semantic relation between the constituents of a noun-compound is important for many NLP applications. It has been addressed in the literature either as a classification task to a set of pre-defined relations or by producing free text paraphrases explicating the relations. Most existing paraphrasing methods lack the ability to generalize, and have a hard time interpreting infrequent or new noun-compounds. We propose a neural model that generalizes better by representing paraphrases in a continuous space, generalizing for both unseen noun-compounds and rare paraphrases. Our model helps improving performance on both the noun-compound paraphrasing and classification tasks. | cs.CL | cs | Paraphrase to Explicate:
Revealing Implicit Noun-Compound Relations
Vered Shwartz
Ido Dagan
Computer Science Department, Bar-Ilan University, Ramat-Gan, Israel
[email protected]
[email protected]
8
1
0
2
y
a
M
7
]
L
C
.
s
c
[
1
v
2
4
4
2
0
.
5
0
8
1
:
v
i
X
r
a
Abstract
Revealing the implicit
semantic rela-
tion between the constituents of a noun-
compound is important for many NLP ap-
plications.
It has been addressed in the
literature either as a classification task to
a set of pre-defined relations or by pro-
ducing free text paraphrases explicating
the relations. Most existing paraphras-
ing methods lack the ability to generalize,
and have a hard time interpreting infre-
quent or new noun-compounds. We pro-
pose a neural model that generalizes better
by representing paraphrases in a contin-
uous space, generalizing for both unseen
noun-compounds and rare paraphrases.
Our model helps improving performance
on both the noun-compound paraphrasing
and classification tasks.
1
Introduction
Noun-compounds hold an implicit semantic rela-
tion between their constituents. For example, a
'birthday cake' is a cake eaten on a birthday, while
'apple cake' is a cake made of apples. Interpreting
noun-compounds by explicating the relationship is
beneficial for many natural language understand-
ing tasks, especially given the prevalence of noun-
compounds in English (Nakov, 2013).
The interpretation of noun-compounds has been
addressed in the literature either by classifying
them to a fixed inventory of ontological relation-
ships (e.g. Nastase and Szpakowicz, 2003) or by
generating various free text paraphrases that de-
scribe the relation in a more expressive manner
(e.g. Hendrickx et al., 2013).
Methods dedicated to paraphrasing noun-
compounds usually rely on corpus co-occurrences
of the compound's constituents as a source of ex-
plicit relation paraphrases (e.g. Wubben, 2010;
Versley, 2013). Such methods are unable to gen-
eralize for unseen noun-compounds. Yet, most
noun-compounds are very infrequent in text (Kim
and Baldwin, 2007), and humans easily interpret
the meaning of a new noun-compound by general-
izing existing knowledge. For example, consider
interpreting parsley cake as a cake made of pars-
ley vs. resignation cake as a cake eaten to cele-
brate quitting an unpleasant job.
We follow the paraphrasing approach and pro-
pose a semi-supervised model
for paraphras-
ing noun-compounds. Differently from previ-
ous methods, we train the model to predict ei-
ther a paraphrase expressing the semantic rela-
tion of a noun-compound (predicting '[w2] made
of [w1]' given 'apple cake'), or a missing con-
stituent given a combination of paraphrase and
noun-compound (predicting 'apple' given 'cake
made of [w1]'). Constituents and paraphrase tem-
plates are represented as continuous vectors, and
semantically-similar paraphrase templates are em-
bedded in proximity, enabling better generaliza-
tion.
Interpreting 'parsley cake' effectively re-
duces to identifying paraphrase templates whose
"selectional preferences" (Pantel et al., 2007) on
each constituent fit 'parsley' and 'cake'.
A qualitative analysis of the model shows that
the top ranked paraphrases retrieved for each
noun-compound are plausible even when the con-
stituents never co-occur (Section 4). We evalu-
ate our model on both the paraphrasing and the
classification tasks (Section 5). On both tasks,
the model's ability to generalize leads to improved
performance in challenging evaluation settings.1
1The code is available at github.com/vered1986/panic
2 Background
2.1 Noun-compound Classification
Noun-compound classification is the task con-
cerned with automatically determining the seman-
tic relation that holds between the constituents of
a noun-compound, taken from a set of pre-defined
relations.
Early work on the task leveraged information
derived from lexical resources and corpora (e.g.
Girju, 2007; ´O S´eaghdha and Copestake, 2009;
Tratz and Hovy, 2010). More recent work broke
the task into two steps: in the first step, a noun-
compound representation is learned from the dis-
tributional representation of the constituent words
(e.g. Mitchell and Lapata, 2010; Zanzotto et al.,
2010; Socher et al., 2012). In the second step, the
noun-compound representations are used as fea-
ture vectors for classification (e.g. Dima and Hin-
richs, 2015; Dima, 2016).
The datasets for this task differ in size, num-
ber of relations and granularity level (e.g. Nastase
and Szpakowicz, 2003; Kim and Baldwin, 2007;
Tratz and Hovy, 2010). The decision on the re-
lation inventory is somewhat arbitrary, and sub-
sequently, the inter-annotator agreement is rela-
tively low (Kim and Baldwin, 2007). Specifi-
cally, a noun-compound may fit into more than
one relation: for instance, in Tratz (2011), busi-
ness zone is labeled as CONTAINED (zone con-
tains business), although it could also be labeled
as PURPOSE (zone whose purpose is business).
2.2 Noun-compound Paraphrasing
As an alternative to the strict classification to pre-
defined relation classes, Nakov and Hearst (2006)
suggested that the semantics of a noun-compound
could be expressed with multiple prepositional
and verbal paraphrases. For example, apple cake
is a cake from, made of, or which contains apples.
The suggestion was embraced and resulted
in two SemEval tasks. SemEval 2010 task 9
(Butnariu et al., 2009) provided a list of plau-
sible human-written paraphrases for each noun-
compound, and systems had to rank them with the
goal of high correlation with human judgments.
In SemEval 2013 task 4 (Hendrickx et al., 2013),
systems were expected to provide a ranked list of
paraphrases extracted from free text.
Various approaches were proposed for this task.
Most approaches start with a pre-processing step
of extracting joint occurrences of the constituents
from a corpus to generate a list of candidate para-
phrases. Unsupervised methods apply information
extraction techniques to find and rank the most
meaningful paraphrases (Kim and Nakov, 2011;
Xavier and Lima, 2014; Pasca, 2015; Pavlick
and Pasca, 2017), while supervised approaches
learn to rank paraphrases using various features
such as co-occurrence counts (Wubben, 2010; Li
et al., 2010; Surtani et al., 2013; Versley, 2013)
or the distributional representations of the noun-
compounds (Van de Cruys et al., 2013).
One of the challenges of this approach is the
ability to generalize.
If one assumes that suffi-
cient paraphrases for all noun-compounds appear
in the corpus, the problem reduces to ranking the
existing paraphrases. It is more likely, however,
that some noun-compounds do not have any para-
phrases in the corpus or have just a few. The ap-
proach of Van de Cruys et al. (2013) somewhat
generalizes for unseen noun-compounds. They
represented each noun-compound using a compo-
sitional distributional vector (Mitchell and Lap-
ata, 2010) and used it to predict paraphrases from
the corpus. Similar noun-compounds are expected
to have similar distributional representations and
therefore yield the same paraphrases. For exam-
ple, if the corpus does not contain paraphrases for
plastic spoon, the model may predict the para-
phrases of a similar compound such as steel knife.
sharing information between
semantically-similar paraphrases, Nulty and
Costello (2010) and Surtani et al. (2013) learned
"is-a" relations between paraphrases from the
co-occurrences of various paraphrases with each
other. For example, the specific '[w2] extracted
in the context of olive
from [w1]' template (e.g.
oil) generalizes to '[w2] made from [w1]'. One of
the drawbacks of these systems is that they favor
more frequent paraphrases, which may co-occur
with a wide variety of more specific paraphrases.
In terms of
2.3 Noun-compounds in other Tasks
Noun-compound paraphrasing may be considered
as a subtask of the general paraphrasing task,
whose goal is to generate, given a text fragment,
additional texts with the same meaning. How-
ever, general paraphrasing methods do not guar-
antee to explicate implicit information conveyed
in the original text. Moreover, the most notable
source for extracting paraphrases is multiple trans-
lations of the same text (Barzilay and McKeown,
w1i = 28
M LPw
pi = 78
M LPp
cake
made
of
[w1]
cake
[p]
apple
(23) made
(28) apple
(4145) cake
...
(7891) of
(1) [w1]
(2) [w2]
(3) [p]
(23) made
(28) apple
(4145) cake
...
(7891) of
(1) [w1]
(2) [w2]
(3) [p]
(78) [w2] containing [w1]
...
(131) [w2] made of [w1]
...
Figure 1: An illustration of the model predictions for w1 and p given the triplet (cake, made of, apple).
The model predicts each component given the encoding of the other two components, successfully pre-
dicting 'apple' given 'cake made of [w1]', while predicting '[w2] containing [w1]' for 'cake [p] apple'.
2001; Ganitkevitch et al., 2013; Mallinson et al.,
2017).
If a certain concept can be described by
an English noun-compound, it is unlikely that a
translator chose to translate its foreign language
equivalent to an explicit paraphrase instead.
Another related task is Open Information Ex-
traction (Etzioni et al., 2008), whose goal is to ex-
tract relational tuples from text. Most system fo-
cus on extracting verb-mediated relations, and the
few exceptions that addressed noun-compounds
provided partial solutions.
Pal and Mausam
(2016) focused on segmenting multi-word noun-
compounds and assumed an is-a relation between
the parts, as extracting (Francis Collins, is, NIH
director) from "NIH director Francis Collins".
Xavier and Lima (2014) enriched the corpus with
compound definitions from online dictionaries, for
interpreting oil industry as (industry,
example,
produces and delivers, oil) based on the Word-
Net definition "industry that produces and delivers
oil". This method is very limited as it can only
interpret noun-compounds with dictionary entries,
while the majority of English noun-compounds
don't have them (Nakov, 2013).
3 Paraphrasing Model
As opposed to previous approaches, that focus on
predicting a paraphrase template for a given noun-
compound, we reformulate the task as a multi-
task learning problem (Section 3.1), and train the
model to also predict a missing constituent given
the paraphrase template and the other constituent.
Our model is semi-supervised, and it expects as
input a set of noun-compounds and a set of con-
strained part-of-speech tag-based templates that
make valid prepositional and verbal paraphrases.
Section 3.2 details the creation of training data,
and Section 3.3 describes the model.
3.1 Multi-task Reformulation
Each training example consists of two constituents
and a paraphrase (w2, p, w1), and we train the
model on 3 subtasks: (1) predict p given w1 and
w2, (2) predict w1 given p and w2, and (3) predict
w2 given p and w1. Figure 1 demonstrates the pre-
dictions for subtasks (1) (right) and (2) (left) for
the training example (cake, made of, apple). Ef-
fectively, the model is trained to answer questions
such as "what can cake be made of?", "what can
be made of apple?", and "what are the possible re-
lationships between cake and apple?".
The multi-task reformulation helps learning bet-
ter representations for paraphrase templates, by
embedding semantically-similar paraphrases in
proximity. Similarity between paraphrases stems
either from lexical similarity and overlap between
the paraphrases (e.g. 'is made of' and 'made of'),
or from shared constituents, e.g. '[w2] involved in
[w1]' and '[w2] in [w1] industry' can share [w1]
= insurance and [w2] = company. This allows the
model to predict a correct paraphrase for a given
noun-compound, even when the constituents do
not occur with that paraphrase in the corpus.
3.2 Training Data
We collect a training set of (w2, p, w1, s) exam-
ples, where w1 and w2 are constituents of a noun-
compound w1w2, p is a templated paraphrase, and
s is the score assigned to the training instance.2
2We refer to "paraphrases" and "paraphrase templates" in-
terchangeably. In the extracted templates, [w2] always pre-
cedes [w1], probably because w2 is normally the head noun.
We use the 19,491 noun-compounds found in
the SemEval tasks datasets (Butnariu et al., 2009;
Hendrickx et al., 2013) and in Tratz (2011). To ex-
tract patterns of part-of-speech tags that can form
noun-compound paraphrases, such as '[w2] VERB
PREP [w1]', we use the SemEval task training data,
but we do not use the lexical information in the
gold paraphrases.
Corpus. Similarly to previous noun-compound
paraphrasing approaches, we use the Google N-
gram corpus (Brants and Franz, 2006) as a source
of paraphrases (Wubben, 2010; Li et al., 2010;
Surtani et al., 2013; Versley, 2013). The cor-
pus consists of sequences of n terms (for n ∈
{3, 4, 5}) that occur more than 40 times on the
web. We search for n-grams following the ex-
tracted patterns and containing w1 and w2's lem-
mas for some noun-compound in the set. We re-
move punctuation, adjectives, adverbs and some
determiners to unite similar paraphrases. For ex-
ample, from the 5-gram 'cake made of sweet ap-
ples' we extract the training example (cake, made
of, apple). We keep only paraphrases that occurred
at least 5 times, resulting in 136,609 instances.
Weighting. Each n-gram in the corpus is accom-
panied with its frequency, which we use to assign
scores to the different paraphrases. For instance,
'cake of apples' may also appear in the corpus, al-
though with lower frequency than 'cake from ap-
ples'. As also noted by Surtani et al. (2013), the
shortcoming of such a weighting mechanism is
that it prefers shorter paraphrases, which are much
count('cake
more common in the corpus (e.g.
made of apples') (cid:28) count('cake of apples')). We
overcome this by normalizing the frequencies for
each paraphrase length, creating a distribution of
paraphrases in a given length.
Negative Samples. We add 1% of negative sam-
ples by selecting random corpus words w1 and
w2 that do not co-occur, and adding an exam-
ple (w2, [w2] is unrelated to [w1], w1, sn), for
some predefined negative samples score sn. Sim-
ilarly, for a word wi that did not occur in a para-
phrase p we add (wi, p, UNK, sn) or (UNK, p,
wi, sn), where UNK is the unknown word. This
may help the model deal with non-compositional
noun-compounds, where w1 and w2 are unrelated,
rather than forcibly predicting some relation be-
tween them.
3.3 Model
For a training instance (w2, p, w1, s), we predict
each item given the encoding of the other two.
Encoding. We use the 100-dimensional pre-
trained GloVe embeddings (Pennington et al.,
2014), which are fixed during training.
In addi-
tion, we learn embeddings for the special words
[w1], [w2], and [p], which are used to represent
a missing component, as in "cake made of [w1]",
"[w2] made of apple", and "cake [p] apple".
For a missing component x ∈ {[p], [w1], [w2]}
surrounded by the sequences of words v1:i−1 and
vi+1:n, we encode the sequence using a bidirec-
tional long-short term memory (bi-LSTM) net-
work (Graves and Schmidhuber, 2005), and take
the ith output vector as representing the missing
component: bLS(v1:i, x, vi+1:n)i.
In bi-LSTMs, each output vector is a concate-
nation of the outputs of the forward and backward
LSTMs, so the output vector is expected to con-
tain information on valid substitutions both with
respect to the previous words v1:i−1 and the sub-
sequent words vi+1:n.
Prediction. We predict a distribution of the vo-
cabulary of the missing component, i.e. to predict
w1 correctly we need to predict its index in the
word vocabulary Vw, while the prediction of p is
from the vocabulary of paraphrases in the training
set, Vp. We predict the following distributions:
p = softmax(Wp · bLS( (cid:126)w2, [p], (cid:126)w1)2)
w1 = softmax(Ww · bLS( (cid:126)w2, (cid:126)p1:n, [w1])n+1)
w2 = softmax(Ww · bLS([w2], (cid:126)p1:n, (cid:126)w1)1)
where Ww ∈ RVw×2d, Wp ∈ RVp×2d, and d is
the embeddings dimension.
(1)
During training, we compute cross-entropy loss
for each subtask using the gold item and the pre-
diction, sum up the losses, and weight them by the
instance score. During inference, we predict the
missing components by picking the best scoring
index in each distribution:3
pi = argmax(p)
w1i = argmax( w1)
w2i = argmax( w2)
(2)
The subtasks share the pre-trained word embed-
dings, the special embeddings, and the biLSTM
parameters. Subtasks (2) and (3) also share Ww,
the MLP that predicts the index of a word.
3In practice, we pick the k best scoring indices in each
distribution for some predefined k, as we discuss in Section 5.
[w1]
[w2]
cataract
surgery
software
company
stone
wall
Predicted Paraphrases
[w2] of [w1]
[w2] on [w1]
[w2] to remove [w1]
[w2] in patients with [w1]
[w2] of [w1]
[w2] to develop [w1]
[w2] in [w1] industry
[w2] involved in [w1]
[w2] is of [w1]
[w2] of [w1]
[w2]
Paraphrase
surgery
[w2] to treat [w1]
company
[w2] engaged in [w1]
Predicted [w1]
heart
brain
back
knee
management
production
computer
business
spring
afternoon
Paraphrase
[w1]
[w2] to treat [w1]
cataract
[w2] engaged in [w1]
software
Predicted [w2]
surgery
drug
patient
transplant
company
firm
engineer
industry
party
meeting
[w2] is made of [w1]
[w2] made of [w1]
rally
session
Table 1: Examples of top ranked predicted components using the model: predicting the paraphrase given
w1 and w2 (left), w1 given w2 and the paraphrase (middle), and w2 given w1 and the paraphrase (right).
hour
day
meeting
[w2] held in [w1]
[w2] held in [w1]
morning
Figure 2: A t-SNE map of a sample of paraphrases, using the paraphrase vectors encoded by the biLSTM,
for example bLS([w2] made of [w1]).
Implementation Details. The model is imple-
mented in DyNet (Neubig et al., 2017). We dedi-
cate a small number of noun-compounds from the
corpus for validation. We train for up to 10 epochs,
stopping early if the validation loss has not im-
proved in 3 epochs. We use Momentum SGD
(Nesterov, 1983), and set the batch size to 10 and
the other hyper-parameters to their default values.
4 Qualitative Analysis
To estimate the quality of the proposed model, we
first provide a qualitative analysis of the model
outputs. Table 1 displays examples of the model
outputs for each possible usage: predicting the
paraphrase given the constituent words, and pre-
dicting each constituent word given the paraphrase
and the other word.
The examples in the table are from among the
top 10 ranked predictions for each component-
pair. We note that most of the (w2, paraphrase,
w1) triplets in the table do not occur in the training
data, but are rather generalized from similar exam-
ples. For example, there is no training instance for
"company in the software industry" but there is a
"firm in the software industry" and a company in
many other industries.
While the frequent prepositional paraphrases
are often ranked at the top of the list, the model
also retrieves more specified verbal paraphrases.
The list often contains multiple semantically-
similar paraphrases, such as '[w2] involved in
[w1]' and '[w2] in [w1] industry'. This is a result
of the model training objective (Section 3) which
positions the vectors of semantically-similar para-
phrases close to each other in the embedding
space, based on similar constituents.
To illustrate paraphrase similarity we compute
a t-SNE projection (Van Der Maaten, 2014) of
the embeddings of all the paraphrases, and draw a
sample of 50 paraphrases in Figure 2. The projec-
tion positions semantically-similar but lexically-
divergent paraphrases in proximity, likely due to
[w2] is for [w1][w2] belongs to [w1][w2] pertaining to [w1][w2] issued by [w1][w2] related to [w1][w2] by way of [w1][w2] in terms of [w1][w2] done by [w1][w2] to produce [w1][w2] involved in [w1][w2] with [w1][w2] composed of [w1][w2] employed in [w1][w2] owned by [w1][w2] by means of [w1][w2] to make [w1][w2] produced by [w1][w2] source of [w1][w2] found in [w1][w2] offered by [w1][w2] out of [w1][w2] held by [w1][w2] for use in [w1][w2] consists of [w1][w2] relating to [w1][w2] devoted to [w1][w2] engaged in [w1][w2] occur in [w1][w2] caused by [w1][w2] supplied by [w1][w2] part of [w1][w2] provided by [w1][w2] generated by [w1][w2] made of [w1][w2] consisting of [w1][w2] is made of [w1][w2] for [w1][w2] from [w1][w2] created by [w1][w2] given by [w1][w2] of providing [w1][w2] belonging to [w1][w2] aimed at [w1][w2] conducted by [w1][w2] dedicated to [w1][w2] made by [w1][w2] because of [w1][w2] included in [w1][w2] with respect to [w1][w2] given to [w1]many shared constituents. For instance, 'with',
'from', and 'out of' can all describe the relation
between food words and their ingredients.
5 Evaluation: Noun-Compound
Interpretation Tasks
For quantitative evaluation we employ our model
for two noun-compound interpretation tasks. The
main evaluation is on retrieving and ranking para-
phrases (§5.1). For the sake of completeness, we
also evaluate the model on classification to a fixed
inventory of relations (§5.2), although it wasn't de-
signed for this task.
5.1 Paraphrasing
Task Definition. The general goal of this task
is to interpret each noun-compound to multiple
prepositional and verbal paraphrases. In SemEval
2013 Task 4,4 the participating systems were
asked to retrieve a ranked list of paraphrases for
each noun-compound, which was automatically
evaluated against a similarly ranked list of para-
phrases proposed by human annotators.
Model. For a given noun-compound w1w2, we
first predict the k = 250 most likely paraphrases:
p1, ..., pk = argmaxk p, where p is the distribution
of paraphrases defined in Equation 1.
While the model also provides a score for each
paraphrase (Equation 1), the scores have not been
optimized to correlate with human judgments. We
therefore developed a re-ranking model that re-
ceives a list of paraphrases and re-ranks the list to
better fit the human judgments.
We follow Herbrich (2000) and learn a pair-
wise ranking model. The model determines which
of two paraphrases of the same noun-compound
should be ranked higher, and it is implemented
as an SVM classifier using scikit-learn (Pedregosa
et al., 2011). For training, we use the available
training data with gold paraphrases and ranks pro-
vided by the SemEval task organizers. We extract
the following features for a paraphrase p:
1. The part-of-speech tags contained in p
2. The prepositions contained in p
3. The number of words in p
4. Whether p ends with the special [w1] symbol
5. cosine(bLS([w2], p, [w1])2, (cid:126)Vp
pi is the biLSTM encoding of the pre-
where (cid:126)Vp
dicted paraphrase computed in Equation 1 and ppi
pi) · ppi
4https://www.cs.york.ac.uk/semeval-2013/task4
is its confidence score. The last feature incorpo-
rates the original model score into the decision, as
to not let other considerations such as preposition
frequency in the training set take over.
During inference, the model sorts the list of
paraphrases retrieved for each noun-compound ac-
cording to the pairwise ranking.
It then scores
each paraphrase by multiplying its rank with its
original model score, and prunes paraphrases with
final score < 0.025. The values for k and the
threshold were tuned on the training set.
Evaluation Settings. The SemEval 2013 task
provided a scorer that compares words and n-
grams from the gold paraphrases against those in
the predicted paraphrases, where agreement on
a prefix of a word (e.g.
in derivations) yields
a partial scoring. The overall score assigned to
each system is calculated in two different ways.
The 'isomorphic' setting rewards both precision
and recall, and performing well on it requires ac-
curately reproducing as many of the gold para-
phrases as possible, and in much the same order.
The 'non-isomorphic' setting rewards only preci-
sion, and performing well on it requires accurately
reproducing the top-ranked gold paraphrases, with
no importance to order.
Baselines. We compare our method with the
published results from the SemEval task. The
SemEval 2013 baseline generates for each noun-
compound a list of prepositional paraphrases in
an arbitrary fixed order.
It achieves a moder-
ately good score in the non-isomorphic setting by
generating a fixed set of paraphrases which are
both common and generic. The MELODI sys-
tem performs similarly: it represents each noun-
compound using a compositional distributional
vector (Mitchell and Lapata, 2010) which is then
used to predict paraphrases from the corpus. The
performance of MELODI indicates that the sys-
tem was rather conservative, yielding a few com-
mon paraphrases rather than many specific ones.
SFS and IIITH, on the other hand, show a more
balanced trade-off between recall and precision.
As a sanity check, we also report the results of a
baseline that retrieves ranked paraphrases from the
training data collected in Section 3.2. This base-
line has no generalization abilities, therefore it is
expected to score poorly on the recall-aware iso-
morphic setting.
Method
SFS (Versley, 2013)
IIITH (Surtani et al., 2013)
MELODI (Van de Cruys et al., 2013)
SemEval 2013 Baseline (Hendrickx et al., 2013)
Baseline
Our method
isomorphic
23.1
23.1
13.0
13.8
3.8
28.2
non-isomorphic
17.9
25.8
54.8
40.6
16.1
28.4
Baselines
This paper
Table 2: Results of the proposed method and the baselines on the SemEval 2013 task.
Category
False Positive
(1) Valid paraphrase missing from gold
(2) Valid paraphrase, slightly too specific
(3) Incorrect, common prepositional paraphrase
(4) Incorrect, other errors
(5) Syntactic error in paraphrase
(6) Valid paraphrase, but borderline grammatical
False Negative
(1) Long paraphrase (more than 5 words)
(2) Prepositional paraphrase with determiners
(3) Inflected constituents in gold
(4) Other errors
%
44%
15%
14%
14%
8%
5%
30%
25%
10%
35%
Table 3: Categories of false positive and false neg-
ative predictions along with their percentage.
Results. Table 2 displays the performance of the
proposed method and the baselines in the two eval-
uation settings. Our method outperforms all the
methods in the isomorphic setting.
In the non-
isomorphic setting, it outperforms the other two
systems that score reasonably on the isomorphic
setting (SFS and IIITH) but cannot compete with
the systems that focus on achieving high precision.
The main advantage of our proposed model
is in its ability to generalize, and that is also
demonstrated in comparison to our baseline per-
formance. The baseline retrieved paraphrases only
for a third of the noun-compounds (61/181), ex-
pectedly yielding poor performance on the isomor-
phic setting. Our model, which was trained on the
very same data, retrieved paraphrases for all noun-
compounds. For example, welfare system was not
present in the training data, yet the model pre-
dicted the correct paraphrases "system of welfare
benefits", "system to provide welfare" and others.
Error Analysis. We analyze the causes of the
false positive and false negative errors made by the
model. For each error type we sample 10 noun-
compounds. For each noun-compound, false pos-
itive errors are the top 10 predicted paraphrases
which are not included in the gold paraphrases,
while false negative errors are the top 10 gold
paraphrases not found in the top k predictions
made by the model. Table 3 displays the manu-
ally annotated categories for each error type.
Many false positive errors are actually valid
paraphrases that were not suggested by the hu-
man annotators (error 1, "discussion by group").
Some are borderline valid with minor grammati-
cal changes (error 6, "force of coalition forces")
or too specific (error 2, "life of women in commu-
nity" instead of "life in community"). Common
prepositional paraphrases were often retrieved al-
though they are incorrect (error 3). We conjec-
ture that this error often stem from an n-gram that
does not respect the syntactic structure of the sen-
tence, e.g. a sentence such as "rinse away the oil
from baby 's head" produces the n-gram "oil from
baby".
With respect to false negative examples, they
consisted of many long paraphrases, while our
model was restricted to 5 words due to the source
of the training data (error 1, "holding done in the
case of a share"). Many prepositional paraphrases
consisted of determiners, which we conflated with
the same paraphrases without determiners (error
2, "mutation of a gene"). Finally, in some para-
phrases, the constituents in the gold paraphrase
appear in inflectional forms (error 3, "holding of
shares" instead of "holding of share").
5.2 Classification
Noun-compound classification is defined as a mul-
ticlass classification problem: given a pre-defined
set of relations, classify w1w2 to the relation that
holds between w1 and w2. Potentially, the cor-
pus co-occurrences of w1 and w2 may contribute
to the classification, e.g. '[w2] held at [w1]' in-
dicates a TIME relation. Tratz and Hovy (2010) in-
cluded such features in their classifier, but ablation
tests showed that these features had a relatively
small contribution, probably due to the sparseness
of the paraphrases. Recently, Shwartz and Wa-
terson (2018) showed that paraphrases may con-
tribute to the classification when represented in a
continuous space.
Model. We generate a paraphrase vector repre-
sentation (cid:126)par(w1w2) for a given noun-compound
w1w2 as follows. We predict the indices of the k
most likely paraphrases: p1, ..., pk = argmaxk p,
where p is the distribution on the paraphrase vo-
cabulary Vp, as defined in Equation 1. We then
encode each paraphrase using the biLSTM, and
average the paraphrase vectors, weighted by their
confidence scores in p:
(cid:80)k
(cid:80)k
i=1 ppi · (cid:126)Vp
i=1 ppi
pi
(3)
(cid:126)par(w1w2) =
We train a linear classifier, and represent w1w2
in a feature vector f (w1w2) in two variants: para-
phrase: f (w1w2) = (cid:126)par(w1w2), or integrated:
concatenated to the constituent word embeddings
f (w1w2) = [ (cid:126)par(w1w2), (cid:126)w1, (cid:126)w2]. The classifier
type (logistic regression/SVM), k, and the penalty
are tuned on the validation set. We also pro-
vide a baseline in which we ablate the paraphrase
component from our model, representing a noun-
compound by the concatenation of its constituent
embeddings f (w1w2) = [ (cid:126)w1, (cid:126)w2] (distributional).
Datasets. We evaluate on the Tratz (2011)
dataset, which consists of 19,158 instances, la-
beled in 37 fine-grained relations (Tratz-fine) or
12 coarse-grained relations (Tratz-coarse).
We report the performance on two different
dataset splits to train, test, and validation: a ran-
dom split in a 75:20:5 ratio, and, following con-
cerns raised by Dima (2016) about lexical mem-
orization (Levy et al., 2015), on a lexical split in
which the sets consist of distinct vocabularies. The
lexical split better demonstrates the scenario in
which a noun-compound whose constituents have
not been observed needs to be interpreted based on
similar observed noun-compounds, e.g. inferring
the relation in pear tart based on apple cake and
other similar compounds. We follow the random
and full-lexical splits from Shwartz and Waterson
(2018).
Baselines. We report the results of 3 baselines
representative of different approaches:
1) Feature-based (Tratz and Hovy, 2010): we re-
implement a version of the classifier with features
from WordNet and Roget's Thesaurus.
2) Compositional (Dima, 2016): a neural archi-
tecture that operates on the distributional represen-
tations of the noun-compound and its constituents.
Noun-compound representations are learned with
Dataset & Split
Tratz
fine
Random
Tratz
fine
Lexical
Tratz
coarse
Random
Tratz
coarse
Lexical
Method
Tratz and Hovy (2010)
Dima (2016)
Shwartz and Waterson (2018)
distributional
paraphrase
integrated
Tratz and Hovy (2010)
Dima (2016)
Shwartz and Waterson (2018)
distributional
paraphrase
integrated
distributional
paraphrase
integrated
distributional
paraphrase
integrated
Tratz and Hovy (2010)
Dima (2016)
Shwartz and Waterson (2018)
Tratz and Hovy (2010)
Dima (2016)
Shwartz and Waterson (2018)
F1
0.739
0.725
0.714
0.677
0.505
0.673
0.340
0.334
0.429
0.356
0.333
0.370
0.760
0.775
0.736
0.689
0.557
0.700
0.391
0.372
0.478
0.370
0.345
0.393
Table 4: Classification results. For each dataset
split, the top part consists of baseline methods and
the bottom part of methods from this paper. The
best performance in each part appears in bold.
the Full-Additive (Zanzotto et al., 2010) and Ma-
trix (Socher et al., 2012) models. We report the
results from Shwartz and Waterson (2018).
3) Paraphrase-based (Shwartz and Waterson,
2018): a neural classification model that learns
an LSTM-based representation of the joint occur-
rences of w1 and w2 in a corpus (i.e. observed
paraphrases), and integrates distributional infor-
mation using the constituent embeddings.
Results. Table 4 displays the methods' perfor-
mance on the two versions of the Tratz (2011)
dataset and the two dataset splits. The paraphrase
model on its own is inferior to the distributional
model, however, the integrated version improves
upon the distributional model in 3 out of 4 settings,
demonstrating the complementary nature of the
distributional and paraphrase-based methods. The
contribution of the paraphrase component is espe-
cially noticeable in the lexical splits.
As expected, the integrated method in Shwartz
and Waterson (2018),
in which the paraphrase
representation was trained with the objective of
classification, performs better than our integrated
model. The superiority of both integrated models
in the lexical splits confirms that paraphrases are
beneficial for classification.
Example Noun-compounds
printing plant
marketing expert
development expert
weight/job loss
rubber band
rice cake
Gold
PURPOSE
Distributional
OBJECTIVE
TOPICAL
OBJECTIVE
OBJECTIVE
CAUSAL
CONTAINMENT
PURPOSE
Example Paraphrases
[w2] engaged in [w1]
[w2] in [w1]
[w2] knowledge of [w1]
[w2] of [w1]
[w2] made of [w1]
[w2] is made of [w1]
laboratory animal
LOCATION/PART-WHOLE
ATTRIBUTE
[w2] in [w1], [w2] used in [w1]
Table 5: Examples of noun-compounds that were correctly classified by the integrated model while being
incorrectly classified by distributional, along with top ranked indicative paraphrases.
Analysis. To analyze the contribution of the
paraphrase component to the classification, we fo-
cused on the differences between the distributional
and integrated models on the Tratz-Coarse lexical
split. Examination of the per-relation F1 scores
revealed that the relations for which performance
improved the most in the integrated model were
TOPICAL (+11.1 F1 points), OBJECTIVE (+5.5), AT-
TRIBUTE (+3.8) and LOCATION/PART WHOLE (+3.5).
a plausible concrete interpretation or which origi-
nated from one. For example, it predicted that sil-
ver spoon is simply a spoon made of silver and that
monkey business is a business that buys or raises
monkeys. In other cases, it seems that the strong
prior on one constituent leads to ignoring the other,
unrelated constituent, as in predicting "wedding
made of diamond". Finally, the "unrelated" para-
phrase was predicted for a few compounds, but
those are not necessarily non-compositional (ap-
plication form, head teacher). We conclude that
the model does not address compositionality and
suggest to apply it only to compositional com-
pounds, which may be recognized using compo-
sitionality prediction methods as in Reddy et al.
(2011).
Table 5 provides examples of noun-compounds
that were correctly classified by the integrated
model while being incorrectly classified by the dis-
tributional model. For each noun-compound, we
provide examples of top ranked paraphrases which
are indicative of the gold label relation.
6 Compositionality Analysis
Our paraphrasing approach at its core assumes
compositionality: only a noun-compound whose
meaning is derived from the meanings of its con-
stituent words can be rephrased using them.
In
§3.2 we added negative samples to the train-
ing data to simulate non-compositional noun-
compounds, which are included in the classifi-
cation dataset (§5.2). We assumed that these
compounds, more often than compositional ones
would consist of unrelated constituents (spelling
bee, sacred cow), and added instances of random
unrelated nouns with '[w2] is unrelated to [w1]'.
Here, we assess whether our model succeeds to
recognize non-compositional noun-compounds.
We used the compositionality dataset of Reddy
et al.
(2011) which consists of 90 noun-
compounds along with human judgments about
their compositionality in a scale of 0-5, 0 be-
ing non-compositional and 5 being compositional.
For each noun-compound in the dataset, we pre-
dicted the 15 best paraphrases and analyzed the er-
rors. The most common error was predicting para-
phrases for idiomatic compounds which may have
7 Conclusion
We presented a new semi-supervised model for
noun-compound paraphrasing. The model differs
from previous models by being trained to predict
both a paraphrase given a noun-compound, and a
missing constituent given the paraphrase and the
other constituent. This results in better general-
ization abilities, leading to improved performance
in two noun-compound interpretation tasks. In the
future, we plan to take generalization one step fur-
ther, and explore the possibility to use the biL-
STM for generating completely new paraphrase
templates unseen during training.
Acknowledgments
This work was supported in part by an Intel
ICRI-CI grant,
the Israel Science Foundation
grant 1951/17, the German Research Foundation
through the German-Israeli Project Cooperation
(DIP, grant DA 1600/1-1), and Theo Hoffenberg.
Vered is also supported by the Clore Scholars Pro-
gramme (2017), and the AI2 Key Scientific Chal-
lenges Program (2017).
References
Regina Barzilay and R. Kathleen McKeown. 2001.
Extracting paraphrases from a parallel corpus.
In Proceedings of
the 39th Annual Meeting of
the Association for Computational Linguistics.
http://aclweb.org/anthology/P01-1008.
Thorsten Brants and Alex Franz. 2006. Web 1t 5-gram
version 1 .
Cristina Butnariu, Su Nam Kim, Preslav Nakov,
Diarmuid ´O S´eaghdha, Stan Szpakowicz, and
Tony Veale. 2009.
Semeval-2010 task 9: The
interpretation of noun compounds using para-
In Proceed-
phrasing verbs and prepositions.
ings of
the Workshop on Semantic Evalua-
tions: Recent Achievements and Future Direc-
tions (SEW-2009). Association for Computational
Linguistics, Boulder, Colorado, pages 100–105.
http://www.aclweb.org/anthology/W09-2416.
Corina Dima. 2016. Proceedings of the 1st Work-
shop on Representation Learning for NLP, As-
sociation for Computational Linguistics, chapter
On the Compositionality and Semantic Interpreta-
tion of English Noun Compounds, pages 27–39.
https://doi.org/10.18653/v1/W16-1604.
Corina Dima and Erhard Hinrichs. 2015. Automatic
noun compound interpretation using deep neural
networks and word embeddings. IWCS 2015 page
173.
Oren Etzioni, Michele Banko, Stephen Soderland, and
Daniel S Weld. 2008. Open information extrac-
tion from the web. Communications of the ACM
51(12):68–74.
In Proceedings of
the North American Chapter of
Juri Ganitkevitch, Benjamin Van Durme, and Chris
PPDB: The paraphrase
Callison-Burch. 2013.
the 2013 Con-
database.
ference of
the
Association for Computational Linguistics: Hu-
man Language Technologies. Association for
Computational
758–764.
pages
http://aclweb.org/anthology/N13-1092.
Linguistics,
Roxana Girju. 2007.
In Proceedings of
Improving the interpreta-
tion of noun phrases with cross-linguistic infor-
the 45th Annual
mation.
Meeting of the Association of Computational Lin-
guistics. Association for Computational Linguis-
tics, Prague, Czech Republic, pages 568–575.
http://www.aclweb.org/anthology/P07-1072.
Alex Graves and Jurgen Schmidhuber. 2005. Frame-
wise phoneme classification with bidirectional lstm
and other neural network architectures. Neural Net-
works 18(5-6):602–610.
Iris Hendrickx, Zornitsa Kozareva, Preslav Nakov, Di-
armuid ´O S´eaghdha, Stan Szpakowicz, and Tony
Veale. 2013. Semeval-2013 task 4: Free paraphrases
In Second Joint Conference
of noun compounds.
on Lexical and Computational Semantics (*SEM),
Volume 2: Proceedings of the Seventh International
Workshop on Semantic Evaluation (SemEval 2013).
Association for Computational Linguistics, pages
138–143. http://aclweb.org/anthology/S13-2025.
Ralf Herbrich. 2000. Large margin rank boundaries for
ordinal regression. Advances in large margin classi-
fiers pages 115–132.
Nam Su Kim and Preslav Nakov. 2011.
Large-
scale noun compound interpretation using boot-
In Pro-
strapping and the web as a corpus.
ceedings of
the 2011 Conference on Empirical
Methods in Natural Language Processing. Associa-
tion for Computational Linguistics, pages 648–658.
http://aclweb.org/anthology/D11-1060.
Su Nam Kim and Timothy Baldwin. 2007. Interpret-
ing noun compounds using bootstrapping and sense
In Proceedings of Conference of the
collocation.
Pacific Association for Computational Linguistics.
pages 129–136.
In Proceedings of
Omer Levy, Steffen Remus, Chris Biemann, and
Do supervised distribu-
Ido Dagan. 2015.
inference re-
tional methods really learn lexical
the 2015 Confer-
lations?
ence of the North American Chapter of the As-
sociation for Computational Linguistics: Human
Language Technologies. Association for Computa-
tional Linguistics, Denver, Colorado, pages 970–
976. http://www.aclweb.org/anthology/N15-1098.
Guofu Li, Alejandra Lopez-Fernandez, and Tony
Veale. 2010. Ucd-goggle: A hybrid system for
In Proceedings of
noun compound paraphrasing.
the 5th International Workshop on Semantic Eval-
uation. Association for Computational Linguistics,
pages 230–233.
Jonathan Mallinson, Rico Sennrich, and Mirella Lap-
ata. 2017. Paraphrasing revisited with neural ma-
chine translation. In Proceedings of the 15th Confer-
ence of the European Chapter of the Association for
Computational Linguistics: Volume 1, Long Papers.
Association for Computational Linguistics, Valen-
cia, Spain, pages 881–893.
Jeff Mitchell and Mirella Lapata. 2010. Composition
in distributional models of semantics. Cognitive sci-
ence 34(8):1388–1429.
Preslav Nakov. 2013. On the interpretation of noun
compounds: Syntax, semantics, and entailment.
Natural Language Engineering 19(03):291–330.
Preslav Nakov and Marti Hearst. 2006. Using verbs to
In International
characterize noun-noun relations.
Conference on Artificial Intelligence: Methodology,
Systems, and Applications. Springer, pages 233–
244.
Vivi Nastase and Stan Szpakowicz. 2003. Explor-
In Fifth in-
ing noun-modifier semantic relations.
ternational workshop on computational semantics
(IWCS-5). pages 285–301.
Yurii Nesterov. 1983. A method of solving a con-
vex programming problem with convergence rate o
(1/k2). In Soviet Mathematics Doklady. volume 27,
pages 372–376.
Graham Neubig, Chris Dyer, Yoav Goldberg, Austin
Matthews, Waleed Ammar, Antonios Anastasopou-
los, Miguel Ballesteros, David Chiang, Daniel
Clothiaux, Trevor Cohn, et al. 2017. Dynet: The
arXiv preprint
dynamic neural network toolkit.
arXiv:1701.03980 .
Paul Nulty and Fintan Costello. 2010. Ucd-pn: Select-
ing general paraphrases using conditional probabil-
In Proceedings of the 5th International Work-
ity.
shop on Semantic Evaluation. Association for Com-
putational Linguistics, pages 234–237.
Diarmuid ´O S´eaghdha and Ann Copestake. 2009.
Using lexical and relational similarity to clas-
the
sify semantic relations.
12th Conference of
the European Chapter of
the ACL (EACL 2009). Association for Computa-
tional Linguistics, Athens, Greece, pages 621–629.
http://www.aclweb.org/anthology/E09-1071.
In Proceedings of
Harinder Pal and Mausam. 2016. Demonyms and com-
pound relational nouns in nominal open ie. In Pro-
ceedings of the 5th Workshop on Automated Knowl-
edge Base Construction. Association for Compu-
tational Linguistics, San Diego, CA, pages 35–39.
http://www.aclweb.org/anthology/W16-1307.
Patrick Pantel, Rahul Bhagat, Bonaventura Coppola,
Timothy Chklovski, and Eduard Hovy. 2007. ISP:
Learning inferential selectional preferences. In Hu-
man Language Technologies 2007: The Confer-
ence of the North American Chapter of the Asso-
ciation for Computational Linguistics; Proceedings
of the Main Conference. Association for Computa-
tional Linguistics, Rochester, New York, pages 564–
571. http://www.aclweb.org/anthology/N/N07/N07-
1071.
Marius Pasca. 2015.
Interpreting compound noun
In Proceed-
phrases using web search queries.
ings of the 2015 Conference of the North American
Chapter of the Association for Computational Lin-
guistics: Human Language Technologies. Associa-
tion for Computational Linguistics, pages 335–344.
https://doi.org/10.3115/v1/N15-1037.
Ellie Pavlick and Marius Pasca. 2017.
Identify-
ing 1950s american jazz musicians: Fine-grained
In Pro-
isa extraction via modifier composition.
ceedings of the 55th Annual Meeting of the As-
sociation for Computational Linguistics (Volume
1: Long Papers). Association for Computational
Linguistics, Vancouver, Canada, pages 2099–2109.
http://aclweb.org/anthology/P17-1192.
F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel,
B. Thirion, O. Grisel, M. Blondel, P. Pretten-
hofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Pas-
sos, D. Cournapeau, M. Brucher, M. Perrot, and
E. Duchesnay. 2011. Scikit-learn: Machine learning
in Python. Journal of Machine Learning Research
12:2825–2830.
Jeffrey Pennington, Richard Socher, and Christopher
Manning. 2014. Glove: Global vectors for word
In Proceedings of the 2014 Con-
representation.
ference on Empirical Methods in Natural Language
Processing (EMNLP). Association for Computa-
tional Linguistics, Doha, Qatar, pages 1532–1543.
http://www.aclweb.org/anthology/D14-1162.
Siva Reddy, Diana McCarthy, and Suresh Manand-
har. 2011. An empirical study on compositional-
In Proceedings of 5th In-
ity in compound nouns.
ternational Joint Conference on Natural Language
Processing. Asian Federation of Natural Language
Processing, Chiang Mai, Thailand, pages 210–218.
http://www.aclweb.org/anthology/I11-1024.
Vered Shwartz and Chris Waterson. 2018. Olive oil
is made of olives, baby oil is made for babies: In-
terpreting noun compounds using paraphrases in a
In The 16th Annual Conference of
neural model.
the North American Chapter of the Association for
Computational Linguistics: Human Language Tech-
nologies (NAACL-HLT). New Orleans, Louisiana.
Richard Socher, Brody Huval, D. Christopher Man-
ning, and Y. Andrew Ng. 2012. Semantic composi-
tionality through recursive matrix-vector spaces. In
Proceedings of the 2012 Joint Conference on Empir-
ical Methods in Natural Language Processing and
Computational Natural Language Learning. Asso-
ciation for Computational Linguistics, pages 1201–
1211. http://aclweb.org/anthology/D12-1110.
Nitesh Surtani, Arpita Batra, Urmi Ghosh, and Soma
Iiit-h: A corpus-driven co-occurrence
Paul. 2013.
based probabilistic model for noun compound para-
In Second Joint Conference on Lexical
phrasing.
and Computational Semantics (* SEM), Volume 2:
Proceedings of the Seventh International Workshop
on Semantic Evaluation (SemEval 2013). volume 2,
pages 153–157.
Stephen Tratz. 2011. Semantically-enriched parsing
for natural language understanding. University of
Southern California.
Stephen Tratz and Eduard Hovy. 2010. A taxon-
omy, dataset, and classifier for automatic noun
In Proceedings of the
compound interpretation.
48th Annual Meeting of the Association for Com-
putational Linguistics. Association for Computa-
tional Linguistics, Uppsala, Sweden, pages 678–
687. http://www.aclweb.org/anthology/P10-1070.
Tim Van de Cruys, Stergos Afantenos, and Philippe
Muller. 2013. Melodi: A supervised distribu-
tional approach for free paraphrasing of noun com-
In Second Joint Conference on Lex-
pounds.
ical and Computational Semantics (*SEM), Vol-
ume 2:
the Seventh Interna-
tional Workshop on Semantic Evaluation (Se-
Proceedings of
mEval 2013). Association for Computational Lin-
guistics, Atlanta, Georgia, USA, pages 144–147.
http://www.aclweb.org/anthology/S13-2026.
Laurens Van Der Maaten. 2014. Accelerating t-sne
Journal of machine
using tree-based algorithms.
learning research 15(1):3221–3245.
Yannick Versley. 2013.
Sfs-tue: Compound para-
phrasing with a language model and discriminative
In Second Joint Conference on Lexical
reranking.
and Computational Semantics (* SEM), Volume 2:
Proceedings of the Seventh International Workshop
on Semantic Evaluation (SemEval 2013). volume 2,
pages 148–152.
Sander Wubben. 2010. Uvt: Memory-based pairwise
In Proceedings of
ranking of paraphrasing verbs.
the 5th International Workshop on Semantic Eval-
uation. Association for Computational Linguistics,
pages 260–263.
Clarissa Xavier and Vera Lima. 2014. Boosting open
information extraction with noun-based relations.
In Nicoletta Calzolari (Conference Chair), Khalid
Choukri, Thierry Declerck, Hrafn Loftsson, Bente
Maegaard, Joseph Mariani, Asuncion Moreno, Jan
Odijk, and Stelios Piperidis, editors, Proceedings of
the Ninth International Conference on Language Re-
sources and Evaluation (LREC'14). European Lan-
guage Resources Association (ELRA), Reykjavik,
Iceland.
Fabio Massimo Zanzotto,
Ioannis Korkontzelos,
Francesca Fallucchi, and Suresh Manandhar. 2010.
Estimating linear models for compositional distribu-
tional semantics. In Proceedings of the 23rd Inter-
national Conference on Computational Linguistics.
Association for Computational Linguistics, pages
1263–1271.
|
1806.02253 | 1 | 1806 | 2018-06-06T15:42:22 | The Limitations of Cross-language Word Embeddings Evaluation | [
"cs.CL"
] | The aim of this work is to explore the possible limitations of existing methods of cross-language word embeddings evaluation, addressing the lack of correlation between intrinsic and extrinsic cross-language evaluation methods. To prove this hypothesis, we construct English-Russian datasets for extrinsic and intrinsic evaluation tasks and compare performances of 5 different cross-language models on them. The results say that the scores even on different intrinsic benchmarks do not correlate to each other. We can conclude that the use of human references as ground truth for cross-language word embeddings is not proper unless one does not understand how do native speakers process semantics in their cognition. | cs.CL | cs |
The Limitations of Cross-language Word Embeddings Evaluation
Amir Bakarov†* Roman Suvorov*
Ilya Sochenkov‡*
†National Research University Higher School of Economics,
*Federal Research Center 'Computer Science and Control' of the Russian Academy of Sciences,
‡Skolkovo Institute of Science and Technology (Skoltech),
[email protected], [email protected], [email protected]
Moscow, Russia
Abstract
The aim of this work is to explore the possi-
ble limitations of existing methods of cross-
language word embeddings evaluation, ad-
dressing the lack of correlation between in-
trinsic and extrinsic cross-language evaluation
methods. To prove this hypothesis, we con-
struct English-Russian datasets for extrinsic
and intrinsic evaluation tasks and compare per-
formances of 5 different cross-language mod-
els on them. The results say that the scores
even on different intrinsic benchmarks do not
correlate to each other. We can conclude that
the use of human references as ground truth for
cross-language word embeddings is not proper
unless one does not understand how do native
speakers process semantics in their cognition.
1 Introduction
Real-valued word representations called word em-
beddings are an ubiquitous and effective technique
of semantic modeling. So it is not surprising that
cross-language extensions of such models (cross-
language word embeddings) rapidly gained pop-
ularity in the NLP community (Vuli´c and Moens,
2013), proving their effectiveness in certain cross-
language NLP tasks (Upadhyay et al., 2016).
However, the problem of proper evaluation of any
type of word embeddings still remains open.
In recent years there was a critique to main-
stream methods of intrinsic evaluation: some re-
searchers addressed subjectivity of human assess-
ments, obscurity of instructions for certain tasks
and terminology confusions (Faruqui et al., 2016;
Batchkarov et al., 2016). Despite all these limi-
tations, some of the criticized methods (like the
word similarity task) has been started to be ac-
tively applied yet for cross-language word embed-
dings evaluation (Camacho-Collados et al., 2017,
2015).
We argue that if certain tasks are considered
as not proper enough for mono-lingual evalua-
tion, then it should be even more inappropriate
to use them for cross-language evaluation since
new problems would appear due to the new fea-
tures of cross-linguality wherein the old limita-
tions still remain. Moreover, it is still unknown
for the field of cross-language word embeddings,
are we able to make relevant predictions on per-
formance of the model on one method, using an-
other. We do not know whether can we use the
relative ordering of different embeddings obtained
by evaluation on an intrinsic task to decide which
model will be better on a certain extrinsic task.
So, the aim of this work is to highlight the lim-
itations of cross-language intrinsic benchmarks,
studying the connection of outcomes from differ-
ent cross-language word embeddings evaluation
schemes (intrinsic evaluation and extrinsic evalu-
ation), and explain this connection by addressing
certain issues of intrinsic benchmarks that hamper
us to have a correlation between two evaluation
schemes. In this study as an extrinsic task we con-
sider the cross-language paraphrase detection task.
This is because we think that the model's features
that word similarity and paraphrase detection eval-
uate are very close: both of them test the quality
of semantic modeling (i.e. not the ability of the
model to identify POS tags, or the ability to clus-
ter words in groups, or something else) in terms of
properness of distances in words pairs with certain
types of semantic relations (particularly, seman-
tic similarity). Therefore, we could not say that a
strong difference in performances of word embed-
dings on these two tasks could be highly expected.
In this paper we propose a comparison of 5
cross-language models on extrinsic and intrinsic
datasets for English-Russian language pair con-
structed specially for this study. We consider Rus-
sian because we are native speakers of this lan-
guage (hence, we are able to adequately construct
novel datasets according the limitations that we
address).
Our work is a step towards exploration of the
limitations of cross-language evaluation of word
embeddings, and it has three primary contribu-
tions:
1. We propose an overview of limitations of
current intrinsic cross-language word embed-
dings evaluation techniques;
was proposed (Ruder, 2017), but this study did not
considered any empirical analysis.
After all, we are aware of certain works on
a topic of cross-language evaluation from the
cross-language information retrieval community
(Braschler et al., 2000), but there are no works that
highlight non-trivial issues of cross-language sys-
tems evaluation from the position of word embed-
dings.
3 Problems of Cross-language
2. We construct 12 cross-language datasets for
Evaluation
evaluation on the word similarity task;
3. We propose a novel task for cross-language
extrinsic evaluation that was never addressed
before from the benchmarking perspective,
and we create a human-assessed dataset for
this task.
This paper is organized as follows. Section 2
puts our work in the context of previous studies.
Section 3 describes the problems of intrinsic cross-
language evaluation. Section 4 is about the exper-
imental setup. The results of the comparison are
reported in Section 5, while Section 6 concludes
the paper.
2 Related Work
First
investigation of tasks for cross-language
word embeddings evaluation was proposed in
2015 (Camacho-Collados et al., 2015). This work
was the first towards mentioning the problem of
lack of lexical one-to-one correspondence across
different languages from the evaluation perspec-
tive. However, no detailed insights on limitations
of evaluation (e.g. effect of this lack on evalua-
tion scores) was reported. 2015 also saw an explo-
ration of the effect of assessments' language and
the difference in word similarity scores for differ-
ent languages (Leviant and Reichart, 2015).
In 2016 the first survey of cross-language intrin-
sic and extrinsic evaluation techniques was pro-
posed (Upadhyay et al., 2016). The results of
this study did not address the correlation of in-
trinsic evaluation scores with extrinsic ones (de-
spite that the lack of correlation of intrinsic and
extrinsic tasks for mono-language evaluation was
proved (Schnabel et al., 2015), it is not obvious if
this would also extend to cross-language evalua-
tion). In 2017 a more extensive overview of cross-
language word embeddings evaluation methods
We address the following problems that could ap-
pear on any kind of evaluation of cross-language
word embeddings against human references on
any intrinsic task:
1. Translation Disagreement.
Some re-
searchers have already faced the limitations
of machine word translation for construct-
ing cross-language evaluation datasets from
mono-language ones by translating them
word-by-word. The obtained problems were
in two different words with the same trans-
lation or with different parts of speech
(Camacho-Collados et al., 2015). We also ar-
gue that some words could have no transla-
tions while some words could have multiple
translations. Of course, these issues could
be partially avoided if the datasets would
be translated manually and the problematic
words would be dropped from the cross-
language dataset, but it is not clear how the
agreement for word dropping of human as-
sessors could be concluded.
2. Scores Re-assessment. Some researchers
obtain new scores reporting human refer-
ences by automatically averaging the scores
from the mono-language datasets of which
the new dataset is constructed. Another op-
tion of scores re-assessment proposes man-
ual scoring of a new dataset by bilingual as-
sessors. We consider that both variants are
not proper since it is unclear how the scores
in the cross-language dataset should be as-
sessed: humans usually do not try to iden-
tify a similarity score between word a in lan-
guage A and word b in language B since
of difference in perception of these words in
cognition of speakers of different languages.
3. Semantic Fields. According to the theories
of lexical typology, the meaning of a prop-
erly translated word could denote a bit differ-
ent things in a new languages. Such effect
is called semantic shift, and there is a pos-
sibility that the actual meanings of two cor-
responding words could be different even if
they are correctly translated and re-assessed
(Ryzhova et al., 2016). One of the ways of
avoiding this problem is to exclude relational
nouns which are words with non-zero va-
lency (Koptjevskaja-Tamm et al., 2015) from
the dataset, so it should consist only of zero
valency nouns that are more properly linked
with real world objects. However, the distinc-
tion of words on relational and non-relational
ones is fuzzy, and such assessments could be
very subjective (also, since verbs are usually
highly relational, they should not be used in
cross-language evaluation).
4. New Factors for Bias. It is already known
that existence of connotative associations
for certain words in mono-language datasets
could introduce additional subjectivity in the
human assessments (Liza and Grzes, 2016).
We argue that yet more factors could be the
cause of assessors' bias in the cross-language
datasets. For example, words five and clock
could be closely connected in minds of En-
glish speakers (since of the common five
o'clock tea collocation), but not in minds of
speakers of other languages, and we think
that a native English speaker could assess bi-
ased word similarity scores for this word pair.
4 Experimental Setup
4.1 Distributional Models
To propose a comparison, we used 5 cross-
language embedding models.
1. MSE (Multilingual Supervised Embeddings).
Trains using a bilingual dictionary and learns
a mapping from the source to the target space
using Procrustes alignment (Conneau et al.,
2017).
2. MUE (Multilingual Unsupervised Embed-
dings).
Trains learning a mapping from
the source to the target space using ad-
versarial training and Procrustes refinement
(Conneau et al., 2017).
3. VecMap. Maps the source into the tar-
get space using a bilingual dictionary or
shared numerals minimizing the squared Eu-
clidean distance between embedding matri-
ces (Artetxe et al., 2018).
4. BiCCA (Bilingual Canonical Correlation
Analysis).
Projects vectors of two differ-
ent languages in the same space using CCA
(Faruqui and Dyer, 2014).
5. MFT (Multilingual FastText). Uses SVD to
learn a linear transformation, which aligns
monolingual vectors from two languages in
a single vector space (Smith et al., 2017).
We mapped vector spaces of Russian and
English FastText models trained on a dump
of Wikipedia (Bojanowski et al., 2016) with
dictionary
an
(Conneau et al., 2017)
translation
for a single word).
bilingual
(only one
English-Russian
4.2 Intrinsic Tasks
Word Semantic Similarity. The task is to predict
the similarity score for a word a in language A
and a word b in language B. All three publicly
available datasets for cross-language word simi-
larity (Camacho-Collados et al., 2015, 2017) are
not available for Russian, so we created the cross-
language datasets ourselves. We used 5 English
datasets assessed by semantic similarity of nouns
and adjectives (S), 3 datasets assessed by seman-
tic similarity of verbs (V), and 3 datasets assessed
by semantic relatedness of nouns and adjectives
(R); we labeled each with a letter reporting the
type of relations. We translated these datasets,
merged into cross-language sets (the first word of
each word pair was English, and the second was
Russian), dropped certain words pairs according to
limitations addressed by us (in the Section 2), and
re-assessed the obtained cross-languages datasets
with the help of 3 English-Russian volunteers,
having Krippendorff's alpha 0.5 (final amount of
word pairs and ratio to original datasets is reported
at Table 1). Then we compared human references
of these datasets with cosine distances of cross-
language word vectors, and computed Spearman's
rank correlation coefficient (p − value in all cases
was lower than 0.05).
Dictionary Induction (also called word trans-
lation). The second task is to translate a word in
language A into language B, so for the seed word
S.RareWord-958 (56.3%) (Luong et al., 2013)
S.SimLex-739 (95.9%) (Hill et al., 2016)
S.SemEval-243 (88.0%) (Camacho-Collados et al., 2017)
S.WordSim-193 (96.4%) (Agirre et al., 2009)
S.RG-54 (83.1%) (Rubenstein and Goodenough, 1965)
S.MC-28 (93.3%) (Miller and Charles, 1991)
V. SimVerb-3074 (87.8%) (Gerz et al., 2016)
V.Verb-115 (85.4%) (Baker et al., 2014)
V.YP-111 (88.5%) (Yang and Powers, 2006)
R.MEN-1146 (94.7%) (Bruni et al., 2014)
R.MTurk-551 (91.7%) (Halawi et al., 2012)
R.WordSim-193 (96.4%) (Agirre et al., 2009)
P@1, dictionary induction
P@5, dictionary induction
P@10, dictionary induction
F1, paraphrase detection, our dataset
F1, paraphrase detection, parallel sentences
MSE MUE VM BCCA MFT
0.44
0.34
0.6
0.69
0.68
0.66
0.2
0.24
0.22
0.68
0.56
0.55
0.31
0.53
0.61
0.82
0.55
0.42
0.32
0.56
0.67
0.67
0.7
0.2
0.39
0.37
0.66
0.51
0.53
0.16
0.34
0.42
0.77
0.45
0.43
0.35
0.35
0.72
0.63
0.71
0.23
0.27
0.25
0.69
0.57
0.57
0.32
0.52
0.5
0.84
0.57
0.43
0.34
0.34
0.67
0.61
0.72
0.22
0.27
0.25
0.66
0.54
0.53
0.29
0.49
0.55
0.83
0.6
0.43
0.34
0.34
0.71
0.61
0.7
0.21
0.27
0.25
0.68
0.57
0.55
0.21
0.38
0.45
0.86
0.59
Table 1: Performance of the compared models across different tasks. Evaluation on first 11 datasets
indicate Spearman's rank correlation. For word similarity task: words before the hyphen in datasets
name report the name of the original English dataset, the number after the hyphen report the amount of
word pairs, the numbers in brackets report ratio to its English original and the prefix before the dot in
the name report type of assessments.
the model generates a list of the closest word in
other language, and we need to find the correct
translation in it. As a source of correct transla-
tions we used English-Russian dictionary of 53
186 translation pairs (Conneau et al., 2017). The
evaluation on this measure was proposed as a pre-
cision on k nearest vectors of a word embedding
model for k = 1, 5, 10.
4.3 Extrinsic Task and Our Dataset
Cross-language Paraphrase Detection.
In an
analogy with a monolingual paraphrase detection
task (also called sentence similarity identifica-
tion) (Androutsopoulos and Malakasiotis, 2010),
the task is to identify whether sentence a in lan-
guage A and sentence b in language B are para-
phrases or not. This task is highly scalable, and
usually figures as a sub-task of bigger tasks like
cross-language plagiarism detection.
We are not aware of any dataset for this task, so
we designed a benchmark ourselves for English-
Russian language pair. The dataset was con-
structed on the base of Wikipedia articles covering
wide range of topics from technology to sports. It
contains 8 334 sentences with a balanced class dis-
tribution. The assessments and translations were
done by 3 bilingual assessors. The negative results
were obtained by automatically randomly sam-
pling another sentence in the same domain from
the datasets.
Translations were produced manually by a pool
of human translators. Translators could para-
phrase the translations using different techniques
(according to our guidelines), and the assessors
had to verify paraphrase technique labels and an-
notate similarity of English-Russian sentences in
binary labels. We invited 3 assessors to estimate
inter-annotator agreement. To obtain the evalua-
tion scores, we conducted 3-fold cross validation
and trained Logistic Regression with only one fea-
ture: cosine similarity of two sentence vectors.
Sentence representations were built by averaging
their word vectors.
In order to validate the correctness of results on
our dataset, we automatically constructed a para-
phrase set from a corpus of 1 million English-
SimLex and WordSim both being word similarity
benchmarks are clustered away from each other).
Our datasets, aligned models and code to repro-
duce the experiments are available at our GitHub †.
6 Conclusions and Future Work
In this work we explored primary limitations
of evaluation methods of intrinsic cross-language
word embeddings. We proposed experiments on 5
models in order to answer the question 'could we
somehow estimate extrinsic performance of cross-
language embeddings given some intrinsic met-
rics?'. Currently, the short answer is 'No', but the
longer is 'maybe yes, if we understand the cogni-
tive and linguistic regularities that take place in the
benchmarks we use. Our point is that we not only
need intrinsic datasets of different types if we want
to robustly predict the performance of different ex-
trinsic tasks, but we also should overthink the de-
sign and capabilities of existing extrinsic bench-
marks.
Our research does not address some evaluation
methods (like MultiQVEC (Ammar et al., 2016))
and word embeddings models (for instance, Bivec
(Luong et al., 2015)) since Russian do not have
enough linguistic resources:
there are certain
parallel corpora available at http://opus.
nlpl.eu, but a merge of all English-Russian cor-
pora has 773.0M/710.5M tokens, while the mono-
lingual Russian model that we used in this study
was trained on Wikipedia of 5B tokens (and En-
glish Wikipedia has a triple of this size). A for-
tiori, these corpora have different nature (subtitles,
corpus of Europar speeches, etc), and we think
that merging them would yield a dataset of unpre-
dictable quality.
In future we plan to make a comparison with
other languages giving more insights about perfor-
mance of compared models. We also plan to inves-
tigate cross-language extensions of other intrinsic
monolingual tasks (like the analogical reasoning
task) to make our findings more generalizable.
Acknowledgments
The reported study was funded by the Russian
Foundation for Basic Research project 16-37-
60048 mol a dk and by the Ministry of Educa-
tion and Science of the Russian Federation (grant
14.756.31.0001).
Figure 1: Clustermap of different evaluation
techniques. Lighter color correspond to stronger
positive correlation. Each row and column is
labeled according to benchmark type: red –
extrinsic, blue – verbs, purple – word translation,
green – word relatedness, yellow – word
similarity.
Russian parallel sentences from WMT'16∗, gen-
erating for each sentence pair a semantic nega-
tive sample, searching for nearest sentence with a
monolingual FastText model.
5 Results and Discussion
The results of the experiments with intrinsic and
extrinsic evaluation are presented in Table 1. De-
spite the difference in scores for different models
in one dataset could be minuscule, the scores for
different intrinsic datasets vary a lot, and models
that achieve higher results on one task often have
lower results on other tasks.
Figure 1 shows mutual similarities between
datasets (measured as Spearman's rank correlation
between evaluation scores from Table 1). One
can see that there are at least 4 clusters: ex-
trinsic+SemEval; word relations; word transla-
tion+some word similarities; others.
Interestingly, SemEval behaves similarly to ex-
trinsic tasks:
this benchmark contains not only
single words but also two-word expressions (e.g.
Borussia Dortmund), so evaluation on this dataset
is more similar to paraphrase detection task. Sur-
prisingly, other word similarity datasets yield very
different metrics. This is kind of unexpected, be-
cause paraphrase detection task relies on similarity
of word senses.
Notably, many datasets from the same group
(marked using color in the leftmost column on
Figure 1) have difference in models' behavior (e.g.
∗https://translate.yandex.ru/corpus
†https://github.com/bakarov/cross-lang-embeddings
References
Eneko Agirre, Enrique Alfonseca, Keith Hall, Jana
Kravalova, Marius Pas¸ca, and Aitor Soroa. 2009. A
study on similarity and relatedness using distribu-
tional and wordnet-based approaches. In Proceed-
ings of Human Language Technologies: The 2009
Annual Conference of the North American Chap-
ter of the Association for Computational Linguistics,
pages 19–27. Association for Computational Lin-
guistics.
Waleed Ammar, George Mulcaire, Yulia Tsvetkov,
Guillaume Lample, Chris Dyer, and Noah A Smith.
2016. Massively multilingual word embeddings.
arXiv preprint arXiv:1602.01925.
Ion Androutsopoulos and Prodromos Malakasiotis.
2010. A survey of paraphrasing and textual entail-
ment methods. Journal of Artificial Intelligence Re-
search, 38:135–187.
Mikel Artetxe, Gorka Labaka, and Eneko Agirre. 2018.
Generalizing and improving bilingual word embed-
ding mappings with a multi-step framework of lin-
ear transformations.
In Proceedings of the Thirty-
Second AAAI Conference on Artificial Intelligence
(AAAI-18).
Simon Baker, Roi Reichart, and Anna Korhonen. 2014.
An unsupervised model for instance level subcate-
gorization acquisition. In EMNLP, pages 278–289.
Miroslav Batchkarov, Thomas Kober, Jeremy Reffin,
Julie Weeds, and David Weir. 2016. A critique of
word similarity as a method for evaluating distribu-
tional semantic models.
Piotr Bojanowski, Edouard Grave, Armand Joulin,
and Tomas Mikolov. 2016. Enriching word vec-
tors with subword information.
arXiv preprint
arXiv:1607.04606.
Martin Braschler, Donna Harman, Michael Hess,
Michael Kluck, Carol Peters, and Peter Schauble.
2000. The evaluation of systems for cross-language
information retrieval. In LREC.
Elia Bruni, Nam-Khanh Tran, and Marco Baroni. 2014.
Multimodal distributional semantics. J. Artif. Intell.
Res.(JAIR), 49(2014):1–47.
Jose Camacho-Collados, Mohammad Taher Pilehvar,
Nigel Collier, and Roberto Navigli. 2017. Semeval-
2017 task 2: Multilingual and cross-lingual semantic
word similarity. In Proceedings of the 11th Interna-
tional Workshop on Semantic Evaluation (SemEval-
2017), pages 15–26.
Jos´e Camacho-Collados, Mohammad Taher Pilehvar,
and Roberto Navigli. 2015. A framework for the
construction of monolingual and cross-lingual word
similarity datasets. In Proceedings of the 53rd An-
nual Meeting of the Association for Computational
Linguistics and the 7th International Joint Confer-
ence on Natural Language Processing (Volume 2:
Short Papers), volume 2, pages 1–7.
Alexis Conneau, Guillaume Lample, Marc'Aurelio
Ranzato, Ludovic Denoyer, and Herv´e J´egou. 2017.
Word translation without parallel data.
arXiv
preprint arXiv:1710.04087.
Manaal Faruqui and Chris Dyer. 2014. Improving vec-
tor space word representations using multilingual
correlation. In Proceedings of EACL.
Manaal Faruqui, Yulia Tsvetkov, Pushpendre Rastogi,
and Chris Dyer. 2016. Problems with evaluation of
word embeddings using word similarity tasks. arXiv
preprint arXiv:1605.02276.
Daniela Gerz, Ivan Vuli´c, Felix Hill, Roi Reichart, and
Anna Korhonen. 2016. Simverb-3500: A large-
scale evaluation set of verb similarity. arXiv preprint
arXiv:1608.00869.
Guy Halawi, Gideon Dror, Evgeniy Gabrilovich, and
Yehuda Koren. 2012. Large-scale learning of word
relatedness with constraints.
In Proceedings of
the 18th ACM SIGKDD international conference on
Knowledge discovery and data mining, pages 1406–
1414. ACM.
Felix Hill, Roi Reichart, and Anna Korhonen. 2016.
Simlex-999: Evaluating semantic models with (gen-
uine) similarity estimation. Computational Linguis-
tics.
Maria Koptjevskaja-Tamm, Ekaterina Rakhilina, and
Martine Vanhove. 2015. The semantics of lexical
typology. The Routledge Handbook of Semantics,
page 434.
Ira Leviant and Roi Reichart. 2015. Separated by an
un-common language: Towards judgment language
informed vector space modeling.
arXiv preprint
arXiv:1508.00106.
Farhana Ferdousi Liza and Marek Grzes. 2016. An
improved crowdsourcing based evaluation technique
for word embedding methods. ACL 2016, page 55.
Minh-Thang Luong, Hieu Pham, and Christopher D.
Manning. 2015. Bilingual word representations
with monolingual quality in mind. In NAACL Work-
shop on Vector Space Modeling for NLP.
Thang Luong, Richard Socher, and Christopher D
Manning. 2013. Better word representations with
recursive neural networks for morphology.
In
CoNLL, pages 104–113.
George A Miller and Walter G Charles. 1991. Contex-
tual correlates of semantic similarity. Language and
cognitive processes, 6(1):1–28.
Herbert Rubenstein and John B Goodenough. 1965.
Contextual correlates of synonymy. Communica-
tions of the ACM, 8(10):627–633.
Sebastian Ruder. 2017. A survey of cross-lingual em-
bedding models. arXiv preprint arXiv:1706.04902.
Daria Ryzhova, Maria Kyuseva, and Denis Paperno.
2016. Typology of adjectives benchmark for com-
positional distributional models.
In Proceedings
of the Language Resources and Evaluation Con-
ference, pages 1253–1257. European Language Re-
sources Association (ELRA).
Tobias Schnabel, Igor Labutov, David M Mimno, and
Thorsten Joachims. 2015. Evaluation methods for
unsupervised word embeddings. In EMNLP, pages
298–307.
Samuel L Smith, David HP Turban, Steven Hamblin,
and Nils Y Hammerla. 2017. Offline bilingual word
vectors, orthogonal transformations and the inverted
softmax. arXiv preprint arXiv:1702.03859.
Shyam Upadhyay, Manaal Faruqui, Chris Dyer, and
Dan Roth. 2016. Cross-lingual models of word em-
beddings: An empirical comparison. arXiv preprint
arXiv:1604.00425.
Ivan Vuli´c and Marie-Francine Moens. 2013. Cross-
lingual semantic similarity of words as the similarity
of their semantic word responses. In Proceedings of
the 2013 Conference of the North American Chap-
ter of the Association for Computational Linguistics:
Human Language Technologies, pages 106–116.
Dongqiang Yang and David Martin Powers. 2006.
Verb similarity on the taxonomy of wordnet.
In
The Third International WordNet Conference: GWC
2006. Masaryk University.
|
1904.08138 | 5 | 1904 | 2019-12-11T17:29:01 | Complementary Fusion of Multi-Features and Multi-Modalities in Sentiment Analysis | [
"cs.CL",
"cs.SD",
"eess.AS"
] | Sentiment analysis, mostly based on text, has been rapidly developing in the last decade and has attracted widespread attention in both academia and industry. However, the information in the real world usually comes from multiple modalities, such as audio and text. Therefore, in this paper, based on audio and text, we consider the task of multimodal sentiment analysis and propose a novel fusion strategy including both multi-feature fusion and multi-modality fusion to improve the accuracy of audio-text sentiment analysis. We call it the DFF-ATMF (Deep Feature Fusion - Audio and Text Modality Fusion) model, which consists of two parallel branches, the audio modality based branch and the text modality based branch. Its core mechanisms are the fusion of multiple feature vectors and multiple modality attention. Experiments on the CMU-MOSI dataset and the recently released CMU-MOSEI dataset, both collected from YouTube for sentiment analysis, show the very competitive results of our DFF-ATMF model. Furthermore, by virtue of attention weight distribution heatmaps, we also demonstrate the deep features learned by using DFF-ATMF are complementary to each other and robust. Surprisingly, DFF-ATMF also achieves new state-of-the-art results on the IEMOCAP dataset, indicating that the proposed fusion strategy also has a good generalization ability for multimodal emotion recognition. | cs.CL | cs | Complementary Fusion of Multi-Features and Multi-Modalities in Sentiment
Analysis
Feiyang Chen
Ziqian Luo
Department of Computer
Science and Technology,
Beijing Forestry University
School of Computer Science,
Language Technologies Institute,
Carnegie Mellon University
[email protected]
[email protected]
Yanyan Xu∗
Department of Computer
Science and Technology,
Beijing Forestry University
[email protected]
Dengfeng Ke†
National Laboratory of
Pattern Recognition,
Institute of Automation,
Chinese Academy of Sciences
[email protected]
9
1
0
2
c
e
D
1
1
]
L
C
.
s
c
[
5
v
8
3
1
8
0
.
4
0
9
1
:
v
i
X
r
a
Abstract
Sentiment analysis, mostly based on text, has been rapidly
developing in the last decade and has attracted widespread
attention in both academia and industry. However, informa-
tion in the real world usually comes from multiple modalities,
such as audio and text. Therefore, in this paper, based on au-
dio and text, we consider the task of multimodal sentiment
analysis and propose a novel fusion strategy including both
multi-feature fusion and multi-modality fusion to improve
the accuracy of audio-text sentiment analysis. We call it the
DFF-ATMF (Deep Feature Fusion - Audio and Text Modal-
ity Fusion) model, which consists of two parallel branches,
the audio modality based branch and the text modality based
branch. Its core mechanisms are the fusion of multiple fea-
ture vectors and multiple modality attention. Experiments
on the CMU-MOSI dataset and the recently released CMU-
MOSEI dataset, both collected from YouTube for sentiment
analysis, show the very competitive results of our DFF-ATMF
model. Furthermore, by virtue of attention weight distribu-
tion heatmaps, we also demonstrate the deep features learned
by using DFF-ATMF are complementary to each other and
robust. Surprisingly, DFF-ATMF also achieves new state-of-
the-art results on the IEMOCAP dataset, indicating that the
proposed fusion strategy also has a good generalization ability
for multimodal emotion recognition.
Introduction
Sentiment analysis provides beneficial information to un-
derstand an individual's attitude, behavior, and preference
(Zhang, Wang, and Liu 2018). Understanding and analyzing
context-related sentiment is an innate ability of a human be-
ing, which is also an important distinction between a machine
and a human being (Kozinets, Scaraboto, and Parmentier
2018). Therefore, sentiment analysis becomes a crucial issue
in the field of artificial intelligence to be explored.
In recent years, sentiment analysis mainly focuses on tex-
tual data, and consequently, text-based sentiment analysis
becomes relatively mature (Zhang, Wang, and Liu 2018).
With the popularity of social media such as Facebook and
∗Corresponding Author
†Corresponding Author
Copyright c(cid:13) 2020, Association for the Advancement of Artificial
Intelligence (www.aaai.org). All rights reserved.
YouTube, many users are more inclined to express their
views with audio or video (Poria et al. 2017a). Audio re-
views become an increasing source of consumer informa-
tion and are increasingly being followed with interest by
companies, researchers and consumers. They also provide
more natural experiences than traditional text comments
due to allowing viewers to better perceive a commenta-
tor's sentiment, belief, and intention through richer chan-
nels such as intonation (Poria, Hussain, and Cambria 2018).
The combination of multiple modalities (Zadeh et al. 2018;
Poria, Hussain, and Cambria 2018) brings significant advan-
tages over using only text, including language disambiguation
(audio features can help eliminate ambiguous language mean-
ings) and language sparsity (audio features can bring addi-
tional emotional information). Also, basic audio patterns can
enhance links to the real world environment. Actually, people
often associate information with learning and interact with
the external environment through multiple modalities such
as audio and text (Baltrušaitis, Ahuja, and Morency 2019).
Consequently, multimodal learning becomes a new effective
method for sentiment analysis (Majumder et al. 2018). Its
main challenge lies in inferring joint representations that can
process and connect information from multiple modalities
(Poria et al. 2018).
In this paper, we propose a novel fusion strategy, including
the multi-feature fusion and the multi-modality fusion, to im-
prove the accuracy of multimodal sentiment analysis based
on audio and text. We call it the DFF-ATMF model, and the
learned features have strong complementarity and robustness.
We conduct experiments on the CMU Multimodal Opinion-
level Sentiment Intensity (CMU-MOSI) (Zadeh et al. 2016)
dataset and the recently released CMU Multimodal Opinion
Sentiment and Emotion Intensity (CMU-MOSEI) (Zadeh et
al. 2018) dataset, both collected from YouTube, and make
comparisons with other state-of-the-art models to show the
very competitive performance of our proposed model. It is
worth mentioning that DFF-ATMF also achieves the most
advanced results on the IEMOCAP dataset in the general-
ized verification experiments, meaning that it has a good
generalization ability for multimodal emotion recognition.
The major contributions of this paper are as follows:
• We propose the DFF-ATMF model for audio-text senti-
ment analysis, combining the multi-feature fusion with
the multi-modality fusion to learn more comprehensive
sentiment information.
• The features learned by the DFF-ATMF model have good
complementarity and excellent robustness, and even show
an amazing performance when generalized to emotion
recognition tasks.
• Experimental results indicate that the proposed model out-
performs the state-of-the-art models on the CMU-MOSI
dataset (Ghosal et al. 2018) and the IEMOCAP dataset
(Poria et al. 2018), and also has very competitive results
on the recently released CMU-MOSEI dataset.
The rest of this paper is structured as follows. In the follow-
ing section, we review related work. We exhibit the details of
our proposed methodologies in Section 3. Then, in Section
4, experimental results and further discussions are presented.
Finally, we conclude this paper in Section 5.
Related Work
Audio Sentiment Analysis
Audio data are usually extracted from the characteristics of
audio samples' channel, excitation, and prosody. Among
them, prosody parameters extracted from segments, sub-
segments, and hyper-segments are used for sentiment anal-
ysis in (Liu et al. 2018). In the past several years, classi-
cal machine learning algorithms, such as Hidden Markov
Model (HMM), Support Vector Machine (SVM), and deci-
sion tree-based methods, have been utilized for audio sen-
timent analysis (Schuller, Rigoll, and Lang 2004; Schuller,
Rigoll, and Lang 2003; Lee et al. 2011). Recently, researchers
have proposed various neural network-based architectures to
improve audio sentiment analysis. In 2014, an initial study
employed deep neural networks (DNNs) to extract high-level
features from raw audio data and demonstrated its effective-
ness (Han, Yu, and Tashev 2014). With the development
of deep learning, more complex neural-based architectures
have been proposed. For example, convolutional neural net-
work (CNN)-based models have been used to train spec-
trograms or audio features derived from original audio sig-
nals such as Mel Frequency Cepstral Coefficients (MFCCs)
and Low-Level Descriptors (LLDs) (Bertero and Fung 2017;
Parthasarathy and Tashev 2018; Minaee and Abdolrashidi
2019).
Text Sentiment Analysis
After decades of development, text sentiment analysis has
become mature in recent years (Hussein 2018). The most
commonly used classification techniques such as SVM, max-
imum entropy and naive Bayes, are based on the word bag
model, where the sequence of words is ignored, which may
result in inefficient extraction of sentiment from the input be-
cause the sequence of words will affect the existing sentiment
(Chaturvedi et al. 2018). Later research has overcome this
problem by using deep learning in sentiment analysis (Zhang,
Wang, and Liu 2018). For instance, a kind of DNN model
is proposed, using word-level, character-level and sentence-
level representations for sentiment analysis (Jianqiang, Xi-
aolin, and Xuejun 2018). In order to better capture the tem-
poral information, (Dai et al. 2019) proposes a novel neural
architecture, called Transformer-XL, which enables learning
dependency beyond a fixed-length without disrupting tem-
poral coherence. It consists of a segment-level recurrence
mechanism and a novel positional encoding scheme, not only
capturing longer-term dependency but also resolving the con-
text fragmentation problem.
Multimodal Learning
Multimodal learning is an emerging field of research (Bal-
trušaitis, Ahuja, and Morency 2019). Learning from multi-
ple modalities needs to capture the correlation among these
modalities. Data from different modalities may have different
predictive power and noise topology, with possibly losing
the information of at least one of the modalities (Baltrušaitis,
Ahuja, and Morency 2019). (Majumder et al. 2018) presents
a novel feature fusion strategy that proceeds in a hierarchi-
cal manner for multimodal sentiment analysis. (Ghosal et al.
2018) proposes a recurrent neural network-based multimodal
attention framework that leverages contextual information for
utterance-level sentiment prediction and shows a state-of-the-
art model on the CMU-MOSI and CMU-MOSEI datasets.
Figure 1: The overall architecture of the proposed DFF-
ATMF framework. ht represents the hidden state of Bi-LSTM
at time t. e means the final audio sentiment vector. at repre-
sents the attention weight and is calculated as the dot product
of the final audio sentiment vector and the final text sentiment
vector of ht. "FC" means a fully-connected layer.
Proposed Methodology
In this section, we describe the proposed DFF-ATMF model
for audio-text sentiment analysis in detail. We firstly intro-
DatasetU1U3U2Audio ModalText ModalLSTMLSTMLSTMLSTMLSTMLSTMASVTSVFCehthtFCatSentiment Analysisduce an overview of the whole neural network architecture,
illustrating how to fuse audio and text modalities. After that,
two separate branches of DFF-ATMF are respectively ex-
plained to show how to fuse the audio feature vector and
the text feature vector. Finally, we present the multimodal-
attention mechanism used in the DFF-ATMF model.
The DFF-ATMF Framework
The overall architecture of the proposed DFF-ATMF frame-
work is shown in Figure 1. We fuse audio and text modalities
in this framework through two parallel branches, that is, the
audio modality based branch and the text modality based
branch. DFF-ATMF's core mechanisms are feature vector
fusion and multimodal-attention fusion. The audio modality
branch uses Bi-LSTM (Cai and Hao 2018) to extract audio
sentiment information between adjacent utterances (U1, U2,
U3), while another branch uses the same network architecture
to extract text features. Furthermore, the audio feature vector
of each piece of utterance is used as the input of our proposed
neural network, which is based on the audio feature fusion,
so we can obtain a new feature vector before the softmax
layer, called the audio sentiment vector (ASV). The text sen-
timent vector (TSV) can be achieved similarly. Finally, after
the multimodal-attention fusion, the output of the softmax
layer produces final sentiment analysis results, as shown in
Figure 1.
4:
5:
6:
7:
8:
9:
10:
11:
12:
Audio Sentiment Vector (ASV) from Audio Feature
Fusion (AFF)
Base on the work in (Luo, Xu, and Chen 2019), in order to
explore further the fusion of feature vectors inter the audio
modality, we extend the experiments of different types of
audio features on the CMU-MOSI dataset, and the results are
shown in Table 1.
In addition, we also implement an improved serial neural
network of Bi-LSTM and CNN (Wu et al. 2018), combin-
ing with the attention mechanism to learn the deep features
of different sound representations. The multi-feature fusion
procedure is described with the LSTM branch and the CNN
branch respectively in Algorithm 1.
Algorithm 1 The Multi-Feature Fusion Procedure
1: procedure LSTM BRANCH
2:
3:
for i:[0,n] do
fi = getAudioF eature(ui) // get the audio fea-
ture from the uth utterance
ai = getASV (fi)
end for
for i:[0,M] do //M is the number of videos
inputi = GetT opU tter(vi)
ufi = getU tterF eature(inputi)
end for
shuf f le(v)
Attention(Ai)
M ulti − F eature F usion f rom the LST M
branch
for i:[0,n] do
13: end procedure
14: procedure CNN BRANCH
15:
16:
17:
18:
19:
20:
xi ← get SpectrogramImage(ui)
ci ← CNNModel(xi)
end for
Attention(Ci)
M ulti − F eature F usion f rom the CN N
branch
for i:[0,n] do
21: end procedure
22: procedure FEATURE FUSION
23:
24:
25:
26:
27:
28:
29: end procedure
end for
Attention(Li + Ci)
M ulti − F eature F usion
Li = Attention(ai)
Ci = Attention(li)
Figure 2: The architecture of ASV from AFF.
The features are learned from raw waveforms and acoustic
features, which are complementary to each other. Therefore,
audio sentiment analysis can be improved by applying our
feature fusion technique, that is, ASV from AFF, whose
architecture is shown in Figure 2.
In terms of raw audio waveforms, taking the CMU-MOSI
dataset as an example, we illustrate their sampling distribu-
tion in Figure 3. The inputs to the network are raw audio
waveforms sampled at 22 kHz. We also scale the waveforms
to be in the range [-256, 256], so that we do not need to sub-
DatasetU1U3U2Audio ModalRaw WaveformAcoustic FeatureBi-LSTMAttentionCNNConcatenated Feature Vector --- Audio Sentiment Vector (ASV)Table 1: Comparison of different types of audio features on the CMU-MOSI dataset.
Feature
1 Chromagram from spectrogram (chroma_stft)
2 Chroma Energy Normalized (chroma_cens)
3 Mel-frequency cepstral coefficients (MFCC)
4 Root-Mean-Square Energy (RMSE)
5 Spectral_Centroid
6 Spectral_Contrast
7 Tonal Centroid Features (tonnetz)
Model
LSTM
BiLSTM
LSTM
BiLSTM
LSTM
BiLSTM
LSTM
BiLSTM
LSTM
BiLSTM
LSTM
BiLSTM
LSTM
BiLSTM
2-class
43.24
45.37
42.98
45.85
55.12
55.98
52.30
52.76
48.39
48.84
48.34
48.97
53.78
54.24
Accuracy(%)
5-class
20.23
2.29
20.87
20.53
23.64
23.75
21.14
22.35
22.25
22.36
22.50
22.28
22.67
21.87
7-class
13.96
12.39
13.31
13.76
16.99
17.24
15.33
15.87
14.97
15.79
15.02
15.98
15.83
16.01
tract the mean value as the data are naturally near zero already.
To obtain a better sentiment analysis accuracy, batch normal-
ization (BN) and the ReLU function are employed after each
convolutional layer. Additionally, dropout regularization is
also applied to the proposed serial network architecture.
In terms of acoustic features, we extract them using the
Librosa (McFee et al. 2015) toolkit and obtain four effec-
tive kinds of features to represent sentiment information,
which are MFCCs, spectral_centroid, chroma_stft and spec-
tral_contrast, respectively. In particular, taking log-Mel spec-
trogram extraction (Yin, Shah, and Zimmermann 2018) as an
example, we use 44.1 kHz without downsampling and extract
the spectrograms with 64 Bin Mel-scale. The window size
for short-time Fourier transform is 1,024 with a hop size of
512. The resulting Mel-spectrograms are next converted into
log-scaled ones and standardized by subtracting the mean
value and divided by the standard deviation.
Finally, we feed feature vectors of raw waveforms and
acoustic features into our improved serial neural network of
Bi-LSTM and CNN, combining with the attention mecha-
nism to learn the deep features of different sound representa-
tions, that is, ASV.
Figure 3: The raw audio waveform sampling distribution on
the CMU-MOSI dataset.
weight ai can be formulated by Equation 1.
Text Sentiment Vector (TSV) from Text Feature
Fusion (TFF)
ai =
The architecture of TSV from TFF is shown in Figure 4.
BERT (Devlin et al. 2018) is a new language representation
model, standing for Bidirectional Encoder Representations
from Transformers. Thus far, to the best of our knowledge,
no studies have leveraged BERT to pre-train text feature rep-
resentations on the multimodal dataset such as CMU-MOSI.
We then utilize BERT embeddings for CMU-MOSI. Next,
the Bi-LSTM layer takes the concatenated word embeddings
and POS tags as its inputs and it outputs each hidden state.
Let hi be the output hidden state at time i. Then its attention
In Equation 1, wimi + bi denotes a linear transformation
of mi. Therefore, the output representation ri is given by:
ri = aihi.
(2)
Based on such text representations, the sequence of fea-
tures will be assigned with different attention weights. Thus,
crucial information such as emotional words can be identified
more easily. The convolutional layer takes the text represen-
tation ri as its input, and the output CNN feature maps are
concatenated together. Finally, text sentiment analysis can be
improved by using TSV from TFF.
mi = tanh(hi)
ai = wimi + bi
(1)
(cid:80)
exp( ai)
j exp( aj)
0100000200000300000400000500000600000Audio Vector Length01020304050607080Frequencyrespectively. xt+1 and xt−1 represent the features at time
(t + 1)th and (t − 1)th, respectively. The text modality is
similar, represented by T .
(cid:80)
(cid:80)
at =
tt =
exp(eT ht)
t exp(eT ht)
exp(eT h(cid:48)
t)
t exp(eT h(cid:48)
t)
atht
Za =
(cid:88)
(cid:88)
t
Zt =
tth(cid:48)
t
(4)
t
yi,j = sof tmax(concat(concat(Za, Zt), A)T M + b)
(5)
score as a weight parameter, the weighted sum(cid:80)
We then consider the final ASV e as an intermediate vec-
tor, as shown in Figure 1. During each time step t, the dot
product of the intermediate vector e and the hidden state
ht is evaluated to calculate a similarity score at. Using this
t atht is
calculated to generate a multi-feature fusion vector Za. The
multi-feature fusion vector of the text modality is calculated
similarly, represented by Zt. We are therefore able to obtain
two kinds of multi-feature fusion vectors for the audio modal-
ity and the text modality respectively, as shown in Equation
4 and 5. These multi-feature fusion vectors are respectively
concatenated with the final intermediate vectors of ASV and
TSV, which will pass through the softmax function to perform
sentiment analysis, as shown in Equation 6 and 7.
ASV = gθ(e)
(cid:48)(ht)
T SV = gθ
(6)
yi = sof tmax(concat(ASV, T SV )T M + b)
(7)
Empirical Evaluation
In this section, we firstly introduce the datasets, the evaluation
metrics and the network structure parameters used in our
experiments, and then exhibit the experimental results and
make comparisons with other state-of-the-art models to show
the advantages of DFF-ATMF. At last, more discussions are
illustrated to understand the learning behavior of DFF-ATMF
better.
Experiment Settings
Datasets The datasets used for training and test are de-
picted in Table 2. The CMU-MOSI dataset is rich in senti-
ment expression, consisting of 2,199 utterances, that is, 93
videos by 89 speakers. The videos involve a large array of top-
ics such as movies, books, and other products. These videos
were crawled from YouTube and segmented into utterances
where each utterance is annotated with scores between −3
Figure 4: The architecture of TSV from TFF.
Audio and Text Modal Fusion with the
Multimodal-Attention Mechanism
Inspired by human visual attention, the attention mechanism,
proposed by (Luong, Pham, and Manning 2015) for neural
machine translation, is introduced into the encoder-decoder
framework to select reference words from the source lan-
guage for the words in the target language. Based on the
existing attention mechanism, inspired by the work in (Yoon,
Byun, and Jung 2018), we improve the multimodal-attention
method on the basis of the multi-feature fusion strategy, fo-
cusing on the fusion of comprehensive and complementary
sentiment information from audio and text. We leverage the
multimodal-attention mechanism to preserve the intermedi-
ate outputs of the input sequences by retaining the Bi-LSTM
encoder, and then a model is trained to selectively learn these
inputs and to correlate output sequences with the model's
output.
More specifically, ASV and TSV are firstly encoded with
Audio-BiLSTM and Text-BiLSTM using Equation 3.
At+1 = fθ(At, xt+1)
At−1 = fθ(At, xt−1)
Tt+1 = fθ(Tt, xt+1)
Tt−1 = fθ(Tt, xt−1)
(3)
In Equation 3, fθ is the LSTM function with the weight
parameter θ. At+1, At and At−1 represent the hidden states
at time (t + 1)th, tth and (t − 1)th from the audio modality,
DatasetU1U3U2Text ModalBi-LSTMAttentionCNNConcatenated Feature Vector --- Text Sentiment Vector (TSV)BERTTable 2: Datasets for training and test in our experiments.
Dataset
CMU-MOSI
CMU-MOSEI
IEMOCAP
Training
#utterance
1 616
18 051
4 290
(strongly negative) and +3 (strongly positive) by five anno-
tators. We take the average of these five annotations as the
sentiment polarity and then consider only two classes, that
is, "positive" and "negative". Our training and test splits of
the dataset are completely disjoint with respect to speakers.
In order to better compare with the previous work, similar
to (Poria et al. 2018), we divide the dataset by 7:3 approxi-
mately, resulting in 1,616 and 583 utterances for training and
test respectively.
The CMU-MOSEI dataset is an upgraded version of the
CMU-MOSI dataset, which has 3,229 videos, that is, 22,676
utterances, from more than 1,000 online YouTube speakers.
The training and test sets include 18,051 and 4,625 utterances
respectively, similar to (Ghosal et al. 2018).
The IEMOCAP dataset was collected following theatrical
theory in order to simulate natural dyadic interactions be-
tween actors. We use categorical evaluations with majority
agreement and use only four emotional categories, that is,
"happy", "sad", "angry", and "neutral" to compare the per-
formance of our model with other researches using the same
categories (Poria et al. 2018).
Evaluation Metrics We evaluate the performance of our
proposed model by the weighted accuracy on 2-class or multi-
class classifications.
weighted accuracy =
correct utterances
utterances
(8)
Additionally, F1-Score is used to evaluate 2-class classifi-
cation.
Fβ=(1 + β2) ·
precision · recall
(β2 · precision) + recall
(9)
In Equation 9, β represents the weight between precision
and recall. During our evaluation process, we set β = 1 since
we consider precision and recall to have the same weight, and
thus F 1-score is adopted.
However, in emotion recognition, we use Macro F 1-Score
to evaluate the performance.
n(cid:80)
F1n
n
M acro F 1=
1
(10)
In Equation 10, n represents the number of classifications
and F1n is the F 1 score on the nth category.
Network Structure Parameters Our proposed architec-
ture is implemented on the open-source deep learning frame-
work TensorFlow. More specifically, for the proposed audio
and text multi-modality fusion framework, we use Bi-LSTM
#video
65
1 550
120
Test
#utterance
583
4 625
1 208
#video
28
679
31
with 200 neurons, each followed by a dense layer consisting
of 100 neurons. Utilizing the dense layer, we project the input
features of audio and text to the same dimension, and next
combine them with the multimodal-attention mechanism. We
set the dropout hyperparameter to be 0.4 for CMU-MOSI
and 0.3 for CMU-MOSEI & IEMOCAP as a measure of
regularization. We also use the same dropout rates for the
Bi-LSTM layers. We employ the ReLu function in the dense
layers and softmax in the final classification layer. When
training the network, we set the batch size to be 32, and use
Adam optimizer with the cross-entropy loss function and
train for 50 epochs. In data processing, we make each utter-
ance one-to-one correspondence with the label and rename
the utterance.
The network structure of the proposed audio and text multi-
feature fusion framework is similar. Taking the audio multi-
feature fusion framework as an example, the hidden states of
Bi-LSTM are of 2 ∗ 200-dim. The kernel sizes of CNN are 3,
5, 7 and 9 respectively. The size of the feature map is 4 ∗ 200.
A dropout rate is a random number between 0.3 and 0.4. The
loss function used is MAE, and the batch size is set to 16.
We combine the training set and the development set in our
experiments. We use 90% for training and reserve 10% for
cross-validation. To train the feature encoder, we follow the
fine-tuning training strategy.
In order to reduce randomness and improve credibility, we
report the average value over 3 runs for all experiments.
Experimental Results
Comparison with Other Models
• (Poria et al. 2017b) proposes an LSTM-based model that
enables utterances to capture contextual information from
their surroundings in the video, thus aiding the classifica-
tion.
• (Poria et al. 2017c) introduces attention-based networks to
improve both context learning and dynamic feature fusion.
• (Zadeh et al. 2018) proposes a novel multimodal fusion
• (Poria et al. 2018) explores three different deep learning-
based architectures, each improving upon the previous one,
which is the state-of-the-art method on the IEMOCAP
dataset at present.
• (Ghosal et al. 2018) proposes a recurrent neural network-
based multimodal-attention framework that leverages the
contextual information, which is the state-of-the-art
model on the CMU-MOSI dataset at present.
• (Lee et al. 2018) proposes a new method of learning about
the hidden representations between speech and text data
technique called Dynamic Fusion Graph (DFG).
Table 3: Comparison with other state-of-the-art models.
Model
(Poria et al. 2017b)
(Poria et al. 2017c)
(Zadeh et al. 2018)
(Poria et al. 2018)
(Ghosal et al. 2018)
(Lee et al. 2018)
DFF-ATMF
CMU-MOSI
Acc(%)
79.30
80.10
74.93
76.60
80.58
-
80.98
F1
80.12
80.62
75.42
76.93
80.96
-
81.26
Acc(%)
CMU-MOSEI
F1
-
-
-
-
76.24
-
79.74
84.08
77.15
77.03
-
80.15
88.89
78.33
IEMOCAP
Overall Acc(%)
75.60
-
-
-
-
78.20
81.37
Macro F1
76.31
-
-
-
-
78.79
82.29
Table 4: Experimental results on the IEMOCAP dataset.
IEMOCAP
Emotion
happy
sad
angry
neutral
Overall
ACC(%)
74.41
73.62
78.57
64.35
81.37
using CNN, which is the state-of-the-art model on the
CMU-MOSEI dataset at present.
Table 3 shows the comparison of DFF-ATMF with other
state-of-the-art models. From Table 3, we can see that DFF-
ATMF outperforms the other models on the CMU-MOSI
dataset and the IEMOCAP dataset. At the same time, the
experimental results on the CMU-MOSEI dataset also show
DFF-ATMF's competitive performance.
Generalization Ability Analysis
In order to verify the fea-
ture complementarity of our proposed fusion strategy and
its robustness, we conduct experiments on the IEMOCAP
dataset to examine DFF-ATMF's generalization capability.
Surprisingly, our proposed fusion strategy is effective on the
IEMOCAP dataset and outperforms the current state-of-the-
art method in (Poria et al. 2018), which can be seen from
Table 3 and the overall accuracy is improved by 3.17%. More
detailed experimental results on the IEMOCAP dataset are
illustrated in Table 4.
Further Discussions
Macro F1
75.66
74.31
79.14
65.72
82.29
Figure 6: Softmax attention weights of an example from the
CMU-MOSEI test set.
Figure 7: Softmax attention weights of an example from the
IEMOCAP test set.
Figure 5: Softmax attention weights of an example from the
CMU-MOSI test set.
The above experimental results have already shown that
DFF-ATMF can improve the performance of audio-text Sen-
timent analysis. We now analyze the attention values to un-
Figure 8: Softmax attention weight comparison of the CMU-
MOSI, CMU-MOSEI, and IEMOCAP test sets.
u1u2u3u1u2u3u1u2u30.150.300.450.600.750.90u1u2u3u1u2u3u1u2u30.150.300.450.600.750.90u1u2u3u1u2u3u1u2u30.150.300.450.600.75u1u2u3u4u5u6u7u8u9u1u2u3u4u5u6u7u8u9u1u2u3u4u5u6u7u8u90.20.40.60.8derstand the learning behavior of the proposed architecture
better.
We take a video from the CMU-MOSI test set as an ex-
ample. From the attention heatmap in Figure 5, we can see
evidently that by applying different weights across contextual
utterances and modalities, the model is able to predict labels
of all the utterances correctly, which shows that our proposed
fusion strategy with multi-feature and multi-modality is in-
deed effective, and thus has good feature complementarity
and excellent robustness of generalization ability. However,
at the same time, we have a doubt about the multi-feature
fusion. When the raw waveform of the audio is fused with the
vector of acoustic features, the dimensions are inconsistent. If
the existing method is utilized to reduce the dimension, some
audio information may also be lost. We intend to solve this
problem from the perspective of some mathematical theory
such as the angle between two vectors.
Similarly, the attention weight distribution heatmaps on
the CMU-MOSEI and IEMOCAP test sets are shown in
Figure 6 and 7, respectively. Furthermore, we also give the
softmax attention weight comparison of the CMU-MOSI,
CMU-MOSEI, and IEMOCAP test sets in Figure 8.
Conclusions
In this paper, we propose a novel fusion strategy, includ-
ing multi-feature fusion and multi-modality fusion, and the
learned features have strong complementarity and robustness,
leading to the most advanced experimental results on the
audio-text multimodal sentiment analysis tasks. Experiments
on both the CMU-MOSI and CMU-MOSEI datasets show
that our proposed model is very competitive. More surpris-
ingly, the experiments on the IEMOCAP dataset achieve un-
expected state-of-the-art results, indicating that DFF-ATMF
can also be generalized for multimodal emotion recognition.
In this paper, we did not consider the video modality because
we try to use only the information of audio and text derived
from videos. To the best of our knowledge, this is the first
attempt in the multimodal domain. In the future, we will con-
sider more fusion strategies supported by basic mathematical
theories for multimodal sentiment analysis.
Acknowledgements
This research work was supported by the National Under-
graduate Training Programs for Innovation and Entrepreneur-
ship (Grant No. 201810022064) and the World-Class Disci-
pline Construction and Characteristic Development Guid-
ance Funds for Beijing Forestry University (Grant No.
2019XKJS0310). We also thank the anonymous reviewers
for their thoughtful comments. Special thanks to the support
of AAAI 2020 and AffCon2020.
References
[Baltrušaitis, Ahuja, and Morency 2019] Baltrušaitis,
T.;
Ahuja, C.; and Morency, L.-P. 2019. Multimodal machine
learning: A survey and taxonomy. IEEE Transactions on
Pattern Analysis and Machine Intelligence 41(2):423 -- 443.
[Bertero and Fung 2017] Bertero, D., and Fung, P. 2017. A
first look into a convolutional neural network for speech
emotion detection. In 2017 IEEE international conference
on acoustics, speech and signal processing (ICASSP), 5115 --
5119. IEEE.
[Cai and Hao 2018] Cai, X., and Hao, Z. 2018. Multi-view
and attention-based bi-lstm for weibo emotion recognition.
In 2018 International Conference on Network, Communica-
tion, Computer Engineering (NCCE), Advances in Intelligent
Systems Research, volume 147, 772 -- 779. Atlantis Press.
[Chaturvedi et al. 2018] Chaturvedi, I.; Cambria, E.; Welsch,
R. E.; and Herrera, F. 2018. Distinguishing between facts
and opinions for sentiment analysis: Survey and challenges.
Information Fusion 44:65 -- 77.
[Dai et al. 2019] Dai, Z.; Yang, Z.; Yang, Y.; Cohen, W. W.;
Carbonell, J.; Le, Q. V.; and Salakhutdinov, R.
2019.
Transformer-xl: Attentive language models beyond a fixed-
length context. arXiv preprint arXiv:1901.02860.
[Devlin et al. 2018] Devlin, J.; Chang, M.-W.; Lee, K.; and
Toutanova, K. 2018. Bert: Pre-training of deep bidirectional
transformers for language understanding. arXiv preprint
arXiv:1810.04805.
[Ghosal et al. 2018] Ghosal, D.; Akhtar, M. S.; Chauhan, D.;
Poria, S.; Ekbal, A.; and Bhattacharyya, P. 2018. Contextual
inter-modal attention for multi-modal sentiment analysis. In
Proceedings of the 2018 Conference on Empirical Methods
in Natural Language Processing, 3454 -- 3466.
[Han, Yu, and Tashev 2014] Han, K.; Yu, D.; and Tashev, I.
2014. Speech emotion recognition using deep neural network
and extreme learning machine. In The fifteenth annual confer-
ence of the international speech communication association
(INTERSPEECH), 223 -- 227.
[Hussein 2018] Hussein, D. M. E.-D. M. 2018. A survey
on sentiment analysis challenges. Journal of King Saud
University-Engineering Sciences 30(4):330 -- 338.
[Jianqiang, Xiaolin, and Xuejun 2018] Jianqiang, Z.; Xi-
aolin, G.; and Xuejun, Z. 2018. Deep convolution neural
IEEE Access
networks for twitter sentiment analysis.
6:23253 -- 23260.
[Kozinets, Scaraboto, and Parmentier 2018] Kozinets, R. V.;
Scaraboto, D.; and Parmentier, M.-A. 2018. Evolving netnog-
raphy: how brand auto-netnography, a netnographic sensibil-
ity, and more-than-human netnography can transform your
research. JOURNAL OF MARKETING MANAGEMENT
34(3-4):231 -- 242.
[Lee et al. 2011] Lee, C.-C.; Mower, E.; Busso, C.; Lee, S.;
and Narayanan, S. 2011. Emotion recognition using a hierar-
chical binary decision tree approach. Speech Communication
53(9-10):1162 -- 1171.
[Lee et al. 2018] Lee, C. W.; Song, K. Y.; Jeong, J.; and Choi,
W. Y. 2018. Convolutional attention networks for multimodal
emotion recognition from speech and text data. arXiv preprint
arXiv:1805.06606.
[Liu et al. 2018] Liu, Z.-T.; Wu, M.; Cao, W.-H.; Mao, J.-W.;
Xu, J.-P.; and Tan, G.-Z. 2018. Speech emotion recognition
based on feature selection and extreme learning machine
decision tree. Neurocomputing 273:271 -- 280.
ing acoustic features and linguistic information in a hybrid
support vector machine-belief network architecture. In 2004
IEEE International Conference on Acoustics, Speech, and
Signal Processing, volume 1, I -- 577. IEEE.
[Wu et al. 2018] Wu, C.; Wu, F.; Liu, J.; Yuan, Z.; Wu, S.;
and Huang, Y. 2018. Thu_ngn at semeval-2018 task 1: Fine-
grained tweet sentiment intensity analysis with attention cnn-
lstm. In Proceedings of The 12th International Workshop on
Semantic Evaluation, 186 -- 192.
[Yin, Shah, and Zimmermann 2018] Yin, Y.; Shah, R. R.; and
Zimmermann, R. 2018. Learning and fusing multimodal
deep features for acoustic scene categorization. In 2018 ACM
Multimedia Conference on Multimedia Conference, 1892 --
1900. ACM.
[Yoon, Byun, and Jung 2018] Yoon, S.; Byun, S.; and Jung,
K. 2018. Multimodal speech emotion recognition using
audio and text. In 2018 IEEE Spoken Language Technology
Workshop (SLT), 112 -- 118. IEEE.
[Zadeh et al. 2016] Zadeh, A.; Zellers, R.; Pincus, E.; and
Morency, L.-P. 2016. Mosi: multimodal corpus of sentiment
intensity and subjectivity analysis in online opinion videos.
arXiv preprint arXiv:1606.06259.
[Zadeh et al. 2018] Zadeh, A. B.; Liang, P. P.; Poria, S.; Cam-
bria, E.; and Morency, L.-P. 2018. Multimodal language
analysis in the wild: Cmu-mosei dataset and interpretable
dynamic fusion graph. In Proceedings of the 56th Annual
Meeting of the Association for Computational Linguistics
(Volume 1: Long Papers), volume 1, 2236 -- 2246.
[Zhang, Wang, and Liu 2018] Zhang, L.; Wang, S.; and Liu,
B. 2018. Deep learning for sentiment analysis: A survey.
Wiley Interdisciplinary Reviews: Data Mining and Knowledge
Discovery 8(4):e1253.
2015.
[Luo, Xu, and Chen 2019] Luo, Z.; Xu, H.; and Chen, F.
2019. Audio sentiment analysis by heterogeneous signal
features learned from utterance-based parallel neural net-
work. In Proceedings of the AAAI-19 Workshop on Affective
Content Analysis, Honolulu, USA, AAAI.
[Luong, Pham, and Manning 2015] Luong, M.-T.; Pham, H.;
and Manning, C. D.
Effective approaches to
attention-based neural machine translation. arXiv preprint
arXiv:1508.04025.
[Majumder et al. 2018] Majumder, N.; Hazarika, D.; Gel-
bukh, A.; Cambria, E.; and Poria, S. 2018. Multimodal
sentiment analysis using hierarchical fusion with context
modeling. Knowledge-Based Systems 161:124 -- 133.
[McFee et al. 2015] McFee, B.; Raffel, C.; Liang, D.; Ellis,
D. P.; McVicar, M.; Battenberg, E.; and Nieto, O. 2015.
librosa: Audio and music signal analysis in python. In Pro-
ceedings of the 14th python in science conference, 18 -- 25.
[Minaee and Abdolrashidi 2019] Minaee, S., and Abdol-
rashidi, A. 2019. Deep-emotion: Facial expression recogni-
tion using attentional convolutional network. arXiv preprint
arXiv:1902.01019.
[Parthasarathy and Tashev 2018] Parthasarathy, S., and Ta-
shev, I. 2018. Convolutional neural network techniques
for speech emotion recognition. In 2018 16th International
Workshop on Acoustic Signal Enhancement (IWAENC), 121 --
125. IEEE.
[Poria et al. 2017a] Poria, S.; Cambria, E.; Bajpai, R.; and
Hussain, A. 2017a. A review of affective computing: From
unimodal analysis to multimodal fusion. Information Fusion
37:98 -- 125.
[Poria et al. 2017b] Poria, S.; Cambria, E.; Hazarika, D.; Ma-
jumder, N.; Zadeh, A.; and Morency, L.-P. 2017b. Context-
dependent sentiment analysis in user-generated videos. In
Proceedings of the 55th Annual Meeting of the Association
for Computational Linguistics (Volume 1: Long Papers), vol-
ume 1, 873 -- 883.
[Poria et al. 2017c] Poria, S.; Cambria, E.; Hazarika, D.;
Mazumder, N.; Zadeh, A.; and Morency, L.-P. 2017c. Multi-
level multiple attentions for contextual multimodal sentiment
analysis. In 2017 IEEE International Conference on Data
Mining (ICDM), 1033 -- 1038. IEEE.
[Poria et al. 2018] Poria, S.; Majumder, N.; Hazarika, D.;
Cambria, E.; Gelbukh, A.; and Hussain, A. 2018. Multi-
modal sentiment analysis: Addressing key issues and setting
up the baselines. IEEE Intelligent Systems 33(6):17 -- 25.
[Poria, Hussain, and Cambria 2018] Poria, S.; Hussain, A.;
and Cambria, E. 2018. Combining textual clues with audio-
visual information for multimodal sentiment analysis.
In
Multimodal Sentiment Analysis. Springer. 153 -- 178.
[Schuller, Rigoll, and Lang 2003] Schuller, B.; Rigoll, G.;
and Lang, M. 2003. Hidden markov model-based speech
emotion recognition. In 2003 IEEE International Conference
on Acoustics, Speech, and Signal Processing, 2003. Proceed-
ings.(ICASSP'03)., volume 2, II -- 1. IEEE.
[Schuller, Rigoll, and Lang 2004] Schuller, B.; Rigoll, G.;
and Lang, M. 2004. Speech emotion recognition combin-
|
1704.03956 | 2 | 1704 | 2017-04-15T07:15:00 | Incremental Skip-gram Model with Negative Sampling | [
"cs.CL"
] | This paper explores an incremental training strategy for the skip-gram model with negative sampling (SGNS) from both empirical and theoretical perspectives. Existing methods of neural word embeddings, including SGNS, are multi-pass algorithms and thus cannot perform incremental model update. To address this problem, we present a simple incremental extension of SGNS and provide a thorough theoretical analysis to demonstrate its validity. Empirical experiments demonstrated the correctness of the theoretical analysis as well as the practical usefulness of the incremental algorithm. | cs.CL | cs | Incremental Skip-gram Model with Negative Sampling
Nobuhiro Kaji and Hayato Kobayashi
{nkaji,hakobaya}@yahoo-corp.jp
Yahoo Japan Corporation
7
1
0
2
r
p
A
5
1
]
L
C
.
s
c
[
2
v
6
5
9
3
0
.
4
0
7
1
:
v
i
X
r
a
Abstract
This paper explores an incremental train-
ing strategy for the skip-gram model with
negative sampling (SGNS) from both em-
pirical and theoretical perspectives. Ex-
isting methods of neural word embed-
dings, including SGNS, are multi-pass al-
gorithms and thus cannot perform incre-
mental model update. To address this
problem, we present a simple incremen-
tal extension of SGNS and provide a
thorough theoretical analysis to demon-
strate its validity. Empirical experiments
demonstrated the correctness of the theo-
retical analysis as well as the practical use-
fulness of the incremental algorithm.
Introduction
1
Existing methods of neural word embeddings are
typically designed to go through the entire train-
ing data multiple times. For example, negative
sampling (Mikolov et al., 2013b) needs to pre-
compute the noise distribution from the entire
training data before performing Stochastic Gradi-
ent Descent (SGD). It thus needs to go through the
training data at least twice. Similarly, hierarchical
soft-max (Mikolov et al., 2013b) has to determine
the tree structure and GloVe (Pennington et al.,
2014) has to count co-occurrence frequencies be-
fore performing SGD.
The fact that those existing methods are multi-
pass algorithms means that they cannot perform
incremental model update when additional train-
ing data is provided. Instead, they have to re-train
the model on the old and new training data from
scratch.
However, the re-training is obviously inefficient
since it has to process the entire training data
received thus far whenever new training data is
provided. This is especially problematic when
the amount of the new training data is relatively
smaller than the old one. One such a situa-
tion is that the embedding model is updated on a
small amount of training data that includes newly
emerged words for instantly adding them to the
vocabulary set. Another situation is that the word
embeddings are learned from ever-evolving data
such as news articles and microbologs (Peng et al.,
2017) and the embedding model is periodically
updated on newly generated data (e.g., once in a
week or month).
This paper investigates an incremental training
method of word embeddings with a focus on the
skip-gram model with negative sampling (SGNS)
(Mikolov et al., 2013b) for its popularity. We
present a simple incremental extension of SGNS,
referred to as incremental SGNS, and provide a
thorough theoretical analysis to demonstrate its
validity. Our analysis reveals that, under a mild
assumption, the optimal solution of incremental
SGNS agrees with the original SGNS when the
training data size is infinitely large. See Section 4
for the formal and strict statement. Additionally,
we present techniques for the efficient implemen-
tation of incremental SGNS.
Three experiments were conducted to assess
the correctness of the theoretical analysis as well
as the practical usefulness of incremental SGNS.
The first experiment empirically investigates the
validity of the theoretical analysis result. The
second experiment compares the word embed-
dings learned by incremental SGNS and the orig-
inal SGNS across five benchmark datasets, and
demonstrates that those word embeddings are of
comparable quality. The last experiment explores
the training time of incremental SGNS, demon-
strating that it is able to save much training time
by avoiding expensive re-training when additional
training data is provided.
2 SGNS Overview
As a preliminary,
overview of SGNS.
this section provides a brief
Given a word sequence, w1, w2, . . . , wn, for
training, the skip-gram model seeks to minimize
the following objective to learn word embeddings:
LSG = − 1
n
log p(wi+j wi),
n(cid:88)
(cid:88)
i=1
j≤c
j(cid:54)=0
where wi is a target word and wi+j is a context
word within a window of size c. p(wi+j wi)
represents the probability that wi+j appears within
the neighbor of wi, and is defined as
p(wi+j wi) =
(cid:80)
exp(twi · cwi+j )
w∈W exp(twi · cw)
,
(1)
where tw and cw are w's embeddings when it be-
haves as a target and context, respectively. W rep-
resents the vocabulary set.
Since it is too expensive to optimize the above
objective, Mikolov et al. (2013b) proposed nega-
tive sampling to speed up skip-gram training. This
approximates Eq. (1) using sigmoid functions and
k randomly-sampled words, called negative sam-
ples. The resulting objective is given as
LSGNS =− 1
n
wi,wi+j +kEv∼q(v)[ψ−
ψ+
wi,v],
n(cid:88)
(cid:88)
i=1
j≤c
j(cid:54)=0
w,v = log σ(tw · cv), ψ−
w,v = log σ(−tw ·
where ψ+
cv), and σ(x) is the sigmoid function. The nega-
tive sample v is drawn from a smoothed unigram
probability distribution referred to as noise distri-
bution: q(v) ∝ f (v)α, where f (v) represents the
frequency of a word v in the training data and α is
a smoothing parameter (0 < α ≤ 1).
The objective is optimized by SGD. Given
a target-context word pair (wi and wi+j) and k
negative samples (v1, v2, . . . , vk) drawn from the
wi,wi+j −
noise distribution, the gradient of −ψ+
kEv∼q(v)[ψ−
k(cid:48)=1 ψ−
wi,vk(cid:48)
is computed. Then, the gradient descent is per-
formed to update twi, cwi+j , and cv1, . . . , cvk.
wi,wi+j − (cid:80)k
wi,v] ≈ −ψ+
SGNS training needs to scan the entire train-
ing data multiple times because it has to pre-
compute the noise distribution q(v) before per-
forming SGD. This makes it difficult to perform
incremental model update when additional train-
ing data is provided.
Incremental SGNS
3
This section explores incremental
training of
SGNS. The incremental training algorithm (Sec-
tion 3.1),
its efficient implementation (Section
3.2), and the computational complexity (Section
3.3) are discussed in turn.
3.1 Algorithm
Algorithm 1 presents incremental SGNS, which
goes through the training data in a single-pass to
update word embeddings incrementally. Unlike
the original SGNS, it does not pre-compute the
noise distribution.
Instead, it reads the training
data word by word1 to incrementally update the
word frequency distribution and the noise distribu-
tion while performing SGD. Hereafter, the origi-
nal SGNS (c.f., Section 2) is referred to as batch
SGNS to emphasize that the noise distribution is
computed in a batch fashion.
The learning rate for SGD is adjusted by using
AdaGrad (Duchi et al., 2011). Although the linear
decay function has widely been used for training
batch SGNS (Mikolov, 2013), adaptive methods
such as AdaGrad are more suitable for the incre-
mental training since the amount of training data is
unknown in advance or can increase unboundedly.
It is straightforward to extend the incremental
SGNS to the mini-batch setting by reading a sub-
set of the training data (or mini-batch), rather than
a single word, at a time to update the noise distri-
bution and perform SGD (Algorithm 2). Although
this paper primarily focuses on the incremental
SGNS, the mini-batch algorithm is also important
in practical terms because it is easier to be multi-
threaded.
Alternatives to Algorithms 2 might be possi-
ble. Other possible approaches include computing
the noise distribution separately on each subset of
the training data, fixing the noise distribution after
computing it from the first (possibly large) subset,
and so on. We exclude such alternatives from our
investigation because it is considered difficult to
provide them with theoretical justification.
3.2 Efficient implementation
Although the incremental SGNS is conceptually
simple, implementation issues are involved.
1In practice, Algorithm 1 buffers a sequence of words
wi−c, . . . , wi+c (rather than a single word wi) at each step,
as it requires an access to the context words wi+j in line 7.
This is not a practical problem because the window size c is
usually small and independent from the training data size n.
Algorithm 1 Incremental SGNS
1: f (w) ← 0 for all w ∈ W
2: for i = 1, . . . , n do
f (wi) ← f (wi) + 1
3:
q(w) ←
4:
for j = −c, . . . ,−1, 1, . . . , c do
5:
6:
7:
8:
9: end for
end for
(cid:80)
f (w)α
w(cid:48)∈W f (w(cid:48))α for all w ∈ W
draw k negative samples from q(w): v1, . . . , vk
use SGD to update twi, cwi+j , and cv1 , . . . , cvk
Algorithm 2 Mini-batch SGNS
1: for each subset D of the training data do
update the noise distribution using D
2:
perform SGD over D
3:
4: end for
3.2.1 Dynamic vocabulary
One problem that arises when training incremen-
tal SGNS is how to maintain the vocabulary set.
Since new words emerge endlessly in the train-
ing data, the vocabulary set can grow unboundedly
and exhaust a memory.
We address this problem by dynamically chang-
ing the vocabulary set. The Misra-Gries algorithm
(Misra and Gries, 1982) is used to approximately
keep track of top-m frequent words during train-
ing, and those words are used as the dynamic vo-
cabulary set. This method allows the maximum
vocabulary size to be explicitly limited to m, while
being able to dynamically change the vocabulary
set.
3.2.2 Adaptive unigram table
Another problem is how to generate negative sam-
ples efficiently. Since k negative samples per
target-context pair have to be generated by the
noise distribution, the sampling speed has a sig-
nificant effect on the overall training efficiency.
Let us first examine how negative samples are
generated in batch SGNS. In a popular implemen-
tation (Mikolov, 2013), a word array (referred to
as a unigram table) is constructed such that the
number of a word w in it is proportional to q(w).
See Table 1 for an example. Using the unigram
table, negative samples can be efficiently gener-
ated by sampling the table elements uniformly at
random. It takes only O(1) time to generate one
negative sample.
The above method assumes that the noise dis-
tribution is fixed and thus cannot be used directly
for the incremental training. One simple solution
is to reconstruct the unigram table whenever new
training data is provided. However, such a method
w
q(w)
a
0.5
b
0.3
c
0.2
T = (a, a, a, a, a, b, b, b, c, c)
Table 1: Example noise distribution q(w) for the
vocabulary set W = {a, b, c} (left) and the corre-
sponding unigram table T of size 10 (right).
f (wi) ← f (wi) + 1
F ← f (wi)α − (f (wi) − 1)α
z ← z + F
if T < τ then
Algorithm 3 Adaptive unigram table.
1: f (w) ← 0 for all w ∈ W
2: z ← 0
3: for i = 1, . . . , n do
4:
5:
6:
7:
8:
9:
10:
11:
12:
end if
13:
14: end for
T [j] ← wi with probability F
add F copies of wi to T
for j = 1, . . . , τ do
end for
else
z
is not effective for the incremental SGNS, because
the unigram table reconstruction requires O(W)
time.2
z = (cid:80)
We propose a reservoir-based algorithm for ef-
ficiently updating the unigram table (Vitter, 1985;
Efraimidis, 2015) (Algorithm 3). The algorithm
incrementally update the unigram table T while
limiting its maximum size to τ. In case T < τ, it
can be easily confirmed that the number of a word
w in T is f (w)α(∝ q(w)). In case T = τ, since
w∈W f (w)α is equal to the normalization
factor of the noise distribution, it can be proven
by induction that, for all j, T [j] is a word w with
probability q(w). See (Vitter, 1985; Efraimidis,
2015) for reference.
Note on implementation In line 8, F copies of
wi are added to T . When F is not an integer, the
copies are generated so that their expected number
becomes F . Specifically, (cid:100)F(cid:101) copies are added to
T with probability F − (cid:98)F(cid:99), and (cid:98)F(cid:99) copies are
added otherwise.
The loop from line 10 to 12 becomes expen-
sive if implemented straightforwardly because the
maximum table size τ is typically set large (e.g.,
τ = 108 in word2vec (Mikolov, 2013)). For ac-
celeration, instead of checking all elements in the
unigram table, randomly chosen τ F
z elements are
substituted with wi. Note that τ F
is the expected
z
2This overhead is amortized in mini-batch SGNS if the
mini-batch size is sufficiently large. Our discussion here is
dedicated to efficiently perform the incremental training irre-
spective of the mini-batch size.
number of table elements to be substituted in the
original algorithm. This approximation achieves
great speed-up because we usually have F (cid:28) z.
In fact, it can be proven that it takes O(1) time
when α = 1.0. See Appendix3 A for more discus-
sions.
3.3 Computational complexity
Both incremental and batch SGNS have the same
space complexity, which is independent of the
training data size n. Both require O(W) space
to store the word embeddings and the word fre-
quency counts, and O(T) space to store the uni-
gram table.
The two algorithms also have the same time
complexity. Both require O(n) training time when
the training data size is n. Although incremen-
tal SGNS requires extra time for updating the
dynamic vocabulary and adaptive unigram table,
these costs are practically negligible, as will be
demonstrated in Section 5.3.
4 Theoretical Analysis
Although the extension from batch to incremental
SGNS is simple and intuitive, it is not readily clear
whether incremental SGNS can learn word em-
beddings as well as the batch counterpart. To an-
swer this question, in this section we examine in-
cremental SGNS from a theoretical point of view.
The analysis begins by examining the difference
between the objectives optimized by batch and in-
cremental SGNS (Section 4.1). Then, probabilis-
tic properties of their difference are investigated
to demonstrate the relationship between batch and
incremental SGNS (Sections 4.2 and 4.3). We
shortly touch the mini-batch SGNS at the end of
this section (Section 4.4).
4.1 Objective difference
As discussed in Section 2, batch SGNS optimizes
the following objective:
LB(θ) =− 1
n
wi,wi+j +kEv∼qn(v)[ψ−
ψ+
wi,v],
n(cid:88)
(cid:88)
i=1
j≤c
j(cid:54)=0
where θ = (t1, t2, . . . , tW, c1, c2, . . . , cW) col-
lectively represents the model parameter4 (i.e.,
word embeddings) and qn(v) represents the noise
3The appendices are in the supplementary material.
4We treat words as integers and thus W ={1, 2, . . .W}.
(cid:80)
distribution. Note that the noise distribution is rep-
resented in a different notation than Section 2 to
make its dependence on the whole training data
explicit. The function qi(v) is defined as qi(v) =
fi(v)α
v(cid:48)∈W fi(v(cid:48))α , where fi(v) represents the word
frequency in the first i words of the training data.
In contrast, incremental SGNS computes the
gradient of −ψ+
wi,v] at each
step to perform gradient descent. Note that the
noise distribution does not depend on n but rather
on i. Because it can be seen as a sample approxi-
mation of the gradient of
wi,wi+j − kEv∼qi(v)[ψ−
LI(θ) = − 1
n
wi,wi+j +kEv∼qi(v)[ψ−
ψ+
wi,v],
n(cid:88)
(cid:88)
i=1
j≤c
j(cid:54)=0
objectives can be given as
∆L(θ) = LB(θ) − LI(θ)
incremental SGNS can be interpreted as optimiz-
ing LI(θ) with SGD.
(cid:80)
Since the expectation terms in the objec-
tives can be rewritten as Ev∼qi(v)[ψ−
wi,v] =
v∈W qi(v)ψ−
wi,v, the difference between the two
(cid:88)
n(cid:88)
(cid:88)
(cid:88)
n(cid:88)
n(cid:88)
(cid:88)
(qi(v) − qn(v))ψ−
(qi(v)−qn(v))ψ−
j≤c
j(cid:54)=0
2ck
n
i=1
v∈W
v∈W
1
n
wi,v
wi,v
i=1
k
δwi,w(qi(v) − qn(v))ψ−
w,v
=
=
=
2ck
n
w,v∈W
i=1
where δw,v = δ(w = v) is the delta function.
4.2 Unsmoothed case
Let us begin by examining the objective difference
∆L(θ) in the unsmoothed case, α = 1.0.
The technical difficulty in analyzing ∆L(θ) is
that it is dependent on the word order in the train-
ing data. To address this difficulty, we assume that
the words in the training data are generated from
some stationary distribution. This assumption al-
lows us to investigate the property of ∆L(θ) from
a probabilistic perspective. Regarding the validity
of this assumption, we want to note that this as-
sumption is already taken by the original SGNS:
the probability that the target and context words
co-occur is assumed to be independent of their po-
sition in the training data.
We below introduce some definitions and nota-
tions as the preparation of the analysis.
Definition 1. Let Xi,w be a random variable that
represents δwi,w. It takes 1 when the i-th word in
the training data is w ∈ W and 0 otherwise.
Remind that we assume that the words in the
training data are generated from a stationary dis-
tribution. This assumption means that the expec-
tation and (co)variance of Xi,w do not depend on
the index i. Hereafter, they are respectively de-
noted as E[Xi,w] = µw and V[Xi,w, Xj,v] = ρw,v.
Definition 2. Let Yi,w be a random variable that
represents qi(w) when α = 1.0.
It is given as
Yi,w = 1
i
4.2.1 Convergence of the first and second
i(cid:48)=1 Xi(cid:48),w.
(cid:80)i
order moments of ∆L(θ)
It can be shown that the first order moment of
∆L(θ) has an analytical form.
Theorem 1. The first order moment of ∆L(θ) is
given as
E[∆L(θ)] =
2ck(Hn − 1)
ρw,vψ−
w,v,
n
w,v∈W
(cid:88)
n(cid:88)
(cid:88)
where Hn is the n-th harmonic number.
Sketch of proof. Notice that E[∆L(θ)] can be
written as
2ck
n
Because we have, for any i and j such that i ≤ j,
(cid:0)E[Xi,wYi,v] − E[Xi,wYn,v](cid:1)ψ−
j(cid:88)
w,v∈W
Xj(cid:48),v
w,v.
i=1
E[Xi,wYj,v] =
E[Xi,w
] = µwµv +
ρw,v
,
j
j(cid:48)=1
j
plugging this into E[∆L(θ)] proves the theorem.
See Appendix B.1 for the complete proof.
Theorem 1 readily gives the convergence prop-
erty of the first order moment of ∆L(θ):
Theorem 2. The first-order moment of ∆L(θ) de-
creases in the order of O( log(n)
n ):
(cid:18) log(n)
(cid:19)
,
n
E[∆L(θ)] = O
and thus converges to zero in the limit of infinity:
E[∆L(θ)] = 0.
lim
n→∞
Proof. We have Hn = O(log(n)) from the up-
per integral bound, and thus Theorem 1 gives the
proof.
A similar result to Theorem 2 can be obtained
for the second order moment of ∆L(θ) as well.
Theorem 3. The second-order moment of ∆L(θ)
decreases in the order of O( log(n)
n ):
(cid:18) log(n)
(cid:19)
,
n
E[∆L(θ)2] = O
and thus converges to zero in the limit of infinity:
E[∆L(θ)2] = 0.
lim
n→∞
Proof. Omitted. See Appendix B.2.
4.2.2 Main result
The above theorems reveal the relationship be-
tween the optimal solutions of the two objectives,
as stated in the next lemma.
Lemma 4. Let θ∗ and θ be the optimal solu-
tions of LB(θ) and LI(θ), respectively: θ∗ =
arg minθ LB(θ) and θ = arg minθ LI(θ). Then,
E[LB(θ) − LB(θ∗)] = 0,
V[LB(θ) − LB(θ∗)] = 0.
lim
n→∞
lim
n→∞
(2)
(3)
Proof. The proof is made by the squeeze theorem.
Let l = LB(θ) − LB(θ∗). The optimality of θ∗
gives 0 ≤ l. Also, the optimality of θ gives
l = LB(θ) − LI(θ∗) + LI(θ∗) − LB(θ∗)
≤ LB(θ) − LI(θ) + LI(θ∗) − LB(θ∗)
= ∆L(θ) − ∆L(θ∗).
We thus have 0 ≤ E[l] ≤ E[∆L(θ) − ∆L(θ∗)].
Since Theorem 2 implies that the right hand side
converges to zero when n → ∞, the squeeze the-
orem gives Eq. (2). Next, we have
V[l] =E[l2]−E[l]2≤E[l2]≤E[(∆L(θ)−∆L(θ∗))2]
≤E[(∆L(θ)−∆L(θ∗))2+(∆L(θ)+∆L(θ∗))2]
= 2E[∆L(θ)2] + 2E[∆L(θ∗)2].
(4)
Theorem 3 suggests that Eq. (4) converges to zero
when n → ∞. Also, the non-negativity of the
variance gives 0 ≤ V[l]. Therefore, the squeeze
theorem gives Eq. (3).
(cid:20)
(cid:20)
(cid:21)
(cid:21)
We are now ready to provide the main result of
the analysis. The next theorem shows the conver-
gence of LB(θ).
Theorem 5. LB(θ) converges in probability to
LB(θ∗):
∀ > 0, lim
LB(θ) − LB(θ∗) ≥
(cid:21)
(cid:20)
= 0.
n→∞ Pr
Proof. Let again l = LB(θ) − LB(θ∗). Then,
Chebyshev's inequality gives, for any 1 > 0,
V[l]
2
1
lim
n→∞
≥ lim
n→∞ Pr
l − E[l] ≥ 1
.
Remember that Eq. (2) means that for any 2 > 0,
there exists n(cid:48) such that if n(cid:48) ≤ n then E[l] < 2.
Therefore, we have
V[l]
2
1
lim
n→∞
≥ lim
n→∞ Pr
l ≥ 1 + 2
≥ 0.
The arbitrary property of 1 and 2 allows 1 +
2 to be rewritten as . Also, Eq. (3) implies that
limn→∞
= 0. This completes the proof.
V[l]
2
1
Informally, this theorem can be interpreted as sug-
gesting that the optimal solutions of batch and in-
cremental SGNS agree when n is infinitely large.
4.3 Smoothed case
We next examine the smoothed case (0 < α < 1).
In this case, the noise distribution can be repre-
sented by using the ones in the unsmoothed case:
qi(w) =
(cid:80)
(cid:80)
fi(w)α
Fi
w(cid:48)∈W fi(w(cid:48))α =
where Fi =(cid:80)
w(cid:48)∈W
w(cid:48)∈W fi(w(cid:48)) and fi(w)
Fi
(cid:1)α
(cid:0) fi(w)
(cid:0) fi(w(cid:48))
(cid:1)α
Fi
corresponds
to the noise distribution in the unsmoothed case.
Definition 3. Let Zi,w be a random variable that
represents qi(w) in the smoothed case. Then, it
can be written by using Yi,w:
Zi,w = gw(Yi,1, Yi,2, . . . , Yi,W)
w(cid:80)
xα
w(cid:48) .
w(cid:48)∈W xα
where gw(x1, x2, . . . , xW) =
Because Zi,w is no longer a linear combina-
tion of Xi,w, it becomes difficult to derive simi-
lar proofs to the unsmoothed case. To address this
difficulty, Zi,w is approximated by the first-order
Taylor expansion around
E[(Yi,1, Yi,2, . . . , Yi,W)] = (µ1, µ2, . . . , µW).
The first-order Taylor approximation gives
Zi,w ≈ gw(µ) +
Mw,v(Yi,v − gv(µ))
(cid:88)
v∈W
∂xv
where µ = (µ1, µ2, . . . , µW) and Mw,v =
x=µ. Consequently, it can be shown that
∂gw(x)
the first and second order moments of ∆L(θ) have
the order of O( log(n)
n ) in the smoothed case as
well. See Appendix C for the details.
4.4 Mini-batch SGNS
The same analysis result can also be obtained for
the mini-batch SGNS. We can prove Theorems
2 and 3 in the mini-batch case as well (see Ap-
pendix D for the proof). The other part of the anal-
ysis remains the same.
5 Experiments
Three experiments were conducted to investigate
the correctness of the theoretical analysis (Sec-
tion 5.1) and the practical usefulness of incremen-
tal SGNS (Sections 5.2 and 5.3). Details of the
experimental settings that do not fit into the paper
are presented in Appendix E.
5.1 Validation of theorems
An empirical experiment was conducted to vali-
date the result of the theoretical analysis. Since
it is difficult to assess the main result in Section
4.2.2 directly, the theorems in Sections 4.2.1, from
which the main result is readily derived, were in-
vestigated. Specifically, the first and second order
moments of ∆L(θ) were computed on datasets of
increasing sizes to empirically investigate the con-
vergence property.
Datasets of various sizes were constructed from
the English Gigaword corpus (Napoles et al.,
2012). The datasets made up of n words were
constructed by randomly sampling sentences from
the Gigaword corpus. The value of n was varied
over {103, 104, 105, 106, 107}. 10, 000 different
datasets were created for each size n to compute
the first and second order moments.
Figure 1 (top left) shows log-log plots of the
first order moments of ∆L(θ) computed on the
different sized datasets when α = 1.0. The crosses
and circles represent the empirical values and the-
oretical values obtained by Theorem 1, respec-
tively. Figure 1 (top right) similarly illustrates the
second order moments of ∆L(θ). Since Theo-
rem 3 suggests that the second order moment de-
ample, incremental SGNS (denoted as incremen-
tal) utilized the dynamic vocabulary (c.f., Section
3.2.1) and thus we set the maximum vocabulary
size m to control the vocabulary size. On the other
hand, we set a frequency threshold to determine
the vocabulary size of w2v. We set m = 240k for
incremental, while setting the frequency thresh-
old to 100 for w2v. This yields vocabulary sets of
comparable sizes: 220, 389 and 246, 134.
The learned word embeddings were assessed
on five benchmark datasets commonly used in
the literature (Levy et al., 2015): WordSim353
(Agirre et al., 2009), MEN (Bruni et al., 2013),
SimLex-999 (Hill et al., 2015), the MSR analogy
dataset (Mikolov et al., 2013c), the Google anal-
ogy dataset (Mikolov et al., 2013a). The former
three are for a semantic similarity task, and the
remaining two are for a word analogy task. As
evaluation measures, Spearman's ρ and prediction
accuracy were used in the two tasks, respectively.
Figures 2 (a) and (b) represent the results on the
similarity datasets and the analogy datasets. We
see that the three methods (incremental, batch,
and w2v) perform equally well on all of the
datasets. This indicates that incremental SGNS
can learn as good word embeddings as the batch
counterparts, while being able to perform incre-
mental model update. Although incremental per-
forms slightly better than the batch methods in
some datasets, the difference seems to be a prod-
uct of chance.
The figures also show the results of incremen-
tal SGNS when the maximum vocabulary size m
was reduced to 150k and 100k (incremental-150k
and incremental-100k). The resulting vocabulary
sizes were 135, 447 and 86, 993, respectively. We
see that incremental-150k and incremental-100k
perform comparatively well with incremental, al-
though relatively large performance drops are ob-
served in some datasets (MEN and MSR). This
demonstrates that the Misra-Gries algorithm can
effectively control the vocabulary size.
5.3 Update time
The last experiment investigates how much time
incremental SGNS can save by avoiding re-
training when updating the word embeddings.
In this experiment,
incremental was first
trained on the initial training data of size5 n1 and
then updated on the new training data of size n2 to
5The number of sentences here.
Figure 1: Log-log plots of the first and second
order moments of ∆L(θ) on the different sized
datasets when α = 1.0 (top left and top right) and
α = 0.75 (bottom left and bottom right).
creases in the order of O( log(n)
n ), the graph y ∝
is also shown. The graph was fitted to the
log(x)
x
empirical data by minimizing the squared error.
The top left figure demonstrates that the empiri-
cal values of the first order moments fit the theoret-
ical result very well, providing a strong empirical
evidence for the correctness of Theorem 1. In ad-
dition, the two figures show that the first and sec-
ond order moments decrease almost in the order
of O( log(n)
n ), converging to zero as the data size
increases. This result validates Theorems 2 and 3.
Figures 1 (bottom left) and (bottom right) show
similar results when α = 0.75. Since we do not
have theoretical estimates of the first order mo-
ment when α (cid:54)= 1.0, the graphs y ∝ log(n)
are
shown in both figures. From these, we can again
observe that the first and second order moments
decrease almost in the order of O( log(n)
n ). This
indicates the validity of the investigation in Sec-
tion 4.3. The relatively larger deviations from the
graphs y ∝ log(n)
n , compared with the top right
figure, are considered to be attributed to the first-
order Taylor approximation.
n
5.2 Quality of word embeddings
The next experiment investigates the quality of the
word embeddings learned by incremental SGNS
through comparison with the batch counterparts.
The Gigaword corpus was used for the training.
For the comparison, both our own implementation
of batch SGNS as well as WORD2VEC (Mikolov
et al., 2013c) were used (denoted as batch and
w2v). The training configurations of the three
methods were set the same as much as possible,
although it is impossible to do so perfectly. For ex-
10-610-510-410-310-210-1100102103104105106107108First order momentData size10-610-510-410-310-210-1100102103104105106107108Second order momentData size10-610-510-410-310-210-1100102103104105106107108First order momentData size10-610-510-410-310-210-1100102103104105106107108Second order momentData size(a)
(b)
(c)
Figure 2: (a): Spearman's ρ on the word similarity datasets. (b): Accuracy on the analogy datasets. (c):
Update time when new training data is provided.
measure the update time. For comparison, batch
and w2v were re-trained on the combination of the
initial and new training data. We fixed n1 = 107
and varied n2 over {1×106, 2×106, . . . , 5×106}.
Figure 2 (c) compares the update time of the
three methods across various values of n2. We see
that incremental significantly reduces the update
time. It achieves 10 and 7.3 times speed-up com-
pared with batch and w2v (when n2 = 106). This
represents the advantage of the incremental algo-
rithm, as well as the time efficiency of the dynamic
vocabulary and adaptive unigram table. We note
that batch is slower than w2v because it uses Ada-
Grad, which maintains different learning rates for
different dimensions of the parameter, while w2v
uses the same learning rate for all dimensions.
6 Related Work
Word representations based on distributional se-
mantics have been common (Turney and Pantel,
2010; Baroni and Lenci, 2010). The distribu-
tional methods typically begin by constructing a
word-context matrix and then applying dimen-
sion reduction techniques such as SVD to obtain
high-quality word meaning representations. Al-
though some investigated incremental updating of
the word-context matrix (Yin et al., 2015; Goyal
and Daume III, 2011), they did not explore the re-
duced representations. On the other hand, neural
word embeddings have recently gained much pop-
ularity as an alternative. However, most previous
studies have not explored incremental strategies
(Mikolov et al., 2013a,b; Pennington et al., 2014).
Very recently, Peng et al. (2017) proposed an
incremental learning method of hierarchical soft-
max. Because hierarchical soft-max and negative
sampling have different advantages (Peng et al.,
2017), the incremental SGNS and their method are
complementary to each other. Also, their updating
method needs to scan not only new but also old
training data, and thus is not an incremental algo-
rithm in a strict sense. As a consequence, it poten-
tially incurs the same time complexity as the re-
training. Another consequence is that their method
has to retain the old training data and thus wastes
space, while incremental SGNS can discard old
training examples after processing them.
There are publicly available implementations
for training SGNS, one of the most popular being
WORD2VEC (Mikolov, 2013). However, it does
not support an incremental training method. GEN-
SIM ( Rehurek and Sojka, 2010) also offers SGNS
training. Although GENSIM allows the incremen-
tal updating of SGNS models, it is done in an ad-
hoc manner.
In GENSIM, the vocabulary set as
well as the unigram table are fixed once trained,
meaning that new words cannot be added. Also,
they do not provide any theoretical accounts for
the validity of their training method.
7 Conclusion and Future Work
This paper proposed incremental SGNS and pro-
vided thorough theoretical analysis to demonstrate
its validity. We also conducted experiments to em-
pirically demonstrate its effectiveness. Although
the incremental model update is often required in
practical machine learning applications, only a lit-
tle attention has been paid to learning word em-
beddings incrementally. We consider that incre-
mental SGNS successfully addresses this situation
and serves as an useful tool for practitioners.
The success of this work suggests several re-
search directions to be explored in the future. One
possibility is to explore extending other embed-
ding methods such as GloVe (Pennington et al.,
2014) to incremental algorithms. Such studies
would further extend the potential of word embed-
ding methods.
0.2 0.4 0.6 0.8 1WordSim353MENSimLex999Spearman's ρincrementalincremental-150kincremental-100kbatchw2v 0.2 0.4 0.6 0.8 1GoogleMSRAccuracyincrementalincremental-150kincremental-100kbatchw2v 0 5 10 1512345Update time (103 sec.)Size of new training data (×106)incrementalbatchw2vReferences
Eneko Agirre, Enrique Alfonseca, Keith Hall,
Jana Kravalova, Marius Pasca, and Aitor Soroa.
A study on similarity and relatedness
2009.
using
distributional
ap-
proaches. In Proceedings of NAACL. pages 19–27.
http://www.aclweb.org/anthology/N/N09/N09-
1003.
and wordnet-based
Marco Baroni and Alessandro Lenci. 2010. Dis-
tributional memory: A general
framework for
corpus-based semantics. Computatoinal Linguistics
36:673–721. http://aclweb.org/anthology/J/J10/J10-
4006.
E. Bruni, N. K. Tran, and M. Baroni. 2013. Multi-
modal distributional semantics. Journal of Artificial
Intelligence Research 49:1–49.
Courtney Napoles, Matthew Gormley, and Ben-
jamin Van Durme. 2012. Annotated english giga-
word ldc2012t21.
Hao Peng, Jianxin Li, Yangqiu Song, and Yaopeng Liu.
2017. Incrementally learning the hierarchical soft-
max function for neural language models. In Pro-
ceedings of AAAI (to appear).
Jeffrey Pennington, Richard Socher, and Christopher
Manning. 2014. Glove: Global vectors for word
In Proceedings of EMNLP. pages
representation.
1532–1543. http://www.aclweb.org/anthology/D14-
1162.
Radim Rehurek and Petr Sojka. 2010. Software frame-
work for topic modelling with large corpora. In Pro-
ceedings of the LREC 2010 Workshop on New Chal-
lenges for NLP Frameworks. pages 45–50.
John Duchi, Elad Hazan, and Yoram Singer. 2011.
Adaptive subgradient methods for online learning
Journal of Machine
and stochastic optimization.
Learning Research 12:2121–2159.
Peter D. Turney and Patrick Pantel. 2010. From fre-
quency to meaning: Vector space models of se-
mantics. Journal of Artificial Intelligence Research
37:141–188.
Pavlos S. Efraimidis. 2015. Weighted random sam-
pling over data streams. ArXiv:1012.0256.
Amit Goyal and Hal Daume III. 2011. Approxi-
mate scalable bounded space sketch for large data
In Proceedings of EMNLP. pages 250–261.
nlp.
http://www.aclweb.org/anthology/D11-1023.
Felix Hill, Roi Reichart,
Simlex-999:
and Anna Korho-
Evaluating seman-
similarity estima-
Computational Linguistics 41:665–695.
nen. 2015.
tic models with (genuine)
tion.
http://aclweb.org/anthology/J/J15/J15-4004.
Jeffrey S. Vitter. 1985. Random sampling with a reser-
voir. ACM Transactions on Mathematical Software
11:37–57.
Wenpeng Yin, Tobias Schnabel,
Schutze. 2015.
resentations
Proceedings
http://aclweb.org/anthology/D15-1155.
for part-of-speech tagging.
of EMNLP.
and Hinrich
Online updating of word rep-
In
1329–1334.
pages
Omer Levy, Yoav Goldberg, and Ido Dagan. 2015. Im-
proving distributional similarity with lessons learned
from word embeddings. Transactions of the Asso-
ciation for Computational Linguistics 3:211–225.
https://tacl2013.cs.columbia.edu/ojs/index.php/tacl/article/view/570.
Tomas
Mikolov.
https://code.google.com/archive/p/word2vec.
2013.
word2vec.
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey
Dean. 2013a. Efficient estimation of word represen-
tations in vector space. In Workshop at ICLR.
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Cor-
rado, and Jeff Dean. 2013b. Distributed representa-
tions of words and phrases and their compositional-
ity. In Advances in NIPS. pages 3111–3119.
Tomas Mikolov, Wen-Tau Yih,
and Geof-
regularities
frey Zweig. 2013c.
in
representations.
In Proceedings of NAACL. pages 746–751.
http://www.aclweb.org/anthology/N13-1090.
space word
continuous
Linguistic
Jayadev Misra and David Gries. 1982. Finding re-
peated elements. Science of Computer Program-
ming 2(2):143–152.
A Note on Adaptive Unigram Table
Algorithm 4 illustrates the efficient implementation of the adaptive unigram table (c.f., Section 3.2.2). In
line 8 and 10, F and τ F
z are not always integers and therefore they are probabilistically converted into
integers as explained in the paper.
Time complexity of Algorithm 4 is O(1) per update in case of α = 1.0. When T < τ, the update
(line 8) takes O(1) time since we always have F = 1. When τ ≤ T, we have τ ≤ z and consequently
z ≤ 1. This means that the update (line 10–13) takes O(1) time.
Even if α (cid:54)= 1.0, the value of z becomes sufficiently large in practice, and thus the update becomes
τ F
efficient as demonstrated in the experiment.
f (wi) ← f (wi) + 1
F ← f (wi)α − (f (wi) − 1)α
z ← z + F
if T < τ then
Algorithm 4 Adaptive unigram table.
1: f (w) ← 0 for all w ∈ W
2: z ← 0
3: for i = 1, . . . , n do
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
end if
14:
15: end for
add F copies of wi to T
for t = 1, . . . , τ F
end for
z do
else
j is randomly drawn from [1,T]
T [j] ← wi
B Complete Proofs
This appendix provides complete proofs of Theorems 1, 3, and 5.
B.1 Proof of Theorem 1
Proof. The first order moment of ∆L(θ) can be rewritten as
E[∆L(θ)] = E
δwi,w(qi(v) − qn(v))ψ−
w,v
n
i=1
v∈W
w∈W
(cid:20) 2ck
n(cid:88)
(cid:88)
(cid:88)
n(cid:88)
(cid:88)
(cid:88)
n(cid:88)
(cid:88)
(cid:88)
(cid:18)
n(cid:88)
(cid:88)
(cid:88)
w∈W
w∈W
v∈W
v∈W
i=1
i=1
w∈W
v∈W
i=1
=
=
=
2ck
n
2ck
n
2ck
n
(cid:21)
(cid:19)
E[δwi,w(qi(v) − qn(v))ψ−
w,v]
E[Xi,w(Yi,v − Yn,v)ψ−
w,v]
E[Xi,wYi,v] − E[Xi,wYn,v]
ψ−
w,v.
Here, for any i and j such that i ≤ j, we have
j(cid:88)
j(cid:48)=1
Xj(cid:48),v] =
j(cid:88)
j(cid:48)=1
1
j
E[Xi,wXj(cid:48),v]
(cid:19)
E[Xi,w]E[Xj(cid:48),v] + V[Xi,w, Xj(cid:48),v]
E[Xi,wYj,v] = E[Xi,w
1
j
(cid:18)
j(cid:88)
j(cid:48)=1
=
1
j
Therefore, we have
E[∆L(θ)] =
=
= µwµv +
ρw,v.
1
j
(cid:18)
n(cid:88)
(cid:88)
(cid:88)
i=1
(cid:88)
(cid:88)
2ck
n
v∈W
2ck(Hn − 1)
w∈W
n
w∈W
v∈W
ρw,v − µwµv − 1
n
µwµv +
1
i
ρw,vψ−
w,v.
(cid:19)
ψ−
w,v
ρw,v
B.2 Proof of Theorem 3
To prove Theorem 3, we begin by examining the upper- and lower-bounds of E[Xi,wYj,vYk,v] in the
following Lemma, and then make use of the bounds to evaluate the order of the second order moment of
∆L(θ).
Lemma 6. For any j and k such that j ≤ k, we have
Proof. We have
v + 2j + k − 2
,
E[Xi,wYj,vYk,v] ≤ (jk − 2j − k + 2)µwµ2
E[Xi,wYj,vYk,v] ≥ (jk − 2j − k + 2)µwµ2
(cid:19)(cid:18) 1
E[Xi,wYj,vYk,v] = E[Xi,w
j(cid:88)
Xl,v
jk
jk
v
.
(cid:18) 1
k(cid:88)
j(cid:88)
=
l=1
j
k
E[Xi,wXl,vXm,v]
l=1
m=1
jk
(cid:19)
Xm,v
]
k(cid:88)
m=1
.
To prove the lemma, we rewrite the expression by splitting the set of (l, m) into two subsets. Let S (j,k)
(j ≤ k) be a set of (l, m) such that Xi,w, Xl,v, and Xm,v are independent from each other (i.e., i, l, and
m are all different), and let ¯S (j,k)
be its complementary set:
i
i
i
S (j,k)
¯S (j,k)
i
= {(l, m) ∈ {1, 2, . . . , j} × {1, 2, . . . , k} i (cid:54)= l ∧ l (cid:54)= m ∧ m (cid:54)= i},
= {1, 2, . . . , j} × {1, 2, . . . , k} \ S (j,k)
.
i
Then, E[Xi,wYj,vYk,v] is upper-bounded as
E[Xi,wYj,vYk,v] =
E[Xi,w]E[Xl,v]E[Xm,v]
+
(cid:88)
E[Xi,wXl,vXm,v]
jk
(cid:88)
≤ (cid:88)
(l,m)∈S(j,k)
i
+
µwµ2
v
jk
v + ¯S (j,k)
µwµ2
jk
i
,
(l,m)∈S(j,k)
S (j,k)
i
i
=
jk
(cid:88)
(l,m)∈ ¯S(j,k)
i
(l,m)∈ ¯S(j,k)
i
1
jk
where the inequality holds because Xi,w, Xl,v, and Xm,v are binary random variables and thus
E[Xi,wXl,vXm,v] ≤ 1. Here, we have ¯S (j,k)
includes j elements such that
l = m and also includes k − 1 and j − 1 elements such that i = l (cid:54)= m and i = m (cid:54)= l, respectively.
And we consequently have S (j,k)
= jk − 2j − k + 2. Therefore, the upper-bound can
be rewritten as
= 2j + k − 2, because ¯S (j,k)
= jk − ¯S (j,k)
i
i
i
i
Similarly, by making use of 0 ≤ E[Xi,wXl,vXm,v], the lower-bound can be derived:
E[Xi,wYj,vYk,v] =
E[Xi,w]E[Xl,v]E[Xm,v]
E[Xi,wXl,vXm,v]
E[Xi,wYj,vYk,v] ≤ (jk − 2j − k + 2)µwµ2
(cid:88)
≥ (cid:88)
(l,m)∈S(j,k)
i
jk
(cid:88)
+
µwµ2
v
jk
jk
0
jk
.
v + 2j + k − 2
(cid:88)
+
(l,m)∈ ¯S(j,k)
i
jk
i
(l,m)∈S(j,k)
S (j,k)
µwµ2
jk
v
i
=
=
(l,m)∈ ¯S(j,k)
i
(jk − 2j − k + 2)µwµ2
v
.
jk
Making use the above Lemma, we can prove Theorem 3.
Proof. The upper-bound of E[∆L(θ)2] is examined to prove the theorem. Let Ψi,n,w,v = δwi,w(qi(v) −
qn(v))ψ−
w,v. Making use of Jensen's inequality, we have
E[∆L(θ)2] = E
Furthermore, the term E[Ψ2
E[Ψ2
i,n,w,v] = E[δ2
(cid:19)2(cid:21)
Ψi,n,w,v
(cid:21)
1
W2n
Ψi,n,w,v
(cid:19)2(cid:21)
1
W2n
n2
(cid:20) 4c2k2
(cid:20) 4c2k2
(cid:20) 4c2k2
n2
n2
Ψi,n,w,v
i=1
v∈W
(cid:18)(cid:88)
w∈W
W4n2
(cid:88)
n(cid:88)
(cid:18)(cid:88)
(cid:88)
n(cid:88)
n(cid:88)
(cid:88)
W4n2 (cid:88)
n(cid:88)
(cid:88)
(cid:88)
w∈W
w∈W
v∈W
v∈W
i=1
i=1
E[Ψ2
i,n,w,v].
= E
≤ E
4c2k2W2
=
n
v∈W
i,n,w,v] is upper-bounded as
w∈W
i=1
wi,v(qi(v) − qn(v))2(ψ−
w,v)2]
= E[δwi,v(qi(v) − qn(v))2(ψ−
w,v)2]
= E[Xi,w(Yi,v − Yn,v)2](ψ−
w,v)2
= (E[Xi,wY2
≤
(cid:26) 1
v + 3i − 2
(cid:19)
(cid:18)
(cid:18)
i2
− 2
1
in
1
n2
+
(cid:26)
=
(2µwµ2
+ (2µwµ2
v
(i2 − 3i + 2)µwµ2
(in − 2i − n + 2)µwµ2
(n2 − 3n + 2)µwµ2
v − 2)
i2 + (−µwµ2
v − 2)
1
n2 + (µwµ2
1
v + 3n − 2
(cid:27)
v − 4
n
1
n
v + 3)
(cid:19)(cid:27)
(ψ−
w,v)2
µwµ2
1
i
v + 3)
(ψ−
w,v)2,
i,v] − 2E[Xi,wYi,vYn,v] + E[Xi,wY2
n,v])(ψ−
w,v)2
where the above Lemma is used to derive the inequality. Therefore, we have
n(cid:88)
i=1
E[Ψ2
(cid:26)
i,n,w,v] ≤ n(cid:88)
(cid:26)
i=1
+ (2µwµ2
=
(2µwµ2
(2µwµ2
v − 2)
1
i2 + (−µwµ2
µwµ2
v + 3)
1
i
v − 4
(cid:27)
n
(ψ−
w,v)2
µwµ2
v + 3)Hn
1
n2 + (µwµ2
v − 2)
v + 3)
v − 2)Hn,2 + (−µwµ2
v − 2)
1
n
(cid:27)
v − 4
n
(ψ−
+ (µwµ2
v + 3)
1
n
w,v)2,
+ (2µwµ2
we have(cid:80)n
where Hn,2 represents the generalized harmonic number of order n of 2. Since Hn,2 ≤ Hn = O(log(n)),
E[Ψ2
i,n,w,v] = O(log(n)) and consequently E[∆L(θ)2] = O( log(n)
n ).
i=1
B.3 Proof of Theorem 5
Proof. The proof is made by the squeeze theorem. Let l = LB(θ) − LB(θ∗). Then, Chebyshev's
inequality gives, for any 1 > 0,
V[l]
2
1
lim
n→∞
≥ lim
n→∞ Pr
l − E[l] ≥ 1
= lim
n→∞ Pr
= lim
n→∞ Pr
l − E[l] ≤ −1
+ Pr
1 ≤ l − E[l]
l ≤ E[l] − 1
+ Pr
E[l] + 1 ≤ l
.
(cid:20)
(cid:20)
(cid:20)
(cid:20)
(cid:20)
(cid:20)
(cid:21)
(cid:21)
(cid:21)
(cid:21)
(cid:21)
(cid:21)
(cid:20)
(cid:20)
(cid:20)
(cid:20)
(cid:21)
(cid:21)
(cid:21)
(cid:19)
Remind that Eq. (2) in Lemma 4 means that for any 2 > 0, there exists n(cid:48) such that if n(cid:48) ≤ n then
E[l] < 2. Therefore we have
V[l]
2
1
E[l] + 1 ≤ l
l ≤ E[l] − 1
n→∞ Pr
≥ lim
lim
n→∞
+ Pr
(cid:21)
≥ lim
n→∞ Pr
= lim
n→∞ Pr
l ≤ −2 − 1
+ Pr
2 + 1 ≤ l
l ≥ 1 + 2
≥ 0.
The arbitrary property of 1 and 2 allows 1 + 2 to be rewritten as . Also, Eq. (3) in Lemma 4 implies
that limn→∞
= 0. Therefore, the squeeze theorem gives the proof.
V[l]
2
1
C Theoretical Analysis in Smoothed Case
This appendix investigates the convergence of the first and second order moment of ∆L(θ) in the
smoothed case.
C.1 Convergence of the first order moment of ∆L(θ)
The first order moment of ∆L(θ) in the smoothed case is given as
(cid:88)
(cid:88)
(cid:18)
n(cid:88)
w∈W
v∈W
i=1
E[∆L(θ)] =
2ck
n
E[Xi,wZi,v] − E[Xi,wZn,v]
ψ−
w,v.
Let us investigate E[Xi,wZj,v] as we did E[Xi,wYj,v] in the unsmoothed case. Let φw = gw(µ) −
(cid:80)
v∈W Mw,vgv(µ). Then, for any i and j such that i ≤ j, we have
E[Xi,wZj,v] ≈ E[Xi,w
gv(µ) +
Mv,v(cid:48)(Yj,v(cid:48) − gv(cid:48)(µ))
]
(cid:88)
v(cid:48)∈W
(cid:18)
(cid:88)
v(cid:48)∈W
= E[Xi,w(
Mv,v(cid:48)Yj,v(cid:48) + φv)]
v(cid:48)∈W
(cid:88)
(cid:88)
(cid:88)
v(cid:48)∈W
v(cid:48)∈W
=
=
=
Mv,v(cid:48)E[Xi,wYj,v(cid:48)] + φvE[Xi,w]
Mv,v(cid:48)(µwµv(cid:48) +
1
j
ρw,v(cid:48)) + µwφv
Mv,v(cid:48)µwµv(cid:48) + µwφv +
1
j
Mv,v(cid:48)ρw,v(cid:48).
(cid:88)
v(cid:48)∈W
Therefore, plugging the above equation into E[∆L(θ)] yields E[∆L(θ)] ≈ O( log(n)
n ).
C.2 Convergence of the second order moment of ∆L(θ)
Next, let us examine the convergence of the second order moment of ∆L(θ). This can be confirmed by
inspecting E[Xi,wZj,vZk,v] and then E[Ψ2
i,n,w,v] analogously to the unsmoothed case.
For any i, j, and k such that i ≤ j ≤ k, we have
E[Xi,wZj,vZk,v] ≈ E[Xi,w
Mv,v(cid:48)Yj,v(cid:48) + φv
Mv,v(cid:48)(cid:48)Yk,v(cid:48)(cid:48) + φv
]
(cid:19)
(cid:19)
=
=
v(cid:48)∈W
+
v(cid:48)(cid:48)∈W
(cid:18)(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
(cid:88)
v(cid:48)(cid:48)∈W
v(cid:48)∈W
v(cid:48)∈W
v(cid:48)∈W
+
+
v(cid:48)(cid:48)∈W
(cid:19)(cid:18) (cid:88)
(cid:88)
v(cid:48)(cid:48)∈W
v(cid:48)∈W
v(cid:48)(cid:48)∈W
Mv,v(cid:48)Mv,v(cid:48)(cid:48)E[Xi,wYj,v(cid:48)Yk,v(cid:48)(cid:48)]
Mv,v(cid:48)Mv,v(cid:48)(cid:48)E[Xi,wYj,v(cid:48)Yk,v(cid:48)(cid:48)]
Mv,v(cid:48)φv(µwµv(cid:48) +
1
j
ρw,v(cid:48))
Mv,v(cid:48)(cid:48)φv(µwµv(cid:48)(cid:48) +
1
k
Σw,v(cid:48)(cid:48)) + µwφ2
v.
Mv,v(cid:48)φvE[Xi,wYj,v(cid:48)] +
Mv,v(cid:48)(cid:48)φvE[Xi,wYk,v(cid:48)(cid:48)] + φ2
E[Xi,w]
v
Therefore, we have
E[Ψ2
(cid:18)
i,n,w,v] = E[Xi,w(Zi,v − Zn,v)2]ψ2
Mv,v(cid:48)Mv,v(cid:48)(cid:48)
≈ (cid:88)
(cid:88)
w,v
v(cid:48)(cid:48)∈W
v(cid:48)∈W
− 2E[Xi,wYi,v(cid:48)Yn,v(cid:48)(cid:48)] + E[Xi,wYn,v(cid:48)Yn,v(cid:48)(cid:48)]
ψ2
w,v.
E[Xi,wYi,v(cid:48)Yi,v(cid:48)(cid:48)]
(cid:19)
Using similar bounds to Lemma 3, we also have (cid:80)n
E[Ψ2
i,n,w,v] ≈ O(log(n)) and consequently
i=1
E[∆L(θ)2] ≈ O( log(n)
n ).
D Theoretical Analysis of Mini-batch SGNS
This appendix demonstrates that Theorems 2 and 3 also hold for the mini-batch SGNS, that is, the first
and second order moments of ∆L(θ) are in the order of O( log(n)
n ). We here investigate the mini-batch
setting in which M words, as opposed to a single word in the case of incremental SGNS, are processed
at a time.
Definition 4. Let Y(M )
size is M. Then, it is given as
i,w be a random variable that represents qi(w) when α = 1.0 and the mini-batch
where b(i, M ) = (cid:100) i
Y(M )
i,w = Yb(i,M ),w
M (cid:101) × M. Note that we always have Y(M )
We first examine the first order moment of ∆L(θ) by taking a similar step as the proof of Theorem 1.
The first order moment of ∆L(θ) is given as
n,w = Yn,w and i ≤ b(i, M ).
(cid:19)
j,v ] − E[Xi,wY(M )
(cid:19)
n,v ]
j,v ] − E[Xi,wYn,v]
(cid:19)
− n(cid:88)
1
.
1
n
b(i, M )
i=1
i=1
ψ−
w,v
ψ−
w,v
E[Xi,wY(M )
E[Xi,wY(M )
(cid:18) n(cid:88)
ρw,vψ−
w,v
w∈W
v∈W
w∈W
v∈W
(cid:88)
(cid:88)
(cid:88)
w∈W
1
(cid:18)
(cid:18)
i=1
n(cid:88)
n(cid:88)
(cid:88)
(cid:88)
(cid:88)
≤ n(cid:88)
i=1
v∈W
i=1
b(i, M )
= Hn = O(log(n)),
1
i
(5)
E[∆L(θ)] =
=
=
Because we have
2ck
n
2ck
n
2ck
n
n(cid:88)
i=1
we have E[∆L(θ)] = O( log(n)
n ).
proof of Theorem 3, we have
n(cid:88)
i,n,w,v] ≤ n(cid:88)
(cid:26)
E[Ψ2
Next, we investigate the second order moment of E[∆L(θ)]. Analogously to the last inequality of the
i=1
i=1
+ (2µwµ2
v − 2)
(2µwµ2
v − 2)
v − 4
n
1
b(i, M )2 + (−µwµ2
(cid:27)
(ψ−
v + 3)
w,v)2.
1
n2 + (µwµ2
1
n
µwµ2
v + 3)
1
b(i, M )
Since we have
n(cid:88)
i=1
b(i, M )2 ≤ n(cid:88)
1
i=1
1
i2 = Hn,2 = O(log(n)),
(6)
it can be proven that E[∆L(θ)2] = O( log(n)
n ).
E Experimental Configurations
This appendix details the experimental configurations that are not described in the paper.
E.1 Verification of theorems
The vocabulary set in the Gigaword corpus was reduced to 1000 by converting infrequent words into
the same special tokens because it is expensive to evaluate the expectation terms in ∆L(θ) for a large
vocabulary set.
The parameter θ was set to 100-dimensional vectors each element of which is drawn from [−0.5, 0.5]
uniformly at random. In preliminary experiments we confirmed that the result is not sensitive to the
choice of the parameter value. Note that the same parameter value was used for all n. We set c and k as
c = 5 and k = 5.
The mean µw and covariances ρw,v are required to compute the theoretical value of the first order
moment. They were given as the maximum likelihood estimations from the entire Gigaword corpus.
Parameter
Embedding size
Number negative samples
Subsampling threshold
Subsampling method
Window size
Smoothing parameter α
Value
400
10
1.0 × 10−5
dirty
10
0.75
Table 2: Training configurations. Incremental SGNS used the incrementally-updated frequency for the
subsampling.
E.2 Quality of word embeddings
Table 2 summarizes the training configurations. Those parameter values were used for both incremental
and batch SGNS. The learning rate was set to 0.1 for incremental and batch, which use AdaGrad to
adjust the learning rate. On the other hand, the learning rate of w2v, which uses linear decay function to
adjust the learning rate, was set as the default value of 0.025.
In the word similarity and the analogy tasks, we use tw + cw as an embedding of the word w (Pen-
nington et al., 2014; Levy et al., 2015). The analogy task was performed by using 3CosMul (Levy et al.,
2015).
E.3 Update time
The experiment was conducted on Intel R(cid:13) Xeon R(cid:13) 2GHz CPU. The update time was averaged over five
trials.
|
1804.07331 | 1 | 1804 | 2018-04-19T18:37:40 | Stylistic Variation in Social Media Part-of-Speech Tagging | [
"cs.CL",
"cs.AI"
] | Social media features substantial stylistic variation, raising new challenges for syntactic analysis of online writing. However, this variation is often aligned with author attributes such as age, gender, and geography, as well as more readily-available social network metadata. In this paper, we report new evidence on the link between language and social networks in the task of part-of-speech tagging. We find that tagger error rates are correlated with network structure, with high accuracy in some parts of the network, and lower accuracy elsewhere. As a result, tagger accuracy depends on training from a balanced sample of the network, rather than training on texts from a narrow subcommunity. We also describe our attempts to add robustness to stylistic variation, by building a mixture-of-experts model in which each expert is associated with a region of the social network. While prior work found that similar approaches yield performance improvements in sentiment analysis and entity linking, we were unable to obtain performance improvements in part-of-speech tagging, despite strong evidence for the link between part-of-speech error rates and social network structure. | cs.CL | cs |
Stylistic Variation in Social Media Part-of-Speech Tagging
Murali Raghu Babu Balusu and Taha Merghani and Jacob Eisenstein
School of Interactive Computing
Georgia Institute of Technology
Atlanta, GA, USA
{b.murali, tmerghani3, jacobe}@gatech.edu
Abstract
Social media features substantial stylistic vari-
ation, raising new challenges for syntactic
analysis of online writing. However, this vari-
ation is often aligned with author attributes
such as age, gender, and geography, as well
as more readily-available social network meta-
data.
In this paper, we report new evidence
on the link between language and social net-
works in the task of part-of-speech tagging.
We find that tagger error rates are correlated
with network structure, with high accuracy in
some parts of the network, and lower accu-
racy elsewhere. As a result, tagger accuracy
depends on training from a balanced sample
of the network, rather than training on texts
from a narrow subcommunity. We also de-
scribe our attempts to add robustness to stylis-
tic variation, by building a mixture-of-experts
model in which each expert is associated with
a region of the social network. While prior
work found that similar approaches yield per-
formance improvements in sentiment analysis
and entity linking, we were unable to obtain
performance improvements in part-of-speech
tagging, despite strong evidence for the link
between part-of-speech error rates and social
network structure.
Introduction
1
Social media feature greater diversity than the for-
mal genres that constitute classic datasets such as
the Penn Treebank (Marcus et al., 1993) and the
Brown Corpus (Francis and Kucera, 1982): there
are more authors, more kinds of authors, more var-
ied communicative settings, fewer rules, and more
stylistic variation (Baldwin et al., 2013; Eisen-
stein, 2013). Previous work has demonstrated
precipitous declines in the performance of state-
of-the-art systems for core tasks such as part-of-
speech tagging (Gimpel et al., 2011) and named-
entity recognition (Ritter et al., 2010) when these
systems are applied to social media text, and
stylistic diversity seems the likely culprit. How-
ever, we still lack quantitative evidence of the role
played by language variation in the performance
of NLP systems in social media, and existing so-
lutions to this problem are piecemeal at best. In
this paper, we attempt to address both issues: we
quantify the impact of one form of sociolinguistic
variation on part-of-speech tagging accuracy, and
we design a model that attempts to adapt to this
variation.
Our contribution focuses on the impact of lan-
guage variation that is aligned with one or more
social networks among authors on the microblog-
ging platform Twitter. We choose Twitter because
language styles in this platform are particularly di-
verse (Eisenstein et al., 2010), and because mod-
erately large labeled datasets are available (Gim-
pel et al., 2011; Owoputi et al., 2013). We choose
social networks for several reasons. First, they
can readily be obtained from both metadata and
behavioral traces on multiple social media plat-
forms (Huberman et al., 2008). Second, social net-
works are strongly correlated with "demographic"
author-level variables such as age (Rosenthal and
McKeown, 2011), gender (Eckert and McConnell-
Ginet, 2003), race (Green, 2002), and geogra-
phy (Trudgill, 1974), thanks to the phenomenon
of homophily, also known as assortative mix-
ing (McPherson et al., 2001; Al Zamal et al.,
2012). These demographic variables are in turn
closely linked to language variation in American
English (Wolfram and Schilling-Estes, 2005), and
have been shown to improve some document clas-
sification tasks (Hovy, 2015). Third, there is grow-
ing evidence of the strong relationship between
social network structures and language variation,
even beyond the extent to which the social network
acts as a proxy for demographic attributes (Milroy,
1991; Dodsworth, 2017).
To measure the impact of socially-linked lan-
guage variation, we focus on part-of-speech tag-
ging, a fundamental task for syntactic analysis.
First, we measure the extent to which tagger per-
formance is correlated with network structure,
finding that tagger performance on friends is sig-
nificantly more correlated than would be expected
by chance. We then design alternative training and
test splits that are aligned with network structure,
and find that test set performance decreases in this
scenario, which corresponds to domain adaptation
across social network communities. This speaks
to the importance of covering all relevant social
network communities in training data.
We then consider how to address the prob-
lem of language variation, by building social
awareness into a recurrent neural tagging model.
Our modeling approach is inspired by Yang and
Eisenstein (2017), who train a mixture-of-experts
for sentiment analysis, where the expert weights
are computed from social network node embed-
dings. But while prior work demonstrated im-
provements in sentiment analysis and information
extraction (Yang et al., 2016), this approach does
not yield any gains on part-of-speech tagging. We
conclude the paper by briefly considering possi-
ble reasons for this discrepancy, and propose ap-
proaches for future work in social adaptation of
syntactic analysis.1
2 Data
We use the corrected2 OCT27 dataset from Gim-
pel et al. (2011) and Owoputi et al. (2013) as our
training set, which contains part-of-speech anno-
tations for 1,827 tweets sampled from Oct 27-28,
2010. We use the train and dev splits of OCT27
as our training dataset and the test split of OCT27
dataset as our validation dataset. The DAILY547
dataset from Owoputi et al. (2013) which has 547
tweets is used for evaluation. Table 2 specifies the
number of tweets and tokens in each dataset. The
tagset for this dataset is explained in Owoputi et al.
(2013); it differs significantly from the Penn Tree-
bank and Universal Dependencies tagsets.
In September 2017, we extracted author IDs
for each of the tweets and constructed three au-
thor social networks based on the follow, mention,
and retweet relations between the authors in the
1Code for rerunning the experiments is available here:
https://github.com/bmurali1994/socialnets postagging
2Owoputi et al. corrected inconsistencies in the ground
labeling of that/this in 100 (about 0.4%) total labels.
Dataset
OCT27
DAILY547
#Msg.
1,827
547
#Tok.
26,594
7,707
Table 1: Annotated datasets: number of messages
and tokens
Network #Authors
Follow
Mention
Retweet
1,280
1,217
1,154
#Nodes
905,751
384,190
182,390
#Edges
1,239,358
623,754
314,381
Table 2: Statistics for each social network
dataset, which we refer to as follow, mention and
retweet networks in Table 2. Specifically, we use
the Twitter API to crawl the friends of the OCT27
and DAILY547 users (individuals that they follow)
and the most recent 3,200 tweets in their timelines.
The mention and retweet links are then extracted
from the tweet text and metadata. Table 2 specifies
the total number of authors (whose tweets exist
in our dataset) in each network, the total number
of nodes and the total number of relations among
these nodes. We treat all social networks as undi-
rected graphs, where two users are socially con-
nected if there exists at least one social relation
between them. Several authors of the tweets can
no longer be queried from Twitter, possibly be-
cause their accounts have been deleted. They are
not included in the network, but their tweets are
still used for training and evaluation.
3 Linguistic Homophily
The hypothesis of linguistic homophily is that
socially connected individuals tend to use lan-
guage similarly, as compared to randomly selected
pairs of individuals who are not socially con-
nected (Yang and Eisenstein, 2017). We now de-
scribe two pilot studies that test this hypothesis.
3.1 Assortativity
We test whether errors in POS tagging are assorta-
tive on the social networks defined in the previous
section: that is, if two individuals (i, j) are con-
nected in the network, then a model's error on the
tweets of author i suggests that the errors on the
tweets of author j are more likely. To measure as-
sortativity, we compute the average difference in
the tagger's per-token accuracy on tweets for au-
(a) Most-common-tag baseline tagger
(b) Pre-trained MEMM tagger from Owoputi et al. (2013).
Figure 1: Average of the squared difference in tagging accuracy on observed (red) and randomized net-
works (blue).
thors i and j, averaged over all connected pairs in
the network. This measures whether classification
errors are related on the network structure.
We compare the observed assortativity against
the assortativity in a network that has been ran-
domly rewired. Each rewiring epoch involves a
number of random rewiring operations equal to the
total number of edges in the network. The edges
are randomly selected, so a given edge may not be
rewired in each epoch; furthermore, the degree of
each node is preserved throughout. If the squared
difference in accuracy is lower for the observed
networks than for their rewired counterparts, this
would indicate that tagger accuracy is correlated
with network structure. Figure 2 explains the met-
ric and rewiring briefly through an example.
We compute the assortativity for three taggers:
• We first use a naıve tagger, which predicts
the most common tag seen during training if
the word exists in the vocabulary, and oth-
erwise predicts the the most common tag
for an unseen word. Preprocessing of each
tweet involves lowercasing, normalizing all
@-mentions to h@M EN T IONi, and nor-
malizing URLs and email addresses to a com-
mon token (e.g. http : //bit.ly/dP 8rR8 ⇒
hU RLi).
Figure 2: Toy example: differences in tagging ac-
curacy on original and randomly-rewired network.
• We train a lexical, feature-rich CRF model.
Lexical features in the CRF model include
the word, previous two words, next
two
words, prefixes and suffixes of the previ-
ous two, current and next two words, and
flags for special characters like hyphen, at-
mention, hashtag, hyphen and digits in the
current word.
• Finally, we repeat these experiments with the
pretrained maximum entropy Markov model
(MEMM) tagger from (Owoputi et al., 2013),
trained on OCT27 tweets.
Figure 1 shows the results for the naıve tagger
and the MEMM tagger; the results were similar
for the CRF were similar. Tagger accuracy is well
correlated with network structure in the mention
and retweet graphs, consistent with the hypothe-
sis of linguistic homophily. These findings sup-
port prior work suggesting that "behavioral" social
networks such as mentions and retweets are more
meaningful than "articulated" networks like the
follower graph (Huberman et al., 2008; Puniyani
et al., 2010).
3.2 Clustering
Next, we examine whether linguistic homophily
can lead to mismatches between the test and train-
ing data. We embed each author's social network
position into a vector representation of dimension
Dv, using the LINE method for social network
node embedding (Tang et al., 2015). These em-
beddings are obtained solely from the social net-
work, and not from the text.
We obtain Dv = 50-dimensional node embed-
dings, and apply k-means clustering (Hartigan and
Wong, 1979) to obtain two sets of authors (train
and test). By design, the training and test sets will
be in different regions of the network, so train-
ing and test authors will be unlikely to be socially
connected. We then train the lexical CRF tagger
on the training set, and apply it to the test set.
The same setup is then applied to a randomly-
selected training/test split, in which the social net-
work structure is ignored. This comparison is il-
lustrated in Figure 3. We repeat this experiment
for 10 times for all three social networks: follow,
mention and retweet.
The theory of linguistic homophily implies that
the test set performance should be worse in the
case that the test set and training sets are drawn
from different parts of the network, since the lin-
guistic style in the training set will not match the
test data. In contrast, when the training and test
sets are drawn in a manner that is agnostic to net-
work structure, the training and test sets are ex-
pected to be more linguistically similar, and there-
fore, test set performance should be better. As
shown in Table 3, the results support the theory:
predictive accuracy is higher when the test and
training sets are not drawn from different parts of
the network.
4 Adapting to socially-linked variation
In this section, we describe a neural network
method that leverages social network informa-
Network Network clusters Random
83.83%
Follow
83.07%
Mention
Retweet
83.52%
82.01%
81.40%
81.01%
Table 3: Comparison of tagger accuracy using
network-based and random training/test splits
tion to improve part-of-speech tagging. We em-
ploy the Social Attention neural network architec-
ture, where the system prediction is the weighted
combination of the outputs of several basis mod-
els (Yang and Eisenstein, 2017). We encour-
age each basis model to focus on a local re-
gion of the social network, so that classification
on socially connected individuals employs simi-
lar model combinations. This allows sharing of
strength for some similar properties between these
network components.
In this architecture, each prediction is the
weighted combination of the outputs of several
basis models. Given a set of labeled instances
{xi, yi} and authors {ai}, the goal of personalized
probabilistic classification is to estimate a condi-
tional label distribution p(y x, a). We condition
on the author a by modeling the conditional label
distribution as a mixture over the posterior distri-
butions of K basis taggers,
p(y x, a) =
K
X
k=1
πa,k × pk(y x)
(1)
The basis taggers pk(y x) can be arbitrary
conditional distributions. We use a hierarchical
recurrent neural network model,
in addition to
a tag dictionary and Brown cluster surface fea-
tures (Brown et al., 1992), which we describe in
more detail in § 4.2. The component weighting
distribution πa,k is conditioned on the social net-
work G, and functions as an attentional mecha-
nism, described in § 4.1. The main idea is that for
a pair of authors ai and aj who are nearby in the
social network G, the prediction rules should be-
have similarly if the attentional distributions are
similar, i.e., πai,k ≈ πaj ,k. If we have labeled
training data for ai and wish to make predictions
on author aj, some of the personalization from ai
will be shared by aj. The overall classification ap-
proach can be viewed as a mixture of experts (Ja-
cobs et al., 1991), leveraging the social network
Figure 3: (left) Network-aligned train/test split and (right) random train/test split
as side information to choose the distribution over
experts for each author.
4.1 Social Attention Model
The goal of the social attention model is to assign
similar basis weights to authors who are nearby
in the social network G. We operationalize so-
cial proximity by embedding each author's so-
cial network position into a vector representation,
again using the LINE method for node embed-
ding (Tang et al., 2015). The resulting embeddings
va are treated as fixed parameters in a probabilis-
tic model over edges in the social network. These
embeddings are learned solely from the social net-
work G, without leveraging any textual informa-
tion. The attentional weights are then computed
from the embeddings using a softmax layer,
πa,k =
PK
exp(φk · va + bk)
k0 exp(φk0 · va + bk0 )
.
(2)
The parameters φk and bk are learned in the
model. We observed that almost 50% of the au-
thors in our dataset do not appear in any social
network. For all these authors, we use the same
embedding v0 to let the model learn the proportion
weight of the individual basis models in the en-
semble. This embedding v0 is also learned as a pa-
rameter in the model. We have also tried comput-
ing the attentional weights using a sigmoid func-
tion,
πa,k = σ(φk · va + bk),
(3)
so that πa is not normalized, but the results were
quite similar.
4.2 Modeling Surface Features
We use surface-level features in addition to the
basis models to improve the performance of our
model closer to the state-of-the-art results. Specif-
ically, we use the tag dictionary features and the
Brown cluster features as described by Gimpel
et al. (2011).
Since Brown clusters are hierarchical in a bi-
nary tree, each word is associated with a tree path
represented as a bitstring with length ≤ 16; we
use prefixes of the bitstring as features (for all pre-
fix lengths ∈ {2, 4, 6, ..., 16}). Concatenating the
Brown cluster features of the previous and next to-
ken along with the current token helped improve
the performance of the baseline model.
We also used the tag dictionary features from
Gimpel et al. (2011), by adding features for a
word's most frequent part-of-speech tags from
Penn Treebank and Universal Dependencies. This
also helped improve the performance of the base-
line model. We found these surface features to be
vital. Nonetheless, we were not able to match the
performance of the state-of-the-art systems.
4.3 POS tagging with Hierarchical LSTMs
We next describe the baseline model: pk(y x).
The baseline model is a word-level bi-LSTM, with
a character-level bi-LSTM to compute the embed-
dings of the words (Ling et al., 2015).
In addi-
tion to the embeddings from the character level bi-
LSTM, we also learn the word embeddings which
are initialized randomly and also use fixed pre-
trained GloVe Twitter (Pennington et al., 2014)
embeddings for the word-level bi-LSTM. The fi-
nal input to the word-level LSTM is the concate-
nation of the embedding from the character level,
learned word embedding and the fixed pretrained
word embedding. The final hidden state for each
word hi is obtained and concatenated with the sur-
face features for each word sk
i , and the result is
passed through a fully connected neural network,
i . The conditional
giving a latent representation rk
probability is then computed as,
pk(yi = t xi) =
i + ct)
exp(βt · rk
Pt0 exp(βt0 · rk
i + ct0 )
.
(4)
4.4 Loss Function and Training
We train the ensemble model by minimizing the
negative log likelihood of the tags for all the to-
kens in all the tweets in the training dataset.
Alternative objectives We have also tried train-
ing the model using a hinge loss, but the results
were similar and hence excluded in the paper.
We also explored a variational autoencoder (VAE)
framework (Kingma and Welling, 2014), in which
the node embeddings were modeled with a latent
vector z, which was used both to control the mix-
ture weights πk, and to reconstruct the node em-
beddings. Again, results were similar to those ob-
tained with the simpler negative log-likelihood ob-
jective.
Training problems One potential problem with
this framework is that after initialization, a small
number of basis models may claim most of the
mixture weights for all the users, while other basis
models are inactive. This can occur because some
basis models may be initialized with parameters
that are globally superior. As a result, the "dead"
basis models will receive near-zero gradient up-
dates, and therefore can never improve. Care-
ful initialization of the parameters φk and bk and
using L2-regularization parameters of the model
helped mitigate the issue to some extent. Using
the attentional weights computed using the sig-
moid function as described in Equation 3 does not
have this problem, but the final evaluation results
were quite similar to the model with attentional
weights computed using softmax as mentioned in
Equation 2.
5 Experiments
Our
evaluation focuses on the DAILY547
dataset (Owoputi et al., 2013). We train our
system on the train and dev splits of the OCT27
dataset (Gimpel et al., 2011) and use the test
split of OCT27 as our validation dataset and
evaluate on the DAILY547 dataset. Accuracy of
the tokens is our evaluation metric for the model.
We compare our results to our baseline model
and the state of the art results on the Twitter
OCT27+Daily547 dataset.
5.1 Experimental Settings
We use 100-dimensional pretrained Twitter GloVe
embeddings (Pennington et al., 2014) which are
System
Owoputi et. al.
BiLSTM tagger
Ensemble of BiLSTM taggers
BiLSTM taggers with social attention
Accuracy
92.80%
90.50%
90.11%
89.80%
Table 4: Accuracy of the models on the DAILY547
dataset. The best results are in bold.
Network Accuracy
89.42%
Follow
Mention
89.80%
89.65%
Retweet
Table 5: Accuracy of the social attention model,
across each of the three networks.
trained on about two billion tweets. We use one-
layer for both the character-level and the word-
level bi-LSTM model with hidden state sizes of 50
and 150 dimensions respectively. The dimensions
of character embeddings is set to be 30 and the
learned word embeddings is 50. We use tanh acti-
vation functions all throughout the model and use
Xavier initialization (Glorot and Bengio, 2010)
for the parameters. The model is trained with
ADAM optimizer (Kingma and Ba, 2014) on L2-
regularized negative log-likelihood. The regular-
ization strength was set to 0.01, and the dropout
was set to 0.35. The best hyper-parameters for the
number of basis classifiers is K = 3 for the follow
and mention networks, and K = 4 for the retweet
network.
5.2 Results and Discussion
Table 4 summarizes the main empirical findings,
where we report results from author embeddings
trained on the mention network for Social Atten-
tion. The results of different social networks with
Social Attention is shown in Table 5.
We also evaluate the performance of the trained
Social Attention model on the subset of authors
who can be located in the social network. The ac-
curacy on these authors is similar to the overall
performance on the full dataset. We also observe
the attention distributions of the authors in the so-
cial network on the basis models in the ensemble.
For every pair of authors ai and aj connected in
the social network we compute Σkπai,k − πaj ,k
and average it across all pairs in the network. This
Network Actual Network Random
Follow
Mention
Retweet
1.10
1.06
0.68
0.90
0.38
0.36
Table 6: Comparison of the mean absolute dif-
ference in attention distributions of connected au-
thors in actual social networks versus randomly
rewired networks.
is compared with against a randomly rewired net-
work.
If this value is lower for the social net-
work, then this indicates that the connected au-
thors tend to have similar attentional distributions
as explained in § 4. The results are presented in
Table 6. These results clearly indicate that the au-
thors who are connected in the social network tend
to have similar attentional distributions.
While the analyses in § 3 indicated a strong de-
gree of linguistic homophily, we do not observe
any significant gain in performance. We think the
following factors played an important role:
Missing authors. There are a large number of
missing authors in each of the social network
(about 50% of the authors of the tweets in
the dataset). The results from combining all
the three social networks by just concatenat-
ing this embeddings did not help either in our
experiments.
Tweets per author. We have only one tweet for
every author in our dataset and this makes it
harder for the model to extract relations be-
tween authors and their tweets.
Dataset size. The dataset contains only 2374
tweets, which could be the reason our deep
learning model is still behind the feature-rich
Markov Model of Owoputi et al. (2013) by
about 2%.
Sparse social networks. The
social
networks
that we constructed using the twitter IDs
from the tweet metadata of the OCT27 and
DAILY547 datasets were very sparse, and
the node degree distributions (number of
edges per node) have high variance.
6 Related Work
Previous problems on incorporating social rela-
tions have focused on sentiment analysis and en-
tity linking, where the existence of social relations
between users is considered as a clue that the sen-
timent polarities in the messages from the users
should be similar or the entities that they refer to
in their messages are the same. Speriosu et al.
(2011) constructs a heterogeneous network with
tweets, users, and n-grams as nodes, and the senti-
ment label distributions associated with the nodes
are refined by performing label propagation over
social relations. Tan et al. (2011) and Hu et al.
(2013) leverage social relations for sentiment anal-
ysis by exploiting a factor graph model and the
graph Laplacian technique respectively, so that the
tweets belonging to social connected users share
similar label distributions. Yang et al. (2016) pro-
posed a neural based structured learning architec-
ture for tweet entity linking, leveraging the ten-
dency of socially linked individuals to share simi-
lar interests on named entities - the phenomenon
of entity homophily. Yang and Eisenstein (2017)
proposed a middle ground between group-level
demographic characteristics and personalization,
by exploiting social network structure. We extend
this work by applying it for the first time to syn-
tactic analysis.
7 Conclusion
This paper describes the hypothesis of linguistic
homophily specifically linked to stylistic variation
on social media data and tests the effectiveness
of social attention to overcome language varia-
tion, leveraging the tendency of socially proxi-
mate individuals to use language similarly for POS
tagging. While our preliminary analyses demon-
strate a strong correlation between tagging accu-
racy and network structure, we are unable to lever-
age these correlations for improvements in tagging
accuracy.
How should we reconcile these conflicting re-
sults? In the limit of infinite resources, we could
train separate taggers for separate treebanks, fea-
turing each language variety. But even if language
variation is strongly associated with the network
structure, the effectiveness of this approach would
still be limited by the inherent difficulty of tagging
each language variety. In other words, augment-
ing the tagger with social network metadata may
not help much, because some parts of the network
may simply be harder to tag than others. However,
this pessimistic conclusion must be offset by not-
ing the small size of existing annotated datasets for
social media writing, which are orders of magni-
tude smaller than comparable corpora of newstext.
While some online varieties maybe hard to tag
well, it is equally possible that the advantages of
more flexible modeling frameworks only become
visible when there is sufficient data to accurately
estimate them. We are particularly interested to
explore the utility of semi-supervised techniques
for training such models in future work.
References
Faiyaz Al Zamal, Wendy Liu, and Derek Ruths. 2012.
Homophily and latent attribute inference: Inferring
latent attributes of Twitter users from neighbors. In
Proceedings of the International Conference on Web
and Social Media (ICWSM). pages 387–390.
Timothy Baldwin, Paul Cook, Marco Lui, Andrew
MacKinlay, and Li Wang. 2013. How noisy social
media text, how diffrnt social media sources. In Pro-
ceedings of the 6th International Joint Conference
on Natural Language Processing (IJCNLP 2013).
pages 356–364.
Peter F Brown, Peter V Desouza, Robert L Mercer,
Vincent J Della Pietra, and Jenifer C Lai. 1992.
Class-based n-gram models of natural
language.
Computational linguistics 18(4):467–479.
Robin Dodsworth. 2017. Migration and dialect con-
tact. Annual Review of Linguistics 3(1):331–346.
P. Eckert and S. McConnell-Ginet. 2003. Language
and Gender. Cambridge Textbooks in Linguistics.
Cambridge University Press.
Jacob Eisenstein. 2013. What to do about bad language
on the internet. In Proceedings of the North Amer-
ican Chapter of the Association for Computational
Linguistics (NAACL). pages 359–369.
Jacob Eisenstein, Brendan O'Connor, Noah A. Smith,
and Eric P. Xing. 2010. A latent variable model for
geographic lexical variation. In Proceedings of Em-
pirical Methods for Natural Language Processing
(EMNLP). pages 1277–1287.
W Francis and Henry Kucera. 1982. Frequency analy-
sis of English usage. Houghton Mifflin Company.
Kevin Gimpel, Nathan Schneider, Brendan O'Connor,
Dipanjan Das, Daniel Mills,
Jacob Eisenstein,
Michael Heilman, Dani Yogatama, Jeffrey Flanigan,
and Noah A Smith. 2011. Part-of-speech tagging for
twitter: Annotation, features, and experiments. ACL
pages 42–47.
Xavier Glorot and Yoshua Bengio. 2010. Understand-
ing the difficulty of training deep feedforward neural
networks. In Yee Whye Teh and Mike Titterington,
editors, Proceedings of the Thirteenth International
Conference on Artificial Intelligence and Statistics.
PMLR, Chia Laguna Resort, Sardinia, Italy, vol-
ume 9 of Proceedings of Machine Learning Re-
search, pages 249–256.
L.J. Green. 2002. African American English: A Lin-
guistic Introduction. Cambridge University Press.
J. A. Hartigan and M. A. Wong. 1979. A k-means
JSTOR: Applied Statistics
clustering algorithm.
28(1):100–108.
Dirk Hovy. 2015. Demographic factors improve clas-
sification performance. ACL pages 752–762.
Xia Hu, Lei Tang, Jiliang Tang, and Huan Liu. 2013.
Exploiting social relations for sentiment analysis in
microblogging.
In Proceedings of the Sixth ACM
International Conference on Web Search and Data
Mining. ACM, New York, NY, USA, WSDM '13,
pages 537–546.
Bernardo A. Huberman, Daniel M. Romero, and Fang
Wu. 2008. Social networks that matter: Twitter un-
der the microscope. CoRR abs/0812.1045.
Robert A. Jacobs, Michael I. Jordan, Steven J. Nowlan,
and Geoffrey E. Hinton. 1991. Adaptive mixtures of
local experts. Neural Comput. 3(1):79–87.
Diederik P. Kingma and Jimmy Ba. 2014. Adam:
CoRR
A method for stochastic optimization.
abs/1412.6980.
Diederik P Kingma and Max Welling. 2014. Auto-
encoding variational bayes.
In Proceedings of the
International Conference on Learning Representa-
tions (ICLR).
Wang Ling, Chris Dyer, Alan W Black, Isabel Tran-
coso, Ramon Fermandez, Silvio Amir, Luis Marujo,
and Tiago Luis. 2015. Finding function in form:
Compositional character models for open vocab-
ulary word representation.
Proceedings of Em-
pirical Methods for Natural Language Processing
(EMNLP) pages 1520–1530.
Mitchell P. Marcus, Mary Ann Marcinkiewicz, and
Beatrice Santorini. 1993. Building a large annotated
corpus of English: The Penn Treebank. Computa-
tional Linguistics 19(2):313–330.
Miller McPherson, Lynn Smith-Lovin, and James M
Cook. 2001. Birds of a feather: Homophily in social
networks. Annual review of sociology 27(1):415–
444.
Lesley Milroy. 1991. Language and Social Networks.
Wiley-Blackwell, 2 edition.
Olutobi Owoputi, Brendan O'Connor, Chris Dyer,
Kevin Gimpel, Nathan Schneider, and Noah A
Smith. 2013.
Improved part-of-speech tagging for
online conversational text with word clusters. Pro-
ceedings of North American Association for Compu-
tational Linguistics (NAACL) .
Jeffrey Pennington, Richard Socher, and Christo-
pher D. Manning. 2014. Glove: Global vectors
for word representation.
In Proceedings of Em-
pirical Methods for Natural Language Processing
(EMNLP). pages 1532–1543.
Kriti Puniyani, Jacob Eisenstein, Shay Cohen, and
Eric P. Xing. 2010. Social links from latent topics
in microblogs. In Proceedings of NAACL Workshop
on Social Media. Los Angeles.
Alan Ritter, Colin Cherry, and Bill Dolan. 2010. Un-
supervised modeling of twitter conversations.
In
Human Language Technologies: The 2010 Annual
Conference of the North American Chapter of the
Association for Computational Linguistics. Associ-
ation for Computational Linguistics, Stroudsburg,
PA, USA, HLT '10, pages 172–180.
Sara Rosenthal and Kathleen McKeown. 2011. Age
prediction in blogs: A study of style, content, and
online behavior in pre-and post-social media genera-
tions. In Proceedings of the 49th Annual Meeting of
the Association for Computational Linguistics: Hu-
man Language Technologies-Volume 1. Association
for Computational Linguistics, pages 763–772.
Michael Speriosu, Nikita Sudan, Sid Upadhyay, and Ja-
son Baldridge. 2011. Twitter polarity classification
with label propagation over lexical links and the fol-
lower graph. In Proceedings of the First Workshop
on Unsupervised Learning in NLP. Association for
Computational Linguistics, Stroudsburg, PA, USA,
EMNLP '11, pages 53–63.
Chenhao Tan, Lillian Lee, Jie Tang, Long Jiang, Ming
Zhou, and Ping Li. 2011. User-level sentiment anal-
ysis incorporating social networks. In Proceedings
of the 17th ACM SIGKDD International Conference
on Knowledge Discovery and Data Mining. ACM,
New York, NY, USA, KDD '11, pages 1397–1405.
Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun
Yan, and Qiaozhu Mei. 2015. Line: Large-scale in-
formation network embedding. In WWW. ACM.
Peter Trudgill. 1974. Linguistic change and diffusion:
description and explanation in sociolinguistic dialect
geography. Language in Society 3(2):215246.
Walt Wolfram and Natalie Schilling-Estes. 2005.
American English: dialects and variation. Wiley-
Blackwell, second edition.
Yi Yang, Ming-Wei Chang, and Jacob Eisenstein.
2016. Toward socially-infused information extrac-
tion: Embedding authors, mentions, and entities. In
Proceedings of Empirical Methods for Natural Lan-
guage Processing (EMNLP).
Yi Yang and Jacob Eisenstein. 2017. Overcoming lan-
guage variation in sentiment analysis with social at-
tention. Transactions of the Association for Compu-
tational Linguistics (TACL) 5.
|
1909.09524 | 1 | 1909 | 2019-09-20T14:16:27 | Pivot-based Transfer Learning for Neural Machine Translation between Non-English Languages | [
"cs.CL",
"cs.LG"
] | We present effective pre-training strategies for neural machine translation (NMT) using parallel corpora involving a pivot language, i.e., source-pivot and pivot-target, leading to a significant improvement in source-target translation. We propose three methods to increase the relation among source, pivot, and target languages in the pre-training: 1) step-wise training of a single model for different language pairs, 2) additional adapter component to smoothly connect pre-trained encoder and decoder, and 3) cross-lingual encoder training via autoencoding of the pivot language. Our methods greatly outperform multilingual models up to +2.6% BLEU in WMT 2019 French-German and German-Czech tasks. We show that our improvements are valid also in zero-shot/zero-resource scenarios. | cs.CL | cs | Pivot-based Transfer Learning for Neural Machine Translation
between Non-English Languages
Yunsu Kim1∗ Petre Petrov1,2∗ Pavel Petrushkov2 Shahram Khadivi2 Hermann Ney1
1RWTH Aachen University, Aachen, Germany
{surname}@cs.rwth-aachen.de
{petrpetrov,ppetrushkov,skhadivi}@ebay.com
2eBay, Inc., Aachen, Germany
9
1
0
2
p
e
S
0
2
]
L
C
.
s
c
[
1
v
4
2
5
9
0
.
9
0
9
1
:
v
i
X
r
a
Abstract
We present effective pre-training strategies
for neural machine translation (NMT) using
parallel corpora involving a pivot language,
i.e., source-pivot and pivot-target, leading to
a significant improvement in source→target
translation. We propose three methods to
increase the relation among source, pivot,
and target
languages in the pre-training:
1) step-wise training of a single model for
different language pairs, 2) additional adapter
component to smoothly connect pre-trained
encoder and decoder, and 3) cross-lingual
encoder
the
pivot language. Our methods greatly out-
perform multilingual models up to +2.6%
BLEU in WMT 2019 French→German and
German→Czech tasks. We show that our
improvements are valid also in zero-shot/zero-
resource scenarios.
training via autoencoding of
i.e.,
Introduction
1
Machine translation (MT) research is biased to-
wards language pairs including English due to
the ease of collecting parallel corpora. Trans-
lation between non-English languages,
e.g.,
French→German,
is usually done with pivot-
ing through English,
translating French
(source) input
to English (pivot) first with a
French→English model which is later translated
to German (target) with a English→German
model (De Gispert and Marino, 2006; Utiyama
and Isahara, 2007; Wu and Wang, 2007). How-
ever, pivoting requires doubled decoding time and
the translation errors are propagated or expanded
via the two-step process.
Therefore, it is more beneficial to build a sin-
gle source→target model directly for both effi-
ciency and adequacy. Since non-English language
∗ Equal contribution.
pairs often have little or no parallel text, common
choices to avoid pivoting in NMT are generating
pivot-based synthetic data (Bertoldi et al., 2008;
Chen et al., 2017) or training multilingual systems
(Firat et al., 2016; Johnson et al., 2017).
In this work, we present novel transfer learn-
ing techniques to effectively train a single, di-
rect NMT model for a non-English language
pair. We pre-train NMT models for source→pivot
and pivot→target, which are transferred to a
source→target model. To optimize the usage of
given source-pivot and pivot-target parallel data
for the source→target direction, we devise the fol-
lowing techniques to smooth the discrepancy be-
tween the pre-trained and final models:
• Step-wise pre-training with careful parameter
freezing.
• Additional adapter component to familiarize
the pre-trained decoder with the outputs of
the pre-trained encoder.
• Cross-lingual encoder pre-training with au-
toencoding of the pivot language.
Our methods are evaluated in two non-English
language pairs of WMT 2019 news translation
tasks: high-resource (French→German) and low-
resource (German→Czech). We show that NMT
models pre-trained with our methods are highly ef-
fective in various data conditions, when fine-tuned
for source→target with:
• Real parallel corpus
• Pivot-based synthetic parallel corpus (zero-
resource)
• None (zero-shot)
For each data condition, we consistently outper-
form strong baselines, e.g., multilingual, pivoting,
or teacher-student, showing the universal effec-
tiveness of our transfer learning schemes.
The rest of the paper is organized as follows.
We first review important previous works on pivot-
based MT in Section 2. Our three pre-training
techniques are presented in Section 3. Section 4
shows main results of our methods with a detailed
description of the experimental setups. Section
5 studies variants of our methods and reports the
results without source-target parallel resources or
with large synthetic parallel data. Section 6 draws
conclusion of this work with future research direc-
tions.
2 Related Work
In this section, we first review existing approaches
to leverage a pivot language in low-resource/zero-
resource MT. They can be divided into three cate-
gories:
1. Pivot translation (pivoting).
The most
naive approach is reusing (already trained)
source→pivot and pivot→target models di-
rectly, decoding twice via the pivot language
(Kauers et al., 2002; De Gispert and Marino,
2006). One can keep N-best hypotheses in
the pivot language to reduce the prediction
bias (Utiyama and Isahara, 2007) and im-
prove the final translation by system combi-
nation (Costa-Juss`a et al., 2011), which how-
ever increases the translation time even more.
In multilingual NMT, Firat et al. (2016) mod-
ify the second translation step (pivot→target)
to use source and pivot language sentences
together as the input.
2. Pivot-based synthetic parallel data. We
may translate the pivot side of given pivot-
target parallel data using a pivot→source
model (Bertoldi et al., 2008), or the other way
around translating source-pivot data using a
pivot→target model (De Gispert and Marino,
2006). For NMT, the former is extended by
Zheng et al. (2017) to compute the expec-
tation over synthetic source sentences. The
latter is also called teacher-student approach
(Chen et al., 2017), where the pivot→target
model (teacher) produces target hypotheses
for training the source→target model (stu-
dent).
3. Pivot-based model training.
In phrase-
there have been many ef-
based MT,
forts to combine phrase/word level
fea-
tures of source-pivot and pivot-target into
a source→target system (Utiyama and Isa-
hara, 2007; Wu and Wang, 2007; Bakhshaei
et al., 2010; Zahabi et al., 2013; Zhu et al.,
2014; Miura et al., 2015).
In NMT, Cheng
et al. (2017) jointly train for three transla-
tion directions of source-pivot-target by shar-
ing network components, where Ren et al.
(2018) use the expectation-maximization al-
gorithm with the target sentence as a latent
variable. Lu et al. (2018) deploy intermedi-
ate recurrent layers which are common for
multiple encoders and decoders, while John-
son et al. (2017) share all components of
a single multilingual model. Both methods
train the model for language pairs involv-
ing English but enable zero-shot translation
for unseen non-English language pairs. For
this, Ha et al. (2017) encode the target lan-
guage as an additional embedding and filter
out non-target tokens in the output. Lakew
et al. (2017) combine the multilingual train-
ing with synthetic data generation to improve
the zero-shot performance iteratively, where
Sestorain et al. (2018) applies the NMT pre-
diction score and a language model score to
each synthetic example as gradient weights.
Our work is based on transfer learning (Zoph
et al., 2016) and belongs to the third category:
model training. On the contrary to the multilingual
joint training, we suggest two distinct steps: pre-
training (with source-pivot and pivot-target data)
and fine-tuning (with source-target data). With our
proposed methods, we prevent the model from los-
ing its capacity to other languages while utilizing
the information from related language pairs well,
as shown in the experiments (Section 4).
Our pivot adapter (Section 3.2) shares the same
motivation with the interlingua component of Lu
et al. (2018), but is much compact, independent
of variable input length, and easy to train offline.
The adapter training algorithm is adopted from
bilingual word embedding mapping (Xing et al.,
2015). Our cross-lingual encoder (Section 3.3) is
inspired by cross-lingual sentence embedding al-
gorithms using NMT (Schwenk and Douze, 2017;
Schwenk, 2018).
Transfer learning was first introduced to NMT
by Zoph et al. (2016), where only the source
language is switched before/after the transfer.
Nguyen and Chiang (2017) and Kocmi and Bojar
(2018) use shared subword vocabularies to work
Figure 1: Plain transfer learning.
Figure 2: Step-wise pre-training.
with more languages and help target language
switches. Kim et al. (2019) propose additional
techniques to enable NMT transfer even without
shared vocabularies. To the best of our knowl-
edge, we are the first to propose transfer learn-
ing strategies specialized in utilizing a pivot lan-
guage, transferring a source encoder and a target
decoder at the same time. Also, for the first time,
we present successful zero-shot translation results
only with pivot-based NMT pre-training.
3 Pivot-based Transfer Learning
Our methods are based on a simple transfer learn-
ing principle for NMT, adjusted to a usual data
condition for non-English language pairs: lots of
source-pivot and pivot-target parallel data, little
(low-resource) or no (zero-resource) source-target
parallel data. Here are the core steps of the plain
transfer (Figure 1):
1. Pre-train
a
source-pivot
source→pivot model with
a
a
pivot→target model with a pivot-target
parallel corpus.
and
parallel
corpus
2. Initialize the source→target model with
the source encoder
from the pre-trained
source→pivot model and the target decoder
from the pre-trained pivot→target model.
3. Continue the training with a source-target
parallel corpus.
If we skip the last step (for zero-resource cases)
and perform the source→target
translation di-
rectly, it corresponds to zero-shot translation.
Thanks to the pivot language, we can pre-train
a source encoder and a target decoder without
changing the model architecture or training objec-
tive for NMT. On the contrary to other NMT trans-
fer scenarios (Zoph et al., 2016; Nguyen and Chi-
ang, 2017; Kocmi and Bojar, 2018), this principle
has no language mismatch between transferor and
transferee on each source/target side. Experimen-
tal results (Section 4) also show its competitive-
ness despite its simplicity.
Nonetheless, the main caveat of this basic pre-
training is that the source encoder is trained to be
used by an English decoder, while the target de-
coder is trained to use the outputs of an English
encoder -- not of a source encoder. In the follow-
ing, we propose three techniques to mitigate the
inconsistency of source→pivot and pivot→target
pre-training stages. Note that these techniques are
not exclusive and some of them can complement
others for a better performance of the final model.
3.1 Step-wise Pre-training
A simple remedy to make the pre-trained encoder
and decoder refer to each other is to train a single
NMT model for source→pivot and pivot→target
in consecutive steps (Figure 2):
1. Train a source→pivot model with a source-
pivot parallel corpus.
2. Continue the training with a pivot-target par-
allel corpus, while freezing the encoder pa-
rameters of 1.
In the second step, a target decoder is trained to
use the outputs of the pre-trained source encoder
as its input. Freezing the pre-trained encoder en-
sures that, even after the second step, the encoder
is still modeling the source language although we
train the NMT model for pivot→target. Without
the freezing, the encoder completely adapts to the
pivot language input and is likely to forget source
language sentences.
We build a joint vocabulary of the source and
pivot languages so that the encoder effectively rep-
resents both languages. The frozen encoder is pre-
trained for the source language in the first step,
but also able to encode a pivot language sentence
in a similar representation space.
It is more ef-
fective for linguistically similar languages where
Pre-trainFinal ModelSourceEncoderPivotDecoderSourceEncoderTargetDecoderCopyParametersPre-trainPivotEncoderTargetDecoderCopyParametersPre-train 1Pre-train 2SourceEncoderPivotDecoderPivotEncoder(Frozen)TargetDecoderCopyParametersFinal ModelSourceEncoderTargetDecoderCopyParametersCopyParametersFigure 3: Pivot adapter.
many tokens are common for both languages in
the joint vocabulary.
3.2 Pivot Adapter
Instead of the step-wise pre-training, we can also
postprocess the network to enhance the connec-
tion between the source encoder and the target de-
coder which are pre-trained individually. Our idea
is that, after the pre-training steps, we adapt the
source encoder outputs to the pivot encoder out-
puts to which the target decoder is more familiar
(Figure 3). We learn a linear mapping between
the two representation spaces with a small source-
pivot parallel corpus:
1. Encode the source sentences with the source
the pre-trained source→pivot
encoder of
model.
2. Encode the pivot sentences with the pivot en-
coder of the pre-trained pivot→target model.
3. Apply a pooling to each sentence of 1 and
2, extracting representation vectors for each
sentence pair: (s, p).
4. Train a mapping M ∈ Rd×d to minimize the
distance between the pooled representations
s ∈ Rd×1 and p ∈ Rd×1, where the source
representation is first fed to the mapping:
(cid:88)
M = argmin
(cid:107)Ms − p(cid:107)2
(1)
M
s,p
where d is the hidden layer size of the encoders.
Introducing matrix notations S ∈ Rd×n and P ∈
Rd×n, which concatenate the pooled representa-
tions of all n sentences for each side in the source-
pivot corpus, we rewrite Equation 1 as:
(cid:107)MS − P(cid:107)2
M = argmin
(2)
M
Figure 4: Cross-lingual encoder.
which can be easily computed by the singular
value decomposition (SVD) for a closed-form so-
lution, if we put an orthogonality constraint on M
(Xing et al., 2015). The resulting optimization is
also called Procrustes problem.
The learned mapping is multiplied to encoder
outputs of all positions in the final source→target
tuning step. With this mapping, the source en-
coder emits sentence representations that lie in a
similar space of the pivot encoder. Since the tar-
get decoder is pre-trained for pivot→target and ac-
customed to receive the pivot encoder outputs, it
should process the mapped encoder outputs better
than the original source encoder outputs.
3.3 Cross-lingual Encoder
As a third technique, we modify the source→pivot
pre-training procedure to force the encoder to have
cross-linguality over source and pivot languages;
modeling source and pivot sentences in the same
mathematical space. We achieve this by an ad-
ditional autoencoding objective from a pivot sen-
tence to the same pivot sentence (Figure 4).
The encoder is fed with sentences of both
source and pivot languages, which are processed
by a shared decoder that outputs only the pivot
language. In this way, the encoder is learned to
produce representations in a shared space regard-
less of the input language, since they are used in
the same decoder. This cross-lingual space facili-
tates smoother learning of the final source→target
model, because the decoder is pre-trained to trans-
late the pivot language.
The same input/output in autoencoding encour-
ages, however, merely copying the input; it is said
to be not proper for learning complex structure of
the data domain (Vincent et al., 2008). Denoising
autoencoder addresses this by corrupting the in-
put sentences by artificial noises (Hill et al., 2016).
Learning to reconstruct clean sentences, it encodes
linguistic structures of natural language sentences,
e.g., word order, better than copying. Here are the
Pre-trainFinal ModelSourceEncoderPivotDecoderSourceEncoderTargetDecoderCopyParametersPre-trainPivotEncoderTargetDecoderCopyParametersSource→PivotAdapterTrainTrainPre-trainFinal ModelPivotDecoderSourceEncoderTargetDecoderCopyParametersPre-trainPivotEncoderTargetDecoderCopyParametersSource/PivotEncoderSourcePivotPivotPivotnoise types we use (Edunov et al., 2018):
• Drop tokens randomly with a probability pdel
• Replace tokens with a <BLANK> token ran-
domly with a probability prep
• Permute the token positions randomly so that
the difference between an original index and
its new index is less than or equal to dper
We set pdel = 0.1, prep = 0.1, and dper = 3 in our
experiments.
The key idea of all three methods is to build a
closer connection between the pre-trained encoder
and decoder via a pivot language. The differ-
ence is in when we do this job: Cross-lingual
encoder (Section 3.3) changes the encoder pre-
training stage (source→pivot), while step-wise
pre-training (Section 3.1) modifies decoder pre-
training stage (pivot→target). Pivot adapter (Sec-
tion 3.2) is applied after all pre-training steps.
4 Main Results
We evaluate the proposed transfer learning tech-
niques in two non-English language pairs of WMT
2019 news translation tasks1: French→German
and German→Czech.
Data We used the News Commentary v14 par-
allel corpus and newstest2008-2010 test sets as
the source-target
training data for both tasks.
The newstest sets were oversampled four times.
The German→Czech task was originally limited
to unsupervised learning (using only monolin-
gual corpora) in WMT 2019, but we relaxed this
constraint by the available parallel data. We
used newstest2011 as a validation set and new-
stest2012/newstest2013 as the test sets.
Both language pairs have much abundant paral-
lel data in source-pivot and pivot-target with En-
glish as the pivot language. Detailed corpus statis-
tics are given in Table 1.
Preprocessing We used the Moses2 tokenizer
and applied true-casing on all corpora. For all
transfer learning setups, we learned byte pair en-
coding (BPE) (Sennrich et al., 2016) for each lan-
guage individually with 32k merge operations, ex-
cept for cross-lingual encoder training with joint
BPE only over source and pivot languages. This
1http://www.statmt.org/wmt19/translation-task.
html
2http://www.statmt.org/moses/
Usage
Data
Sentences
Pre-train
Fine-tune
Pre-train
Fine-tune
fr-en
en-de
fr-de
de-en
en-cs
de-cs
35M
9.1M
270k
9.1M
49M
230k
Words
(Source)
950M
170M
6.9M
181M
658M
5.1M
Table 1: Parallel training data statistics.
is for modularity of pre-trained models: for ex-
ample, a French→English model
trained with
joint French/English/German BPE could be trans-
ferred smoothly to a French→German model, but
would not be optimal for a transfer to e.g., a
French→Korean model. Once we pre-train an
NMT model with separate BPE vocabularies, we
can reuse it for various final language pairs with-
out wasting unused portion of subword vocabu-
laries (e.g., German-specific tokens in building a
French→Korean model).
On the contrary, baselines used joint BPE over
all languages with also 32k merges.
Model and Training The 6-layer base Trans-
former architecture (Vaswani et al., 2017) was
used for all of our experiments. Batch size was
set to 4,096 tokens. Each checkpoint amounts to
10k updates for pre-training and 20k updates for
fine-tuning.
Each model was optimized with Adam (Kingma
and Ba, 2014) with an initial learning rate of
0.0001, which was multiplied by 0.7 whenever
perplexity on the validation set was not improved
for three checkpoints. When it was not improved
for eight checkpoints, we stopped the training.
The NMT model training and transfer were done
with the OPENNMT toolkit (Klein et al., 2017).
Pivot adapter was trained using the MUSE
toolkit (Conneau et al., 2018), which was orig-
inally developed for bilingual word embeddings
but we adjusted for matching sentence represen-
tations.
Baselines We thoroughly compare our ap-
proaches to the following baselines:
1. Direct source→target: A standard NMT
model trained on given source→target paral-
French→German
German→Czech
newstest2012
newstest2013
newstest2012
newstest2013
BLEU [%] TER [%] BLEU [%] TER [%] BLEU [%] TER [%] BLEU [%] TER [%]
77.7
73.2
75.8
70.9
70.3
71.4
70.8
70.9
69.9
11.1
14.9
13.1
15.4
15.9
15.0
15.6
15.6
16.2
81.1
76.6
79.6
75.4
75.0
75.9
75.3
75.0
74.6
12.8
16.5
14.6
18.0
18.7
17.6
18.1
18.1
19.1
14.8
18.7
18.3
17.5
18.0
17.4
17.8
18.6
19.5
75.1
71.9
71.7
72.3
71.9
72.1
72.3
70.7
69.8
16.0
19.5
19.2
18.7
19.1
18.9
19.1
19.9
20.7
75.1
72.6
71.5
71.8
71.1
71.8
71.5
70.4
69.4
Direct source→target
Multilingual many-to-many
Multilingual many-to-one
Plain transfer
+ Pivot adapter
+ Cross-lingual encoder
+ Pivot adapter
Step-wise pre-training
+ Cross-lingual encoder
Table 2: Main results fine-tuned with source-target parallel data.
lel data.
2. Multilingual: A single, shared NMT model
for multiple translation directions (Johnson
et al., 2017).
• Many-to-many: Trained for all possi-
ble directions among source, target, and
pivot languages.
• Many-to-one: Trained for only the
directions
i.e.,
source→target and pivot→target, which
tends to work better than many-to-many
systems (Aharoni et al., 2019).
to target
language,
In Table 2, we report principal results after fine-
tuning the pre-trained models using source-target
parallel data.
As for baselines, multilingual models are bet-
ter than a direct NMT model. The many-to-many
models surpass the many-to-one models; since
both tasks are in a low-resource setup, the model
gains a lot from related language pairs even if the
target languages do not match.
Plain transfer of pre-trained encoder/decoder
without additional techniques (Figure 1) shows
a nice improvement over the direct baseline: up
to +2.7% BLEU for French→German and +5.2%
BLEU for German→Czech. Pivot adapter pro-
vides an additional boost of maximum +0.7%
BLEU or -0.7% TER.
Cross-lingual encoder pre-training is proved to
be not effective in the plain transfer setup.
It
shows no improvements over plain transfer in
French→German, and 0.4% BLEU worse perfor-
mance in German→Czech. We conjecture that
the cross-lingual encoder needs a lot more data to
be fine-tuned for another decoder, where the en-
coder capacity is basically divided into two lan-
guages at the beginning of the fine-tuning. On the
other hand, the pivot adapter directly improves the
connection to an individually pre-trained decoder,
which works nicely with small fine-tuning data.
Pivot adapter gives an additional improvement
on top of the cross-lingual encoder; up to +0.4%
BLEU in French→German and +0.6% BLEU in
German→Czech. In this case, we extract source
and pivot sentence representations from the same
shared encoder for training the adapter.
Step-wise pre-training gives a big improve-
ment up to +1.2% BLEU or -1.6% TER against
plain transfer in French→German.
It shows the
best performance in both tasks when combined
with the cross-lingual encoder:
up to +1.2%
BLEU in French→German and +2.6% BLEU in
German→Czech, compared to the multilingual
baseline.
Step-wise pre-training prevents the
cross-lingual encoder from degeneration, since
the pivot→target pre-training (Step 2 in Section
3.1) also learns the encoder-decoder connection
with a large amount of data -- in addition to the
source→target tuning step afterwards.
Note that the pivot adapter, which inserts an ex-
tra layer between the encoder and decoder, is not
appropriate after the step-wise pre-training;
the
decoder is already trained to correlate well with
the pre-trained encoder. We experimented with the
pivot adapter on top of step-wise pre-trained mod-
els -- with or without cross-lingual encoder -- but
obtained detrimental results.
Compared to pivot translation (Table 5), our
best results are also clearly better in French
→German and comparable in German→Czech.
5 Analysis
In this section, we conduct ablation studies on the
variants of our methods and see how they perform
in different data conditions.
5.1 Pivot Adapter
newstest2013
Adapter Training BLEU [%] TER [%]
70.7
70.5
70.3
Average-pooled
18.2
18.4
18.7
None
Max-pooled
Plain transfer
18.0
70.9
Table 3: Pivot adapter variations (German→Czech).
All results are tuned with source-target parallel data.
Firstly, we compare variants of the pivot adapter
(Section 3.2) in Table 3. The row "None" shows
that a randomly initialized linear layer already
guides the pre-trained encoder/decoder to harmo-
nize with each other. Of course, when we train
the adapter to map source encoder outputs to
pivot encoder outputs, the performance gets bet-
ter. For compressing encoder outputs over posi-
tions, average-pooling is better than max-pooling.
We observed the same trend in the other test set
and in French→German.
We also tested nonlinear pivot adapter, e.g., a 2-
layer feedforward network with ReLU activations,
but the performance was not better than just a lin-
ear adapter.
5.2 Cross-lingual Encoder
Trained on
Monolingual
Pivot side of parallel
newstest2013
Input BLEU [%] TER [%]
Clean
77.7
73.6
Noisy
77.3
Clean
72.7
Noisy
15.7
17.5
15.9
18.0
Table 4: Cross-lingual encoder variations (French→
German). All results are in the zero-shot setting with
step-wise pre-training.
Table 4 verifies that the noisy input in autoen-
coding is indeed beneficial to our cross-lingual
encoder. It improves the final translation perfor-
mance by maximum +2.1% BLEU, compared to
using the copying autoencoding objective.
As the training data for autoencoding, we also
compare between purely monolingual data and the
pivot side of the source-pivot parallel data. By
the latter, one can expect a stronger signal for a
joint encoder representation space, since two dif-
ferent inputs (in source/pivot languages) are used
to produce the exactly same output sentence (in
pivot language). The results also tell that there are
slight but consistent improvements by using the
pivot part of the parallel data.
Again, we performed these comparisons in the
other test set and German→Czech, observing the
same tendency in results.
5.3 Zero-resource/Zero-shot Scenarios
If we do not have an access to any source-
target parallel data (zero-resource), non-English
language pairs have two options for still building
a working NMT system, given source-English and
target-English parallel data:
• Zero-shot: Perform source→target transla-
tion using models which have not seen any
source-target parallel sentences, e.g., multi-
lingual models or pivoting (Section 2.1).
• Pivot-based synthetic data: Generate syn-
thetic
source-target parallel data using
source↔English and target↔English models
(Section 2.2). Use this data to train a model
for source→target.
Table 5 shows how our pre-trained models
perform in zero-resource scenarios with the two
options. Note that, unlike Table 2,
the mul-
tilingual baselines exclude source→target and
target→source directions. First of all, plain trans-
fer, where the encoder and the decoder are pre-
trained separately, is poor in zero-shot scenarios.
It simply fails to connect different representation
spaces of the pre-trained encoder and decoder. In
our experiments, neither pivot adapter nor cross-
lingual encoder could enhance the zero-shot trans-
lation of plain transfer.
Step-wise pre-training solves this problem by
changing the decoder pre-training to familiarize
itself with representations from an already pre-
trained encoder. It achieves zero-shot performance
of 11.5% BLEU in French→German and 6.5%
BLEU in German→Czech (newstest2013), while
French→German
German→Czech
newstest2012
newstest2013
newstest2012
newstest2013
BLEU [%] TER [%] BLEU [%] TER [%] BLEU [%] TER [%] BLEU [%] TER [%]
99.8
70.1
70.9
79.1
72.4
70.3
74.5
75.0
5.9
16.4
16.0
0.1
6.0
14.1
16.5
-
-
92.1
76.8
74.6
6.3
19.5
18.5
0.1
6.5
16.5
19.1
-
87.8
73.5
70.2
Multilingual many-to-many
Pivot translation
Teacher-student
Plain transfer
Step-wise pre-training
+ Cross-lingual encoder
+ Teacher-student
14.1
16.6
18.7
0.1
11.0
17.3
19.3
14.6
17.9
20.7
0.2
11.5
18.0
20.9
79.1
72.5
69.5
-
82.5
72.7
69.3
-
81.6
72.1
69.7
Table 5: Zero-resource results. Except those with the teacher-student, the results are all in the zero-shot setting,
i.e., the model is not trained on any source-target parallel data. '-' indicates a TER score over 100%.
showing comparable or better fine-tuned perfor-
mance against plain transfer (see also Table 2).
the data size of pivot-target
With the pre-trained cross-lingual encoder,
the zero-shot performance of step-wise pre-
training is superior to that of pivot translation in
French→German with only a single model. It is
worse than pivot translation in German→Czech.
We think that
is
critical in pivot translation; relatively huge data
for English→Czech make the pivot translation
stronger. Note again that, nevertheless, pivoting
(second row) is very poor in efficiency since it per-
forms decoding twice with the individual models.
For the second option (pivot-based synthetic
the
data), we compare our methods against
sentence-level beam search version of the teacher-
student framework (Chen et al., 2017), with which
we generated 10M synthetic parallel sentence
pairs. We also tried other variants of Chen et al.
(2017), e.g., N-best hypotheses with weights, but
there were no consistent improvements.
Due to enormous bilingual signals, the model
trained with the teacher-student synthetic data out-
performs pivot translation. If tuned with the same
synthetic data, our pre-trained model performs
even better (last row), achieving the best zero-
resource results on three of the four test sets.
We also evaluate our best German→Czech
zero-resource model on newstest2019 and com-
pare it with the participants of the WMT 2019
unsupervised news translation task. Ours yield
17.2% BLEU, which is much better than the best
single unsupervised system of the winner of the
task (15.5%) (Marie et al., 2019). We argue that, if
one has enough source-English and English-target
parallel data for a non-English language pair, it
is more encouraged to adopt pivot-based transfer
learning than unsupervised MT -- even if there is
no source-target parallel data. In this case, unsu-
pervised MT unnecessarily restricts the data con-
dition to using only monolingual data and its high
computational cost does not pay off; simple pivot-
based pre-training steps are more efficient and ef-
fective.
5.4 Large-scale Results
We also study the effect of pivot-based transfer
learning in more data-rich scenarios: 1) with large
synthetic source-target data (German→Czech),
and 2) with larger real source-target data in combi-
nation with the synthetic data (French→German).
We generated synthetic parallel data using pivot-
based back-translation (Bertoldi et al., 2008): 5M
sentence pairs for German→Czech and 9.1M sen-
tence pairs for French→German. For the second
scenario, we also prepared 2.3M more lines of
French→German real parallel data from Europarl
v7 and Common Crawl corpora.
Table 6 shows our transfer learning results
fine-tuned with a combination of given parallel
data and generated synthetic parallel data. The
real source-target parallel data are oversampled to
make the ratio of real and synthetic data to be 1:2.
As expected, the direct source→target model can
be improved considerably by training with large
synthetic data.
Plain pivot-based transfer outperforms the syn-
thetic data baseline by up to +1.9% BLEU or -3.3%
TER. However, the pivot adapter or cross-lingual
encoder gives marginal or inconsistent improve-
ments over the plain transfer. We suppose that the
entire model can be tuned sufficiently well without
French→German
German→Czech
newstest2012
newstest2013
newstest2012
newstest2013
Direct source→target
+ Synthetic data
Plain transfer
+ Pivot adapter
+ Cross-lingual encoder
+ Pivot adapter
Step-wise pre-training
+ Cross-lingual encoder
20.1
21.1
21.8
21.8
21.9
22.1
21.8
21.9
69.8
68.2
67.6
67.6
67.7
67.5
67.8
67.6
BLEU [%] TER [%] BLEU [%] TER [%] BLEU [%] TER [%] BLEU [%] TER [%]
77.7
72.0
68.7
68.3
68.7
68.5
69.2
68.6
12.8
18.5
20.3
20.9
20.3
20.6
20.0
20.5
11.1
15.7
17.6
17.6
17.5
17.5
17.3
17.5
22.3
22.6
23.1
23.1
23.4
23.3
23.0
23.4
68.7
68.1
67.5
67.6
67.4
67.5
67.8
67.4
81.1
76.5
73.2
73.0
73.5
73.2
73.6
73.1
Table 6: Results fine-tuned with a combination of source-target parallel data and large synthetic data.
French→German task used larger real parallel data than Table 2.
additional adapter layers or a well-curated training
process, once we have a large source-target paral-
lel corpus for fine-tuning.
6 Conclusion
In this paper, we propose three effective tech-
niques for transfer learning using pivot-based par-
allel data. The principle is to pre-train NMT mod-
els with source-pivot and pivot-target parallel data
and transfer the source encoder and the target de-
coder. To resolve the input/output discrepancy of
the pre-trained encoder and decoder, we 1) consec-
utively pre-train the model for source→pivot and
pivot→target, 2) append an additional layer after
the source encoder which adapts the encoder out-
put to the pivot language space, or 3) train a cross-
lingual encoder over source and pivot languages.
Our methods are suitable for most of the non-
English language pairs with lots of parallel data
involving English. Experiments in WMT 2019
French→German and German→Czech tasks show
that our methods significantly improve the fi-
nal source→target translation performance, out-
performing multilingual models by up to +2.6%
BLEU. The methods are applicable also to zero-
resource language pairs, showing a strong perfor-
mance in the zero-shot setting or with pivot-based
synthetic data. We claim that our methods expand
the advances in NMT to many more non-English
language pairs that are not yet studied well.
Future work will be zero-shot translation with-
out step-wise pre-training, i.e., combining individ-
ually pre-trained encoders and decoders freely for
a fast development of NMT systems for a new
non-English language pair.
Acknowledgments
This work has received funding from the Euro-
pean Research Council (ERC) (under the Euro-
pean Union's Horizon 2020 research and inno-
vation programme, grant agreement No 694537,
project "SEQCLAS") and eBay Inc. The work
reflects only the authors' views and none of the
funding agencies is responsible for any use that
may be made of the information it contains.
References
Roee Aharoni, Melvin Johnson, and Orhan Firat. 2019.
Massively multilingual neural machine translation.
In Proceedings of the 2019 Conference of the North
American Chapter of the Association for Computa-
tional Linguistics: Human Language Technologies,
Volume 1 (Long and Short Papers), pages 3874 --
3884.
Somayeh Bakhshaei, Shahram Khadivi, and Noushin
Riahi. 2010. Farsi-german statistical machine trans-
lation through bridge language. In 2010 5th Inter-
national Symposium on Telecommunications, pages
557 -- 561. IEEE.
Nicola Bertoldi, Madalina Barbaiani, Marcello Fed-
erico, and Roldano Cattoni. 2008. Phrase-based
statistical machine translation with pivot languages.
In Proceedings of 5th International Workshop on
Spoken Language Translation (IWSLT 2008), pages
143 -- 149, Honolulu, HI, USA.
Yun Chen, Yang Liu, Yong Cheng, and Victor OK
Li. 2017. A teacher-student framework for zero-
In Proceed-
resource neural machine translation.
ings of the 55th Annual Meeting of the Association
for Computational Linguistics (Volume 1: Long Pa-
pers), pages 1925 -- 1935.
Manuel Kauers, Stephan Vogel, Christian Fugen, and
Alex Waibel. 2002. Interlingua based statistical ma-
chine translation. In Seventh International Confer-
ence on Spoken Language Processing.
Yong Cheng, Qian Yang, Yang Liu, Maosong Sun, and
Wei Xu. 2017. Joint training for pivot-based neu-
ral machine translation. In Proceedings of the 26th
International Joint Conference on Artificial Intelli-
gence, pages 3974 -- 3980. AAAI Press.
Alexis Conneau, Guillaume Lample, Marc'Aurelio
Ranzato, Ludovic Denoyer, and Herv´e J´egou. 2018.
Word translation without parallel data. In Proceed-
ings of 6th International Conference on Learning
Representations (ICLR 2018).
Marta R Costa-Juss`a, Carlos Henr´ıquez, and Rafael E
Banchs. 2011. Enhancing scarce-resource language
translation through pivot combinations. In Proceed-
ings of 5th International Joint Conference on Nat-
ural Language Processing (IJCNLP 2011), pages
1361 -- 1365, Chiang Mai, Thailand.
Adri`a De Gispert and Jose B Marino. 2006. Catalan-
english statistical machine translation without par-
In Pro-
allel corpus: bridging through spanish.
ceedings of the 5th International Conference on
Language Resources and Evaluation (LREC 2006),
pages 65 -- 68, Genoa, Italy.
Sergey Edunov, Myle Ott, Michael Auli, and David
Grangier. 2018. Understanding back-translation at
In Proceedings of the 2018 Conference on
scale.
Empirical Methods in Natural Language Process-
ing, pages 489 -- 500, Brussels, Belgium.
Orhan Firat, Baskaran Sankaran, Yaser Al-Onaizan,
Fatos T Yarman Vural, and Kyunghyun Cho. 2016.
Zero-resource translation with multi-lingual neural
In Proceedings of the 2016
machine translation.
Conference on Empirical Methods in Natural Lan-
guage Processing, pages 268 -- 277.
Thanh-Le Ha, Jan Niehues, and Alexander Waibel.
2017. Effective strategies in zero-shot neural ma-
In 14th International Workshop
chine translation.
on Spoken Language Translation.
Felix Hill, Kyunghyun Cho, and Anna Korhonen. 2016.
Learning distributed representations of sentences
from unlabelled data. In Proceedings of the 15th An-
nual Conference of the North American Chapter of
the Association for Computational Linguistics: Hu-
man Language Technologies (NAACL-HLT 2016),
pages 1367 -- 1377.
Melvin Johnson, Mike Schuster, Quoc V Le, Maxim
Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat,
Fernanda Vi´egas, Martin Wattenberg, Greg Corrado,
et al. 2017. Google's multilingual neural machine
translation system: Enabling zero-shot translation.
Transactions of the Association of Computational
Linguistics (TACL), 5(1):339 -- 351.
Yunsu Kim, Yingbo Gao, and Hermann Ney. 2019.
Effective cross-lingual transfer of neural machine
translation models without shared vocabularies. In
Proceedings of the 57th Annual Meeting of the As-
sociation for Computational Linguistics (Volume 1:
Long Papers), pages 1246 -- 1257, Florence, Italy.
Diederik P Kingma and Jimmy Ba. 2014. Adam: A
method for stochastic optimization. arXiv preprint
arXiv:1412.6980.
Guillaume Klein, Yoon Kim, Yuntian Deng, Jean
Senellart, and Alexander Rush. 2017. OpenNMT:
Open-source toolkit for neural machine translation.
In Proceedings of ACL 2017, System Demonstra-
tions, pages 67 -- 72, Vancouver, Canada. Association
for Computational Linguistics.
Tom Kocmi and Ondrej Bojar. 2018. Trivial trans-
fer learning for low-resource neural machine trans-
In Proceedings of the Third Conference on
lation.
Machine Translation: Research Papers, pages 244 --
252.
Surafel M Lakew, Quintino F Lotito, Matteo Negri,
Marco Turchi, and Marcello Federico. 2017.
Im-
proving zero-shot translation of low-resource lan-
guages. In 14th International Workshop on Spoken
Language Translation.
Yichao Lu, Phillip Keung, Faisal Ladhak, Vikas Bhard-
waj, Shaonan Zhang, and Jason Sun. 2018. A neu-
ral interlingua for multilingual machine translation.
In Proceedings of the Third Conference on Machine
Translation: Research Papers, pages 84 -- 92.
Benjamin Marie, Haipeng Sun, Rui Wang, Kehai
Chen, Atsushi Fujita, Masao Utiyama, and Ei-
ichiro Sumita. 2019. NICT's unsupervised neural
and statistical machine translation systems for the
In Proceedings of
WMT19 news translation task.
the Fourth Conference on Machine Translation (Vol-
ume 2: Shared Task Papers, Day 1), pages 294 -- 301,
Florence, Italy.
Akiva Miura, Graham Neubig, Sakriani Sakti, Tomoki
Toda, and Satoshi Nakamura. 2015.
Improving
pivot translation by remembering the pivot. In Pro-
ceedings of the 53rd Annual Meeting of the Associ-
ation for Computational Linguistics and the 7th In-
ternational Joint Conference on Natural Language
Processing (Volume 2: Short Papers), volume 2,
pages 573 -- 577.
Toan Q Nguyen and David Chiang. 2017. Trans-
fer learning across low-resource, related languages
In Proceedings of
for neural machine translation.
the Eighth International Joint Conference on Natu-
ral Language Processing (Volume 2: Short Papers),
volume 2, pages 296 -- 301.
Shuo Ren, Wenhu Chen, Shujie Liu, Mu Li, Ming
Zhou, and Shuai Ma. 2018. Triangular architecture
for rare language translation. In Proceedings of the
56th Annual Meeting of the Association for Compu-
tational Linguistics (Volume 1: Long Papers), pages
56 -- 65.
Samira Tofighi Zahabi, Somayeh Bakhshaei, and
Shahram Khadivi. 2013. Using context vectors in
improving a machine translation system with bridge
language. In Proceedings of the 51st Annual Meet-
ing of the Association for Computational Linguistics
(Volume 2: Short Papers), volume 2, pages 318 -- 322.
Holger Schwenk. 2018. Filtering and mining paral-
In Proceed-
lel data in a joint multilingual space.
ings of the 56th Annual Meeting of the Association
for Computational Linguistics (Volume 2: Short Pa-
pers), pages 228 -- 234.
Hao Zheng, Yong Cheng, and Yang Liu. 2017.
Maximum expected likelihood estimation for zero-
resource neural machine translation. In Proceedings
of the 26th International Joint Conference on Artifi-
cial Intelligence, pages 4251 -- 4257. AAAI Press.
Xiaoning Zhu, Zhongjun He, Hua Wu, Conghui Zhu,
Haifeng Wang, and Tiejun Zhao. 2014. Improving
pivot-based statistical machine translation by pivot-
ing the co-occurrence count of phrase pairs. In Pro-
ceedings of the 2014 Conference on Empirical Meth-
ods in Natural Language Processing, pages 1665 --
1675.
Barret Zoph, Deniz Yuret, Jonathan May, and Kevin
Knight. 2016. Transfer learning for low-resource
In Proceedings of the
neural machine translation.
2016 Conference on Empirical Methods in Natural
Language Processing, pages 1568 -- 1575.
Holger Schwenk and Matthijs Douze. 2017. Learn-
ing joint multilingual sentence representations with
In Proceedings of the
neural machine translation.
2nd Workshop on Representation Learning for NLP,
pages 157 -- 167.
Rico Sennrich, Barry Haddow, and Alexandra Birch.
2016. Neural machine translation of rare words with
subword units. In Proceedings of the 54th Annual
Meeting of the Association for Computational Lin-
guistics (Volume 1: Long Papers), volume 1, pages
1715 -- 1725.
Lierni Sestorain, Massimiliano Ciaramita, Chris-
tian Buck, and Thomas Hofmann. 2018. Zero-
arXiv preprint
shot dual machine translation.
arXiv:1805.10338.
Masao Utiyama and Hitoshi Isahara. 2007. A com-
parison of pivot methods for phrase-based statistical
machine translation. In Human Language Technolo-
gies 2007: The Conference of the North American
Chapter of the Association for Computational Lin-
guistics; Proceedings of the Main Conference, pages
484 -- 491.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob
Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz
Kaiser, and Illia Polosukhin. 2017. Attention is all
you need. In Advances in Neural Information Pro-
cessing Systems, pages 5998 -- 6008.
Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and
Pierre-Antoine Manzagol. 2008. Extracting and
composing robust features with denoising autoen-
In Proceedings of the 25th international
coders.
conference on Machine learning, pages 1096 -- 1103.
ACM.
Hua Wu and Haifeng Wang. 2007. Pivot language ap-
proach for phrase-based statistical machine transla-
tion. In Proceedings of the 45th Annual Meeting of
the Association of Computational Linguistics, pages
856 -- 863.
Chao Xing, Dong Wang, Chao Liu, and Yiye Lin. 2015.
Normalized word embedding and orthogonal trans-
In Proceed-
form for bilingual word translation.
ings of the 2015 Conference of the North Ameri-
can Chapter of the Association for Computational
Linguistics: Human Language Technologies, pages
1006 -- 1011.
|
1710.10361 | 2 | 1710 | 2018-09-21T10:57:04 | Deep Residual Learning for Small-Footprint Keyword Spotting | [
"cs.CL"
] | We explore the application of deep residual learning and dilated convolutions to the keyword spotting task, using the recently-released Google Speech Commands Dataset as our benchmark. Our best residual network (ResNet) implementation significantly outperforms Google's previous convolutional neural networks in terms of accuracy. By varying model depth and width, we can achieve compact models that also outperform previous small-footprint variants. To our knowledge, we are the first to examine these approaches for keyword spotting, and our results establish an open-source state-of-the-art reference to support the development of future speech-based interfaces. | cs.CL | cs | DEEP RESIDUAL LEARNING FOR SMALL-FOOTPRINT KEYWORD SPOTTING
Raphael Tang
Jimmy Lin
David R. Cheriton School of Computer Science
{r33tang,jimmylin}@uwaterloo.ca
University of Waterloo
8
1
0
2
p
e
S
1
2
]
L
C
.
s
c
[
2
v
1
6
3
0
1
.
0
1
7
1
:
v
i
X
r
a
ABSTRACT
We explore the application of deep residual learning and di-
lated convolutions to the keyword spotting task, using the
recently-released Google Speech Commands Dataset as our
benchmark. Our best residual network (ResNet) implemen-
tation significantly outperforms Google's previous convo-
lutional neural networks in terms of accuracy. By varying
model depth and width, we can achieve compact models that
also outperform previous small-footprint variants. To our
knowledge, we are the first to examine these approaches for
keyword spotting, and our results establish an open-source
state-of-the-art reference to support the development of future
speech-based interfaces.
Index Terms -- deep residual networks, keyword spotting
1. INTRODUCTION
The goal of keyword spotting is to detect a relatively small set
of predefined keywords in a stream of user utterances, usually
in the context of an intelligent agent on a mobile phone or a
consumer "smart home" device. Such a capability comple-
ments full automatic speech recognition, which is typically
performed in the cloud. Because cloud-based interpretation
of speech input requires transferring audio recordings from
the user's device, there are significant privacy implications.
Therefore, on-device keyword spotting has two main uses:
First, recognition of common commands such as "on" and
"off" as well as other frequent words such as "yes" and "no"
can be accomplished directly on the user's device, thereby
sidestepping any potential privacy concerns. Second, key-
word spotting can be used to detect "command triggers" such
as "hey Siri", which provide explicit cues for interactions di-
rected at the device.
It is additionally desirable that such
models have a small footprint (for example, measured in the
number of model parameters) so they can be deployed on low
power and performance-limited devices.
In recent years, neural networks have been shown to pro-
vide effective solutions to the small-footprint keyword spot-
ting problem. Research typically focuses on a tradeoff be-
tween achieving high detection accuracy and having a small
footprint. Compact models are usually variants derived from
a full model that sacrifice accuracy for a smaller model foot-
print, often via some form of sparsification.
In this work, we focus on convolutional neural networks
(CNNs), a class of models that has been successfully applied
to small-footprint keyword spotting in recent years. In par-
ticular, we explore the use of residual learning techniques and
dilated convolutions. On the recently-released Google Speech
Commands Dataset, which provides a common benchmark
for keyword spotting, our full residual network model outper-
forms Google's previously-best CNN [1] (95.8% vs. 91.7% in
accuracy). We can tune the depth and width of our networks
to target a desired tradeoff between model footprint and ac-
curacy: one variant is able to achieve accuracy only slightly
below Google's best CNN with a 50× reduction in model pa-
rameters and an 18× reduction in the number of multiplies
in a feedforward inference pass. This model far outperforms
previous compact CNN variants.
2. RELATED WORK
Deep residual networks (ResNets) [2] represent a ground-
breaking advance in deep learning that has allowed re-
searchers to successfully train deeper networks. They were
first applied to image recognition, where they contributed to a
significant jump in state-of-the-art performance [2]. ResNets
have subsequently been applied to speaker identification [3]
and automatic speech recognition [4, 5]. This paper explores
the application of deep residual learning techniques to the
keyword spotting task.
The application of neural networks to keyword spotting,
of course, is not new. Chen et al. [6] applied a standard multi-
layer perceptron to achieve significant improvements over
previous HMM-based approaches. Sainath and Parada [1]
built on that work and achieved better results using convo-
lutional neural networks (CNNs). They specifically cited
reduced model footprints (for low-power applications) as a
major motivation in moving to CNNs.
Despite more recent work in applying recurrent neural
networks to the keyword spotting task [7, 8], we focus on
the family of CNN models for several reasons. CNNs to-
day remain the standard baseline for small-footprint keyword
Fig. 2. Exponentially increasing dilated convolutions; in this
case, k = 1.
type m r
3
conv
res × 6
3
3
conv
-
bn
avg-pool
-
softmax
-
Total
-
3
3
3
-
-
-
-
n
45
45
45
45
45
12
-
dw
-
2(cid:98) i
3(cid:99)
16
-
-
-
-
dh
-
2(cid:98) i
3(cid:99)
16
-
-
-
-
Mult.
Par.
1.52M
405
219K
824M
18.2K 68.6M
169K
-
-
540
238K
45
540
894M
Table 1. Parameters used for res15, along with the number
of parameters and multiplies.
be merely "tacked on" to shallower nets. Specifically, He
et al. proposed that it may be easier to learn the residual
H(x) = F (x) + x instead of the true mapping F (x), since
it is empirically difficult to learn the identity mapping for F
when the model has unnecessary depth. In residual networks
(ResNets), residuals are expressed via connections between
layers (see Figure 1), where an input x to layer i is added
to the output of some downstream layer i + k, enforcing the
residual definition H(x) = F (x) + x.
Following standard ResNet architectures, our residual
block begins with a bias-free convolution layer with weights
W ∈ R(m×r)×n, where m and r are the width and height,
respectively, and n the number of feature maps. After the con-
volution layer, there are ReLU activation units and -- instead
of dropout -- a batch normalization [11] layer.
In addition
to using residual blocks, we also use a (dw, dh) convolution
dilation [12] to increase the receptive field of the network,
which allows us to consider the one-second input in its en-
tirety using a smaller number of layers. To expand our input
for the residual blocks, which requires inputs and outputs of
equal size throughout, our entire architecture starts with a
convolution layer with weights W ∈ R(m×r)×n. A separate
non-residual convolution layer and batch normalization layer
are further appended to the chain of residual blocks, as shown
in Figure 1 and Table 1.
Our base model, which we refer to as res15, comprises
six such residual blocks and n = 45 feature maps (see Fig-
ure 1). For dilation, as illustrated in Figure 2, an exponential
sizing schedule [12] is used: at layer i, the dilation is dw =
Fig. 1. Our full architecture, with a magnified residual block.
spotting -- they have a straightforward architecture, are rel-
atively easy to tune, and have implementations in multiple
deep learning frameworks (at least TensorFlow [9] and Py-
Torch [10]). We are not aware of any publicly-available im-
plementations of recurrent architectures to compare against.
We believe that residual learning techniques form a yet unex-
plored direction for the keyword spotting task, and that our
use of dilated convolutions achieves the same goal that pro-
ponents of recurrent architectures tout, the ability to capture
long(er)-range dependencies.
3. MODEL IMPLEMENTATION
This section describes our base model and its variants. All
code necessary to replicate our experiments has been made
open source in our GitHub repository.1
3.1. Feature Extraction and Input Preprocessing
For feature extraction, we first apply a band-pass filter
of 20Hz/4kHz to the input audio to reduce noise. Forty-
dimensional Mel-Frequency Cepstrum Coefficient (MFCC)
frames are then constructed and stacked using a 30ms win-
dow and a 10ms frame shift. All frames are stacked across a
1s interval to form the two-dimensional input to our models.
3.2. Model Architecture
Our architecture is similar to that of He et al. [2], who pos-
tulated that it may be easier to learn residuals than to learn
the original mapping for deep convolutional neural networks.
They found that additional layers in deep networks cannot
1https://github.com/castorini/honk/
3x3 conv, 45 3x3 conv, 45 3x3 conv, 45 Avg pool softmax 3x3 conv, 45 MFCCs ⋮ 3x3 conv, 45 3x3 Convolution Batch Normalization ReLU 3x3 Convolution Batch Normalization ReLU Add 3x3 conv, 45 Layer 1 Layer 1+k Layer 1+2k ⋯ ⋯ Convolution filter Receptive field type m r
3
conv
3
avg-pool
res × 3
3
avg-pool
-
-
softmax
Total
-
3
4
3
-
-
-
n
19
19
19
19
12
-
19.5K
Par.
171
-
Mult.
643K
6.18K
5.0M
19
-
228
228
19.9K 5.65M
Table 2. Parameters used for res8-narrow.
type m r
3
conv
2
avg-pool
res × 12
3
-
avg-pool
-
softmax
Total
-
3
2
3
-
-
-
n
45
45
45
45
12
-
Par. Mult.
1.80M
405
-
45K
437K 378M
45
-
540
540
438K 380M
Table 3. Parameters used for res26.
3(cid:99), resulting in a total receptive field of 125×125. As
dh = 2(cid:98) i
is standard in ResNet architectures, all output is zero-padded
at each layer and finally average-pooled and fed into a fully-
connected softmax layer. Following previous work, we mea-
sure the "footprint" of a model in terms of two quantities: the
number of parameters in the model and the number of multi-
plies that are required for a full feedforward inference pass.
Our architecture uses roughly 238K parameters and 894M
multiplies (see Table 1 for the exact breakdown).
To derive a compact small-footprint model, one simple
approach is to reduce the depth of the network. We tried cut-
ting the number of residual blocks in half to three, yielding a
model we call res8. Because the footprint of res15 arises
from its width as well as its depth, the compact model adds a
4× 3 average-pooling layer after the first convolutional layer,
reducing the size of the time and frequency dimensions by a
factor of four and three, respectively. Since the average pool-
ing layer sufficiently reduces the input dimension, we did not
use dilated convolutions in this variant.
In the opposite direction, we explored the effects of
deeper models. We constructed a model with double the
number of residual blocks (12) with 26 layers, which we
refer to as res26. To make training tractable, we prepend a
2 × 2 average-pooling layer to the chain of residual blocks.
Dilation is also not used, since the receptive field of 25 3×3
convolution filters is large enough to cover our input size.
In addition to depth, we also varied model width. All
models described above used n = 45 feature maps, but we
also considered variants with n = 19 feature maps, denoted
by -narrow appended to the base model's name. A detailed
breakdown of the footprint of res8-narrow, our best com-
pact model, is shown in Table 2; the same analysis for our
deepest and widest model, res26, is shown in Table 3.
4. EVALUATION
4.1. Experimental Setup
We evaluated our models using Google's Speech Commands
Dataset [9], which was released in August 2017 under a
Creative Commons license.2 The dataset contains 65,000
one-second long utterances of 30 short words by thousands of
different people, as well as background noise samples such as
pink noise, white noise, and human-made sounds. The blog
post announcing the data release also references Google's
TensorFlow implementation of Sainath and Parada's models,
which provide the basis of our comparisons.
Following Google's implementation, our task is to dis-
criminate among 12 classes: "yes," "no," "up," "down," "left,"
"right," "on," "off," "stop," "go", unknown, or silence. Our
experiments followed exactly the same procedure as the
TensorFlow reference. The Speech Commands Dataset was
split into training, validation, and test sets, with 80% training,
10% validation, and 10% test. This results in roughly 22,000
examples for training and 2,700 each for validation and test-
ing. For consistency across runs, the SHA1-hashed name of
the audio file from the dataset determines the split.
To generate training data, we followed Google's pre-
processing procedure by adding background noise to each
sample with a probability of 0.8 at every epoch, where the
noise is chosen randomly from the background noises pro-
vided in the dataset. Our implementation also performs a
random time-shift of Y milliseconds before transforming the
audio into MFCCs, where Y ∼ UNIFORM[−100, 100]. In or-
der to accelerate the training process, all preprocessed inputs
are cached for reuse across different training epochs. At each
epoch, 30% of the cache is evicted.
Accuracy is our main metric of quality, which is sim-
ply measured as the fraction of classification decisions that
are correct. For each instance, the model outputs its most
likely prediction, and is not given the option of "don't know".
We also plot receiver operating characteristic (ROC) curves,
where the x and y axes show false alarm rate (FAR) and
false reject rate (FRR), respectively. For a given sensitiv-
ity threshold -- defined as the minimum probability at which
a class is considered positive during evaluation -- FAR and
FRR represent the probabilities of obtaining false positives
and false negatives, respectively. By sweeping the sensitiv-
ity interval [0.0, 1.0], curves for each of the keywords are
computed and then averaged vertically to produce the over-
all curve for a particular model. Curves with less area under
the curve (AUC) are better.
4.2. Model Training
Mirroring the ResNet paper [2], we used stochastic gradient
descent with a momentum of 0.9 and a starting learning rate
2https://research.googleblog.com/2017/08/
launching-speech-commands-dataset.html
Model
trad-fpool3
tpool2
one-stride1
res15
res15-narrow
res26
res26-narrow
res8
res8-narrow
Test accuracy
90.5% ± 0.297
91.7% ± 0.344
77.9% ± 0.715
95.8% ± 0.484
94.0% ± 0.516
95.2% ± 0.184
93.3% ± 0.377
94.1% ± 0.351
90.1% ± 0.976
Mult.
Par.
1.37M 125M
1.09M 103M
954K 5.76M
238K
894M
42.6K 160M
438K
380M
78.4K 68.5M
110K
30M
19.9K 5.65M
Table 4. Test accuracy of each model with 95% confidence
intervals (across five trials), as well as footprint size in terms
of number of parameters and multiplies.
of 0.1, which is multiplied by 0.1 on plateaus. We also ex-
perimented with Nesterov momentum, but we found slightly
decreased learning performance in terms of cross entropy loss
and test accuracy. We used a mini-batch size of 64 and L2
weight decay of 10−5. Our models were trained for a total of
26 epochs, resulting in roughly 9,000 training steps.
4.3. Results
Since our own networks are implemented in PyTorch, we
used our PyTorch reimplementations of Sainath and Parada's
models as a point of comparison. We have previously con-
firmed that our PyTorch implementation achieves the same
accuracy as the original TensorFlow reference [10]. Our
ResNet models are compared against three CNN variants
proposed by Sainath and Parada: trad-fpool3, which is
their base model; tpool2, the most accurate variant of those
they explored; and one-stride1, their best compact vari-
ant. The accuracies of these models are shown in Table 4,
which also shows the 95% confidence intervals from five
different optimization trials with different random seeds. The
table provides the number of model parameters as well as
the number of multiplies in an inference pass. We see that
tpool2 is indeed the best performing model, slightly better
than trad-fpool3. The one-stride1 model substan-
tially reduces the model footprint, but this comes at a steep
price in terms of accuracy.
The performance of our ResNet variants is also shown in
Table 4. Our base res15 model achieves significantly better
accuracy than any of the previous Google CNNs (the con-
fidence intervals do not overlap). This model requires fewer
parameters, but more multiplies, however. The "narrow" vari-
ant of res15 with fewer feature maps sacrifices accuracy, but
remains significantly better than the Google CNNs (although
it still uses ∼30% more multiplies).
Looking at our compact res8 architecture, we see that
the "wide" version strictly dominates all the Google models --
it achieves significantly better accuracy with a smaller foot-
print. The "narrow" variant reduces the footprint even more,
Fig. 3. ROC curves for different models.
albeit with a small degradation in performance compared to
tpool2, but requires 50× fewer model parameters and 18×
fewer multiplies. Both models are far superior to Google's
compact variant, one-stride1.
Turning our attention to the deeper variants, we see that
res26 has lower accuracy than res15, suggesting that we
have overstepped the network depth for which we can prop-
erly optimize model parameters. Comparing the narrow vs.
wide variants overall, it appears that width (the number of
feature maps) has a larger impact on accuracy than depth.
We plot the ROC curves of selected models in Fig-
ure 3, comparing the two competitive baselines to res8,
res8-narrow, and res15. The remaining models were
less interesting and thus omitted for clarity. These curves are
consistent with the accuracy results presented in Table 4, and
we see that res15 dominates the other models in perfor-
mance at all operating points.
5. CONCLUSIONS AND FUTURE WORK
This paper describes the application of deep residual learn-
ing and dilated convolutions to the keyword spotting problem.
Our work is enabled by the recent release of Google's Speech
Commands Dataset, which provides a common benchmark
for this task. Previously, related work was mostly incompa-
rable because papers relied on private datasets. Our work es-
tablishes new, state-of-the-art, open-source reference models
on this dataset that we encourage others to build on.
For future work, we plan to compare our CNN-based ap-
proaches with an emerging family of models based on recur-
rent architectures. We have not undertaken such a study be-
cause there do not appear to be publicly-available reference
implementations of such models, and the lack of a common
benchmark makes comparisons difficult. The latter problem
has been addressed, and it would be interesting to see how
recurrent neural networks stack up against our approach.
6. REFERENCES
[1] Tara N. Sainath and Carolina Parada, "Convolutional
neural networks for small-footprint keyword spotting,"
in Interspeech, 2015, pp. 1478 -- 1482.
[2] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian
Sun, "Deep residual learning for image recognition," in
CVPR, 2016, pp. 770 -- 778.
[3] Chunlei Zhang and Kazuhito Koishida,
"End-to-end
text-independent speaker verification with triplet loss on
short utterances," in Interspeech, 2017, pp. 1487 -- 1491.
[4] Wayne Xiong, Jasha Droppo, Xuedong Huang, Frank
Seide, Mike Seltzer, Andreas Stolcke, Dong Yu, and
Geoffrey Zweig, "The Microsoft 2016 conversational
in ICASSP, 2017, pp.
speech recognition system,"
5255 -- 5259.
[5] Wayne Xiong, Lingfeng Wu, Fil Alleva, Jasha Droppo,
Xuedong Huang, and Andreas Stolcke,
"The Mi-
crosoft 2017 conversational speech recognition system,"
arXiv:1708.06073v2, 2017.
[6] Guoguo Chen, Carolina Parada, and Georg Heigold,
"Small-footprint keyword spotting using deep neural
networks," in ICASSP, 2014, pp. 4087 -- 4091.
[7] Sercan Omer Arik, Markus Kliegl, Rewon Child, Joel
Hestness, Andrew Gibiansky, Christopher Fougner,
Ryan Prenger, and Adam Coates, "Convolutional recur-
rent neural networks for small-footprint keyword spot-
ting," arXiv:1703.05390v3, 2017.
[8] Ming Sun, Anirudh Raju, George Tucker, Sankaran
Panchapagesan, Gengshen Fu, Arindam Mandal, Spy-
ros Matsoukas, Nikko Strom, and Shiv Vitaladevuni,
"Max-pooling loss training of Long Short-Term Mem-
ory networks for small-footprint keyword spotting,"
arXiv:1705.02411v1, 2017.
[9] Pete Warden,
"Launching the speech commands
dataset," Google Research Blog, 2017.
[10] Raphael Tang and Jimmy Lin, "Honk: A PyTorch reim-
plementation of convolutional neural networks for key-
word spotting," arXiv:1710.06554v2, 2017.
[11] Sergey Ioffe and Christian Szegedy, "Batch normaliza-
tion: Accelerating deep network training by reducing
internal covariate shift," arXiv:1502.03167v3, 2015.
[12] Fisher Yu and Vladlen Koltun,
dilated
by
context
arXiv:1511.07122v3, 2015.
aggregation
"Multi-scale
convolutions,"
|
1801.00388 | 2 | 1801 | 2018-08-30T21:54:56 | Beyond Word Embeddings: Learning Entity and Concept Representations from Large Scale Knowledge Bases | [
"cs.CL",
"cs.AI",
"cs.IR",
"cs.SI"
] | Text representations using neural word embeddings have proven effective in many NLP applications. Recent researches adapt the traditional word embedding models to learn vectors of multiword expressions (concepts/entities). However, these methods are limited to textual knowledge bases (e.g., Wikipedia). In this paper, we propose a novel and simple technique for integrating the knowledge about concepts from two large scale knowledge bases of different structure (Wikipedia and Probase) in order to learn concept representations. We adapt the efficient skip-gram model to seamlessly learn from the knowledge in Wikipedia text and Probase concept graph. We evaluate our concept embedding models on two tasks: (1) analogical reasoning, where we achieve a state-of-the-art performance of 91% on semantic analogies, (2) concept categorization, where we achieve a state-of-the-art performance on two benchmark datasets achieving categorization accuracy of 100% on one and 98% on the other. Additionally, we present a case study to evaluate our model on unsupervised argument type identification for neural semantic parsing. We demonstrate the competitive accuracy of our unsupervised method and its ability to better generalize to out of vocabulary entity mentions compared to the tedious and error prone methods which depend on gazetteers and regular expressions. | cs.CL | cs | Accepted in Information Retrieval Journal.
Publisher link: http://link.springer.com/article/10.1007/s10791-018-9340-3
Beyond Word Embeddings: Learning Entity and Concept
Representations from Large Scale Knowledge Bases
Walid Shalaby · Wlodek Zadrozny · Hongxia Jin.
Received: 30 January 2018 / Accepted: 2 August 2018
Abstract Text representations using neural word embeddings have proven effective in many NLP
applications. Recent researches adapt the traditional word embedding models to learn vectors of
multiword expressions (concepts/entities). However, these methods are limited to textual knowledge
bases (e.g., Wikipedia). In this paper, we propose a novel and simple technique for integrating the
knowledge about concepts from two large scale knowledge bases of different structure (Wikipedia,
and Probase) in order to learn concept representations. We adapt the efficient skip-gram model to
seamlessly learn from the knowledge in Wikipedia text and Probase concept graph. We evaluate
our concept embedding models on two tasks: 1) analogical reasoning, where we achieve a state-
of-the-art performance of 91% on semantic analogies, 2) concept categorization, where we achieve
a state-of-the-art performance on two benchmark datasets achieving categorization accuracy of
100% on one and 98% on the other. Additionally, we present a case study to evaluate our model
on unsupervised argument type identification for neural semantic parsing. We demonstrate the
competitive accuracy of our unsupervised method and its ability to better generalize to out of
vocabulary entity mentions compared to the tedious and error prone methods which depend on
gazetteers and regular expressions.
In this paper, we use the terms "concept" and "entity" interchangeably.
Walid Shalaby
Department of Computer Science
University of North Carolina at Charlotte
9201 University City Blvd, Charlotte, NC 28223, USA
E-mail: [email protected]
Wlodek Zadrozny
Department of Computer Science
University of North Carolina at Charlotte
9201 University City Blvd, Charlotte, NC 28223, USA
E-mail: [email protected]
Hongxia Jin
Samsung Research America
665 Clyde Avenue, Mountain View, CA 94043, USA
E-mail: [email protected]
8
1
0
2
g
u
A
0
3
]
L
C
.
s
c
[
2
v
8
8
3
0
0
.
1
0
8
1
:
v
i
X
r
a
2
Walid Shalaby et al.
Fig. 1 Integrating knowledge from Wikipedia text (left) and Probase concept graph (right). Local concept-concept,
concept-word, and word-word contexts are generated from both KBs and used for training the skip-gram model.
Keywords Entity & Concept Embeddings · Entity Identification · Concept Categorization ·
Skip-gram · Probase · Knowledge Graph Representations
1 Introduction
Vector-based semantic representation models are used to represent textual structures (words, phrases
and documents) as multidimensional vectors. Typically, these models utilize textual corpora and/or
Knowledge Bases (KBs) in order to extract and model real-world knowledge. Once acquired, any
given text structure is represented as a real-valued vector in the semantic space. The goal is thus
to accurately place semantically similar structures close to each other in that semantic space, while
placing dissimilar structures far apart.
Recent neural-based methods for learning word vectors (embeddings) have even succeeded in
capturing both syntactic and semantic regularities using simple vector arithmetic (Mikolov et al
(2013a,b); Pennington et al (2014)). For example, inferring analogical relationships between words:
vec(king)-vec(man)+vec(woman)=vec(queen). This indicates that the learned vector dimensions
encode meaningful multi-clustering for each word.
Word vectors suffer significant limitations. First, each word is assumed to have a single meaning
regardless of its context and thus is represented by a single vector in the semantic space (e.g.,
charlotte (city) vs. charlotte (given name)). Second, the space contains vectors of single words
only. Vectors of multiword expressions (MWEs) are typically obtained by averaging the vectors of
individual words. However, this would often produce inaccurate representations especially if the
Title Suppressed Due to Excessive Length
3
meaning of the MWE is different from the composition of meanings of its individual words (e.g.,
vec(north carolina) vs. vec(north)+vec(carolina). Additionally, mentions that are used to refer to
the same concept would have different embeddings (e.g., u.s., america, usa), and the model might
not be able to place those individual vectors in the same sub-cluster, especially the rare surface
forms.
To address these limitations, a lot of research interest has been focusing on learning distributed
representations of concepts and entities which are lexical expressions (single or multiword) that
denote an idea, event, or an object and have a set of properties. Typically each concept has an
entry in a KB (e.g., an article in Wikipedia or a node in knowledge graph). Such entity embeddings
models utilize text KBs (e.g., Wikipedia) or a triple-based KBs (e.g., DBpedia and Freebase) in
order to learn entity vectors. Broadly speaking, existing methods can be divided into two categories.
First, methods that learn embeddings of KB concepts only (Hu et al (2015); Zwicklbauer et al (2016);
Li et al (2016); Ristoski and Paulheim (2016)). Second, methods that jointly learn embeddings of
words and concepts in the same semantic space (Wang et al (2014); Fang et al (2016); Yamada et al
(2016); Camacho-Collados et al (2016); Fang et al (2016); Cao et al (2017); Shalaby and Zadrozny
(2017); Phan et al (2017)).
In this paper, we introduce an effective approach for jointly learning word and concept vectors
from two large scale KBs of different modalities: a text KB (Wikipedia) and a graph-based concept
KB (Microsoft concept graph1 (aka Probase)). We adapt skip-gram, the popular local context
window method Mikolov et al (2013b), to integrate the knowledge from both KBs. As shown in
Figure 1, three key properties differentiate our approach from existing methods. First, we generate
word and concept contexts from their raw mentions in the Wikipedia text. This makes our model
extensible to other text corpora with annotated concept mentions. Second, we model Probase as a
weighted undirected KB graph, exploiting the co-occurrence counts between pairs of concepts. This
allows us to generate more concept-concept contexts during training, and subsequently learn better
concept vectors for rare and infrequent concepts in Wikipedia. Third, to our knowledge, this work
is the first to combine knowledge from two KBs of different modalities (Wikipedia and Probase)
into a unified representation.
We evaluate the generated concept vectors intrinsically on two tasks: 1) analogical reasoning
where we achieve a state-of-the-art accuracy of 91% on semantic analogies, 2) concept categorization
on two datasets, where we achieve 100% accuracy on one dataset and 98% accuracy on the other. We
also present a case study to analyze the impact of using our concept vectors for unsupervised argu-
ment type identification with semantic parsing as an end-to-end task. The results show competitive
performance of our unsupervised method compared to the tedious and error prone argument type
identification methods which depend on gazetteers and regular expressions. The analysis also shows
superior generalization performance on utterances containing out of vocabulary (OOV) mentions.
We make our concept vectors and source code publicly available2 for the research community
for further experimentation and replication.
1 https://concept.research.microsoft.com
2 https://sites.google.com/site/conceptembeddings/
4
Walid Shalaby et al.
2 Learning Concept Embeddings
2.1 Skip-gram
We learn continuous vectors of words and entities by building upon the skip-gram model of Mikolov
et al (2013b). In the conventional skip-gram model, a set of contexts are generated by sliding a
context window of predefined size over sentences of a given text corpus. The vector representation
of a target word is learned with the objective to maximize the ability of predicting surrounding
words of that target word.
Formally, given a training corpus of V words w1, w2, ..., wV . The skip-gram model aims to
maximize the average log likelihood probability:
V(cid:88)
1
V
(cid:88)
i=1
−s≤j≤s,j(cid:54)=0
log p(wi+jwi)
(1)
where s is the context window size, wi is the target word, and wi+j is a surrounding context word.
The softmax function is used to estimate the probability p(wOwI ) as follows:
p(wOwI ) =
(cid:80)V
(cid:124)
wO
exp(v
w=1 exp(v
uwI )
(cid:124)
wuwI )
(2)
where uw and vw are the input and output vectors respectively, and V is the vocabulary size.
Mikolov et al (2013b) proposed hierarchical softmax and negative sampling as efficient alternatives
to approximate the softmax function (which becomes computationally intractable when V becomes
huge).
2.2 Learning from Text
Our approach genuinely learns distributed concept representations by generating concept contexts
from mentions of those concepts in large encyclopedic text KBs such as Wikipedia. Utilizing such
annotated KBs eliminates the need to manually annotate concept mentions and thus comes at no
cost.
Here we propose learning the embeddings of both words and concepts jointly. First, all concept
mentions are identified in the given corpus. Second, contexts are generated for both words and
concepts from other surrounding words and other surrounding concepts as well. After generating
all the contexts, we use the skip-gram model to jointly learn embeddings of words and concepts.
Formally, given a training corpus of V words w1, w2, ..., wV . We iterate over the corpus identifying
words and concept mentions and thus generating a sequence of T tokens t1, t2, ...tT where T < V
(as multiword concepts will be counted as one token). Afterwards we train the a skip-gram model
aiming to maximize:
log p(ti+jti)
(3)
T(cid:88)
(cid:88)
i=1
−s≤j≤s,j(cid:54)=0
Lt =
1
T
where as in the conventional skip-gram model, s is the context window size. Here, ti is the target
token which would be either a word or a concept mention, and ti+j is a surrounding context word
or concept mention.
Title Suppressed Due to Excessive Length
5
2.3 Learning from Concept Graph
We employ Microsoft concept graph (Probase), a large scale probabilistic KB of millions of concepts
and their relationships (basically is-a hierarchy). Probase was created by mining billions of Web
pages and search logs of Microsoft's Bing3 repository using syntactic patterns. The concept KB was
then leveraged for text conceptualization to support text understanding tasks such as clustering
of Twitter messages and News titles (Song et al (2011, 2015)), search query understanding (Wang
et al (2015b)), short text segmentation (Hua et al (2015)), and term similarity (Kim et al (2013)).
Probase has a different structure (or modality) than Wikipedia because the knowledge is orga-
nized as a graph whose nodes are concepts and edges represent a weighted is-a relationship between
pairs of concepts. Formally, we model Probase as a 4-tuple graph G = (C, E, TC, TE) such that:
-- C is a set of vertices representing concepts.
-- E is a set of edges (arcs) connecting pairs of concepts.
-- TC is a finite set of tuples representing global statistics of each concept (i.e. its total occurrences).
-- TE is a finite set of tuples representing co-statistics of each edge connecting pairs of concepts
(i.e. their co-occurrence count).
Under this representation, location information is lost. Therefore the context of each concept can
be defined by the set of its neighbors in the graph. Formally, the skip-gram optimization function
would be maximizing:
C(cid:88)
(cid:88)
i=1
(ci,cj )∈E
Lp =
1
C
log p(cjci)
(4)
Note that, while maximizing Lp, the number of training examples generated from (ci, cj) ∈ E, is
equal to their co-occurrence count nci,cj . The incorporation of the concept-concept co-occurrence
counts in Probase will result in a dynamic adjustment to the overall likelihood Lp depending on the
counts between pairs of concepts. For example, for highly related concepts the co-occurrence count
will be high, and so will be their contribution to Lp and vice versa. Thus Probase provides another
source of conceptual knowledge to generate more concept-concept contexts, and subsequently learn
better concept representations.
2.4 Data and Model Training
2.4.1 Wikipedia
We utilized the Wikipedia dump of August 20164, which had ∼7 million articles. We extracted
articles plain text discarding images and tables. We also discarded References and External links
sections (if any). We pruned articles not under the main namespace5. Eventually, our corpus con-
tained ∼5 million articles in total. We preprocessed each article replacing all its references to other
Wikipedia articles with the their corresponding article IDs. In case any of the references is a title of
a redirect page, we used the page ID of the original page to ensure that all concept mentions were
normalized to their article IDs.
3 https://www.bing.com/
4 http://dumps.wikimedia.org/enwiki/
5 Articles which are prefixed with a string then colon before the title name
6
Walid Shalaby et al.
2.4.2 Microsoft Concept Graph (Probase)
We used Probase data repository6 which contained ∼5 million unique concepts, ∼12 million unique
instances, and ∼85 million is-a relationships. We followed a simple exact string matching between
Wikipedia article titles and Probase concept names in order to align the concepts in both KBs and
generate the final concepts set.
2.4.3 Training
We call our model Concept Multimodal Embedding (CME). During training, we jointly train our
model to maximize L = Lt + Lp, which as mentioned before is estimated using the softmax
function. Although it is possible to use weighted sum of Lt and Lp, we opted using unweighted
sum as it is simpler to train, and will not to introduce an extra hyperparameter to the learning
model. Thus, we let the model learn the best combination between Lt and Lp based on the global
words/concepts counts and local co-occurrences between pairs of them.
Following Mikolov et al (2013b), we utilize negative sampling to efficiently approximate the
softmax function by replacing every log p(wOwI ) term in the softmax function (equation 2) with:
k(cid:88)
log σ(v
(cid:124)
wO
uwI ) +
Ews∼Pn(w)[log σ(−v
(cid:124)
wg
uwI )]
(5)
g=1
1
where k is the number of negative samples drawn for each term, and σ(x) is the sigmoid function
1+e−x ).
(
We consider global word and concept statistics when generating the negative samples for train-
ing. As in Mikolov et al (2013b), we implement the downsampling trick where words with normalized
frequency (>10-3) are downsampled. For each training sample, we sample 5 noisy words/concepts
as negatives from the uniform distribution raised to 3/4rd power.
For text learning, we use a context window of size 9. We set the vector size to 500 dimensions
and train the model for 10 iterations using 12 cores machine with 64GB of RAM. Our model takes
∼15 hours to train. The total vocabulary size is ∼12.7 million including words and concepts.
3 Evaluation
3.1 Analogical Reasoning
Mikolov et al (2013c) introduced this intrinsic evaluation scheme to assess the capacity of the
embedding model to learn a vector space with meaningful substructure. Typically, analogies take
the form "a to b is same as c to ?" where a, b, and c are elements of the vocabulary V . Using vector
arithmetic, this can be answered by identifying d such that: d = arg maxd Sim(vec(d), vec(b) −
vec(a) + vec(c)), ∀d ∈ V −{a, b, c}, where Sim is a similarity function7. A good performance on this
task indicates the model's ability to learn semantic and syntactic patterns as linear relationships
between vectors in the embedding space (Pennington et al (2014)).
6 https://concept.research.microsoft.com/Home/Download
7 Cosine similarity or dot product if vectors are normalized.
Title Suppressed Due to Excessive Length
7
Dataset/Questions Semantic Syntactic
(10,675)
Method
(8,869)
Word2Vecsg
Word2Vecsg b
Glove
Gloveb
MPME
CME
58
78.1
80.8
69.5
71.6
91.4
61
62.8
61.5
32.1
54.6
61.7
All
(19,544)
59.5
69.8
70.3
49.1
63.1
75.2
Table 1 Results of analogical reasoning, given as percent accuracy (bold indicates best obtained accuracy). Our
CME model gives the best result on semantic analogies and higher overall accuracy than all other models.
3.1.1 Dataset
We use the word analogies dataset of Mikolov et al (2013a). The dataset contains 19,544 questions
divided into semantic analogies (8,869), and syntactic analogies (10,675). The semantic analogies
are questions about country capitals, state cities, country currencies...etc. For example, "cairo to
egypt is same as paris to france". The syntactic analogies are questions about verb tenses, opposites,
and adjective forms. For example, "big to biggest is same as great to greatest". In order to leverage
the concept vectors, we first identify the corresponding entity of each analogy word and use its
vector. If the word has no corresponding entity or corresponds to a disambiguation page under
Wikipedia we use its word vector instead.
3.1.2 Compared Systems
We compare our model to various word and entity embedding methods including:
1. Word embeddings: a) Word2Vecsg, word embedding model trained on Wikipedia using skip-
gram Mikolov et al (2013a), b) Word2Vecsg b, a baseline model we created by training the
skip-gram model on the same Wikipedia dump we used for our CME model, c) GloVe, word em-
bedding model proposed by Pennington et al (2014), and d) GloVeb, same model by Pennington
et al (2014), but trained on the same Wikipedia version used by CME without preprocessing,
for fair comparison. We use recommended hyperparameter values in Pennington et al (2014).
2. Entity mention embeddings: MPME, a recent model proposed by Cao et al (2017). The
model jointly learn embeddings of words and entity mentions by training the skip-gram on
Wikipedia, and utilizing anchor texts to generate multi-prototype entity mention embeddings.
3.1.3 Results
We report the accuracy scores of analogical reasoning in Table 1. As we see, our CME model outper-
forms all other models by significant percentages on the semantic analogies. The closest performing
model (Glove) is ∼10% less accurate. Performance on syntactic analogies is still very competitive
to Word2Vecsg b and GloVe. Overall, our model is ∼ 5% better than the closest performing model.
3.1.4 Error Analysis
Local context window models like ours generally perform better on semantic analogies than syn-
tactic ones. This indicates that syntactic regularities in most textual corpora are more difficult
8
Walid Shalaby et al.
to capture, using embeddings, than semantic regularities. A possible reason could be the more
morphological variations of verbs and adjectives than nouns. Our model training is even more bi-
ased toward capturing semantic relationships between concepts by incorporating knowledge from
Probase concept graph. This bias caused our model to produce some semantic predictions on the
syntactic analogies compared to the Word2Vecsg b baseline, returning a semantically related word
to the answer. For instance, our model predicted "fast" rather than "slows" 9 times compared
to 2 times by Word2Vecsg b. And "large" rather than "smaller" 14 times compared to 1 time by
Word2Vecsg b, Another set of errors were predicting the correct word but with wrong ending espe-
cially "ing". For instance, "implementing" rather than "implements" 27 times compared to 19 time
by Word2Vecsg b. We argue that, despite this bias, our CME model still produces very competitive
performance compared to other models on syntactic analogies. And more importantly, emphasizing
the semantic relatedness between concepts during training contributes to the significant accuracy
gains on the semantic analogies.
Algorithm 1: Classification + Bootstrapping
Input: U ={(l1, ul1 ), ..., (ln, uln )}: labels + embeddings
D ={(d1, vd1 ), ..., (dm, vdm )}: instances + embeddings
Result: L ={..., (di, lj ), ...}: label assignment for each instance
N: number of bootstrap instances
1 repeat
2
candidates ← {l1 : φ, ..., ln : φ}
foreach (d, vd) ∈ D do
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
dmax sim = 0
dmax label = null
foreach (l, ul) ∈ U do
siml = Sim(vd, ul)
if siml > dmax sim then
dmax sim = siml
dmax lebel = l
end
end
add (d, dmax sim) to candidates[l]
end
foreach (l, candidatesl) ∈ candidates.items do
repeat
scoremax = 0
dmax = null
foreach (d, scored) ∈ candidatesl do
if scored > scoremax then
scoremax = scored
dmax = d
end
end
add (dmax, l) to L
ul ← ul + vd
remove d from candidatesl
remove d from D
until N highest scored instances added
end
30
31 until D = φ
(cid:46) most similar instance so far
(cid:46) assign class label
(cid:46) bootstrap label embedding
(cid:46) no more instances to classify
Title Suppressed Due to Excessive Length
9
3.2 Concept Learning
Concept learning is a cognitive process which involves classifying a given concept/entity to one or
more candidate categories (e.g., "milk" as beverage, dairy product, liquid...etc). This process is also
known as concept categorization8 Li et al (2016).
Automated concept categorization can be viewed through both intrinsic and extrinsic evaluation.
Intrinsic because a "good" embedding model would generate clusters of concepts belonging to the
same category, and optimally place the category vector at the center of its instances cluster. And
extrinsic as the embedding model could be leveraged in many knowledge modeling tasks such
as KB construction (creating new concepts), KB completion (inferring new relationships between
concepts), and KB curation (removing noisy or assessing weak relationships).
Similar to Li et al (2016), we assign a given concept to a target category using Rocchio classifi-
cation (Rocchio (1971)), where the centroid of each category is set to the category's corresponding
embedding vector. Formally, given a set of n candidate concept categories G = {g1, ..., gn}, an in-
stance concept c, an embedding function f , and a similarity function Sim, then c is assigned to the
ith category gi such that gi = arg maxi Sim(f (gi), f (c)). Under our CME model, the embedding
function f would always map the given concept to its vector.
3.2.1 Bootstrapping
We leverage bootstrapping in order to improve the categorization accuracy without the need for
labeled data. In the context of concept learning, we start with the vectors of target category
concepts as a prototype view upon which categorization assignments are made (e.g., vec(bird),
vec(mammal)...etc). We leverage bootstrapping by iteratively updating this prototype view with
the vectors of concept instances we are most confident. For example, if "deer" is closest to "mammal"
than any other instance in the dataset, then we update the definition of "mammal" by perform-
ing vec(mammal)+=vec(deer), normalize it, and repeat the same operation for other categories as
well. This way, we adapt the initial prototype view to better match the specifics of the given data.
Algorithm 1 presents the pseudocode for performing concept categorization with bootstrapping. In
our implementation, we bootstrap the category vector with vectors of the most similar N instances
at a time. Another implementation option might be defining a threshold and bootstrapping using
vectors of N instances if their similarity scores exceed that threshold.
3.2.2 Datasets
As in Li et al (2016), we utilize two benchmark datasets: 1) Battig test (Baroni and Lenci (2010)),
which contains 83 single word concepts (e.g., cat, tuna, spoon..etc) belonging to 10 categories (e.g.,
mammal, fish, kitchenware..etc), and 2) DOTA, which was created by Li et al (2016) from Wikipedia
article titles (entities) and category names (categories). DOTA contains 300 single-word concepts
(DOTA-single) (e.g., coffee, football, semantics..etc), and (150) multiword concepts (DOTA-mult)
(e.g., masala chai, table tennis, noun phrase..etc). Both belong to 15 categories (e.g., beverage,
sport, linguistics...etc). Performance is measured in terms of the ability of the system to assign
concept instances to their correct categories.
8 In this paper, we use concept learning and concept categorization interchangeably
10
Walid Shalaby et al.
Dataset/Instances Battig DOTA-single DOTA-mult DOTA-all
Method
WESenna
WEM ikolov
TransE1
TransE2
TransE3
CE
HCE
WEb
+bootstrap
Wiki-ccb
+bootstrap
Probase-ccb
+bootstrap
CME
+bootstrap
(83)
44
74
66
75
46
79
87
77
88
72
81
73
95
94
100
(300)
(150)
(450)
52
72
72
80
55
89
93
93
97
90
91
65
78
91
99
32
67
69
77
52
85
91
86
86
80
86
70
81
88
95
45
72
71
79
54
88
92
91
90
87
87
67
83
90
98
Table 2 Results of the concept categorization task, given as percent accuracy (bold indicates best obtained accu-
racy). Our CME model with bootstrapping gives the best results outperforming all other models and baselines.
3.2.3 Compared Systems
We compare our model to various word, entity and category embedding methods including:
1. Word embeddings: Collobert et al (2011) model (WESenna) trained on Wikipedia. Here
vectors of multiword concepts are obtained by averaging their individual word vectors.
2. MWEs embeddings: Mikolov et al (2013b) model (WEM ikolov) trained on Wikipedia. This
model jointly learns single and multiword embeddings where MWEs are identified using corpus
statistics.
3. Entity-category embeddings: which include Bordes et al (2013) embedding model (TransE).
This model utilizes relational data between entities in a KB as triplets in the form (entity,
relation, entity) to generate representations of both entities and relationships. Li et al (2016)
implemented three variants of this model (TransE1, TransE2, TransE3) to generate represen-
tations for entities and categories jointly. Two other models introduced by Li et al (2016) are
CE and HCE. CE generates embeddings for concepts and categories using category information
of Wikipedia articles. HCE extends CE by incorporating Wikipedia's category hierarchy while
training the model to generate concept and category vectors.
4. Other baselines: we created three baselines: a) WEb, has word embeddings only and was
obtained by training the skip-gram model on the same Wikipedia dump we used for our CME
model (cf. equation 1), b) Wiki-ccb, has concept embeddings only and was obtained by first
preprocessing Wikipedia to remove all non-concept tokens, and then training the skip-gram
model on concept-concept contexts (cf. equation 3 where each token t is a concept mention),
and c) Probase-ccb, has concept embeddings only and was obtained by training the adapted
skip-gram model on Probase concept graph (cf. equation 4).
These baselines are meant to quantify and analyze the contribution of each type of information
individually. Specifically, entity-entity in Wikipedia conceptual contexts, entity-entity in Probase
knowledge graph, and word-word in Wikipedia raw contexts.
Title Suppressed Due to Excessive Length
11
No Utterance
1 where is new orleans
where is ci0
2 what states border the mississippi river
how many states border ri0
3
list flights from philadelphia to san francisco via dallas
list flight from ci0 to ci1 via ci2
4
flights from jfk or la guardia to cleveland
flight from ap0 or ap1 to ci0
Logical form
( lambda $0 e ( loc:t new orleans:ci $0 ) )
( lambda $0 e ( loc:t ci0 $0 ) )
( lambda $0 e ( and ( state:t $0 )
( next to:t $0 mississippi river:r ) ) )
( count $0 ( and ( state:t $0 ) ( next to:t $0 ri0 ) ) )
( lambda $0 e ( and ( flight $0 )
( from $0 philadelphia:ci ) ( to $0 san francisco:ci )
( stop $0 dallas:ci ) ) )
( lambda $0 e ( and ( flight $0 ) ( from $0 ci0 )
( to $0 ci1 ) ( stop $0 ci2 ) ) )
( lambda $0 e ( and ( flight $0 ) ( or ( from $0 jfk:ap )
( from $0 lga:ap ) ) ( to $0 cleveland:ci ) ) )
( lambda $0 e ( and ( flight $0 ) ( or ( from $0 ap0 )
( from $0 ap1 ) ) ( to $0 ci0 ) ) )
Table 3 Example utterances and their corresponding logical forms from the geography and flights domains. Left,
utterances before and after argument type identification. Right, logical forms before and after argument type iden-
tification. City is mapped to ci, Airport to ap, and River to ri.
3.2.4 Results
We report the accuracy scores of concept categorization9 in Table 2. Accuracy is calculated by
dividing the number of correctly classified concepts by the total number of concepts in the given
dataset. Scores of all non-baseline methods are obtained from Li et al (2016). As we can see in Table
2, our CME+bootstrap model outperforms all other models and baselines by significant percentages.
It even achieves 100% accuracy on the Battig dataset. With single word concepts, CME achieves
the best performance on Battig and competitive performance to WEb on DOTA-single. When it
comes to multiword concepts, our CME model comes second after HCE. In general, baselines which
depend only on pure concept-concept contexts (Wiki-ccb and Probase-ccb) perform worse than the
word-word contexts baseline (WEb). This indicates the significance of the full concept contextual
information obtained when including both other nearby words and other nearby concepts while
learning target concept representation.
3.2.5 Analysis
Is bootstrapping a magic bullet? A first look at the results of CME+bootstrap vs. CME might
indicate that if bootstrapping is applied to HCE or WEb which perform better than CME on
some datasets, their performance would still be superior. However, the results of WEb+bootstrap
show that the margin of performance gains of bootstrapping is not necessarily proportional to
the performance of the model without it. For example, WEb+bootstrap performs worse than
CMEb+bootstrap on DOTA-single, though WEb was initially better than CME. This means that
bootstrapping other better performing models such as HCE might not be as beneficial as it is to
CME. The bottom line here is: the model should learn a semantic space with optimal substruc-
tures which cluster instances of the same category together, and keep them far from instances of
other categories. This is clearly the case with our CME model which ends up having (near-)optimal
category vectors with bootstrapping.
9 From a multi-class classification perspective, the accuracy scores would be equivalent to the clustering purity
score as reported in Li et al (2016).
12
Walid Shalaby et al.
3.3 Argument Type Identification: A Case Study
In this section, we present a case study to analyze the impact of using our concept vectors for un-
supervised argument type identification with semantic parsing as an end-to-end task. In a nutshell,
semantic parsing is concerned with mapping natural language utterances into executable logical
forms Wang et al (2015a). The logical form is subsequently executed on a knowledge base to answer
the user question. Table 3 shows some example utterances and their corresponding logical forms
from the geography and flights domains.
3.3.1 Argument Identification
As we can notice from the examples in Table 3, user utterances usually contain mentions of entities of
various types (e.g., city, state, and airport names). These mentions are typically parsed as arguments
in the resulting logical form. Some of these mentions could be rare or even missing in the training
data. As noted by Dong and Lapata (2016), this problem reduces the model's capacity to learn
reliable parameters for such mentions.
One possible solution is to preprocess the training data, replacing all entity mentions with their
type names (e.g., san francisco to city, california to state...etc). This step allows the model to see
more identical input/output patterns during training, and thus better learn the parameters of such
patterns. The model would also generalize better to out of vocabulary mentions because the same
preprocessing could be done at test time.
Dong and Lapata (2016) proposed using gazetteers and regular expressions for argument identifi-
cation. The authors also demonstrated increased accuracy when employing such approach. However,
using regular expressions is error prone as the same utterance could be paraphrased in many dif-
ferent ways. In addition, gazetteers usually have low recall, and will not cover many surface forms
of the same entity mention.
In this paper, we embrace argument type identification in a totally unsupervised fashion. The
idea is to build upon the promising performance we achieved in concept categorization and apply
the same scheme to map entity mentions to their corresponding type names. Our unsupervised
argument type identification is a four step process: 1) we predefine target entity types and retrieve
their corresponding vectors from our CME model, 2) we identify entity mentions in user utterances
(e.g., mississippi river), 3) we lookup the mention vector in our CME model, and 4) we compute the
similarity between the mention vector and each of the predefined target entity types and choose the
most similar type if it exceeds a predefined threshold. This scheme is efficient and doesn't require
any manually crafted rules or heuristics. The only needed parameter is the similarity threshold
which we fix to 0.5 during experiments.
Note that standard off-the-shelf entity recognition systems could help in identifying the entity
mentions but not their type names. In domains like flights, we are interested in non standard
types such as airports and airlines. It is also important to distinguish between city, state, and
country mentions in the geography domain and not classifying all instances of these categories as
the standard location type.
Title Suppressed Due to Excessive Length
13
Dataset
w/o Identification
w/ Identification
GEO ATIS
73.2
68.6
77.1
83.7
Table 4 Results of semantic parsing before and after argument type identification, given as percent accuracy. Using
CME to identify argument types resulted in improved accuracy on both datasets.
3.3.2 Datasets
We analyze our unsupervised scheme on two datasets10 : 1) GEO which contains a total of 880
utterances about U.S. geography Zettlemoyer and Collins (2012). The dataset is split into 680
training instances and 200 test instances. Here we target identifying five entity types: city, state,
river, mountain, and country, and 2) ATIS which contains 5,410 utterances about flight bookings
split into 4,480 training instances, 480 development instances, and 450 test instances. Here we target
identifying six entity types: city, state, airline, airport, day name, and month.
3.3.3 Model & Training
We assess the performance of argument type identification by training Dong and Lapata (2016)
neural semantic parsing model11. The model utilizes sequence-to-sequence learning with neural
attention (see Dong and Lapata (2016) for more details). We use the Seq2Seq variant of the model
and do not perform any parameter tuning as our purpose is to analyze the performance before and
after argument type identification, and not to get a state-of-the-art performance on these datasets.
3.3.4 Results
We report the parsing accuracy in Table 4. Accuracy is defined as the proportion of the input
utterances whose logical form is identical to the gold standard. As we can see, our argument type
identification scheme resulted in significant accuracy improvements of ∼10% on both datasets.
We present this experiment as a case study for the utility of our embedding model in an end-
to-end task. We don't claim superiority over other embedding techniques here, rather we show that
the application of our embedding space to infer is-a relationships can be extended successfully to
other application areas including but not limited to: 1) unsupervised argument type identification,
and 2) inferring is-a relationship of other categories (city, state, airline, airport, day name...etc)
than those categories in the concept learning datasets (DOTA and Battig).
3.3.5 Error Analysis
Training the Seq2Seq semantic parsing model on preprocessed data is clearly beneficial as the results
in Table 4 show. Without argument identification, the model is prone to the out of vocabulary
problem. For example, on GEO we spotted 24 test instances with entities not mentioned in the
training data (e.g., new jersey, chattahoochee river). The same on ATIS with 23 instances. Another
source of errors was due to rare mentions. For example, "portland" appeared once in GEO training
data.
10 We obtained the raw dataset files by contacting the authors of Dong and Lapata (2016)
11 https://github.com/donglixp/lang2logic
14
Walid Shalaby et al.
Our scheme demonstrated good ability to capture most entity mentions and map them to their
correct type names. However, there was some subtle failure cases. For example, in "what length is
the mississippi", our scheme mapped "mississippi" to the state, while it was mapped to the river
in the gold standard logical form. Another example was mapping "new york" to the city in "what
is the density of the new york", while it was mapped to the state in the gold standard.
Overall, the results show competitive performance of our unsupervised method compared to
the tedious and error prone argument type identification methods. The analysis also shows supe-
rior generalization performance when using unsupervised argument identification with utterances
containing out of vocabulary and rare mentions.
4 Related Work
Neural embedding models have been proposed to learn distributed representations of concepts and
entities. Song and Roth (2015) proposed using the popular Word2Vec model of Mikolov et al (2013a)
to obtain the embeddings of each concept by averaging the vectors of the concept's individual words.
For example, the embeddings of "Microsoft Office" would be obtained by averaging the embeddings
of "Microsoft" and "Office" obtained from the Word2Vec model. Clearly, this scheme fails when
the semantics of multiword concepts is different from the compositional meaning of their individual
words.
More robust entity embeddings can be learned from the entity's corresponding article and/or
from the structure of the employed KB (e.g., its link graph) as in Hu et al (2015); Li et al (2016);
Yamada et al (2016); and Shalaby and Zadrozny (2017) who all utilize the skip-gram model, but
differ in how they define the context of the target concept. However, all these methods utilize one
KB only (Wikipedia) to learn entity representations. Our approach, on the other hand, learns better
entity representations by exploiting the conceptual knowledge in a weighted KB graph (Probase)
and not only from Wikipedia.
Unlike Hu et al (2015) and Li et al (2016) who learn entity embeddings only, our proposed
CME model maps both words and concepts into the same semantic space. In addition, compared to
Yamada et al (2016) model which also learns words and entity embeddings jointly, we better model
the local contextual information of entities and words in Wikipedia viewed as a textual KB. During
training, we generate word-word, word-concept, concept-word, and concept-concept contexts (cf.
equation 3). In Yamada et al (2016) model, concept-concept contexts are generated from Wikipedia
link graph, and not from their raw mentions in Wikipedia text.
Exploiting all concept tokens surrounding a target concept allows us, given another corpus with
annotated concept mentions, to easily harness concept-concept contexts even if the corpus has no
link structure (e.g., news stories, scientific publications, medical guidelines...etc).
Our model is computationally less costly than those of Hu et al (2015) and Yamada et al (2016)
as it requires a few hours rather than days to train using similar computing resources.
Although the learning of the embeddings might seem straightforward, as it uses the standard
skip-gram model, we see this as an advantage. On one hand, it allows our training to scale efficiently
to huge vocabulary of words and concepts without the need for a lot of preprocessing (e.g., removing
low frequent words and phrases as in Wang et al (2014); Fang et al (2016)). On the other hand,
to learn from the knowledge graph contexts, we propose simple adaption to the skip-gram model
(cf. equation 4), which allows us to use the same dot product scoring function when optimizing for
both Lt and Lp. This is a simpler and more computationally efficient function than the scoring
Title Suppressed Due to Excessive Length
15
function proposed by previous approaches which learn from knowledge graphs (cf. Fang et al (2016)'s
equation 1).
5 Conclusion & Discussion
Concepts are lexical expressions (single or multiword) that denote an idea, event or an object and
typically have a set of properties associated with it. In this paper, we introduced a neural-based
approach for learning embeddings of explicit concepts using the skip-gram model. Our approach
learns concept representations from mentions in free text corpora with annotated concept men-
tions. These mentions even if not available could be obtained through state-of-the-art entity linking
systems. We also proposed an effective and seamless addition to the skip-gram learning scheme to
learn concept vectors from two large scale knowledge bases of different modalities (Wikipedia, and
Probase).
We evaluated of the learned concept embeddings intrinsically and extrinsically. Our performance
on the analogical reasoning task produced a new state-of-the-art performance of 91% on semantic
analogies.
Empirical results on two datasets for performing concept categorization show superior perfor-
mance of our approach over other word and entity embedding models.
We also presented a case study to analyze the feasibility of using the learned vectors for argument
identification with neural semantic parsing. The analysis shows significant performance gains using
our unsupervised argument type identification scheme and better handling of out of vocabulary
entity mentions.
To our knowledge, this work is the first to combine knowledge from both Wikipedia and Probase
into a unified representation. Our concept space contains all Wikipedia article titles (∼5 million). We
use Probase as another source of conceptual knowledge to generate more concept-concept contexts,
and subsequently learn better concept vectors. In this spirit, we first filter Probase graph keeping
only edges whose both vertices are Wikipedia concepts. Using string matching, ∼1 million unique
Probase concepts were mapped to Wikipedia articles. Note that we still use the contexts generated
from the 5 million Wikipedia concepts, and add to them contexts obtained from the filtered Probase
graph. Out of the ∼12.7 million vectors in our model, we have ∼5 million concept vectors and ∼7.7
million word vectors.
One important future improvement is to better match entities from both Wikipedia and Probase.
For example, using string edits to increase recall or graph matching techniques to increase precision.
Despite using a simple string matching, the performance of our method is superior to other methods
utilizing Wikipedia only. It is expected that string matching might produce incorrect mappings.
However, it is important to mention that our string matching exploits the redirect pages titles as
well as the canonical titles of Wikipedia articles. This increases the recall. For example, in Probase,
nyc, city of new york, new york city are all matched with same Wikipedia article New York City.
Our initial qualitative analysis shows that it is common to match single-sense Wikipedia concepts
(ss-Wiki) with multi-sense Probase concepts (ms-Pro). However, in many of these cases, the ms-Pro
is dominated by the ss-Wiki. For example, the Wikipedia page for Tiger describes the animal. In
Probase, Tiger is-a Animal and Tiger is-a Big cat has more co-occurrences (917 & 315 respectively)
compared to Tiger is-a Dance (1 co-occurrence). Same for Rose which is described in Wikipedia as
flowering plant. In Probase, Rose is-a Flower has (906) and Rose is-a Plant has (487) co-occurrences
compared to Rose is-a Garden (10) and Rose is-a Odor (5) co-occurrences. We believe this would
16
Walid Shalaby et al.
help generating more consistent contexts from Wikipedia and Probase. On the other hand, such
multiple sense concepts in Probase could be leveraged for tasks like sense disambiguation and multi-
prototype embeddings, along the lines of Camacho-Collados et al (2016), Iacobacci et al (2015), and
Mancini et al (2016).
One important aspect of our CME model is its ability to better represent the long tail entities
with few mentions. Existing approaches that utilize Wikipedia's link graph treat Wikipedia as
unweighted directed KB graph. During training, a context is generated for entities e1 and e2 if e1 has
incoming/outgoing link from/to e2. This mechanism poorly represents rare/infrequent Wikipedia
concepts which have few incoming links (i.e. few mentions). We, alternatively, exploit Probase link
structure modeling it as a weighted undirected KB graph. We also utilize the co-occurrence counts
between pairs of concepts (cf. Figure 1). Therefore, we generate more concept-concept contexts,
resulting in better representations of the long-tail concepts. Consider for example Nightstand which
has in Wikipedia 17 incoming links. In Probase, Nightstand is-a Furniture, is-a Casegoods, and is-a
Bedroom furniture with co-occurrences 47, 47, and 32 respectively. This is a 100+ more contexts
than we can generate from Wikipedia. Even for frequent Wikipedia concepts, by exploiting the
co-occurrence counts, our model will reinforce concept-concept relatedness from the many contexts
obtained from Probase.
Our aim in this work was to combine the knowledge from both Wikipedia and Probase in a
seamless and simple way which is scalable (computationally cheap) and effective. The integration
learning scheme and the results show that we can achieve these two goals with high degree of success.
It principle, it is possible to perform such integration between Wikipedia and Probase contexts in
other ways, which may for example distinguish between syntactic and semantic information in
these contexts. However, such approaches will require extra preprocessing in order to prepare such
contexts. For instance, Levy and Goldberg (2014) explored learning word embeddings from contexts
generated from a dependency parser. We still claim an advantage over such approaches, because
they require costly preprocessing in terms of scalability and effectiveness. As demonstrated by the
results, our CME model advances the state-of-the-art on both the analogical reasoning and the
concept learning tasks, without the need to do expensive preprocessing or training to learn concept
representations.
Acknowledgements This work was partially supported by the National Science Foundation under grant number
1624035. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the
authors and do not necessarily reflect the views of the National Science Foundation. The authors would like to
thank Avik Ray and Yilin Shen from Samsung Research America for their constructive feedback and discussions
while developing the case study on the argument type identification task. The authors also appreciate the reviewers
valuable and profound comments.
References
Baroni M, Lenci A (2010) Distributional memory: A general framework for corpus-based semantics.
Computational Linguistics 36(4):673 -- 721
Bordes A, Usunier N, Garcia-Duran A, Weston J, Yakhnenko O (2013) Translating embeddings
for modeling multi-relational data. In: Advances in neural information processing systems, pp
2787 -- 2795
Title Suppressed Due to Excessive Length
17
Camacho-Collados J, Pilehvar MT, Navigli R (2016) Nasari: Integrating explicit knowledge and
corpus statistics for a multilingual representation of concepts and entities. Artificial Intelligence
240:36 -- 64
Cao Y, Huang L, Ji H, Chen X, Li J (2017) Bridge text and knowledge by learning multi-prototype
entity mention embedding. In: Proceedings of the 55th Annual Meeting of the Association for
Computational Linguistics (Volume 1: Long Papers), vol 1, pp 1623 -- 1633
Collobert R, Weston J, Bottou L, Karlen M, Kavukcuoglu K, Kuksa P (2011) Natural language
processing (almost) from scratch. Journal of Machine Learning Research 12(Aug):2493 -- 2537
Dong L, Lapata M (2016) Language to logical
form with neural attention. arXiv preprint
arXiv:160101280
Fang W, Zhang J, Wang D, Chen Z, Li M (2016) Entity disambiguation by knowledge and text
jointly embedding. In: Proceedings of The 20th SIGNLL Conference on Computational Natural
Language Learning, pp 260 -- 269
Hu Z, Huang P, Deng Y, Gao Y, Xing EP (2015) Entity hierarchy embedding. In: Proceedings of
The 53rd Annual Meeting of the Association for Computational Linguistics
Hua W, Wang Z, Wang H, Zheng K, Zhou X (2015) Short text understanding through lexical-
semantic analysis. In: Data Engineering (ICDE), 2015 IEEE 31st International Conference on,
IEEE, pp 495 -- 506
Iacobacci I, Pilehvar MT, Navigli R (2015) Sensembed: Learning sense embeddings for word and
relational similarity. In: ACL (1), pp 95 -- 105
Kim D, Wang H, Oh AH (2013) Context-dependent conceptualization. In: IJCAI, pp 2330 -- 2336
Levy O, Goldberg Y (2014) Dependency-based word embeddings. In: Proceedings of the 52nd
Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers),
vol 2, pp 302 -- 308
Li Y, Zheng R, Tian T, Hu Z, Iyer R, Sycara K (2016) Joint embedding of hierarchical categories
and entities for concept categorization and dataless classification. arXiv preprint arXiv:160707956
Mancini M, Camacho-Collados J, Iacobacci I, Navigli R (2016) Embedding words and senses to-
gether via joint knowledge-enhanced training. arXiv preprint arXiv:161202703
Mikolov T, Chen K, Corrado G, Dean J (2013a) Efficient estimation of word representations in
vector space. arXiv preprint arXiv:13013781
Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J (2013b) Distributed representations of words
and phrases and their compositionality. In: Advances in neural information processing systems,
pp 3111 -- 3119
Mikolov T, Yih Wt, Zweig G (2013c) Linguistic regularities in continuous space word representa-
tions. In: hlt-Naacl, vol 13, pp 746 -- 751
Pennington J, Socher R, Manning CD (2014) Glove: Global vectors for word representation. Pro-
ceedings of the Empiricial Methods in Natural Language Processing (EMNLP 2014) 12:1532 -- 1543
Phan MC, Sun A, Tay Y, Han J, Li C (2017) Neupl: Attention-based semantic matching and pair-
linking for entity disambiguation. In: Proceedings of the 2017 ACM on Conference on Information
and Knowledge Management, ACM, pp 1667 -- 1676
Ristoski P, Paulheim H (2016) Rdf2vec: Rdf graph embeddings for data mining. In: International
Semantic Web Conference, Springer, pp 498 -- 514
Rocchio JJ (1971) Relevance feedback in information retrieval
Shalaby W, Zadrozny W (2017) Learning concept embeddings for efficient bag-of-concepts densifi-
cation. arXiv preprint arXiv:170203342
18
Walid Shalaby et al.
Song Y, Roth D (2015) Unsupervised sparse vector densification for short text similarity. In: Pro-
ceedings of NAACL
Song Y, Wang H, Wang Z, Li H, Chen W (2011) Short text conceptualization using a probabilistic
knowledgebase. In: Proceedings of the Twenty-Second international joint conference on Artificial
Intelligence-Volume Volume Three, AAAI Press, pp 2330 -- 2336
Song Y, Wang S, Wang H (2015) Open domain short text conceptualization: A generative+ de-
scriptive modeling approach. In: IJCAI, pp 3820 -- 3826
Wang Y, Berant J, Liang P, et al (2015a) Building a semantic parser overnight. In: ACL (1), pp
1332 -- 1342
Wang Z, Zhang J, Feng J, Chen Z (2014) Knowledge graph and text jointly embedding. In: EMNLP,
vol 14, pp 1591 -- 1601
Wang Z, Zhao K, Wang H, Meng X, Wen JR (2015b) Query understanding through knowledge-based
conceptualization
Yamada I, Shindo H, Takeda H, Takefuji Y (2016) Joint learning of the embedding of words and
entities for named entity disambiguation. arXiv preprint arXiv:160101343
Zettlemoyer LS, Collins M (2012) Learning to map sentences to logical form: Structured classifica-
tion with probabilistic categorial grammars. arXiv preprint arXiv:12071420
Zwicklbauer S, Seifert C, Granitzer M (2016) Robust and collective entity disambiguation through
semantic embeddings. In: Proceedings of the 39th International ACM SIGIR conference on Re-
search and Development in Information Retrieval, ACM, pp 425 -- 434
|
1909.00091 | 1 | 1909 | 2019-08-30T23:27:06 | Automatically Inferring Gender Associations from Language | [
"cs.CL"
] | In this paper, we pose the question: do people talk about women and men in different ways? We introduce two datasets and a novel integration of approaches for automatically inferring gender associations from language, discovering coherent word clusters, and labeling the clusters for the semantic concepts they represent. The datasets allow us to compare how people write about women and men in two different settings - one set draws from celebrity news and the other from student reviews of computer science professors. We demonstrate that there are large-scale differences in the ways that people talk about women and men and that these differences vary across domains. Human evaluations show that our methods significantly outperform strong baselines. | cs.CL | cs |
Automatically Inferring Gender Associations from Language
Serina Chang
Kathleen McKeown
Department of Computer Science
Department of Computer Science
Columbia University∗
Columbia University
[email protected]
[email protected]
Abstract
Our contributions include:
In this paper, we pose the question: do people
talk about women and men in different ways?
We introduce two datasets and a novel integra-
tion of approaches for automatically inferring
gender associations from language, discover-
ing coherent word clusters, and labeling the
clusters for the semantic concepts they repre-
sent. The datasets allow us to compare how
people write about women and men in two dif-
ferent settings - one set draws from celebrity
news and the other from student reviews of
computer science professors. We demonstrate
that there are large-scale differences in the
ways that people talk about women and men
and that these differences vary across domains.
Human evaluations show that our methods sig-
nificantly outperform strong baselines.
• Two datasets for studying language and gen-
der, each consisting of over 300K sentences.
• Methods to infer gender-associated words
and labeled clusters in any domain.
• Novel findings that demonstrate in both do-
mains that people do talk about women and
men in different ways.
Each contribution brings us closer to modeling
how gender associations appear in everyday lan-
guage. In the remainder of the paper, we present
related work, our data collection, methods and
findings, and human evaluations of our system.1
1 Introduction
2 Related Work
It is well-established that gender bias exists in
language -- for example, we see evidence of
this given the prevalence of sexism in abu-
sive language datasets (Waseem and Hovy, 2016;
Jha and Mamidi, 2017). However, these are ex-
treme cases of gender norms in language, and only
encompass a small proportion of speakers or texts.
Less studied in NLP is how gender norms man-
ifest in everyday language -- do people talk about
women and men in different ways? These types of
differences are far subtler than abusive language,
but they can provide valuable insight into the roots
of more extreme acts of discrimination. Subtle dif-
ferences are difficult to observe because each case
on its own could be attributed to circumstance, a
passing comment or an accidental word. How-
ever, at the level of hundreds of thousands of data
points, these patterns, if they do exist, become un-
deniable. Thus, in this work, we introduce new
datasets and methods so that we can study subtle
gender associations in language at the large-scale.
∗ Since writing this paper, Serina Chang has moved to
the Department of Computer Science at Stanford University.
The study of gender and language has a rich his-
tory in social science. Its roots are often attributed
to Robin Lakoff, who argued that language is fun-
damental to gender inequality, "reflected in both
the ways women are expected to speak, and the
ways in which women are spoken of" (Lakoff,
1973). Prominent scholars following Lakoff have
included Deborah Tannen (1990), Mary Bucholtz
and Kira Hall (1995), Janet Holmes (2003), Pene-
lope Eckert (2003), and Deborah Cameron (2008),
along with many others.
In recent decades,
the study of gender and
re-
language has also attracted computational
searchers. Echoing Lakoff's original claim, a
popular strand of computational work focuses on
differences in how women and men talk, an-
alyzing key lexical traits (Boulis and Ostendorf,
2005; Argamon et al., 2007; Bamman et al., 2014)
and predicting a person's gender from some text
they have written (Rao et al., 2010; Jurgens et al.,
1Our
datasets
and
code
are
available
cs.columbia.edu/nlp/tools.cgi#gendered%20corpus
github.com/serinachang5/gender-associations, respectively.
at
and
2017). There is also research studying how people
talk to women and men (Voigt et al., 2018), as well
as how people talk about women and men, typi-
cally in specific domains such as sports journalism
(Fu et al., 2016), fiction writing (Fast et al., 2016),
movie scripts (Sap et al., 2017), and Wikipedia bi-
ographies (Wagner et al., 2015, 2016). Our work
builds on this body by diving into two novel do-
mains: celebrity news, which explores gender in
pop culture, and student reviews of CS professors,
which examines gender in academia and, particu-
larly, the historically male-dominated field of CS.
Furthermore, many of these works rely on manu-
ally constructed lexicons or topics to pinpoint gen-
dered language, but our methods automatically in-
fer gender-associated words and labeled clusters,
thus reducing supervision and increasing the po-
tential to discover subtleties in the data.
Modeling gender associations
in language
could also be instrumental to other NLP tasks.
Abusive language is often founded in sex-
ism (Waseem and Hovy, 2016; Jha and Mamidi,
2017), so models of gender associations could
help to improve detection in those cases. Gen-
der bias also manifests
in NLP pipelines:
prior research has found that word embeddings
preserve gender biases (Bolukbasi et al., 2016;
Caliskan et al., 2017; Garg et al., 2018), and some
have developed methods to reduce this bias
(Zhao et al., 2018, 2019). Yet, the problem is far
from solved; for example, Gonen and Goldberg
2019 showed that it is still possible to recover
gender bias from "de-biased" embeddings. These
findings further motivate our research, since be-
fore we can fully reduce gender bias in embed-
dings, we need to develop a deeper understanding
of how gender permeates through language in the
first place.
We also build on methods to cluster words in
word embedding space and automatically label
clusters. Clustering word embeddings has proven
useful for discovering salient patterns in text cor-
pora (Wilson et al., 2018; Demszky et al., 2019).
Once clusters are derived, we would like them to
be interpretable. Much research simply considers
the top-n words from each cluster, but this method
can be subjective and time-consuming to interpret.
Thus, there are efforts to design methods of auto-
matic cluster labeling (Manning et al., 2008). We
take a similar approach to Poostchi and Piccardi
2018, who leverage word embeddings and Word-
Num. texts
Num. sentences
Fem-Male prop.
Celeb
15,917
342,645
.67 / .33
Professor
283,973
976,677
.28 / .72
Table 1: Summary statistics of our datasets.
Net during labeling, and we extend their method
with additional techniques and evaluations.
3 Data Collection
Our first dataset contains articles from celebrity
magazines People, UsWeekly, and E!News. We
labeled each article for whether it was report-
ing on men, women, or neither/unknown.2 To
do this, we first extracted the article's topic tags.
Some of these tags referred to people, but oth-
ers to non-people entities, such as "Gift Ideas"
or "Health." To distinguish between these types
of tags, we queried each tag on Wikipedia and
checked whether the top page result contained a
"Born" entry in its infobox -- if so, we concluded
that the tag referred to a person.
Then, from the person's Wikipedia page, we de-
termined their gender by checking whether the in-
troductory paragraphs of the page contained more
male or female pronouns. This method was simple
but effective, since pronouns in the introduction al-
most always resolve to the subject of that page. In
fact, on a sample of 80 tags that we manually an-
notated, we found that comparing pronoun counts
predicted gender with perfect accuracy. Finally, if
an article tagged at least one woman and did not
tag any men, we labeled the article as Female; in
the opposite case, we labeled it as Male.
Our second dataset contains reviews from Rate-
MyProfessors (RMP), an online platform where
students can review their professors. We included
all 5,604 U.S. schools on RMP, and collected all
reviews for CS professors at those schools. We la-
beled each review with the gender of the professor
whom it was about, which we determined by com-
paring the count of male versus female pronouns
over all reviews for that professor. This method
was again effective, because the reviews are ex-
2Our method unfortunately could not take into account
non-binary gender identities, as it relied on she/her and
he/his pronouns, and could not easily integrate the singular
they/them, nor could we find sufficient examples of ze/zir or
other non-binary pronouns in our data. That said, we will
continue striving towards better inclusion, and hope in future
work to expand our methods beyond the binary.
pressly written about a certain professor, so the
pronouns typically resolve to that professor.
In addition to extracting the text of the articles
or reviews, for each dataset we also collected var-
ious useful metadata. For the celebrity dataset, we
recorded each article's timestamp and the name
of the author, if available. Storing author names
creates the potential to examine the relationship
between the gender of the author and the gender
of the subject, such as asking if there are differ-
ences between how women write about men and
how men write about men. In this work, we did
not yet pursue this direction because we wanted
to begin with a simpler question of how gender
is discussed: regardless of the gender of the au-
thors, what is the content being put forth and con-
sumed? Furthermore, we were unable to extract
author gender in the professor dataset since the
RMP reviews are anonymous. However, in future
work, we may explore the influence of author gen-
der in the celebrity dataset.
For the professor dataset, we captured metadata
such as each review's rating, which indicates how
the student feels about the professor on a scale of
AWFUL to AWESOME. This additional variable
in our data creates the option in future work to
factor in sentiment; for example, we could study
whether there are differences in language used
when criticizing a female versus a male professor.
4 Inferring Word-Level Associations
Our first goal was to discover words that are sig-
nificantly associated with men or women in a
given domain. We employed an approach used by
Bamman et al. 2014 in their work to analyze dif-
ferences in how men and women write on Twitter.
4.1 Methods
First, to operationalize, we say that term i is as-
sociated with gender j if, when discussing indi-
viduals of gender j, i is used with unusual fre-
quency -- which we can check with statistical hy-
pothesis tests. Let fi represent the likelihood of
i appearing when discussing women or men. fi
is unknown, but we can model the distribution of
all possible fi using the corpus of texts that we
have from the domain. We construct a gender-
balanced version of the corpus by randomly un-
dersampling the more prevalent gender until the
proportions of each gender are equal. Assuming a
non-informative prior distribution on fi, the pos-
Female-Associated
girl, cover, husband,
wedding, gown, fash-
ion, mom, pregnancy,
photo, top, hair, look
rec-
respond, email,
ommend, help,
love,
accept, need, send, re-
ply, communicate
easy,
rude, wonder-
ful, kind, caring, hot,
strict,
timely, mean,
disorganized, beautiful
teach,
lecture,
Male-Associated
movie, president, wife,
dad, death, film, host,
assault, claim, miscon-
duct, action, director
know,
learn,
write,
chal-
lenge, solve, ramble,
push, joke, bore
real,
knowledgeable,
challenging,
bril-
liant, arrogant, hard,
passionate, practical
Table 2: Top: Sample from the top-25 most gender-
associated nouns in the celebrity domain. Middle: pro-
fessor domain, sample from top-25 verbs. Bottom:
professor domain, sample from top-25 adjectives. All
associations listed are p ≤ 0.05, with Bonferroni cor-
rection. See Appendix for all top-25 nouns, verbs, and
adjectives for both genders in both domains.
terior distribution is Beta(ki, N − ki), where ki is
the count of i in the gender-balanced corpus and
N is the total count of words in that corpus.
As Bamman et al. 2014 discuss, "the distri-
bution of the gender-specific counts can be de-
scribed by an integral over all possible fi. This
integral defines the Beta-Binomial distribution
(Gelman et al., 2004), and has a closed form so-
lution." We say that term i is significantly asso-
ciated with gender j if the cumulative distribu-
tion at kij (the count of i in the j portion of the
gender-balanced corpus) is p ≤ 0.05. As in the
original work, we apply the Bonferroni correction
(Dunn, 1961) for multiple comparisons because
we are computing statistical tests for thousands of
hypotheses.
4.2 Findings
We applied this method to discover gender-
In Table 2,
associated words in both domains.
we present a sample of the most gender-associated
nouns from the celebrity domain. Several themes
emerge:
for example, female celebrities seem
to be more associated with appearance ("gown,"
"photo," "hair," "look"), while male celebrities are
more associated with creating content ("movie,"
"film," "host," "director"). This echoes real-world
trends: for instance, on the red carpet, actresses
tend to be asked more questions about their ap-
pearance - what brands they are wearing, how
long it took to get ready, etc. - while actors are
asked questions about their careers and creative
processes (as an example, see Selby 2014).
Table 2 also includes some of the most gender-
associated verbs and adjectives from the professor
domain. Female CS professors seem to be praised
for being communicative and personal with stu-
dents ("respond," "communicate," "kind," "car-
ing"), while male CS professors are recognized
for being knowledgeable and challenging the stu-
dents ("teach,", "challenge," "brilliant," "practi-
cal"). These trends are well-supported by so-
cial science literature, which has found that fe-
male teachers are praised for "personalizing" in-
struction and interacting extensively with students,
while male teachers are praised for using "teacher
as expert" styles that showcase mastery of material
(Statham et al., 1991).
These findings establish that there are clear dif-
ferences in how people talk about women and men
-- even with Bonferroni correction, there are still
over 500 significantly gender-associated nouns,
verbs, and adjectives in the celebrity domain and
over 200 in the professor domain. Furthermore,
the results in both domains align with prior stud-
ies and real world trends, which validates that
our methods can capture meaningful patterns and
innovatively provide evidence at the large-scale.
This analysis also hints that it can be helpful to
abstract from words to topics to recognize higher-
level patterns of gender associations, which moti-
vates our next section on clustering.
5 Clustering & Cluster Labeling
With word-level associations in hand, our next
goals were to discover coherent clusters among the
words and to automatically label those clusters.
5.1 Methods
First, we trained domain-specific word embed-
dings using the Word2Vec (Mikolov et al., 2013)
CBOW model (w ∈ R100). Then, we used k-
means clustering to cluster the embeddings of the
gender-associated words. Since k-means may con-
verge at local optima, we ran the algorithm 50
times and kept the model with the lowest sum of
squared errors.
To automatically label the clusters, we com-
bined the grounded knowledge of WordNet
(Miller, 1995) and context-sensitive strengths of
domain-specific word embeddings. Our algo-
rithm is similar to Poostchi and Piccardi 2018's
approach, but we extend their method by introduc-
ing domain-specific word embeddings for cluster-
ing as well as a new technique for sense disam-
biguation. Given a cluster, our algorithm proceeds
with the following three steps:
1. Sense disambiguation: The goal is to as-
sign each cluster word to one of its WordNet
synsets; let S represent the collection of cho-
sen synsets. We know that these words have
been clustered in domain-specific embedding
space, which means that in the context of the
domain, these words are very close semanti-
cally. Thus, we choose S ∗ that minimizes the
total distance between its synsets.
2. Candidate label generation: In this step, we
generate L, the set of possible cluster labels.
Our approach is simple: we take the union of
all hypernyms of the synsets in S ∗.
3. Candidate label ranking: Here, we rank the
synsets in L. We want labels that are as close
to all of the synsets in S ∗ as possible; thus,
we score the candidate labels by the sum of
their distances to each synset in S ∗ and we
rank them from least to most distance.
In steps 1 and 3, we use WordNet pathwise dis-
tance, but we encourage the exploration of other
distance representations as well.
5.2 Findings
Table 3 displays a sample of our results -- we find
that the clusters are coherent in context and the la-
bels seem reasonable. In the next section, we dis-
cuss human evaluations that we conducted to more
rigorously evaluate the output, but first we discuss
the value of these methods toward analysis.
At the word-level, we hypothesized that in the
celebrity domain, women were more associated
with appearance and men with creating content.
Now, we can validate those hypotheses against la-
beled clusters -- indeed, there is a cluster labeled
clothing that is 100% female (i.e. 100% words
are female-associated), and a 80% male cluster
labeled movie. Likewise,
in the professor do-
main, we had guessed that women are associated
with communication and men with knowledge,
and there is a 100% female cluster labeled commu-
nication and a 89% male cluster labeled cognition.
Thus, cluster labeling proves to be very effective at
Domain
Celeb
Professor
Sample Words in Cluster
gown, top, dress, pant, skirt, neckline
film, release, role, character, project
boyfriend, beau, hubby, wife, girlfriend
response, email, contact, answer
material, concept, topic, stuff, subject
teacher, woman, lady, prof, guy, dude
F:M Top 3 Pred. Cluster Labels
25:0
4:16
15:7
13:0
1:8
5:7
covering, cloth covering, clothing
movie, show, event
lover, person, relative
statement, message, communication
content, idea, cognition
man, adult, woman
Table 3: Sample of our clusters and predicted cluster labels. We include in the Appendix a more comprehensive
table of our results. F:M refers to the ratio of female-associated to male-associated words in the cluster.
pulling out the patterns that we believed we saw at
the word-level, but could not formally validate.
The clusters we mentioned so far all lean heav-
ily toward one gender association or the other,
but some clusters are interesting precisely be-
cause they do not lean heavily -- this allows us
to see where semantic groupings do not align
exactly with gender association. For example,
in the celebrity domain,
there is a cluster la-
beled lover that has a mix of female-associated
words ("boyfriend," "beau," "hubby") and male-
associated words ("wife," "girlfriend").
Jointly
leveraging cluster labels and gender associations
allows us to see that in the semantic context of hav-
ing a lover, women are typically associated with
male figures and men with female figures, which
reflects heteronormativity in society.
whether the word falls under the concept. The
concept is a potential cluster label and the word
is either a word from that cluster or drawn ran-
domly from the domain vocabulary. For a good
label, the rate at which in-cluster words fall un-
der the label should be much higher than the rate
at which out-of-cluster words fall under.
In our
experiments, we tested the top 4 predicted labels
and the centroid of the cluster as a strong base-
line label. The centroid achieved an in-cluster rate
of .60 and out-of-cluster rate of .18 (difference of
.42). Our best performing predicted label achieved
an in-cluster rate of .65 and an out-of-cluster rate
of .04 (difference of .61), thus outperforming the
centroid on both rates and increasing the gap be-
tween rates by nearly 20 points. In the Appendix,
we include more detailed results on both tasks.
6 Human Evaluations
7 Conclusion
To test our clusters, we employed the Word In-
trusion task (Chang et al., 2009). We present the
annotator with five words -- four drawn from one
cluster and one drawn randomly from the domain
vocabulary -- and we ask them to pick out the in-
truder. The intuition is that if the cluster is co-
herent, then an observer should be able to identify
the out-of-cluster word as the intruder. For both
domains, we report results on all clusters and on
the top 8, ranked by ascending normalized sum of
squared errors, which can be seen as a prediction
of coherence. In the celebrity domain, annotators
identified the out-of-cluster word 73% of the time
in the top-8 and 53% overall. In the professor do-
main, annotators identified it 60% of the time in
the top-8 and 49% overall. As expected, top-8 per-
formance in both domains does considerably bet-
ter than overall, but at all levels the precision is
significantly above the random baseline of 20%.
To test cluster labels, we present the annota-
tor with a label and a word, and we ask them
We have presented two substantial datasets and
a novel integration of methods to automatically
infer gender associations in language. We have
demonstrated that in both datasets, there are clear
differences in how people talk about women and
men. Furthermore, we have shown that cluster-
ing and cluster labeling are effective at identifying
higher-level patterns of gender associations, and
that our methods outperform strong baselines in
human evaluations.
In future work, we hope to
use our findings to improve performance on tasks
such as abusive language detection. We also hope
to delve into finer-grained analyses, exploring how
language around gender interacts with other vari-
ables, such as sexual orientation or profession (e.g.
actresses versus female athletes). Finally, we plan
to continue widening the scope of our study --
for example, expanding our methods to include
non-binary gender identities, evaluating changes
in gender norms over time, and spreading to more
domains, such as the political sphere.
References
Shlomo Argamon, Moshe Koppel, James Pennebaker,
and Jonathan Schler. 2007. Mining the blogosphere:
age, gender, and the varieties of self-expression.
First Monday, 12(9).
David Bamman, Jacob Eisenstein, and Tyler Schnoe-
belen. 2014. Gender identity and lexical variation in
social media. Journal of Sociolinguistics, 18(2).
Tolga Bolukbasi, Kai-Wei Chang,
James Zou,
Venkatesh Saligrama, and Adam Kalai. 2016. Man
is to computer programmer as woman is to home-
maker? debiasing word embeddings. In NeurIPS.
Constantinos Boulis and Mari Ostendorf. 2005. A
quantitative analysis of lexical differences between
genders in telephone conversations. In ACL.
Mary Bucholtz and Kira Hall. 1995. Gender articu-
lated: language and the socially constructed self.
Routledge.
Aylin Caliskan,
Joanna J. Bryson,
and Arvind
Narayanan. 2017. Semantics derived automatically
from language corpora contain human-like biases.
Science, 356(6334).
Deborah Cameron. 2008.
The myth of mars and
venus: do men and women really speak different lan-
guages? Oxford University Press.
Jonathan Chang, Sean Gerrish, Chong Wang, Jordan L.
Boyd-Graber, and David M. Blei. 2009. Reading
tea leaves: how humans interpret topic models. In
NeurIPS.
Dorottya Demszky, Nikhil Garg, Rob Voigt, James
Zou, Matthew Gentzkow, Jesse Shapiro, and Dan Ju-
rafsky. 2019. Analyzing polarization in social me-
dia: method and application to tweets on 21 mass
shootings. In NAACL.
Olive Jean Dunn. 1961. Multiple comparisons among
means. Journal of the American Statistical Associa-
tion, 56(293).
Penelope Eckert and Sally McConnell-Ginet. 2003.
Language and gender. Cambridge University Press.
Ethan Fast, Tina Vachovsky, and Michael Bernstein.
2016. Shirtless and dangerous: quantifying linguis-
tic signals of gender bias in an online fiction writing
community. In ICWSM.
Liye Fu, Cristian Danescu-Niculescu-Mizil, and Lil-
lian Lee. 2016. Tie-breaker: using language mod-
els to quantify gender bias in sports journalism. In
IJCAI Workshop on NLP Meets Journalism.
Andrew Gelman, John B. Carlin, Hal S. Stern, and
Donald B. Rubin. 2004. Bayesian data analysis.
CRC Press/Chapman Hall.
Hila Gonen and Yoav Goldberg. 2019. Lipstick on a
pig: debiasing methods cover up systematic gender
biases in word embeddings but do not remove them.
In NAACL-HLT.
Janet Holmes and Miriam Meyerhoff. 2003. The hand-
book of language and gender. Blackwell Publish-
ing.
Akshita Jha and Radhika Mamidi. 2017. When does
a compliment become sexist? analysis and classifi-
cation of ambivalent sexism using twitter data.
In
ACL Workshop on NLP and Computational Social
Science.
David Jurgens, Yulia Tsvetkov, and Dan Jurafsky.
2017. Writer profiling without the writers text. In
SocInfo.
Robin Lakoff. 1973. Language and woman's place.
Language in Society, 2(1).
Christopher D. Manning, Prabhakar Raghavan, and
Hinrich Schutze. 2008. Introduction to information
retrieval. Cambridge University Press.
Tomas Mikolov, Kai Chen, Gregory Corrado, and Jef-
frey Dean. 2013. Efficient estimation of word repre-
sentations in vector space. In ICLR Workshop.
George A. Miller. 1995. Wordnet: a lexical database
for english. Communications of the ACM, 38(11).
Hanieh Poostchi and Massimo Piccardi. 2018. Cluster
labeling by word embeddings and wordnet's hyper-
nymy. In Australasian Language Technology Asso-
ciation Workshop.
Delip Rao, David Yarowsky, Abhishek Shreevats, and
Manaswi Gupta. 2010. Classifying latent user at-
tributes in twitter. In SMUC.
Maarten Sap, Marcella Cindy Prasetio, Ari Holtzman,
Hannah Rashkin, and Yejin Choi. 2017. Connota-
tion frames of power and agency in modern films.
In EMNLP.
Jenn Selby. 2014. Cate blanchett calls out red carpet sexism: 'do you do this to the guys?'.
In Independent.
Anna Statham, Laurel Richardson, and Judith A. Cook.
1991. Gender and university teaching: a negotiated
difference. SUNY Press.
Deborah Tannen. 1990. You just dont understand: men
and women in conversation. Ballantine Books.
Nikhil Garg, Londa Schiebinger, Dan Jurafsky, and
James Zou. 2018. Word embeddings quantify 100
years of gender and ethnic stereotypes. Proceedings
of the National Academy of Sciences, 155(16).
Rob Voigt, David Jurgens, Vinodkumar Prabhakaran,
Dan Jurafsky, and Yulia Tsvetkov. 2018. Rtgender:
a corpus for studying differential responses to gen-
der. In LREC.
for just the top 8, determined by ascending nor-
malized sum of squares.
Domain
Celeb
Celeb
Prof.
Prof.
Level
Top-8
Overall
Top-8
Overall
Precision Fleiss' κ
.725
.527
.600
.488
.530
.314
.216
.212
Table 4: Results for Word Intrusion task. All results
significantly outperform the random baseline of .20
(p ≤ 0.0001).
Table 9 displays more detailed results for the
cluster labeling task. As discussed in the main pa-
per, we would like to see that the rate at which in-
cluster words fall under the cluster label is much
higher than the rate at which out-of-cluster words
fall under. We tried the top 4 predicted labels,
compared against the centroid as a baseline label.
For each cluster, we tested labels against 10 in-
cluster words and 3 out-of-cluster words; thus, we
tested 65 questions (13 words x 5 labels) per clus-
ter. Due to the high number of questions per clus-
ter, we only tested 15 clusters -- the top 10 labeled
in the celebrity domain and the top 5 labeled in the
professor domain. We report results over all tested
clusters, but broken down by label type (e.g. cen-
troid or 2nd predicted label).
Claudia Wagner, David Garcia, Mohsen Jadidi, and
Markus Strohmaier. 2015. It's a man's wikipedia?
assessing gender inequality in an online encyclope-
dia. In ICWSM.
Claudia Wagner, Eduardo Graells-Garrido, David Gar-
cia, and Filippo Menczer. 2016. Women through
the glass ceiling: gender asymmetries in wikipedia.
EPJ Data Sci, 5(5).
Zeerak Waseem and Dirk Hovy. 2016. Hateful sym-
bols or hateful people? predictive features for hate
speech detection on twitter. In NAACL-HLT.
Steven Wilson, Yiting Shen, and Rada Mihalcea. 2018.
Building and validating hierarchical lexicons with a
case study on personal values. In SocInfo.
Jieyu Zhao, Tianlu Wang, Mark Yatskar, Ryan Cot-
terell, Vicente Ordonez, and Kai-Wei Chang. 2019.
Gender bias in contextualized word embeddings. In
NAACL-HLT.
Jieyu Zhao, Yichao Zhou, Zeyu Li, Wei Wang, and Kai-
Wei Chang. 2018. Learning gender-neutral word
embeddings. In EMNLP.
A Appendix
We include here extended results for each of the
stages of work that we covered in the main paper:
findings for inferring word-level gender associa-
tions (Tables 5 and 6), findings from clustering and
cluster labeling (Tables 7 and 8), and results from
our two evaluation tasks (Tables 4 and 9). Tables
5 -- 9 are on the following three pages.
A.1 Word-Level Results
Tables 5 and 6 provide the top 25 most significant
female-associated and male-associated nouns,
verbs, and adjectives in both domains. Gender
association is determined using the method de-
scribed in Section 4.1.
A.2 Clustering and Cluster Labeling Results
Tables 7 and 8 provide the clustering and clus-
ter labeling results for the top-n clusters in each
domain, ranked by ascending normalized sum of
squared errors. During clustering, we set k to N
50 ,
where N was the number of embeddings being
clustered.
In the celebrity domain, this resulted
in 45 clusters; in Table 7, we show the top 12. In
the professor domain, this resulted in 16 clusters;
in Table 8, we show the top 6.
A.3 Human Evaluation Results
Table 4 provides more detailed results for the
Word Intrusion task. As in the main paper, we pro-
vide the results in each domain for all clusters and
Table 5: Top 25 most gender-associated nouns, verbs, and adjectives in the celebrity domain. Words are listed in
order of decreasing significance, but all words fall under p ≤ 0.05, with Bonferroni correction.
Nouns
Verbs
Adj.
Female-Associated
girl, eye, cover, star, sister, shoulder,
husband, lady, baby, issue, wedding,
actress, reality, daughter, carpet, gown,
fashion, mom, pregnancy, photo, top,
hair, look, outfit, mother
caption, wear, look, keep, love, date,
match, rock, use, accessorize, style,
pair, feel, share, show, shop, fit, plunge,
model, apply, reveal, flaunt, open, tone,
color
red, pink, pregnant, sexy, sheer, white,
black, beautiful, stylish, nude, stun-
ning, chic, natural, blonde, new, blue,
sweet, glam, loose, hot, oversized, ca-
sual, gorgeous, toned, little
Male-Associated
movie, actor, president, wife, dad,
death, film, host, news, statement,
father, girlfriend, man, assault, alle-
gation, attorney, claim, investigation,
misconduct, behavior, lawsuit, action,
guy, director, harassment
say, deny, accord, claim, accuse, allege,
would, apologize, publish, fire, hear,
play, come, continue, ask,
involve,
pass, replace, investigate, charge, win,
rap, pay, state, sue
sexual, consensual, inappropriate, fu-
rious, guilty, alleged, oral, presiden-
tial, late, republican, deadpool, many,
financial, bad, political, public, false,
russian, comic, non, dead, detailed, nu-
merous, untrue, criminal
Table 6: Top 25 most gender-associated nouns, verbs, and adjectives in the professor domain. Words are listed in
order of decreasing significance, but all words fall under p ≤ 0.05, with Bonferroni correction, aside from the last
three terms listed for Female-Associated Verbs and the last four terms listed for Male-Associated Verbs.
Nouns
Verbs
Adj.
instruction,
Female-Associated
class, work, teacher, person, woman,
assignment, email, credit, week, step,
direction, attitude,
lady,
instructor, date, response, discussion,
sweetheart, communication, husband,
point, group, mail, time
take, would, respond, email, recom-
mend, help, love, submit, miss, grade,
treat, follow, complete, accept, hat,
need, send, reply, turn, correct, com-
municate, check, feel, wait, finish
easy, helpful, nice, rude, online, due,
wonderful, extra, sweet, kind, busy,
caring, hot, late, strict, timely, annoy-
ing, horrible, mean, quick, disorga-
nized, pleasant, responsive, beautiful,
lovely
topic,
lay,
teach,
Male-Associated
material, concept, professor, exam,
sense,
joke, math, stuff, pro-
gramming, world, department, lecture,
prof, note, humor, guy, story, lecturer,
curve, tangent, man, dude, genius, in-
dustry
learn, curve,
talk, crack,
know, write, lecture, challenge, want,
relate, sleep, solve, ramble, push, start,
entertain,
joke, put, bore, mumble,
base, cover, explain
smart,
good, knowledgeable, great,
interesting,
intelligent, difficult, real,
funny, hilarious, boring, cool, dry, en-
tertaining, favorite, challenging, bril-
liant, arrogant,
interested, hard, pas-
sionate, old, tough, practical, excellent
Table 7: Top 12 clusters out of 45 overall in the celebrity domain. Predicted labels are included if applicable --
we were only able to predict labels for clusters that contained nouns, since our clustering labeling algorithm relied
on the noun taxonomy in WordNet. In the Sample Words in Cluster column, italics indicate female-associated
terms, and non-italics indicate male-associated. F:M refers to the ratio of female-associated to male-associated
words in the cluster.
F:M Centroid Top 3 Pred. Cluster Labels
2:3
month
time period, fundamental quan-
tity, measure
state, union, separation
breakup
man
person, man, adult
10:2
snapshot
photograph, representation, pic-
ture
N/A
explain
6:0
1:7
7:3
1:5
5:0
1:5
Sample Words in Cluster
month, day, year, decade, hour
engagement, marriage, divorce, re-
lationship, split, breakup
woman, man, guy, people, some-
one, anyone, one, person
photo, post, pic, snap, selfie, image,
snapshot, kiss, photograph, tribute
reveal, gush, tell, explain, dish, ad-
mit, say, recall, reply
trophy, win, category, nominate,
nomination, finalist
exclusive, peek, sneak, glimpse, pre-
view
difference, allegation, claim, accu-
sation, truth, lie
accessorize,
jewel,
floral, embroider, pink, hat, veil,
turtleneck, sequin, tiara, bodysuit
girl, sister, baby, daughter, mom,
pregnancy, dad, father, brother, son
husband, boyfriend, beau, hubby, fi-
ance, wife, girlfriend, finacee
top, dress, pant,
shoulder, gown,
skirt, diamond, neckline, waist, bra
sneaker,
toe,
finalist
collection, condition, award
preview
look, sensing, screening
accusation claim, assertion, statement
123:1
halter
artifact, garment, covering
14:6
dad
person, parent, mother
15:7
fiance
lover, person, relative
25:0
blouse
covering, cloth covering, cloth-
ing
Table 8: Top 6 clusters out of 16 overall in the professor domain. Same details as Table 7 apply.
lady, professor,
Sample Words in Cluster
teacher, woman,
prof, guy, lecturer, man, dude
everything, material, concept, topic,
stuff, tangent, subject, content
respond, email, response, respon-
sive, stuff, reply, contact, answer
familiar,
nerd, background, scientist, geek
communicate,
solve, explain, introduce, convey
compassionate,
lovely, amazing,
sweet, understanding, hot, nice,
passionate, funniest, smart, cool, in-
spirational, intelligent, likable
savvy, genius,
teach, know,
literate,
learn,
F:M Centroid Top 3 Pred. Cluster Labels
5:7
man, adult, woman
prof
1:8
content
content, idea, cognition
13:0
respond
5:10
geek
statement, message, communi-
cation
person, expert, anomaly
1:18
simplify
N/A
21:44
outgoing
N/A
Label Type
In-Cluster Rate Out-of-Cluster Rate Difference Fleiss' κ
Centroid
1st pred. label
2nd pred. label
3rd pred. label
4th pred. label
.597
.621
.540
.653
.452
.178
.156
.200
.044
.111
.419
.465
.340
.609
.341
.322
.258
.256
.353
.261
Table 9: Results for cluster labeling task. The 3rd predicted label has a significantly lower out-of-cluster rate than
the centroid and all the other predicted labels (p ≤ 0.02). The same label also slightly outperforms the centroid on
the in-cluster rate, thus producing a much larger gap between rates than the centroid.
|
1707.07167 | 3 | 1707 | 2018-02-13T08:20:30 | Attention-Based End-to-End Speech Recognition on Voice Search | [
"cs.CL",
"cs.SD"
] | Recently, there has been a growing interest in end-to-end speech recognition that directly transcribes speech to text without any predefined alignments. In this paper, we explore the use of attention-based encoder-decoder model for Mandarin speech recognition on a voice search task. Previous attempts have shown that applying attention-based encoder-decoder to Mandarin speech recognition was quite difficult due to the logographic orthography of Mandarin, the large vocabulary and the conditional dependency of the attention model. In this paper, we use character embedding to deal with the large vocabulary. Several tricks are used for effective model training, including L2 regularization, Gaussian weight noise and frame skipping. We compare two attention mechanisms and use attention smoothing to cover long context in the attention model. Taken together, these tricks allow us to finally achieve a character error rate (CER) of 3.58% and a sentence error rate (SER) of 7.43% on the MiTV voice search dataset. While together with a trigram language model, CER and SER reach 2.81% and 5.77%, respectively. | cs.CL | cs | ATTENTION-BASED END-TO-END SPEECH RECOGNITION ON VOICE SEARCH
Changhao Shan1,2, Junbo Zhang2, Yujun Wang2, Lei Xie1
1Shaanxi Provincial Key Laboratory of Speech and Image Information Processing,
School of Computer Science, Northwestern Polytechnical University, Xi'an, China
{shanchanghao, zhangjunbo, wangyujun}@xiaomi.com, [email protected]
2Xiaomi Inc., Beijing, China
8
1
0
2
b
e
F
3
1
]
L
C
.
s
c
[
3
v
7
6
1
7
0
.
7
0
7
1
:
v
i
X
r
a
ABSTRACT
Recently, there has been a growing interest in end-to-end
speech recognition that directly transcribes speech to text
without any predefined alignments. In this paper, we explore
the use of attention-based encoder-decoder model for Man-
darin speech recognition on a voice search task. Previous
attempts have shown that applying attention-based encoder-
decoder to Mandarin speech recognition was quite difficult
due to the logographic orthography of Mandarin, the large
vocabulary and the conditional dependency of the attention
model.
In this paper, we use character embedding to deal
with the large vocabulary. Several tricks are used for effective
model training, including L2 regularization, Gaussian weight
noise and frame skipping. We compare two attention mech-
anisms and use attention smoothing to cover long context in
the attention model. Taken together, these tricks allow us to
finally achieve a character error rate (CER) of 3.58% and a
sentence error rate (SER) of 7.43% on the MiTV voice search
dataset. While together with a trigram language model, CER
and SER reach 2.81% and 5.77%, respectively.
Index Terms- automatic speech recognition, end-to-end
speech recognition, attention model, voice search
1. INTRODUCTION
Voice search (VS) allows users to acquire information by a
simple voice command. It has become a dominating function
on various devices such as smart phones, speakers and TVs,
etc. Automatic speech recognition (ASR) is the first step for a
voice search task and thus its performance highly affects the
user experience.
Deep Neural Networks (DNNs) have shown tremendous
success and are widely used in ASR, usually in combination
with Hidden Markov Models (HMMs) [12, 9, 21]. These
systems are based on a complicated architecture with sev-
eral separate components, including acoustic, phonetic and
language models, which are usually trained separately, each
with a different objective. Recently, some end-to-end neu-
ral network ASR approaches, such as connectionist temporal
classification (CTC) [11, 1, 17] and attention-based encoder-
decoder [6, 8, 3, 4, 5, 14, 23, 7], have emerged. These end-
to-end trained systems directly map the input acoustic speech
to grapheme (or word) sequences and the acoustic, pronunci-
ation, and language modeling components are trained jointly
in a single system.
Attention-based models have become increasingly popu-
lar and with delightful performances on various sequence-to-
sequence tasks, such as machine translation [2], text summa-
rization [20], image captioning [22] and speech recognition.
In speech recognition, the attention-based approaches usually
consist of an encoder network, which maps the input acoustic
speech into a higher-level representation, and an attention-
based decoder that predicts the next output symbol condi-
tioned on the sequence of previous predictions. A recent com-
parison of sequence-to-sequence models for speech recogni-
tion [19] has shown that Listen, Attend and Spell (LAS) [4], a
typical attention-based approach, offered improvements over
other sequence-to-sequence models.
Attention-based encoder-decoder performs considerably
well in English speech recognition [7] and many attempts
have been proposed to further optimize the model [8, 23].
However, applying attention-based encoder-decoder to Man-
darin was found quite problematic. In [5], Chan et. al. have
pointed out that the attention model is difficult to converge
with Mandarin data due to the logographic orthography of
Mandarin, the large vocabulary and the conditional depen-
dency of the attention model. They have proposed a joint
Mandarin Character-Pinyin model but with limited success:
the character error rate (CER) is as high as 59.3% on GALE
broadcast news corpus.
In this paper, we aim to improve
the LAS approach for Mandarin speech recognition on a
voice search task.
Instead of using joint Character-Pinyin
model, we directly use Chinese characters as network output.
Specifically, we map the one-hot character representation to
an embedding vector via a neural network layer. We also
use several tricks for effective model training, including L2
regularization [13], Gaussian weight noise [15] and frame
skipping [18]. We compare two attention mechanisms and
use attention smoothing to cover long context in the attention
model. Taken together, these tricks allow us to finally achieve
a promising result on a Mandarin voice search task.
2. LISTEN, ATTEND AND SPELL
Listen, Attend and Spell (LAS) [4] is an attention-based
encoder-decoder network which is often used to deal with
variable-length input to variable-length output mapping prob-
lems. The encoder (the Listen module) extracts a higher-level
feature representation (i.e., an embedding) from the input
features. Then the attention mechanism (the Attend module)
determines which encoder features should be attended in or-
der to predict the next output symbol, resulting in a context
vector. Finally, the decoder (the Spell module) takes the
attention context vector and an embedding of the previous
prediction to generate a prediction of the next output.
Specifically, in Fig. 1, the encoder we used is a bidirec-
tional long short term memory (BLSTM) recurrent neural net-
work (RNN) that generates a high-level feature representation
sequence h = (h1, ..., hT ) from the input time-frequency rep-
resentation sequence of speech x:
h = Listen(x)
(1)
Fig. 1. The encoder model is a BLSTM that extracts h from
input x. Frame skipping is employed during training.
In Fig. 2, the AttendAndSpell is an attention-based trans-
ducer:
p(yx) = AttendAndSpell(y, h).
(2)
In practice, the process predicts the character yi at a time ac-
cording to the probability distribution:
p(yix, yi−1,··· , y1) = CharacterDist(si, ci),
(3)
where si is an LSTM hidden state for time i, computed by
si = DecodeRN N ([yi−1, ci−1], si−1),
and the context vector
ci = AttentionContext(si, h).
(4)
(5)
The DecodeRN N is a unidirectional LSTM RNN which pro-
duces a transducer state si and the AttentionContext gener-
ates context ci with a multi-layer perceptron (MLP) attention
network. Finally, the probability distribution CharacterDist
is computed by a softmax function.
3. METHODS
In this section, we detail the tricks we used in LAS-based
speech recognition for the Mandarin voice search task.
3.1. Embedding and regularization
Chinese has a large set of characters and even the number of
frequently-used characters can reach 3,500. Chan et. al. [5]
have pointed out that the large vocabulary with limited train-
ing data made the model difficult to learn and generalize well.
This means that, for an end-to-end Mandarin system that di-
rectly outputs characters, it is critical to use an appropriate
embedding to ensure the converge of the model.
Fig. 2. The AttendAndSpell model composed by MLP (the
Attention mechanism) and LSTM (the Decoder model).
In this paper, we first represent each character in a one-
hot scheme and further embed it to a vector using neural net-
work. Specifically, in Fig. 2, a fully-connected embedding
layer (shaded circle) is used to connect the one-hot input and
the subsequent BLSTM layer of the LAS encoder. The weight
matrix We of the character embedding layer is updated in the
whole LAS model training procedure. The embedding layer
works as follows. Assume the size of the vocabulary is n and
the dimension of the embedding layer is m. Then the weight
matrix We is of size n × m. When the character's index is i,
the embedding layer will pass the ith row of We to the sub-
sequent encoder. That is, it acts as a lookup-table, making
the training procedure more efficient. We find that this simple
character embedding provides significant benefit to the model
convergence and robustness.
The LAS model often gives poor generalization to new
data without regularizations. Thus two popular regularization
tricks are used in this paper: L2 regularization and Gaussian
x1x3x5x7x2T-1h2h3h4hTh1h = (h1, ,hT) <sos>y2y3y4yL-1y4y5y2y3<eos>s3Initial stateh = (h1,h2, ,hT)s2c2c2weight noise [13, 15].
3.2. Attention mechanism
The attention mechanism selects (or weights) the input frames
to generate the next output element. In this study, we com-
pared the content-based attention and the location-based at-
tention.
Content-based attention: Borrowed from neural ma-
chine translation [2], content-based attention can be directly
used in speech recognition. Here, the context vector ci is
computed as a weighted sum of hi:
T(cid:88)
j=1
ci =
αi,jhj.
T(cid:88)
(6)
(7)
The weight αi,j of each hj is computed by
αi,j = exp(ei,j)/
exp(ei,j),
j=1
where
ei,j = Score(si−1, hj).
(8)
Here the Score is an MLP network which measures how well
the inputs around position j and the output at position i match.
It is based on the LSTM hidden state si−1 and hj of the input
sentence. Specifically, it can be further described by
ei,j = w(cid:62)tanh(Wsi−1 + Vhj + b),
(9)
where w and b are vectors, and W and V are matrices.
Location-based attention: In [8], location-awareness
was added to the attention mechanism to better fit the speech
recognition task. Specifically, the content-based attention
mechanism is extended by making it take into account the
alignment at the previous step. k vectors fi,j are extracted for
every position j of the previous alignment αi−1 by convolv-
ing it with a matrix F:
fi = F ∗ αi−1.
By adding fij, the scoring mechanism is changed to
ei,j = w(cid:62)tanh(Wsi−1 + Vhj + Uf ij + b).
3.3. Attention smoothing
(10)
(11)
We found that long context information is important for the
voice search task. Hence we explore attention smoothing
to get longer context in the attention mechanism. When
the input sequence h is long, the αi distribution is typically
very sharp on convergence, and thus it focuses on only a few
frames of h. To keep the diversity of the model, similar to [8],
we replace the softmax function in Eq. (7) with the logistic
sigmoid σ:
αi,j = σ(ei,j).
(12)
C = −(cid:88)
3.4. Frame skipping
Frame skipping is a simple-but-effective trick that has been
previously used for fast model training and decoding [18]. As
training BLSTM is notoriously time-consuming, we borrow
this idea in the training of LAS encoder which is BLSTM. As
our task does not consider online decoding, we use all frames
to generate the context h during decoding.
3.5. Language model
At each time step, the decoder generates a character de-
pending on the previous ones, similar to the mechanism of a
language model (LM). Therefore, the attention model works
pretty good without using any explicit language model. How-
ever, the model itself is insufficient to learn a complex lan-
guage model [3]. Hence we build a character-level language
model T from a word-level language model G that is trained
using the training transcripts and a lexicon L that simply
spells out the characters of each word. In other words, the in-
put of L is characters and output is words. More specifically,
we build a finite state transducer (FST) T = min(det(L◦G))
to calculate the log-probability for the character sequences.
We add T to the cost of decoder's output:
[log p(yix, yi−1,··· , y1) + γT ]
(13)
i
During decoding, we minimize the cost C which combines
the attention-based model and the external language model
with a tunable parameter γ.
4. EXPERIMENTS
4.1. Data
We used a 3000-hour dataset for LAS model training, which
contains approximately 4M voice search utterances, collected
from the microphone on the MiTV remote controller. The
dataset was composed of diverse search entries on popular
TV programs, movies, songs and personal names (e.g. movie
stars). The test set and held-out validation set were also from
the MiTV voice search and each was composed of 3,000 utter-
ances. As input features, we used 80 Mel-scale filterbank co-
efficients computed every 10ms with delta and delta-delta ac-
celeration coefficients. Mean and variance normalization was
conducted for each speaker. For the decoder model, we used
6,925 labels: 6,922 common Chinese characters, unknown to-
ken and sentence start and end tokens (<sos>/<eos>).
4.2. Training
We trained LAS models, in which the encoder was a 3-layer
BLSTM with 256 LSTM units per-direction (or 512 in total)
and the decoder was a 1-layer LSTM with 256 LSTM units.
All the weight matrices were initialized with the normalized
Table 1. Results of our attention-based models with a beam
size of 30, τ = 2 and γ = 0.1.
model
CT C
Content based attention
+ trigram LM
Location based attention
+ trigram LM
Attention smoothing
+ trigram LM
CER/% SER/%
14.57
5.29
4.05
9.10
7.20
3.60
8.17
3.82
6.33
3.26
7.43
3.58
2.81
5.77
Fig. 3. The effect of the decoding beam width for the content-
based attention and attention smoothing (τ = 1).
initialization [10] and the bias vectors were initialized to 0.
Gradient norm clipping to 1 was applied, together with Gaus-
sian weight noise and L2 weight decay 1e-5. We used ADAM
as the optimization method [16] while we decayed the learn-
ing rate from 1e-3 to 1e-4 after it converged. The softmax
output and the cross entropy cost were combined as the model
cost. Frame skipping was used in the encoder during training.
For comparison, we also constructed a CTC model that has
the same structure with the the LAS encoder.
4.3. Decoding
We used a simple left-to-right beam search algorithm during
decoding [8]. We invesitaged the importance of the beam-
search width on decoding accuracy [8] and the impact of the
temperature of the softmax function [5]. The temperature can
smooth the distribution of characters. We changed the charac-
ter probability distribution by a temperature hyperparameter
τ:
(cid:88)
yt = exp(ot/τ )/
exp(oj/τ ).
(14)
where ot is the input of the softmax function.
j
4.4. Results
Fig. 4. The impact of the temperature for content-based at-
tention and attention smoothing (beam-size=30).
a SER of 8.17%, which outperformed the content-based at-
tention model. By using attention smoothing on the content-
based attention model, the CER was reduced to 3.58% ( or
11.6% relative gain over the content-based attention). We
believe that the improvement is mainly because the sigmoid
function keeps the diversity of the model and smooths the fo-
cus found by the attention mechanism.
Fig. 3 shows the effect of the decoding beam width on
the WER/SER for the test set. The CER reached the low-
est (4.78%) at a beam width of 30. We cannot observe extra
benefit when further increasing the beam width.
In Fig. 4,
we can see that attention smoothing achieves the best perfor-
mance when τ = 2 and there is no additional benefits when
we further increase the temperature. We see the same obser-
vation on the validation set as well. Meanwhile, we inves-
tigated the effect of adding language model. During decod-
ing, with the help of a trigram LM that was trained using 4M
voice search entries, further gains can be observed. Finally,
attention smoothing + trigram LM achieved the lowest
CER of 2.81%. This was obtained when γ = 0.1.
5. CONCLUSION
In this paper, we reported our preliminary results on attention-
based encoder-decoder for Mandarin speech recognition.
With several tricks, our model finally achieves a CER of
3.58% and a SER of 7.43% on a Mandarin voice search task
without a language model. Note that the voice search con-
tent on MiTV is kind of limited with closed domains. In the
future, we will further investigage our approach on general
ASR tasks through public datasets.
6. ACKNOWLEDGMENTS
Table 1 shows that our models performed extremely well in
the Mandarin voice search task. The content-based attention
model achieved a CER of 4.05% and a SER of 9.1%. The
location-based attention model achieved a CER of 3.82% and
The authors would like to thank the Xiaomi Deep Learning
Team and MiAI SRE Team for Xiaomi Cloud-ML and GPU
cluster support. We also thank Yu Zhang and Jian Li for help-
ful comments and suggestions.
7. REFERENCES
[1] D. Amodei, S. Ananthanarayanan, R. Anubhai, J. Bai,
E. Battenberg, C. Case, J. Casper, B. Catanzaro,
Q. Cheng, G. Chen et al., "Deep speech 2: End-to-end
speech recognition in English and Mandarin," in ICML,
2016, pp. 173–182.
[2] D. Bahdanau, K. Cho, and Y. Bengio, "Neural machine
translation by jointly learning to align and translate,"
arXiv preprint arXiv:1409.0473, 2014.
[3] D. Bahdanau, J. Chorowski, D. Serdyuk, P. Brakel, and
Y. Bengio, "End-to-end attention-based large vocabu-
lary speech recognition," in ICASSP. IEEE, 2016, pp.
4945–4949.
[4] W. Chan, N. Jaitly, Q. Le, and O. Vinyals, "Listen, at-
tend and spell: A neural network for large vocabulary
conversational speech recognition," in ICASSP. IEEE,
2016, pp. 4960–4964.
[5] W. Chan and I. Lane, "On online attention-based speech
recognition and joint Mandarin character-pinyin train-
ing." in INTERSPEECH, 2016, pp. 3404–3408.
[6] J. Chorowski, D. Bahdanau, K. Cho, and Y. Ben-
gio, "End-to-end continuous speech recognition us-
ing attention-based recurrent NN: first results," arXiv
preprint arXiv:1412.1602, 2014.
[7] J. Chorowski and N. Jaitly, "Towards better decoding
and language model integration in sequence to sequence
models," arXiv preprint arXiv:1612.02695, 2016.
[8] J. K. Chorowski, D. Bahdanau, D. Serdyuk, K. Cho, and
Y. Bengio, "Attention-based models for speech recog-
nition," in Advances in Neural Information Processing
Systems, 2015, pp. 577–585.
[9] L. Deng, J. Li, J. Huang, K. Yao, D. Yu, F. Seide,
M. Seltzer, G. Zweig, X. He, J. Williams et al., "Re-
cent advances in deep learning for speech research at
Microsoft," in ICASSP.IEEE, 2013, pp. 8604–8608.
[10] X. Glorot and Y. Bengio, "Understanding the difficulty
of training deep feedforward neural networks," in Pro-
ceedings of the 13rd International Conference on Artifi-
cial Intelligence and Statistics, 2010, pp. 249–256.
[11] A. Graves, S. Fern´andez, F. Gomez, and J. Schmidhuber,
"Connectionist temporal classification: labelling unseg-
mented sequence data with recurrent neural networks,"
in ICML.ACM, 2006, pp. 369–376.
[12] G. Hinton, L. Deng, D. Yu, G. E. Dahl, A. Mohamed,
N. Jaitly, A. Senior, V. Vanhoucke, P. Nguyen, T. N.
Sainath et al., "Deep neural networks for acoustic mod-
eling in speech recognition: The shared views of four
research groups," IEEE Signal Processing Magazine,
vol. 29, no. 6, pp. 82–97, 2012.
[13] G. E. Hinton and D. Van Camp, "Keeping the neural
networks simple by minimizing the description length
of the weights," in Proceedings of the sixth annual con-
ference on Computational learning theory. ACM, 1993,
pp. 5–13.
[14] T. Hori, S. Watanabe, Y. Zhang, and W. Chan, "Ad-
vances in joint CTC-attention based end-to-end speech
recognition with a deep CNN encoder and RNN-LM,"
arXiv preprint arXiv:1706.02737, 2017.
[15] K. Jim, C. L. Giles, and B. G. Horne, "An analysis of
noise in recurrent neural networks: convergence and
generalization," IEEE Transactions on neural networks,
vol. 7, no. 6, pp. 1424–1438, 1996.
[16] D. Kingma and J. Ba, "Adam: A method for stochastic
optimization," arXiv preprint arXiv:1412.6980, 2014.
[17] Y. Miao, M. Gowayyed, and F. Metze, "Eesen: End-
to-end speech recognition using deep RNN models and
WFST-based decoding," in ASRU.IEEE, 2015, pp. 167–
174.
[18] Y. Miao, J. Li, Y. Wang, S.-X. Zhang, and Y. Gong,
"Simplifying long short-term memory acoustic models
for fast training and decoding," in ICASSP. IEEE, 2016,
pp. 2284–2288.
[19] R. Prabhavalkar, K. Rao, T. N. Sainath, B. Li, L. John-
son, and N. Jaitly, "A comparison of sequence-to-
sequence models for speech recognition," in Inter-
speech, 2017.
[20] A. M. Rush, S. Chopra, and J. Weston, "A neural at-
tention model for abstractive sentence summarization,"
arXiv preprint arXiv:1509.00685, 2015.
[21] J. Schmidhuber, "Deep learning in neural networks: An
overview," Neural networks, vol. 61, pp. 85–117, 2015.
[22] K. Xu,
J. Ba, R. Kiros, K. Cho, A. Courville,
R. Salakhudinov, R. Zemel, and Y. Bengio, "Show, at-
tend and tell: Neural image caption generation with vi-
sual attention," in ICML, 2015, pp. 2048–2057.
[23] Y. Zhang, W. Chan, and N. Jaitly, "Very deep convolu-
tional networks for end-to-end speech recognition," in
ICASSP.IEEE, 2017, pp. 4845–4849.
|
1312.6948 | 1 | 1312 | 2013-12-25T09:23:49 | Description Logics based Formalization of Wh-Queries | [
"cs.CL",
"cs.AI"
] | The problem of Natural Language Query Formalization (NLQF) is to translate a given user query in natural language (NL) into a formal language so that the semantic interpretation has equivalence with the NL interpretation. Formalization of NL queries enables logic based reasoning during information retrieval, database query, question-answering, etc. Formalization also helps in Web query normalization and indexing, query intent analysis, etc. In this paper we are proposing a Description Logics based formal methodology for wh-query intent (also called desire) identification and corresponding formal translation. We evaluated the scalability of our proposed formalism using Microsoft Encarta 98 query dataset and OWL-S TC v.4.0 dataset. | cs.CL | cs | Description Logics based Formalization of Wh-Queries
Sourish Dasgupta
Rupali KaPatel
Ankur Padia
Kushal Shah
DA-IICT, India
DA-IICT, India
DA-IICT, India
DA-IICT, India
kushalshah40
padiaankur
rupali.it.08
sourish_dasgupta
@daiict.ac.in
@gmail.com
@gmail.com
@daiict.ac.in
interest in mining graph databases represented in RDF-like
format. As a result several works have been proposed to translate
NL query into SPARQL-like formalism [5-7, 18]. However, many
of these works support at the most shallow lexico-syntactic query
analysis extracting heuristic patterns which are then translated into
SPARQL like queries. Many other approaches are ontology based
where an external set of ontologies are required for mapping
query tokens to the most probable formal concept (mostly
RDF/RDFS/OWL represented) so as to link together the mapped
tokens into a formal semantic graph structure (such as SPARQL,
nRQL) [5-6, 18]. The graph structure is then matched with similar
graphical
for query
representations of document content
answering. However, ontology assisted NLQF heavily depends on
the correctness and completeness of the external ontologies and
may not be very accurate if the target information source is
independent of the imported ontology set. Moreover, such RDF
databases are nothing more than very light-weight knowledge
bases with no high-end reasoning support required for knowledge
discovery. Hence, if the target corpus is a formal knowledge base
then SPARQL cannot serve as a suitable formal query language.
ABSTRACT
The problem of Natural Language Query Formalization (NLQF) is
to translate a given user query in natural language (NL) into a
formal language ( ) so that the semantic interpretation has
equivalence with the NL interpretation. Formalization of NL
queries enables
logic based reasoning during
information
retrieval, database query, question-answering, etc. Formalization
also helps in Web query normalization and indexing, query intent
analysis, etc. In this paper we are proposing a Description Logics
based formal methodology for wh-query intent (also called desire)
identification and corresponding formal translation. We evaluated
the scalability of our proposed formalism using Microsoft Encarta
98 query dataset and OWL-S TC v.4.0 dataset.
Categories and Subject Descriptors
I.2.4 [Knowledge Representation Formalism and Methods]:
Representation (procedural and rule-based)
General Terms
Theory, Measurement, Performance.
Keywords
Query Formalization, Description Logics, Semantic Web .
1. INTRODUCTION
Natural Language Query Formalization (NLQF) is a formal and
systematic procedure of translating a user query in natural
language into an expression in a formal language without losing
the semantics of the user query. The choice of a formal language
can range from SQL used in conventional DBMS to more
advanced SPARQL for RDF graph based databases designed to
support the Semantic Web. However, any translation process
involves
rigorous
linguistic analysis of NL queries and
constructing a formal semantic interpretation that is equivalent to
the original query semantics. NLQF has a twofold effect. First, it
helps in proper identification of the query intent (also called
desire). Secondly, it formally defines the query intent in relation
to other linguistic constituents of the query thereby providing a
platform for
logical reasoning based semantic
information
retrieval and question answering [1-2]. The biggest challenge
involved in NLQF is to efficiently and accurately identify the
innate desire and to understand the linguistic nuances during a
translation process. A query may bear the same semantic content
but may be structurally different. For an example, the query: "Who
is the greatest crime novel writer?" is semantically equivalent to
the query: "What is the name of the greatest author of crime
novel?". It may also have the same grammatical structure but bear
different semantics.
NLQF has been a topic of intensive research in the database
community. Most of the effort was concentrated in translating NL
queries into formal representations suitable for database retrieval
such as SQL [3-4]. More recent researches have shown a growing
Other distributional hypothesis [8] based purely statistical
approaches has also been proposed mostly for NL query
processing which can hardly fall under NLQF [9-11]. One of the
intrinsic problems of statistical approaches is that query goal (or
desire/intention) detection is very difficult if linguistic analysis is
ignored. Also information retrieval largely depends on similarity
measure models that are mostly token co-occurrence based [12-
13]. Such co-occurrence analysis cannot guarantee semantic
similarity with the query goal.
In this paper we propose a deep linguistic analysis based semantic
formalization framework for NL wh-queries in English. DL
representation of queries provides the support to perform formal
subsumption based reasoning over DL based knowledgebase for
knowledge discovery. We show that such queries can be neatly
called Query
characterized
structure,
syntactic
a
into
Characterization Template (QCT), covering most possible
linguistically valid query variations. The primary aim of QCT is
to identify the query desire and the relationship of the desire with
the query input. This leads to the next step of accurate query
formalization. However, such characterization is non-trivial and
involves capturing positional nuances of query tokens correctly.
We also show that a Description Logic (DL) [25] sub-language
exists that has semantic equivalency with that of wh-queries. We
have presented the salient rules for NL query to DL query
translation. The proposed methodology is independent of any
external ontology assistance. The scope of this paper is limited to
wh- queries of six kinds: (i) what, (ii) which, (iii) who, (iv) when,
(v) where, and (vi) non-procedural how. Our contribution in this
paper is as follows:
Table 11
NLQP
System
NLQ
Type
FL
Ont.
Lex.
Aided
Aided
Target
Corps
L.A.
UR
Triple
based
Yes
many
Word
Net
[10]
UR
No
LASSO
UR
[9]
AquaLog
[7]
R
C.Voc
Key-
word
based
patter
ns
Triple
based
Power-
Aqua
[24]
Querix
UR
[6]
PANTO
UR
[5]
[23]
UR
Triple
based
SPAR
QL
Triple
based
SPAR
QL
DL
based
No
No
No
ATIS
TAN
Word
Net
NL docs
L-
SPL
Yes
Word
Net
No
No
Sem.
mark-up
docs
Distr.
sem.
docs
Yes
Word
Net
Selected
set of
Ont.
L-
SPL
Yes
Word
Net
Ont.
POS
TAG
Yes
NA
Ont.
POS
TAG
Masque/
R
SQL
No
No
RDBMS
PTr.
SQL
[3]
PRECISE
UR
SQL
No
[4]
START
UR
[21]
QCT
based2
UR
NL
Ann.
based
DL
based
No
No
from
DB
MIT
Lexico
n
Word
Net
ATIS
PTr.
Web
corpus
L-
SPL
NL docs
POS
TAG
1. A novel query desire-input dependency analysis theory,
termed QCT, is proposed.
2. Proposing DL has a suitable candidate formal semantic
theory for query formalization.
3. Evaluation in terms of characterization accuracy using
Microsoft Encarta query dataset and query dataset built on
OWL-S TC v.4.0 dataset.
The paper is organized into the following sections: (i) related
work outlining some of the major contributions in NL query
processing, (ii) problem statement defining the problem of NLQF
formally, (iii) Approach where query characterization and DL
1 NLQP: Natural Language Query Processing; FL: Formal
Language; L-SPL: Lexico-Syntactic Pattern Learning; C. Voc.:
Controlled Vocabulary; PTr.: Parse Tree; Ann.: Annotation;
DB: Database; Ont.: Ontology; Lex: Lexicon; Corps: Corpus;
L.A.: Linguistic Analysis; Sem.: Semantic
2 proposed DL based framework
formalization has been discussed at length, and (iv) Evaluation in
terms of characterization accuracy.
2. RELATED WORKS
Various approaches for NL Query Formalization can be broadly
classified into two main categories: (i) statistical learning based
analysis, and (iii) lexico-syntactic analysis. Table 1 is an overview
of various approaches for developing NLQP systems. We have
categorized them on the basis of various parameters which
differentiate them. One of those parameters is query nature which
can be of two types: (i) restricted (R NL), and (ii) unrestricted
(UR NL). Restricted NL based systems cannot accept queries of
all linguistics forms and hence, provide query formulation only
for NL queries that can be given through some sort of controlled
vocabulary. Ontology aided systems import external ontologies as
input for aiding NL queries
into
their respective formal
representations. Lexicon aided systems use lexicons (or thesauri)
for enriching NL query vocabulary which in turn aids in
normalized query formalization. By target corpus we mean the
resource from which the answer is expected. We see that systems
in this respect can be either NL document corpus based or
ontology based.
In [10] author has tried to detect goal (i.e. desire) from the user’s
NL query using Tree-Augmented Naive Bayes networks (TANs)
for goal detection but this work is domain specific and semantic
values are compromised here. In [14] a conversion tool which
takes queries expressed in NL and an ontology as input and
returns the appropriate formal queries. It uses WordNet to
disambiguate the words and triple based model for formalization.
The generated queries are then sent to the reasoner for querying
the knowledge bases. In this work ontology to be queried is
required to be chosen by user and it doesn’t support complex
query formulation. In [15] an approach to Semantic Information
Retrieval of semantically annotated documents, based on NL
understanding of query, has been proposed. This work
incorporates an OWL query ontology for SPARQL based
inference. In [16] a nested CG (Conceptual Graph) language for
formal representations of natural language queries has been
proposed. In [17] a formal semantic analysis of object queries
required for the modern object-oriented databases has been
proposed. Unlike other object query languages, a number of
realistic features including object identity, object creation and
invocation of methods that need not terminate has been covered.
A translation procedure from NL query into a formal language
query such as SPARQL has been described in [18]. In this paper a
user query is translated into SPARQL by choosing the most
appropriate query from the prepared queries. Queries for the
knowledge base and a set of corresponding normalized queries for
the problem has been prepared beforehand and user’s query is
mapped to one of query which is obtainable from the knowledge
base. For relatively large knowledge base such WWW this may
not be scalable approach. In [19] models of DP services as RDF
views over a mediated (domain) ontology has been proposed.
Each RDF view contains concepts and relations from the
mediated ontology to capture the semantic relationships between
input and output parameters. Query rewriting algorithms for
processing queries over DP services and query mediator which
automatically transforms a user’s query (during the query
rewriting stage) into a composition of DP services.
START [20] was the first online question-answering system which
uses statistical NLP techniques and lexico-syntactic pattern
matching. Another system called NLP-Reduce [21] was proposed
which is also based on lexico-syntactic pattern matching. In this
system query keywords are mapped with synonym enhanced triple
stores in the target corpus. A key feature was that user queries can
be phrases or complete queries and also need not be
grammatically correct. A domain-independent system, called
Querix, was proposed in [6] where full English questions had to
be given which were then parsed for extracting triple patterns.
These triples are extracted out of a prior query skeleton which is
generated based on word categories. These triple patterns are then
mapped onto the target knowledge base for match. A guided input
NL search engine, called Ginseng, was proposed in [22].
3. PROBLEM OVERVIEW
The problem of NLQF involves 3 core tasks:
Task 1: To choose a formal grammar that can generate the
dependency structure (ex: parse tree) of the linguistic components
of a given NL query accurately.
language that has an
Task 2: To select a
formal
interpretation such
to one
a one
exists
there
that
correspondence with the semantic interpretation of the formal
grammar .
Task 3: To model a representational equivalence function
that takes in a query Q in and maps it to an expression
in such that maximum semantic preservation is achieved. Such
semantic preservation can be achieved through model-theoretic
semantic constructions. should be consistent and should not
generate expressions that are mutually inconsistent.
Task 1 involves syntactic parsing of all valid NL queries. This is a
challenging task since NL queries can be of varied forms with (a)
similar syntactic structures but different semantics (ex: "Where is
the capital of Florida?" - Answer: "28.5N, 81.3W" vs. "What is
the capital of Florida?" - Answer: "Orlando") and (b) similar
semantics but different syntactic structures (ex: "Where is the
capital of Florida?" vs. "What is Orlando's location?" - Answer
for both: "28.5N, 81.3W"). In the former case the queries should
be characterized such that they have their corresponding formal
language translation unique while in the latter case both the
queries should have the same normalized formal language
translation. Moreover, queries may not always be simple (i.e. no
clausal constraint; ex: "Who are Alexandar's favorite Greek
mythological heroes?") but can be complex (ex: "Who are the
heroes of Greek mythology who were Alexander's favorite?") and
compound ("Who are the heroes of Greek mythology and
Alexander?"). Although structurally the queries are simple,
complex and compound yet semantically they are the equivalent.
Hence, they should have the same answer: "Achilles". This
requires accurate part-of-speech tagging (POS tagger) and parse
tree generation based on which a given NL query is fitted into a
chosen characterization grammar.
Task 2 consists of translation of the parsed queries into a formal
language representation (usually the model-theoretic style). Just
like task 1 formal translation is also not trivial since it involves: (i)
resolution of several ambiguities and linguistic nuances including
re-formulation and normalization of semantically equivalent NL
queries having different structures, (ii) computational query
resolution (ex: "How far is New York from Orlando?"), (iii)
comparative/superlative query resolution (ex: "What is the highest
mountain in Asia?"). The scope of this paper is limited to the wh-
queries of the kinds: (i) what/which, (ii) who/whom/whose, (iii)
where, (iv) when, and (v) how much.
3.1 Problem Definition
in English model a transformation
Given an NL wh-query
function such that:
where:
is the formalization of
in the formal language
is the linguistic reading of English
is the semantic interpretation function of
4. APPROACH
4.1 Characterization (Task 1)
Any user query has two primary linguistic components - (i) desire
(or intent) of the query and (ii) input of the query. While the query
desire is essentially what an answer needs to satisfy, the query
input provides the satisfiability constraint on the desire. For an
example, in the query: "What is the capital of USA?" while the
desire is an instance of the entity Capital, the input is USA acts as
a constraint imposed on the instance relating it to USA (and not
just any other country/province). For task 1 (described in section
3.1) choosing a formal grammar theory serves as a basis for
generating the parse tree of a query. Constructing semantics by
applying a particular semantic theory over complicated (although
sophisticated) parse trees is computationally expensive. We
observed that since our chosen semantic theory is Description
Logics (DL), where concepts are defined in terms of roles and
their associations with other concepts (thus, forming subject-
predicate-object triples), the primary objective of query parsing
should be to identify the desire (which is the subject of the query),
predicate, and input (which is the object of the query). Hence, a
full-fledged parse tree is not necessary for the case. We developed
a pseudo-grammar structure, called Query Characterization
Template
(QCT),
intrinsic desire-input
that captures
the
dependency structure in all forms of English factual queries
(simple, complex, and compound). This dependency generates a
unique QCT for each of the three forms. QCT is a pseudo-
grammar in several senses: (i) the sequence of the lexicons of the
original query can get changed after the characterization process,
(ii) lexicons can get normalized into a standard form after
characterization, and (iii) it does not give a generic set of rules to
combine or split phrase structures but rather "fits in" queries of
equivalent grammatical structure into one fixed template. We
hereby define the wh-query and its three forms of as follows:
Definition 1 (Wh-Query): A Wh-Query is a query that contains at
least one of the following query tokens (or their equivalent lexical
variations): what, which, who, whose, whom, when, where, how ,
why.
What query can be: (i) definitional such as "What is a cat?"
(expected answer: class definition), (ii) inclusion such as "What
animals are mammals?" (expected answer: sub classes of
mammal); (iii) instance retrieval such as "What is the capital of
USA?" (expected answer: a city instance), (iv) class retrieval such
as "What is Taj Mahal?" (expected answer: class of instance Taj
Mahal), and (v) instance associated concept retrieval such as
"What does John drink in the morning?" (expected answer: sub
classes of drink that John has for morning).
Which query is similar to What queries except that such queries
cannot be definitional.
Who query behaves sometimes as a Which query and sometimes
as a What query with the special underpinning that the expected
answer is related to either a named animal, or a person (or person
group/organization).
Definition 6 (Compound Query Wh-Query ): A Compound Wh-
Query is a wh-query that consists of conjunctive/disjunctive
lexicons between one or more simple wh-queries or complex wh-
queries.
When query can be: (i) absolute temporal such as "When is
Thanksgiving?" (expected answer: a particular day of a month),
and (ii) relative temporal such as "When will John arrive?"
(expected answer can be: after/before some event).
Example of compound wh-query is “What are the available car
models of Volkswagen and their respective prices?”. In the
following sub-sections the QCT of each of the three forms of
sentences has been discussed at length.
Where query can be: (i) absolute spatial such as "Where is the
leaning tower of Pisa?" (expected answer: geographical location),
and (ii) relative spatial such as "Where is the ball?" (expected
answer can be: on/under/below/at some object).
How query can be: (i) procedural such as "How is a flan
made?"(expected answer: recipe or step-wise set of actions), (ii)
state based such as "How is Joe?" (expected answer: current
health status of Joe), (iii) quantitative such as "How much does the
bag cost?" (expected answer: price), or (iv) computational such as
"How far is Tampa from Miami?" (expected answer: computed
distance). We do not consider procedural how in the scope of this
paper.
Why query is causal in nature such as "Why is the grass green?".
We also leave out why queries from the scope of this paper.
Definition 2 (Simple Wh-Query): A Simple Wh-Query is a wh-
query that consists of a single and non-clausal query desire
(explicit or implicit) and a single, unconstrained, and explicit
query input.
Example simple wh-query is "What is the capital of USA?". In this
case the desire (Capital) is explicit, single, and unconstrained by
any clausal phrase. The input (USA) is also explicit, single, and
unconstrained by any clausal phrase. It should be noted that, as
remarked earlier, the input is an implied constraint over the desire
which is different than clausal constraint. Also, the desire may be
implicit sometimes. For an example, in the query: "What is a
tomb?" the implicit desire is the definition of Tomb (i.e.
description of the class Tomb) while the unconstrained and single
input is Tomb.
Definition 3 (Complex Wh-Query): A Complex Wh-Query is a
wh-query that consists of a single query desire (explicit or
implicit) and multiple explicit query input.
Definition 4 (Complex Non-Clausal Wh-Query): A Complex
Non-Clausal Wh-Query is a complex wh-query that is clausal
constraint free on both the query desire and the multiple query
input.
Example complex non-clausal query is "In which country is the
state capital of Missouri located?". In this query the desire
Country is unconstrained. There are two input (State Capital and
Missouri) each of which is also unconstrained.
Definition 5 (Complex Clausal Wh-Query): A Complex Clausal
Wh-Query is a complex wh-query that consists of at least one
clausal constraint on either the query desire or query input or both.
Example complex clausal wh-query is "Who was the British Prime
Minister who was elected two times one of which was during
World War II?". In this query the single explicit desire is the
(instance of the) class British Prime Minister having no clausal
constraint. There are two query input: two times and World War
II. Also, the first input two times has a clausal constraint "one of
which was during …".
4.1.1 QCT of Simple Wh-Query
A simple wh-query can be characterized according to the
following structure:
where:
: second square bracket indicates optional component
: Query desire class/instance - value restricted to {NN, NNP,
JJ, RB, VBG}3
: Query input class/instance - value restricted to {NN, NNP, JJ,
RB, VBG}
: Auxiliary relation - includes variations of the set {is, is kind
of, much, might be, does}
: Relation that acts as (i) predicate of D as the subject and I
as the object or (ii) action role of I as the actor - value restricted to
{VB, PP, VB-PP}1
: Quantifier of D or I - values restricted to {DT}1. The *
indicates that Q can recur before D or I.
: Modifier of D or I - value restricted to set {NN, JJ, RB,
VBG}. The * indicates that M can recur before D or I.
We can observe that this QCT can cover all the linguistically valid
180 questions (excluding quantifiers and modifiers) according to
the given definition of simple wh-query. is auxiliary role in the
sense that it cannot act as a predicate of either the D or the I.
However, serves as a good indicator for resolving several
linguistic ambiguities. For an example, in a how query if is
much (or its lexical variations) then it is a quantitative query while
in a who query if is does (or its lexical variations) then the
associated verb is an activity (i.e. Gerund; ex: "Who does
singing?" - Singing is an activity in this case).
is a relation that can either be associated with D as the subject
or I as the subject but not both. If is positioned after D in the
original query then s subject is D. For an example, in the
simple query "What is the capital of USA?" the subject of (of)
is D (Capital) and the object is I (USA). If is positioned after I
in the original query then its subject is I. For an example, in the
query "Which country is California located in?" the subject of
(located in) is I (California) and object is D (Country). Table 2
lists some of the important simple wh-query characterization.
4.1.1.1 Implicit Desire Identification
Implicit query desire implies that D is empty. This can happen if
and only if the following query structures are found:
1.
3 Abbreviations follow the conventions of Penn Treebank POS
tags. [30]
Table 2
Table 4
Natural Language
Wh-Simple Query
What is the capital
of Gujarat?
Which is the highest
mountain in world?
How many legs does
a millipede have?
What
are
some
dangerous plants?
Where
California?
is
Wh-Simple Query Characterization
= 'What', = 'is', = 'the
capital', = 'of', = 'Gujarat', [?]
= 'Which', = 'is', = 'the
highest mountain', =
'in', =
'world', [?]
='How many', = count('legs'),
= 'does have', = 'millipede', [?]
=
=
'are', =
'What',
'dangerous plants', [?]
=
'Where', =
'California', [?]
'is', =
What is most populous
the
democracy
in
is
Caribbean which
geographically
the
largest as well?
What
the distance
is
between Missouri and
Texas?
Table 3
=what, =is, =the_most_p
opulous_democracy,
=the_Caribbean,
=in,
=
=which,
=is,
geographically_the_largest?
=what, =is =the_distance
, =null, =between,
=Misssouri,
=Texas?
=and,
2.
3.
If does not exist then D is empty. If does not exist while
exists then D is empty. For an example, in the query: "What is
converted into diamond?" is identified to be is by default and
is detected to be is converted into. However, there is no
lexicon in between and (structure 3). Therefore, D is empty.
Another case in which D always remains empty is when the wh-
query is a where or a when query. This also holds true for
complex and compound queries. For an example, in the query:
"When is the next solar eclipse?" the query characterization is as:
4.1.1.2 Explicit Desire Identification
As an extension to the observation the previous section we can
conclude that any lexicon between and is D. For an
example, in the simple query "What is the capital of USA?" is
identified to be is and is detected to be of. Therefore, D is
Capital. After D is identified the remaining lexicon is I.
4.1.2 QCT of Complex Wh-Query
A complex Wh-query can be characterized according to4:
Natural
language
Compound Wh-Query
What happens when you
potassium
mix
permanganate
and
glycerin?
How long will an electric
car run and how fast can it
go?
What is shape and size of
baloon when air comes
out?
is
travelling
the
What
charge
to Bombay and
hotel_rent in Bombay?
foremost
the
Who were
authorities in discovering
formulas,
algebraic
theorems,
and/or
expressions?
Which volcanoes are active
and which is which ones
are dormant?
Wh-Query
Compound
Characterization
=null,
=happ
=what,
ens(implicit
=when,
=mix,
activity),
=potassium
=
permanganate, =and,
glycerine, =null?
=will,
=c
=Howlong,
ount(implicit),
=potassi
=mix,
=null,
=
um permanganate, =and,
glycerine?
=is,
=shape,
=What,
=size,
=and,
=null,
=of,
=baloon,
=when,
=comes_out,
=air, =
null?
=is,
=the_tra
=What,
velling_charge,
=hotel_rent,
=n
=and,
=in,
=bombay
ull,
, =null?
=were,
=the_f
=Who,
oremost_authorities,
=in_discoverying,
=null,
=,algebraic_formulas,
theorems
=
,
expressions, =null?
=null,
=volc
=Which
anoes,
=are_active,
=null,
=,n
ull,
=null,
=volc
=Which
anoes,
=dormant,
=null,
=,nul
l?
where:
: clausal lexicon (constraining D)
: second clausal lexicon (constraining I1)
: clausal lexicon associated with structure
: conjunctive/disjunctive lexicon for I
4 Modifiers and quantifiers are not associated with D and I. They
are associated in exactly the same way as QCT of simple
queries.
: query desire - value restricted to {NN, NNP, JJ, RB, VBG}
: l-th query input k-th structure - value restricted to {NN,
NNP, JJ, RB, VBG}
: relation associated with the k-th clause that acts as (i)
predicate of D as the subject and I as the object or (ii) action role
of I as the actor - value restricted to {VB, PP, VB-PP}
: modifier of the D or the I - value restricted to set {NN, JJ,
RB, VBG}. The * indicates that M can recur before D or I.
In this QCT we see the possible repetition of the structure
. Within this structure there is an optional sub-
that may add to the number of input
structure
within each of such structures. A clausal lexicon in a complex
clausal wh-query is always associated with such a structure. The
number of clausal lexicons is the same as the number of such
structures in a given query. It should be noted that there must be at
least two such structures for a query to qualify as complex. Also,
clausal lexicons in the general case is optional and hence, the
QCT also holds true for complex non-clausal wh-query. We name
the following structure as clausal structure (CS):
Example complex query characterization is given in table 3. The
given QCT can cover 1800 linguistically valid complex queries
(excluding quantifiers and modifiers).
4.1.3 QCT of Compound Wh-Query
A compound Wh-query can be characterized according to:
where:
: Conjunctive/disjunctive lexicon for D
: Conjunctive/disjunctive lexicon for wh-sub-query
Compound query characterization example has been given in table
4.
4.2 DL as Formal Query Language (Task 2)
In our approach we choose the formal language to be
Description Logics (DL). As mentioned earlier we argue that most
factual IS-A sentences have expressive equivalency in the DL
language: where:
Attributive Language – supports atomic concept definition,
concept intersection, full value restriction, limited role restriction,
and atomic concept negation.
Union – supports concept union
Existential – supports full role restriction
Complement – supports concept negation
Role Hierarchy – supports inclusion axioms of roles
: Nominal – supports concept creation of unrecognized Named
Entity
: Role Inversion - supports inverse roles
( ): Data Type – supports range concepts to be data type
The choice of DL over other semantic theories has several
reasons: (i) DL is equivalent to the guarded fragment of FOPL
and hence, is decidable [25], (ii) DL representation is compact and
variable-free as compared to representations such as DRS [26]
and LFT [27] making it comparatively easy to parse, (iii) the DL
sub-language is tractable since we
observed that most IS-A sentence interpretation is covered by
, (iv) highly optimized semantic tableau based
DL reasoners [28] are available as compared to slower hyper-
resolution based theorem provers used in DRS or LFT based
reasoning,
(v) DL has direct mapping with
the W3C
recommended OWL format for web ontology5. Expressions in DL
can represent two types of queries: (i) general queries such as
"What is a synagogue?" (answer is a T-Box definition or inclusion
axiom in the knowledgebase), and (ii) specific queries such as
"What is the name of the highest mountain in Australia?" (the
answer is an A-Box assertion in the knowledgebase).
4.3 DL Formalization (Task 3)
As mentioned in the previous section, NL queries can be of two
types in the context of DL: (i) T-Box queries and (ii) A-Box
queries. T-Box queries can be: (i) definitional (ex: "What is a
cat?", (ii) inclusion (ex: "What animals are mammals?"), and (iii)
super class retrieval (ex: "What kind of animal is lion?". A-Box
queries on the other hand can be: (i) instance retrieval ("Who
resides in 221B Baker Street?", (ii) class retrieval (ex: "Who is
Agatha Christie?", and (iii) instance associated concept retrieval
("What does John drink in the morning?"). Some queries are
ambiguous and the linguistic reading may imply either T-Box
definitional or A-Box instance retrieval (ex: "Who is a student?" -
Answer 1: "John and Joe are students"; Answer 2: "A student is a
person who studies in an educational institution .") We argue that
correct and complete DL formalization of query implies that
query processing (and hence, question-answering) can be
formulated as either a T-Box subsumption reasoning or an A-Box
retrieval reasoning over a knowledgebase. We do not include
(i.e. concept negation) in this work since we exclude from the
scope of this paper formalization of queries with negative clauses
(such as "What is an animal called that cannot lay egg?").
4.3.1 Base Translation Rules
As discussed in section 4.1 we model any wh-query to have two
components - desire and input. We also mentioned that QCT helps
to establish desire-input dependency. From a DL formalization
point of view such dependency identification naturally culminates
to the DL definition of the desire in terms of the input. By
definition we mean the model theoretic semantic interpretation of
the description of a desire as constrained by the input. Given any
simple wh-query Q having D, I, R2 the following translation rules
always holds true:
Base Rule 1.1: If is empty and I is not NNP or quantified then
Base Rule 1.2: If is empty and I is NNP then
otherwise:
Base Rule 2.1: If subject of is and is not empty then
5 OWL DL is equivalent to while OWL 2 is
equivalent .
Base Rule 2.2: If subject of is and is not empty then
Base Rule 3.1: If subject of is and I is NNP then
otherwise:
Base Rule 3.2: If subject of is and I is NNP then
otherwise:
where:
Formalized desire
Strongly formalized desire
Weakly formalized desire
Desire component identified in QCT
Input component identified in QCT
Relation component identified in QCT that is associated with
D and I
WordNet.getMSP: A method developed to get the most specific
parent class from WordNet v 2.1.
Base rule 1.1 is meant for T-Box queries in general except when
the input is quantified (ex: "Who is the student?"). Strongly
) is an inclusion/definitional T-Box query
formalized desire (
and requires more specific answers (i.e. sub-classes of I). Weakly
) is an generic T-Box query and can allow
formalized desire (
less specific answers (i.e. super-classes of I is allowed).
Base rules 2.1 and 2.2 are meant for A-Box queries. At an A-Box
level the query formalism for rules 2.1 and 2.2 is: where
?x is the variable that belongs to the class . Rules 3.1 and 3.2
are meant for class retrieval queries and instance associated
concept retrieval. Also rule 1.2 is class retrieval as well.
All the above base rules can be extended automatically for
complex and compound queries as well. The core extension rules
are discussed in the next section.
4.3.2 Extension Translation Rules
In this paper we discuss extension rules: (i) effect of modifiers,
(ii) effect of clausal phrases, and (iii) effect of conjunctive and
disjunctive phrases.
4.3.2.1 Effect of Modifier
Normally, if a modifier in wh-query is a JJ or an NN then it
modifies either an NN or an NNP. For an example, in the query:
“Who are the tall students?” the JJ Tall modifies the input concept
Student which is an NN. In such general cases it is evident that the
concept TallStudent is a sub concept of the concept Student. An
interesting phenomenon that can be observed for desire/input
modification is what we term as recursive nested modification. In
sentences where the subject modification is by a sequence of
modifiers such as then a nested structure is
assumed as: Here '( )' denotes scope of
the modifier. Therefore, the scope of the inner most nested
modifier M3 is the concept D. The scope of the modifier M2 is the
sub-concept M3D formed as a result of the M3 modifying D. At
the same time M2 also recursively modifies D to form the sub-
concept M2D. Similarly M1 has the sub-concept M2M3D as scope
of modification while in recursion modifies M3D and D. The T-
Box rule for such recursive nested modification is as follows:
Extension Rule (Recursive Nested Modification: 3-level nesting):
; ;
4.3.2.2 Effect of Clausal Phrases
Complex wh-queries can be formalized by extending the base rule
and extended rules of simple wh-queries. While formalization it is
important to identify that whether the clausal constraint(s) is
applied to desire or inputs. If it is an input constraint then which
of the multiple inputs it is applied. This leads to a very important
issue called query dependency problem. Query dependencies can
be broadly classified as:
Desire Dependency: In some clausal complex wh-query constraint
is applied on the desire. For example, in the query “Which atomic
bomb was dropped in Japan which had caused million people to
die?” the desire is name or type of atomic bomb with constraint:
the bomb caused million people to die and was dropped in Japan.
If clausal phrase contains an attribute of the desire then we
assume it is constraint on desire. The given example query is
characterized as:
.
Here type of atomic bomb is desire and clausal constraint (i.e.
atomic bomb causing millions people
to die). Therefore,
constraint is considered to be applied on desire, not on input.
Attributes are associated with relations of lexical variations of the
structure {'DESIRE which has',
includes',
'DESIRE which
'DESIRE which is a'}.
Input Dependency: If clausal phrase contains an attribute of the
input then we assume it is constraint on input. For example, in the
query “What is the price of SLR camera which has 3.2 megapixel
resolution?” is characterized as:
Here, “3.2 megapixel resolution” is a constraint input which is
attribute of input “SLR camera”. Attributes are associated with
relations of lexical variations of the structure {'INPUT which has',
'INPUT which includes', 'INPUT which is a'}. In this section
generic DL transformation rule for all complex wh-queries are
given. All constraints can be formulated as intersection of
concepts/instance given in the query.
Extension Rule 1 (Complex Query: Inclusion T-Box):
An example query that requires this rule for translation is: "What
are
the kinds of animals which are vegetarians?". The
corresponding equivalent DL is .
Extension Rule 2 (Complex Query: Input Dependency):
Extension Rule 3.1 (Complex Query: Desire Dependency):
An interesting observation that we make is that if is empty
while D is non empty and constrained then 's subject is D. For
an example, in the query "What country which is in Europe has
the largest population?" (has) has subject D (country) since
is empty. In this case the extension rule is as follows:
Extension Rule 3.2 (Complex Query: Empty ):
;
4.3.2.3 Effect of Conjunctive/Disjunctive Phrases
To formalize the compound wh-queries, after the characterization
process it is important to identify whether conjunctive/disjunctive
phrase is applied on desire, input or relation. Compound queries
can sometimes be split into simple queries and/or complex
queries. They can then be formalized using simple query and
complex query translation rules. We have defined the rules for
cases when a given compound query can be split into
conjunction of simple wh-queries.We have also done exhastive
analysis of all possible structure of compound query structure by
applying conjunctive/disjunctive lexicons between inputs, desires,
relation. We concluded on 14 different forms of compound query.
The main motivation to break the compound query into simple
query is to increase the precision and recall of the knowledge
discovery system. If we can break the compound query into
separated simple queries then later on all separated queries can be
fired in parallel and answer of all separated queires can be
returned by applying union operation between them. We have also
defined the cases where splitting is not possible and separate
formalization rules have been defined for them. More details on
this topic is beyond the scope of this paper due to lack of space.
4.3.3 Non-Trivial Translation Rules
There are some queries whose semantic interpretation cannot be
completely and correctly constructed in a straightforward way by
applying a formal semantic theory. This is because of certain
innate linguistic nuances that these queries carry that demand
additional modification in the formal semantic representations. In
the following sub sections we look into a few of such cases.
4.3.3.1 Problem of Empty Input
In some queries the input can be empty. For an example, in the
query "Who barks?" is a non-transitive verb with no explicit
input as object. In such situation we need to do a reification of
into its corresponding gerund sense and normalize the given
NL query to the form
where fr is
the reification function. In the given example we can reformulate
the query as "Who does barking?" and the corresponding DL rule
is:
Extension Rule (Empty Input):
4.3.3.2 Problem of Desire Inclusion
Some inclusion queries may have desire that have may have an
intersection with input. For an example, in the query "What kind
of a water vehicle is also an air vehicle?". In such cases the base
rule 1.1 is modified as:
Extension Rule (Desire Inclusion):
4.3.3.3 Problem of Quantitative how-Query
In how queries that are quantitative in nature (i.e. R1 = {much,
many, etc}) we need to introduce a primitive concept Count and a
primitive role hasCount where for any arbitrary satisfiable
concept the following axiom holds: .
The hasCount is mapped to a function called fcount that calculates
the size of the instances of at any given point of time. For an
example, in the query "How many people live in New York?" the
count operator works on the desire people living in New York.
The corresponding rule is:
Extension Rule (Quantitative how):
4.3.3.4 Problem of Temporal Adverbial Modifier
Some queries have temporal adverbial tokens such as in the query
"What can be sometimes observed in the morning sky?" where R2
(observed in) is associated with a temporal adverbial modifier
(sometimes). The problem with formalizing such queries is that
the ontological validity of the desire is essentially temporal in
nature. In other words, for the given example, if a particular planet
is observed in the morning sky it is not so that it will always be
observed (like the sun which we can observe every day). Hence,
sun cannot be a candidate answer in this case. The rule for such
queries is as follows:
Extension Rule (Temporal Adverbial: sometimes):
4.3.3.5 Problem of Superlative Modifier
In some queries superlative tokens are included such as in "What
is the tallest mountain in Europe?". In such queries the desire is
for a specific instance that has the optimal (maximal or minimal)
degree of measurable modifier of the desire class. In the example
tall is a measurable modifier whose superlative form is maximal
height of all instances of the desire class Mountain. The height
attribute of mountain is implicit in the given query. Keywords
such as most and least are good indicators of deciding whether the
computation has to be maximal or minimal. However, for suffix
based superlative tokens (i.e. est) it is not so evident. The problem
is how to know that tall+est has to maximized while low+est has
to be minimized. We take a bootstrapping based approach with a
seed bag of measurable modifiers (such as tall, long, big, low,
high, large, wide, etc) and then mapped the bootstrapped
keywords with corresponding plausible attributes (denoted AM).
For an example we get pairs such as:
). Based on such pairing we then classify
into positive modifiers (those
the modifiers
that requires
maximization such as tall, wide, etc.) and negative modifiers
(those that requires minimization such as low). The corresponding
extension rule is:
Extension Rule (Superlative Queries):
where:
Optimality function that returns Integer Datatype ( ).
5. EVALUATION
5.1 Evaluation Goal and Metric
Our evaluation aim was to observe the accuracy of the proposed
QCT. We leave the accuracy evaluation of the DL formalization
as a future work since that requires indirect comparative testing in
terms of mean average precision and recall on some of the
cutting-edge knowledge discovery systems. However, it is to be
understood
that
the accuracy of
the DL formalization
is
intrinsically dependent on the accuracy of QCT.
To evaluate QCT we decided on a simple Characterization
Coverage (CC) measure. The measure is modeled to understand
how many different linguistic forms of simple, complex and
compound wh-queries in English can be identified correctly by
QCT. We measure CC in three perspectives: (i) CC-Precision, (ii)
CC-Recall, and (iii) CC-F1 score. We define them as follows:
CC-Precision: Given a test set of NL queries the CC-Precision is
calculated as the ratio of the number of correctly identified queries
(NCI) and the total number of identified queries in the test set (N I).
CC-Recall: Given a test set of NL queries the CC-Recall is
calculated as the ratio of the number of correctly identified queries
(NCI) and the total number of queries in the test set (N).
CC-F1: The Simple Harmonic Mean of CC-Precision and CC-
Recall is the CC-F1.
5.2 Experimental Results
To evaluate CC of proposed work we have used the Microsoft
Encarta 98 query test set [29] and OWL-S TC dataset. The
Microsoft Question Answering Corpus (MSQA), which is aimed
at querying documents belonging to the Encarta-98 encyclopedia.
The test set contains 1365 usable English wh-queries. We
excluded the queries of procedural how and why from this dataset.
We have categorized simple, complex and compound queries
from the dataset. There are total 473 queries of procedural how
and why which are excluded. The reduced dataset consist of total
982 queries, which is distributed among 676 simple, 147 complex
and 69 compound wh-queries. The accuracy statistics is given in
table 5. We observe that the CC-Precision is 100% for all types of
wh-queries while the overall CC-Recall is 94.50. The perfect
precision shows that the QCT is theoretically sound.
To validate our results with Encarta 98 dataset we also tested
QCT on custom query dataset built on top of OWL-S TC v.4.0
dataset6. The OWL-S TC dataset consists of service descriptions
of 1083 web services from 9 different domains. A service
description is a formal specification of the behavior of a web
service in terms of its required input parameters, given output
parameters, and other binding parametric details for runtime
execution. The description also contains a short NL narrative of
the overall behavior. A query dataset for this corpus was
developed by three research assistants. The task for each of these
three assistants was to formulate a wh-query for every service
such that the query desire matches the given output of the service
and query input matches the required input of the service. Since
this task was done independently we observed that almost in all
cases the syntactic structuring of the query for a given service by
each assistant was different. The queries were simple, complex,
and compound with an average of 90% query of the form complex
and compound. Ideally, the extracted query desire by QCT should
be semantically equivalent
the
the output parameter of
corresponding web service specification. Based on this notion we
have calculated CC-precision, CC-recall and CC-F1 measure for
each of the three query datasets. From table 6 we observed that
the average recall was 98.77%, average precision 100% and
average F1 was 98.92%. The results clearly validate the earlier
results with Microsoft Encarta 98.
6. CONCLUSION
In this paper we have a Description Logic based NL query
formalization methodology. The motivation is to improve
6 http://projects.semwebcentral.org/projects/owls-tc/
Table 5.1
Query
Types
Nwh
NI-wh
NCI-wh
CC-
Re.
CC-
Pr.
CC-
F1
(%)
(%)
(%)
Simple
676
642
642
94.97
100
97.42
Wh-Query
Complex
147
140
140
95.23
100
97.55
Wh-Query
Compound
69
64
64
92.75
100
96.23
Wh-Query
Total
892
843
843
94.50
100
97.17
Table 5.2
Query
Types
Nwh
NI-wh
NCI-wh
How
What
When
Where
Which
Who
Total
165
406
39
85
5
143
843
158
392
35
82
5
143
815
158
392
35
82
5
143
815
Table 6
CC-
Re.
CC-
Pr.
CC-
F1
(%)
(%)
(%)
96.68
95.75
96.55
89.74
96.47
100
100
100
100
100
100
100
98.31
97.83
98.24
94.59
98.20
100
96.68
100
98.31
Query
Types
Nwh
NI-wh
NCI-wh
CC-
Re.
CC-
Pr.
CC-
F1
(%)
(%)
(%)
1083
1000
1000
97.65
1083
1083
997
1010
Total
3249
3007
997
1010
3007
97.36
98.63
97.88
100
100
100
100
98.81
98.66
99.31
98.92
accuracy of answer extraction from NL documents using formal
logic based reasoning. We have proposed the basic DL translation
rules along with some of the important derived rules that cover
different kinds of linguistic nuances. We found promising results
while evaluating DLQS-WhM with MS Encarta query test set and a
query dataset built on top of OWL-S TC v.4.0 dataset.
7. REFERENCES
[1] Pejtersen, A. M. 1998. Semantic information retrieval.
Communications of the ACM. 41, 4 (April,1998) 90 – 92.
[2] Moldovan, D., Clark, C., and Bowden, M. 2007. Lymba's
PowerAnswer 4 In TREC-2007, Association for
Computational Linguistics.
[3] Androutsopoulos, I. , Ritchie, G. D. and Thanisch, P. 1993
MASQUE/SQL-An Efficient and Portable Natural Language
Query Interface for Relational Databases. in Proceedings of
the Sixth International Conference on Industrial and
Engineering Applications of Artificial Intelligence and
Expert Systems - IEA/AIE (Edinburgh, Scotland, 1993).
[4] Popescu, A-M. and Etzioni, O. and Kautz, H. 2003Towards a
theory of natural language interfaces to databases. in
Proceedings of the 8th international conference on
Intelligent user interfaces (Miami, USA, January 12 - 15,
2003).
[5] Wang, C., Xiong, M., Zhou, Q. and Yu, Y. 2007. Panto: A
portable natural language interface to ontologies. in
Proceedings of the 4th European conference on the Semantic
Web: Research and Applications (Innsbruck, Austria, June,
2007).
[6] Kaufmann, E., Bernstein, A. and Zumstein, R. Querix. 2006.
A Natural Language Interface to Query Ontologies Based on
Clarification Dialogs. in International Symposium on
Wearable Computers - ISWC (Montreux, Switzerland,
October 11 - 14, 2006).
[7] Lopez, V. Pasin, M. and Motta, E. 2005. AquaLog: An
Ontology-Portable Question Answering System for the
Semantic Web. in European Semantic Web Symposium
/Conference - ESWS (Heraklion, Crete, May 29 - June 1,
2005)
[8] Sahlgren. M. 2008 The distributional hypothesis. Italian
Journal of Linguistics. 20, 1 (June, 2008) 33 – 54.
[9] Moldovan, D., Harabagiu, S., Pasca, M., Mihalcea, R.,
Goodrum, R., Girju, R. and Rus, V. 1999. LASSO: A Tool
for Surfing the Answer Net. in TREC 1999, National
Institute of Standards and Technology (NIST) (November,
1999)
[10] Yuhan He. 2010. Goal Detection from Natural Language
Queries. In 15th International Conference on Applications of
Natural Language to Information Systems (Cardiff, UK,
June, 2010).
[11] Dumais, S., Banko, M., Brill, E., Lin, J. and Ng, A. 2002.
Web Question Answering: Is More Always Better?. in
Proceedings of ACM SIGIR’02 (Tampere, Finland, August,
2002).
[12] Deerwester, S. C. , Dumais, S. T.,Landauer, T. K., Furnas,
G. W. and Harshman, R. A. 1990. Indexing by latent
semantic analysis. JASIS. 41, 6 (September, 1990) 391 – 407.
[13] Hofmann, T. 1999 Probabilistic latent semantic indexing. In
Proceedings of the 22nd International ACM SIGIR
conference on Research and development in information
retrieval (Berkeley, USA, 1999).
[14] Boumechaal, H. and Boufaida, Z. Formalization of natural
language queries. in IEEE International Symposium on
Innovations in Intelligent Systems and Applications (IN-
ISTA) (Istanbul, June 15 - 18, 2011).
[15] B. Di Martino. 2010. An approach to semantic information
retrieval based on natural language query understanding. in
Current Trends in Web Engineering, ICWE Workshop
(Vienna, Austria, July 5 - 6, 2010).
[16] Cao, T. H. and Mai, A. H. 2010. Ontology-based
understanding of natural language queries using nested
conceptual graphs. in Proceedings of 18th International
Conference on Conceptual Structures: From Information to
Intelligence (Kuching, Malaysia, July 26 - 30, 2010).
[17] Bierman, G.M.. 2003. Formal semantics and analysis of
object queries. in Proceedings of the 2003 ACM SIGMOD
international conference on Management of data (San Diego,
USA, June 9 - 12, 2003).
[18] Han, Y-J., Noh, T-G., Park, S-B., Park, S. Y. and Lee, S-J.
2010. A natural language interface of thorough coverage by
concordance with knowledge bases. in Proceedings of the
15th international conference on Intelligent user interfaces
(HongKong, China, February 7 - 10, 2010).
[19] Barhamgi, M., Benslimane, D. and Medjahed, B. 2010. A
query rewriting approach for web service composition. IEEE
Transactions on Services Computing. 3, 3 (July, 2010) 206-
222.
[20] Katz, B., Borchardt, G. and Felshin, S. 2006. Natural
Language Annotations for Question Answering. in
Proceedings of the 19th International FLAIRS Conference
(Melbourne Beach, USA, May 2006).
[21] Kaufmann, E., Bernstein, A. and Fischer, L. 2007. NLP-
Reduce: A "naive" but Domain-independent Natural
Language Interface for Querying Ontologies. in Proceedings
of the 4th European Semantic Web Conference (Innsbruck,
Austria, June, 2007).
[22] Bernstein, A., Kaufmann, E. , Kaiser, C. and Kiefer, C. 2006.
Ginseng: A Guided Input Natural Language Search Engine
for Querying Ontologies. in 2006 Jena User Conference
(Bristol, UK, May 2006).
[23] Linckels, S. and Meinel, C. 2006. Resolving Ambiguities in
the Semantic Interpretation of Natural Language Questions.
in Proceedings of 7th International Conference on Intelligent
Data Engineering and Automated Learning - IDEAL
(Burgos, Spain, September 20 - 23, 2006).
[24] Lopez, V., Fernández, M., Motta, E., Sabou, M. and Uren, V.
2007. Question Answering on the Real Semantic Web . in
Proceedings of International Semantic Web Conference
(Busan, Korea, November 11 - 15, 2007).
[25] Baader, F. 2003 The description logic handbook: theory,
implementation, and applications. Cambridge university
press.
[26] Kamp, H. 1981 A theory of truth and semantic
representation. Linguistis: Formal semantics-the essential
readings, 7:189 - 222, 1981.
[27] Moldovan D. and Rus V. 2001 Logic form transformation of
wordnet and its applicability to question answering. In ACL,
402 – 409.
[28] Tsarkov D. and Horrocks I. 2006. Fact++ description logic
reasoner: System description. In Proceedings of 3rd Joint
Conference on Automated reasoning (Seattle, USA, August
17 - 20, 2006)
[29] Microsoft Research Question-Answering Corpus - Encarta
98, v 1.0.0, November 2008
[30] Marcus, M. P., Marcinkiewicz, M. A., and Santorini, B. 1993
Building a large annotated corpus of English: The Penn
Treebank. Computational linguistics. 19, 2 (June, 1993) 313
– 330.
|
1512.01409 | 1 | 1512 | 2015-12-04T14:01:32 | What Makes it Difficult to Understand a Scientific Literature? | [
"cs.CL"
] | In the artificial intelligence area, one of the ultimate goals is to make computers understand human language and offer assistance. In order to achieve this ideal, researchers of computer science have put forward a lot of models and algorithms attempting at enabling the machine to analyze and process human natural language on different levels of semantics. Although recent progress in this field offers much hope, we still have to ask whether current research can provide assistance that people really desire in reading and comprehension. To this end, we conducted a reading comprehension test on two scientific papers which are written in different styles. We use the semantic link models to analyze the understanding obstacles that people will face in the process of reading and figure out what makes it difficult for human to understand a scientific literature. Through such analysis, we summarized some characteristics and problems which are reflected by people with different levels of knowledge on the comprehension of difficult science and technology literature, which can be modeled in semantic link network. We believe that these characteristics and problems will help us re-examine the existing machine models and are helpful in the designing of new one. | cs.CL | cs | What Makes it Difficult to Understand a Scientific Literature?
Mengyun Cao#*1, Jiao Tian#*2, Dezhi Cheng#*3, Jin Liu&4, Xiaoping Sun*5
#University of Chinese Academy of Sciences
Beijing, China
[email protected]
[email protected]
[email protected]
*Knowledge Grid Group
Key Lab of Intelligent Information Processing
Institute of Computing Technology
Chinese Academy of Sciences
[email protected]
&Wuhan University
[email protected]
language on different
that people really desire
*Abstract—In the artificial intelligence area, one of the ultimate
goals is to make computers understand human language and
offer assistance. In order to achieve this ideal, researchers of
computer science have put forward a lot of models and
algorithms attempting at enabling the machine to analyze and
process human natural
levels of
semantics. Although recent progress in this field offers much
hope, we still have to ask whether current research can provide
assistance
in reading and
comprehension. To this end, we conducted a reading
comprehension test on two scientific papers which are written
in different styles. We use the semantic link models to analyze
the understanding obstacles that people will face in the process
of reading and figure out what makes it difficult for human to
understand a scientific literature. Through such analysis, we
summarized some characteristics and problems which are
reflected by people with different levels of knowledge on the
comprehension of difficult science and technology literature,
which can be modelled in semantic link network. We believe
that these characteristics and problems will help us re-examine
the existing machine models and are helpful in the designing of
new one.
Keywords: Natrual language processing; Comprehension;
scientific literature; understanding obstacles; Semantic link
network
I.
INTRODUCTION
The term Artificial Intelligence (AI) was coined by John
McCarthy in 1955 [25] and gradually developed into a
formal discipline. This domain is usually defined as the
science and engineering of making machines, especially
intelligent computer programs, conduct tasks that require
* Personal use of this material is permitted. However, permission to
reprint/republish this material for advertising or promotional
purposes or for creating new collective works for resale or
redistribution to servers or lists, or to reuse any copyrighted
component of this work in other works must be obtained from the
IEEE.
Corresponding author: Xiaoping Sun([email protected])
translation have high
intelligence when done by humans [1]. Natural language
processing (NLP) is among the central goals of AI research
[2] and becomes an attractive research field. Some of tasks in
NLP are used to solve syntax/grammar analysis tasks, such
as word segmentation, co-reference resolution, named entity
recognition, Part-of-Speech (PoS) tagging, etc. Some of the
tasks such as automatic summarization, question answering,
and machine
real-world
applications [3] for assisting people in reading, information
retrieval and mining. The performance of models aiming at
addressing these high level tasks of NLP is still far from
satisfactory. For example, the state-of-the-art results on
automatic summarization are not quiet readable yet [6].
Almost all question-answering systems can only handle
questions that are either based on single-relation or factual
issues with some simple inference and their performance can
only achieve 50% on average using this domain’s evaluation
criteria.
level
To achieve a better solution, one way is to tackle a high
level task into many sub tasks and apply different methods to
solve them in more effective and efficient way. Recently,
statistics machine learning methods such as topic models [20]
and deep neural network (NN) models [16][17][18] have
achieved significant progress on many sub NLP tasks [20].
For example, the F1-score of word segmentation for Chinese
novels can reach more than 90% by using a common noun
entities mining method [4], a new model for PoS tagging can
achieve more than 90% accuracy on different domains [5].
Teaching machine to read and comprehend is even possible
[8]. These advances are deemed as a big step toward our
ideal.
If we can make machine to read and comprehend text
like human, one would be able to make more intelligent task
possible, like to teach machine large amount of knowledge.
But before we dedicate ourselves to design new models for
making machine reading and comprehension possible, shall
we rethink what is the help that people really desire or how
difficult and what difficulties in that task.
To more concretely feel difficulties in making machine
reading and understanding text, we can evaluate how
difficult for a human to read and comprehend text. Since
most people feel no difficult in comprehending daily reading
task such as reading news, we pay our attention to scientific
literature comprehension. That is, what makes it difficult for
students or researchers to understand an academic paper? In
order to answer this question, we organized an experiment
about the comprehension of human on scientific literature
reading.
We conducted this test by letting participants read
academic papers that they may not understand well. It should
be noted that we assume that there is no problem in the
articles and readers’ understanding process is to rebuild the
thought of the author inside their own mind. That is, the
content in the articles, such as the structure of papers and the
conclusion drowned by the author, are all reasonable. Two
papers written in different styles and period were selected as
our test material. Six people with different levels of
knowledge background on computer science were invited to
offer their questions when reading test papers.
We intended to probe the comprehension impediments
that they encountered through their questions, and anatomize
the reasons causing these impediments. After the analytical
steps, we draw several conclusions about the characteristics
and problems on the comprehension of such difficult science
and technology literature by people who have different levels
of knowledge. We argue that these characteristics and
problems will facilitate the inspection of the existing works
on NLP, and will provide some insightful guide for the
future research. There are in fact already many psychological
works on science text comprehension properties [21]. Their
main purpose is to improve the quality of tutoring and teach.
We conduct this work mainly from an angle of computer
science and our main target is to investigate how we can
leverage computer models to do the understanding task.
II. SEMANTIC AND KNOWLEDGE MODEL
Before we introduce the main experiment and its results,
we first introduce how to define the problem and concepts
and how to model the problem in a computer science way,
rather than in a psychological way. The key is to model the
semantics, the knowledge and its relationships with texts or
scientific papers. That is, when we say that we can
understand a scientific paper, we mean that we can setup a
mapping from the text to the semantic and knowledge
information in reader's brain and this mapping can match the
author's understanding in a certain acceptable degree. Of
course, exact mapping is impossible. To understand is at
least to be able to set up such a mapping and such a mapping
can be accepted by many readers in a common sense. To
model this argument, we adopt a semantic link network
model [14] to describe the semantics and knowledge in the
text of a scientific paper.
A. Example
A semantic link network is a network consisting of entity
names and their relationships. An entity is a string
representing a real world object and concept. A relationship
is a common accepted relationship such as class-instance
relationship, causality relationship, belong-to relationship,
negation relationship, etc.. Then the semantic of a string of a
word, a sentence or a paragraph, is defined as a mapping
from this string to the predefined semantic link network. The
knowledge of such a string is the mapped node and its
related nodes in the semantic link network. The constraints
of semantic link network are not as strict as what has been
coined in the Semantic Web languages [19], which gives
Knowledge is represented by a sub network A in the shaded area
Square
Tape
Step
Turing Machine
State
Model
Partial
function
Transition
Function
Inversion of
function
Semantic mapping:
a mapping from
text to one node
Knowledge mapping:
a mapping from text to
a sub network of
knowledge
Computer science
math
The Inversion Function of Turing Machine
Fig 1. A simple semantic link network for describing a Turing machine
model and a mapping from a sentence to the semantic link network
semantic link network a flexible modeling capability.
Fig 1. gives such an example of using semantic link
network for describing a Turing machine model and a
semantic mapping and a knowledge mapping from a
sentence "The inversion function of Turing Machine". As
shown in the figure, the shaded area on the network is a
piece of knowledge of about the Turing machine model. The
edges among concepts can be
inclusion relationship,
equivalence relationship and sub class relationship. The
dotted arrow line represented semantic mapping, which is to
map an object to a node in the network. The bold dotted
arrow line is to map the whole sentence to the knowledge
piece in the shaded area. The shade area does not cover the
partial function or the transition concept. It is to show this
mapping is not complete. It is just an incomplete mapping or
even incorrect mapping.
But note that here it does not mean that we use the
semantic link network to describe every piece of knowledge
in author's mind. Or we do not mean that knowledge is only
the semantic link network instances. Rather, we use the
semantic link network to model the knowledge of authors in
some scale or sense such that the semantic link network can
be a knowledge representation at certain level or accuracy or
coverage. Or in another word, if we can find the author or a
specialist, we can let the author use the semantic link
network tool to describe his knowledge in a certain level of
details about his paper and we deem this semantic link
network as the knowledge representation of the paper of the
author or a teacher or an authority. We assume such a
network can be detailed and extended by authors or people.
And when a reader read the paper, he or she can also use the
semantic link network tool to describe his knowledge
derived from the paper. In this way, we can set up a
computable comparing platform to see what they know about
this paper.
B. Semantic link network based knowledge modelling
So from this example, if we say that a reader can
understand the sentence “The inversion function of Turing
machine", we mean that they can setup such a kind of
mapping from text to a semantic link network that describes
the related knowledge about the sentence. Of course, a
semantic link network about one thing is different for
different people with different knowledge background and
understanding. We assume that there is such a "correct"
semantic link network inside author's understanding. And a
'correct' understanding by a reader is to setup such an
approximation to the correct semantic link network and
correct mapping from text to it.
A sentence or a text may be mapped to different
knowledge in different context. But in fact, a context of a
sentence S of a paper P is the knowledge of a set C of strings
larger than that original string. P here is the set of any text
combination of texts in a paper. So its mapping could be
different from the S. To clearly show how this can model the
reading process. We formally define the related concepts as
below:
(1) P: a paper.
(2) s P: a text or a set of text from P.
(3) A=<E,V>: A semantic link network for describing
knowledge of a given people A.
(4) BA means that a semantic link network B is a sub
network of A.
(5) A semantic mapping from s to the knowledge is
defined as:
s(A):sv, where vV is a node in the semantic link
network A.
(6) A knowledge mapping from a text s P to knowledge
A(s) by a given people A when reading a sentence s can be
defined as:
is
A(s):sA(s), where A
the current background
knowledge of reader r, i.e., a set of semantic link network
having being built before reading P. A(s) is the semantic link
network either belong to A or a new semantic link network
that is new to A.
Also note that a semantic mapping can be deemed as a
knowledge mapping: s(A) = A(s) when A=< E =, V={v}>,
i.e. mapping s to a semantic network A with only one node
and no edge.
But simply union of w(A) for all ws does not construct
A(s) because there is no edge in w(A).
(7) A(P):{A(s):sA(s)sP} is a collection of semantic
link networks derived from text of paper P.
(8) A can be updated by A(s) using a simple graph union
operation AAA(s), which means that a semantic link
network A is extended by merging nodes and links from A(s)
as well as adding new edges among A and A(s). If A(s)A,
then, AA(s)=A. Similarly, A(s) A(s)A(p) means that the
semantic link network derived from s is extended by another
semantic link network derived from p and in this case and
the newly one can be different from the original one.
A(p) = A(p)A(s) may not equal to the A(s) = A(s)A(p)
because
applying
A(p) A(p)A(s), which may be different from applying
A(s) A(s)A(p).
added when
new
edges
are
(9) B(s) A(s) means that two semantic link networks are
similar or the knowledge of two people on s are similar. The
similarity can be defined in terms of graph similarity
considering both nodes and edges labels as well as their
topology or can be directly specified using a semantic link
“equivalent” or “similar to”
A:
Knowledge of
author A
A(P):Knowledge
on paper P by A
B: Knowledge of
reader B
B': Knowledge of
reader B before
reading P
Matching
A(P1) A(P):Knowledge
in paper P but
constructed from P1
B'(P): Knowledge
of B on P
Paper P written
by author A and
read by reader B
P
Other resources
P1
P2
Pn
Fig 2. Knowledge derived from paper P by author A and reader B
One possible confusing point is about the abstraction of a
semantic link network. For example, one semantic link
network T may contain only one node v= “Turing Machine”
and another one A is like what in Fig. 1. One may argue that
B(s) A(s) where s = “Turing Machine”. But in fact, from the
aspect of graph information, T is quite different from A. We
take it as the different knowledge because without any other
information we cannot deduce that T is A. One possible of
such information is that a direct semantic link “equivalent”
is added from T to A. When adding such an equivalent link
between T and A, it can be deemed as an updating operation
on T(s) by A(s). That is, T(s) T(s) A(s) adds a link
“equivalent” between corresponding node in T and in A.
C. Reading and Comprehension modelling
Then, we can now use the above modeling tools to model
a reading and comprehension case. We use an example in
Fig. 2 to show how this work.
In Fig. 2, an author A has a paper P that is read by a
reader B. So, here A is used to represent the semantic link
network knowledge of the author along with his paper. We
also use A(P) to represent the semantic link network derived
from P by the author A. And there is a semantic link network
A(P1) A(P) and A(P1) is derived from P1 rather than P. So,
in fact, an extension is applied as A(P)A(P) A (P1).Then,
the process can be modelled in sequence as following:
(1) A is built.
(2) A(P1) is built
(3) A(P)A(P) A (P1) is built. Note that the merging is
actually happen during writing each word or sentence by A.
B' represents the semantic link network knowledge of the
reader B before reading paper P. After reading P, his
semantic link knowledge can be extended by:
BB'B'(P). And then, by applying the updating
extension B(P) B B'(P), we can have the final semantic
link network as the knowledge model of B after reading P.
But we can see that if the reader B has not accessed the
paper P1, then, he may not be able to set up such a
knowledge mapping that B(P) A(P).
III. EXPERIMENT
We conduct a small experiment involving six readers and
two scientific papers. Table 1 shows the basic information of
six participants majoring in computer science area and their
roles in the task. It is also noted that they are all not native
English speakers. We divided participants into two groups
G1 and G2. There are 4 people in G1 and their questions are
used as material for classification and analysis to get
conclusions. The questions of G2 are used as the validation
material for our conclusions.
One of our test material (referred to as P1) is a classical
paper named “The Inversion of Functions defined by Turing
Machines”. This article was written by John McCarthy in
1956 [7]. It is difficult for most people to understand in three
aspects: first, it involves very fundamental ideas on Turing
machine, computational complexity and formal theory;
second, some of its concepts are too old to maintain its
original meaning in current; in addition, there are many
inferences and functions that the author considered obviously
but cannot be easily proved by readers. Another (referred to
as P2) is a newly published paper named “Teaching
machines to read and comprehend”. This article introduces
some deep NN and classical methods for answering Cloze
form queries [8], and that may difficult to understand for
people who have no contact with these methods.
TABLE I EXPERIMENTER INFORMATION
Group Participant
Computer
Roles
ID
G1
G2
A
B
C
D
E
F
Science Degree
college graduate
master candidate
master candidate
doctor
master candidate
PhD candidate
ask questions
ask questions
ask questions
ask & answer
ask questions
ask questions
TABLE II CLASSIFY THE QUESTIONS ABOUT P1
type0
type1
P1
type2
type3
Synthesis
3
0
3
0
0
0
0
0
10
6
4
8
9
0
1
6
37
12
25
18
23
2
4
10
31
5
24
15
9
0
3
4
9
3
10
2
1
0
3
3
TABLE IIII CLASSIFY THE QUESTIONS ABOUT P2
type0
type1
1
0
1
0
12
11
4
4
P2
type2
36
20
18
11
type3
Synthesis
27
11
17
15
7
11
9
2
G1
G2
A
B
C
D
E
F
G1
G2
A
B
C
D
E
F
0
0
0
0
9
0
11
0
20
2
14
8
12
0
9
1
7
0
10
2
A. Experiment Processes
Our experiment is conducted in two days (at least 6 hour
a day) without letting junior participants to do much
preparation work before. The first day, we handed out the
electronic and print version of P1 to all the participants. We
let participants read it paragraph by paragraph without any
auxiliary material such as dictionary, and meanwhile write
down their questions as well as the gist of each paragraph.
Then, D singled out some questions to answer. We recorded
all the questions and answers from D. The second day, we do
the same thing with P2.
We removed repeated questions for the same test paper
on the same group. At last, for P1, we collected a total of 90
questions asked by G1 and 26 by G2; for P2, there are 83
questions asked by G1 and 53 by G2. Finally, by analyzing
materials at hand, we tried to classify all the questions and
summarized several characteristics in the comprehension
processes, and showed them in the following sections.
mechanism of Turning Machine such as “tape”, “square”
and “internal states”, which are basics in Turing Machine
model, are contained within this paper’s outside knowledge.
Following questions are raised by A in P1:
What are the specific definitions of “steps” in the
third, the fourth sentence of paragraph 1, the last
sentence of paragraph 3 and the first two sentences
of paragraph 6?
Why “for any Turing machine there is another one
which does k steps of the original machine in one
step”? This sentence is in the second sentence of
paragraph 6.
Why “a machine with Q internal states and S
symbols should be considered as making about
1/2logQS elementary steps per step of computation”?
This sentence is in the last sentence of paragraph 8.
4) Type 3: lack of semantic links inside the paper:
The answers of this type of questions could be founded
out through the description in the articles, but participants
cannot find them probably because they have not yet read the
relevant sentences in the following sections, or they had
some incomprehensible parts in the earlier parts.
Several questions of this type in P1 are listed here for
B. Analysis and Classification
example:
First, we tried to classify those questions to see what
properties are there. These questions can be divided into four
types according to their inherent characteristic (see Table II
and Table II):
1) Type 0: Language problems:
Language problems represent the questions caused by the
grammar, or particular expression of the author. This type
contains the least number of questions because the English
level of our participants can fit the requirement of parsing the
papers. For example:
Whether the word of “to” is missing in the third
sentence of paragraph 19? Because we always use
the phrase “from … to …”.
2) Type 1: Lack of the semantic mapping from the
notations or words to the concepts behind the word:
Readers did not notice that this notation links to the real
concept. For example:
A does not known the word “enumerative” in the
first sentence of paragraph 5.
C does not known the word “homogeneous” and
“isotropic” in the first sentence of paragraph 8.
3) Type 2: lack of links to the knowledge outside the
paper and reader's current knowledge:
The knowledge outside of the paper represents the
meaning of concepts, logical relationships among concepts,
derivation of theorem and formulas, etc., that are mentioned
in the particular context of the paper and are not directly
provided in the paper but we should have known to
comprehend the paper. In another words, the knowledge
could not be learned in this articles but are still required in
understanding processes.
For example, article P1 does not explain anything about
Turing Machine. So, the structure and the operation
What is the meaning of “well-defined problems”
mentioned in the first sentence of paragraph 1?
Actually the interpretation of this notation is given in
the next three sentences.
In the fourth sentence of paragraph 7, reader A
cannot find the corresponding parts in transform
function of “but”?
Which is the corresponding part of “return to the
the first sentence of
in
question” mentioned
paragraph 10?
5) Synthesis questions:
The questions of this type are caused by two or more
questions listed in the previous type. That is, for example, a
question that is raised not only because the language
problems but also the lack of links to the knowledge outside
of the test papers.
Take the questions raised by G1 about P2 for example:
What is meaning of paragraph 21? A, B, C all asked
this question because they not only have no idea
about Deep LSTM Reader ( both lack of outside
knowledge of P2 and the incomprehension about
description in the paragraph above ), but also don’t
know what the symbols in the formulas refer to.
Why the author said that “There is no significant
advantage in this” in the fifth sentence of paragraph
16? The asker cannot understand the reason that the
author explains followed the mention.
C. Semantic link network modelling
From Table II and III, we can see that the major types of
questions are related to the knowledge inside and outside
paper. We can use the modeling method in section II to
describe these problems. Fig. 3 shows what the knowledge
outside the paper is and what knowledge inside the paper is.
Assuming that the paper contains a sentence S: “A well-
defined problem is a problem that has Turing Machine tester
to validate its solution”, let R is reader and A is the author,
then:
1) Semantic mapping is missing.
Type 1 questions can be modeled as w(R)= or
w(R)w(A) for a word or a phrase w S. For example, in
Fig.3 there are three semantic mappings that link from the
words and phrases of sentence to the nodes in this
knowledge piece.
2) Knowledge constructed inside the paper
There is one semantic link network R(S) that can be
constructed from the sentence S in the paper (marked in the
right shaded area of Fig. 3). This network R(S) is deemed as
the knowledge inside the paper P because sP of reader R. If
this knowledge cannot be setup by reader R, the problem
related to it is of type 3.
3) Knowledge outside the paper and reader knowledge
There is a semantic link network A(w) of the author A
about the word w =“Turing Machine” which can be detailed
in Fig.1. Here we use a shaded area in the left corner to
represent such a network. The knowledge is outside the
paper because from sentences in the paper reader R can NOT
setup such a knowledge piece, or a semantic link network to
represent the model of Turing machine that is similar to A(w).
Setting up R(w) such that R(w) A(w) is possible only when
the reader know the P0 before reading because A(w)=
A(w)A(P0) and P0 is other resource. More formally, we can
define this problem as:
s such that when R(w) R R(w) R(s), we have
R(w) A(w) and A(w) A(w) A(P0) with sP.
That is, there is no text s in paper P such that R(w) can be
extended to approximate A(w).
So, basically, type 1 problem is about the semantic
mapping setup problem. Type 2 problem is about the
knowledge mapping to the knowledge outside paper and
Type 3 problem is related to the knowledge mapping
construction to the inside knowledge. How about type 0
problem? Type0 problem is about the semantic mapping and
knowledge mapping from sentences
language
knowledge.
the
to
4) Modelling understanding
To understand sentence S in the figure, of course, R need
to approximate A(S), which in turn requires to setup R(w) in
a correct way. Before setting up R(w), there is already an R(S)
which can be derived from S using current knowledge R. But
this R(S) is far from A(S). If R obtains A(w) by reading some
other materials P0, then, it can be described as :
R(w) R(w) R(P0) and then R(w) A(w) .
Then, by applying another merging operation:
R(S) R(S) R(w). Then, we finally can have R(S)
A(S) because R(S) R(S) R(w) and A(S) A(S) A(w).
D. Characteristics and problems
Further, we tried to analyse characteristics of those
questions raised by readers to see why they may raise such
questions. We have found that there are 10 characteristics, or
say, problems, that are reflected by these questions.
1) The key questions
from
understanding the article could not be asked by themselves
sometime :
that hinder people
For example, reader A had a question “What are the
logical relations among ‘not defined’, ‘exist’, ‘existence’,
and ‘not exist’? Are they not in conflict with each other?”
when A reads the paragraph 2 of P1.
In fact it is because A does not know “partial function”
and “mth Turing machine”, and the relationship between
function ‘g(m, r)’ and ‘fm(g(m, r))’, which lead A to ask that
question. And A has set up a wrong mapping for “partial
function”.
2) The major understanding obstacles that people
Knowledge A(w) outside the
paper
Turing Machine
related knowledge
Well-defined
problem
Problem
There is a tester on
solution
Semantic mapping
Knowledge mapping
Knowledge
R(S) in the
paper
R(S)
P0
A(w)
Sentence
S in the
paper
A Well-defined problem is a problem that has
Turing Machine tester to validate its solution
Fig 3. A semantic link network that is derived from the sentences of
paper and it is also related to a knowledge piece outside the paper
concern are mainly focused on type 2 and type 3:
This conclusion can be directly drawn for the total
number of questions in all types. The questions in these two
categories are the majority of our question lists for all
participants.
Here we assumed that people who may read scientific
literature all have a good command of English. As for type 1
questions, they all believed that problems caused by the
mismatch about notation and concepts can be solved easily
by a dictionary.
3) The barrier of understanding caused by the lack of
links to the knowledge outsid the paper and the reader's
knowlege will seriously prevent people from comprehending
the paper they are reading:
First, a lot of questions in type 4 contain the concepts that
have been asked in type 2. For example, a question of P1 in
type 2 is “what’s the meaning of ‘well-defined problems’ in
first two sentences of paragraph 1?”, while in P1’s type 3
there is a question about the “logical relationship among
‘problem’, ‘solution’ and ‘test’ in paragraph 1”.
Second, as shown in the first characteristic, the key to
answer many questions depends on
the complete
understanding of knowledge outside the papers. People may
not discover the importance of some concepts or think they
have already armed with that background knowledge, which
will finally
to either wrong understanding or
incomprehensible concepts in other parts of the paper.
leads
4) Some questions of type 3 may also be raised by
leaping thinking in articles and readers cannot keep up with
the authors’ thought:
For example, in the P1, paragraphs from 7 to 9 discuss a
computational complexity in another way. Both B and C
have learned related concepts before, but they paid all of
their attention on the Turing machine, partial function and
the inversion of functions and raised a lot of questions
because they did not realize that these paragraphs is about
computational complexity theory.
5) People can’t reproduce some proof of theorems and
reasoning of functions not only because the lack of
background knowledge but also related to their individual
factors such as capability and training experience:
For example, D has enough background to understand
the major parts of two test papers but he still cannot prove an
argument in the P1: “a machine with Q internal states and S
symbols should be considered as making about 1/2 log QS
elementary steps per step of computation”, which is
mentioned in the last sentence of paragraph 8.
6) The obstacles of comprehension caused by the
limitation of outside knowledge could not be overcame by
using the internal information of the paper; That is,
information from outside is needed:
This is obvious according to the definition of the
knowledge outside the paper. There are the knowledge that
cannot be learned within this article but still be need in
understanding processes.
7) People’s comprehension of the main ideas weakens
dramatically with the increasing of points they don’t
understand as well as with the accumulation of their bad
mood:
Reader A, B and C could hardly summarize the main
ideas of the paragraphs after the third page of P1. E even
gave up reading P1 after paragraph 6. As for P2, reader A, B,
C and E all jumped from paragraph 21 to 26 because there
are many things they don’t know for deep NN. And they all
feel agitated because there are numerous points they could
not understand in the paper.
8) Most of the time, we still cannot understand the
article even if excellent work on syntax/grammar parsing
has been done:
In our experiment, grammar or language problem of type
0 is rare. So, solving type 0 problem may not help much to
solve type 1 and 2 problems. Of course, basic syntactic
parsing is necessary for understanding basic meaning of
sentences, but we argue that the works of syntax parsing
can't help understanding content when the understanding
requires a certain level of semantics or knowledge that is far
above the basic semantics of words.
9) Some research on semantics could help people
understand articles:
In linguistics, semantics is a study mainly focusing on the
meaning and relationship inherent at the levels of words,
phrases, sentences, and larger units of discourse [11]. Many
tasks in NLP need to concern semantic, such as automatic
summarization, co-reference resolution, question answering,
etc. As we argued in the introduction, most of them are still
far from satisfaction. Although these tools can help some in
identifying word and relationships, we argue that to make
machine reading and comprehending, we need to pay
attentions to the problems of type 2, 3 and 4 we have
modelled.
10) The function of guide is significant:
D spent a month reading P1 until he could make a
comprehension, but A, B and C only take one day to reach a
certain degree of understanding under the guidance of D. So
the guidance is important.
From this view, if we intend to make a machine simulate
human to understand scientific literature and then help
people read, it is more plausible that we teach the machine to
understand at first than let it study on its own from scratch.
There are many methods we can refer in the teaching process
among people, such as exemplification, graphical method,
searching for the key problems, etc..
IV.
IMPLICATIONS
Although this experiment is conducted in a very small
scale with only six participants and two papers involved, we
still argue that the results can be representative, especially
for those who are reading difficult scientific literatures that
they are not so familiar with. Moreover, what we have done
in this experiment at least show three instructive points that
could be referred when we design artificial intelligence
models for letting machine to understand text:
1) Syntax semantics and content semantics
A language expression has two levels of semantics. One
is syntax semantics that is used to understand a basic, topic-
irrelevant semantics of the expression. In our work they are
related to type 0 problems. But capturing basic semantics of
an expression may not help much for understanding content
semantics of text. How to deal with this gap may be
fundamental in making machine understanding natural
language text.
2)
the knowledge outside the papers.
To better process text, outside knowledge is important or
even indispensable. How to incorporate explicit outside
knowledge into machine learning process is an important
research issue. In this view, it may be worth thinking how to
design the method for machines to express and save
knowledge, and how to design the algorithm to learning new
knowledge using their own knowledge.
3) High-level guidance.
Guidance is an efficient way to increase the efficiency of
understanding [23]. How to make such explicit guidance on
machine learning process deserves further study. At present,
the popular way to “teach” a machine is to input rules
defined by people, or by a supervised learning model with
large benchmark data. But we still cannot understand how
human comprehend articles until now. So we cannot
completely define the rules for understanding and teach it to
machine.
4) Semantic link network modelling.
We have used the semantic link network model to
analyze four types of questions and we found that the key to
make the reader understanding is to help them setup
semantic link networks either from outside knowledge
sources or from the texts in the paper and then help them
setting up mappings from texts to those semantic link
networks. So this can help us derive the future solution to
make the machine read and comprehend the text. That is,
make machine be able to set up semantic link networks and
then setting up mappings from texts to those semantic link
networks automatically [15][22][24].
V. CONCLUSIONS
In
this work, we conducted a human
reading
comprehension experiment where we let six people read two
computer science papers which are difficult to understand for
many people, and let them write down their questions in the
comprehension process. From the experiment, we have
summarized ten characteristics and problems that people
reflected in reading difficult scientific literature by trying to
classify and analyze the question they listed using a semantic
network model. And those characteristics and problems
show that even for people, it is still hard to comprehend such
complicated papers completely. For machine, it is much
more difficult to conduct such kinds of task. But the results
also provide some implications, that is, we should consider
how to deal with syntax semantics and content semantics,
and how to incorporate explicit knowledge into machine
learning process and how to make explicit guidance on
machine learning process.
ACKNOWLEDGMENT
Thanks to Wei Li and Pengshan Cai for their supporting
and thanks to Prof. Zhiwei Xu for his suggestions in this
work. Research Supported by the Open Project Funding of
CAS Key Lab of Intelligent Information Processing, Institute
of Computing Technology, Chinese Academy of Sciences
(No. IIP2014-2).This work was also partially supported by
National Science Foundation of China (No.61075074 and
No.61070183).
REFERENCES
[1]
[2]
[3]
J. Copeland. AlanTuring.net What is AI. [Online]. Available:
http://www.alanturing.net/turing_archive/pages/Reference%20Articl
es/What%20is%20AI.html.
The Wikipedia page Artificial intelligence. [Online]. Available:
https://en.wikipedia.org/wiki/Artificial_intelligence.
Processing.
Language
The Wikipedia
https://en.wikipedia.org/wiki/Natural_language_ processing. (2015)
[4] Q. Likun and Y. Zhang. "Word Segmentation for Chinese Novels",
in Proceeding of 29th AAAI Conference on Artificial Intelligence.
2015, p. 2440-2446
S. Tobias, and H. Schütze. "Flors: Fast and simple domain
adaptation
the
Association for Computational Linguistics. vol.2, pp. 15-26, 2014
tagging." Transactions of
for part-of-speech
Natural
page
[5]
[6] K. Nandhini and S. R. Balasundaram. “Improving readability
through extractive summarization
reading
difficulties”. Egyptian Informatics, Journal, vol.14, iss.3, pp. 195-
204, Nov. 2013.
J. McCarthy. “The inversion of functions defined by Turing
machines”, Automata studies, pp. 177-181, 1956.
learners with
[7]
for
[8] K. M. Hermann, T. Kočiský, E. Grefenstette, L. Espeholt, W. Kay,
M. Suleyman, & P. Blunsom. "Teaching Machines to Read and
Comprehend". arXiv preprint arXiv:1506.03340. 2015.
[9] C. Mellish, G. Ritchie. "The Grammatical Analysis of Sentences."
http://homepages.abdn.ac.uk/advaith/pages/teaching/
Available:
NLP/information/gram.pdf.
[10] R. Collobert, J. Weston, L. Bottou, et al.. ”Natural language
processing (almost) from scratch”, The Journal of Machine Learning
Research, vol. 12, pp. 2493-2537, 2011.
[11] The
Wikipedia
page
Semantics.
Available:
https://en.wikipedia.org/wiki/Semantics.
[12] Q. V. Le and T. Mikolov. "Distributed representations of sentences
and documents." arXiv preprint arXiv:1405.405[31]3 , 2014.
[13] K. Cho, B. van Merrienboer, C. Gulcehre, D. Bahdanau, F. Bougares,
H. Schwenk, Y. Bengio. "Learning phrase representations using
RNN encoder-decoder for statistical machine translation". arXiv
preprint arXiv:1406.1078, 2014.
[14] H. Zhuge, The Knowledge Grid, World Scientific Publishing Co.,
Singapore, 2004 (1st ed), 2012 (2nd ed)
[15] O. Hassanzadeh, A. Kementsietsidis, L. Lim, R. J. Miller, M. Wang,
M. "A framework for semantic link discovery over relational data".
In Proceedings of the 18th ACM conference on Information and
knowledge management. pp. 1027-1036. ACM. 2009, November.
[16] M. Palmer, D. Gildea, & N. Xue. "Semantic role labeling". Synthesis
Lectures on Human Language Technologies, 3(1), 1-103, 2010.
[17] T. Rocktäschel, S. Singh, S. Riedel. "Injecting Logical Background
Knowledge into Embeddings for Relation Extraction". Proceedings
of the 2015 Human Language Technology Conference of the North
American Chapter of the Association of Computational Linguistics.
2015.
[18] S. R. Bowman, & C. Potts. "Recursive neural networks can learn
logical semantics". ACL-IJCNLP 2015, 12. 2015.
[19] T. Berners-Lee, J. Hendler, & O. Lassila. "The semantic web".
Scientific American, 284(5), pp.28-37, 2001.
[20] M. Steyvers, & T. Griffiths,. Probabilistic topic models. Handbook
of latent semantic analysis, 427(7), 424-440. 2007.
[21] J. Otero, J. Lecentsn, & A. C. Graesser, (Eds.). (2014). The
psychology of science text comprehension. Routledge.
[22] H. Zhuge, Communities and Emerging Semantics in Semantic Link
IEEE Transactions on
Network: Discovery and Learning,
Knowledge and Data Engineering, vol.21, no.6, pp. 785-799, 2009.
[23] H. Zhuge, Interactive Semantics, Artificial Intelligence, 174(2010),
pp.190-204, 2010.
[24] H. Zhuge, Semantic linking through spaces for cyber-physical-socio
intelligence: A methodology, Artificial Intelligence, 175(2011),
pp.988-1019, 2011.
[25] J. McCarthy, M. L. Minsky, N Rochester, et al. A proposal for the
Dartmouth summer research project on artificial intelligence, August
31, 1955[J].
|
1508.05154 | 2 | 1508 | 2015-09-02T17:26:24 | Posterior calibration and exploratory analysis for natural language processing models | [
"cs.CL"
] | Many models in natural language processing define probabilistic distributions over linguistic structures. We argue that (1) the quality of a model' s posterior distribution can and should be directly evaluated, as to whether probabilities correspond to empirical frequencies, and (2) NLP uncertainty can be projected not only to pipeline components, but also to exploratory data analysis, telling a user when to trust and not trust the NLP analysis. We present a method to analyze calibration, and apply it to compare the miscalibration of several commonly used models. We also contribute a coreference sampling algorithm that can create confidence intervals for a political event extraction task. | cs.CL | cs | Posterior calibration and exploratory analysis for natural language
processing models
Khanh Nguyen
Department of Computer Science
University of Maryland, College Park
College Park, MD 20742
Brendan O’Connor
College of Information and Computer Sciences
University of Massachusetts, Amherst
Amherst, MA, 01003
5
1
0
2
p
e
S
2
]
L
C
.
s
c
[
2
v
4
5
1
5
0
.
8
0
5
1
:
v
i
X
r
a
[email protected]
[email protected]
Abstract
Many models in natural language process-
ing define probabilistic distributions over
linguistic structures. We argue that (1)
the quality of a model’s posterior distribu-
tion can and should be directly evaluated,
as to whether probabilities correspond to
empirical frequencies; and (2) NLP uncer-
tainty can be projected not only to pipeline
components, but also to exploratory data
analysis, telling a user when to trust and
not trust the NLP analysis. We present a
method to analyze calibration, and apply
it to compare the miscalibration of sev-
eral commonly used models. We also con-
tribute a coreference sampling algorithm
that can create confidence intervals for a
political event extraction task.1
Introduction
1
Natural language processing systems are imper-
fect. Decades of research have yielded analyzers
that mis-identify named entities, mis-attach syn-
tactic relations, and mis-recognize noun phrase
coreference anywhere from 10-40% of the time.
But these systems are accurate enough so that their
outputs can be used as soft, if noisy, indicators of
language meaning for use in downstream analysis,
such as systems that perform question answering,
machine translation, event extraction, and narra-
tive analysis (McCord et al., 2012; Gimpel and
Smith, 2008; Miwa et al., 2010; Bamman et al.,
2013).
To understand the performance of an ana-
lyzer, researchers and practitioners typically mea-
sure the accuracy of individual labels or edges
among a single predicted output structure y, such
as a most-probable tagging or entity clustering
arg maxy P (yx) (conditional on text data x).
1This is the extended version of a paper published in Pro-
ceedings of EMNLP 2015. This version includes acknowl-
edgments and an appendix. For all materials, see: http:
//brenocon.com/nlpcalib/
But a probabilistic model gives a probability
distribution over many other output structures that
have smaller predicted probabilities; a line of work
has sought to control cascading pipeline errors by
passing on multiple structures from earlier stages
of analysis, by propagating prediction uncertainty
through multiple samples (Finkel et al., 2006),
K-best lists (Venugopal et al., 2008; Toutanova
et al., 2008), or explicitly diverse lists (Gimpel
et al., 2013); often the goal is to marginalize over
structures to calculate and minimize an expected
loss function, as in minimum Bayes risk decod-
ing (Goodman, 1996; Kumar and Byrne, 2004), or
to perform joint inference between early and later
stages of NLP analysis (e.g. Singh et al., 2013;
Durrett and Klein, 2014).
These approaches should work better when the
posterior probabilities of the predicted linguistic
structures reflect actual probabilities of the struc-
tures or aspects of the structures. For example, say
a model is overconfident: it places too much prob-
ability mass in the top prediction, and not enough
in the rest. Then there will be little benefit to us-
ing the lower probability structures, since in the
training or inference objectives they will be incor-
rectly outweighed by the top prediction (or in a
sampling approach, they will be systematically un-
dersampled and thus have too-low frequencies). If
we only evaluate models based on their top pre-
dictions or on downstream tasks, it is difficult to
diagnose this issue.
Instead, we propose to directly evaluate the cal-
ibration of a model’s posterior prediction distri-
bution. A perfectly calibrated model knows how
often it’s right or wrong; when it predicts an event
with 80% confidence, the event empirically turns
out to be true 80% of the time. While perfect
accuracy for NLP models remains an unsolved
challenge, perfect calibration is a more achievable
goal, since a model that has imperfect accuracy
could, in principle, be perfectly calibrated. In this
paper, we develop a method to empirically analyze
calibration that is appropriate for NLP models (§3)
and use it to analyze common generative and dis-
criminative models for tagging and classification
(§4).
Furthermore,
if a model’s probabilities are
meaningful, that would justify using its proba-
bility distributions for any downstream purpose,
including exploratory analysis on unlabeled data.
In §6 we introduce a representative corpus explo-
ration problem, identifying temporal event trends
in international politics, with a method that is de-
pendent on coreference resolution. We develop
a coreference sampling algorithm (§5.2) which
projects uncertainty into the event extraction, in-
ducing a posterior distribution over event frequen-
cies. Sometimes the event trends have very high
posterior variance (large confidence intervals),2
reflecting when the NLP system genuinely does
not know the correct semantic extraction. This
highlights an important use of a calibrated model:
being able to tell a user when the model’s predic-
tions are likely to be incorrect, or at least, not giv-
ing a user a false sense of certainty from an erro-
neous NLP analysis.
2 Definition of calibration
Consider a binary probabilistic prediction prob-
lem, which consists of binary labels and proba-
bilistic predictions for them. Each instance has a
ground-truth label y ∈ {0, 1}, which is used for
evaluation. The prediction problem is to gener-
ate a predicted probability or prediction strength
q ∈ [0, 1]. Typically, we use some form of a prob-
abilistic model to accomplish this task, where q
represents the model’s posterior probability3 of the
instance having a positive label (y = 1).
Let S = {(q1, y1), (q2, y2),··· (qN , yN )} be
the set of prediction-label pairs produced by the
model. Many metrics assess the overall quality
of how well the predicted probabilities match the
data, such as the familiar cross entropy (negative
average log-likelihood),
1
qi
1
N
+ (1 − yi) log
1
i
yi log
L(cid:96)((cid:126)y, (cid:126)q) =
1 − qi
or mean squared error, also known as the Brier
score when y is binary (Brier, 1950),
(yi − qi)2
(cid:88)
L2((cid:126)y, (cid:126)q) =
(cid:88)
1
N
i
2We use the terms confidence interval and credible inter-
val interchangeably in this work; the latter term is debatably
more correct, though less widely familiar.
3Whether q comes from a Bayesian posterior or not is ir-
relevant to the analysis in this section. All that matters is that
predictions are numbers q ∈ [0, 1].
Both tend to attain better (lower) values when q is
near 1 when y = 1, and near 0 when y = 0; and
they achieve a perfect value of 0 when all qi = yi.4
Let P(y, q) be the joint empirical distribution
over labels and predictions. Under this notation,
L2 = Eq,y[y − q]2. Consider the factorization
P(y, q) = P(y q) P(q)
where P(y q) denotes the label empirical fre-
quency, conditional on a prediction strength (Mur-
phy and Winkler, 1987).5 Applying this factor-
ization to the Brier score leads to the calibration-
refinement decomposition (DeGroot and Fienberg,
1983), in terms of expectations with respect to the
prediction strength distribution P(q):
L2 = Eq[q − pq]2
+ Eq[pq(1 − pq)]
(1)
(cid:124)
(cid:123)(cid:122)
(cid:125)
Calibration MSE
Refinement
where we denote pq ≡ P(y = 1 q) for brevity.
Here, calibration measures to what extent a
model’s probabilistic predictions match their cor-
responding empirical frequencies. Perfect calibra-
tion is achieved when P(y = 1 q) = q for all
q; intuitively, if you aggregate all instances where
a model predicted q, they should have y = 1 at q
percent of the time. We define the magnitude of
miscalibration using root mean squared error:
Definition 1 (RMS calibration error).
(cid:113)Eq[q − P(y = 1 q)]2
CalibErr =
(cid:123)(cid:122)
(cid:124)
(cid:125)
The second term of Eq 1 refers to refinement,
which reflects to what extent the model is able
to separate different labels (in terms of the con-
ditional Gini entropy pq(1 − pq)). If the predic-
tion strengths tend to cluster around 0 or 1, the re-
finement score tends to be lower. The calibration-
refinement breakdown offers a useful perspective
on the accuracy of a model posterior. This paper
focuses on calibration.
There are several other ways to break down
squared error, log-likelihood, and other probabilis-
tic scoring rules.6 We use the Brier-based calibra-
tion error in this work, since unlike cross-entropy
4These two loss functions are instances of proper scoring
rules (Gneiting and Raftery, 2007; Brocker, 2009).
5 We alternatively refer to this as label frequency or empir-
ical frequency. The P probabilities can be thought of as fre-
quencies from the hypothetical population the data and pre-
dictions are drawn from. P probabilities are, definitionally
speaking, completely separate from a probabilistic model that
might be used to generate q predictions.
6They all include a notion of calibration corresponding to
a Bregman divergence (Brocker, 2009); for example, cross-
entropy can be broken down such that KL divergence is the
measure of miscalibration.
A set
of N prediction-label
Algorithm 2 Estimate calibration error’s confi-
dence interval by sampling.
Input:
{(q1, y1), (q2, y2),··· , (qN , yN )}.
Output: Calibration error with a 95% confidence interval.
Parameter: Number of samples, S.
Step 1: Calculate {p1, p2,··· , pT} from step 4 of Algo-
rithm 1.
Step 2: Draw S samples. For each s = 1..S,
pairs
i ∼ N(cid:0)pi, σ2
i
(cid:1), where
If necessary clip to [0, 1]:
• For each bin i = 1..T , draw p(s)
i = pi(1 − pi)/Bi.
σ2
p(s)
i
:= min(1, max(0, p(s)
i ))
• Calculate the sample’s CalibErr from using the pairs
qk
(qi, p(s)
i ) as per Step 5 of Algorithm 1.
Step 3: Calculate the 95% confidence interval for the calibra-
tion error as:
CalibErravg ± 1.96 serror
where CalibErravg and serror are the mean and the stan-
dard deviation, respectively, of the CalibErrs calculated
from the samples.
Algorithm 1 Estimate calibration error using
adaptive binning.
Input:
A set
{(q1, y1), (q2, y2),··· , (qN , yN )}.
Output: Calibration error.
Parameter: Target bin size β.
Step 1: Sort pairs by prediction values qk in ascending order.
of N prediction-label
pairs
β
+ 1.
Step 2: For each, assign bin label bk =
Step 3: Define each bin Bi as the set of indices of pairs that
have the same bin label.
If the last bin has size less than
β, merge it with the second-to-last bin (if one exists). Let
{B1, B2,··· , BT} be the set of bins.
Step 4: Calculate empirical and predicted probabilities per
bin:
(cid:106) k−1
(cid:107)
pi =
1
Bi
yk
and
qi =
1
Bi
(cid:88)
k∈Bi
(cid:88)
k∈Bi
Step 5: Calculate the calibration error as the root mean
squared error per bin, weighted by bin size in case they are
not uniformly sized:
(cid:118)(cid:117)(cid:117)(cid:116) 1
N
T(cid:88)
CalibErr =
Bi(qi − pi)2
i=1
the middle of the q distribution (Figure 1).
it does not tend toward infinity when near prob-
ability 0; we hypothesize this could be an issue
since both p and q are subject to estimation error.
3 Empirical calibration analysis
From a test set of labeled data, we can analyze
model calibration both in terms of the calibration
error, as well as visualizing the calibration curve
of label frequency versus predicted strength. How-
ever, computing the label frequencies P(y = 1q)
requires an infinite amount of data. Thus approx-
imation methods are required to perform calibra-
tion analysis.
3.1 Adaptive binning procedure
Previous studies that assess calibration in super-
vised machine learning models (Niculescu-Mizil
and Caruana, 2005; Bennett, 2000) calculate la-
bel frequencies by dividing the prediction space
into deciles or other evenly spaced bins—e.g. q ∈
[0, 0.1), q ∈ [0.1, 0.2), etc.—and then calculat-
ing the empirical label frequency in each bin. This
procedure may be thought of as using a form of
nonparametric regression (specifically, a regres-
sogram; Tukey 1961) to estimate the function
f (q) = P(y = 1 q) from observed data points.
But models in natural language processing give
very skewed distributions of confidence scores q
(many are near 0 or 1), so this procedure performs
poorly, having much more variable estimates near
We propose adaptive binning as an alterna-
tive.
Instead of dividing the interval [0, 1] into
fixed-width bins, adaptive binning defines the bins
such that there are an equal number of points
in each, after which the same averaging proce-
dure is used. This method naturally gives wider
bins to area with fewer data points (areas that re-
quire more smoothing), and ensures that these ar-
eas have roughly similar standard errors as those
near the boundaries, since for a bin with β num-
ber of points and empirical frequency p, the stan-
dard error is estimated by(cid:112)p(1 − p)/β, which is
β. Algorithm 1 describes
bounded above by 0.5/
the procedure for estimating calibration error us-
ing adaptive binning, which can be applied to any
probabilistic model that predicts posterior proba-
bilities.
√
3.2 Confidence interval estimation
Especially when the test set is small, estimating
calibration error may be subject to error, due to
uncertainty in the label frequency estimates. Since
how to estimate confidence bands for nonparamet-
ric regression is an unsolved problem (Wasserman,
2006), we resort to a simple method based on the
binning. We construct a binomial normal approx-
imation for the label frequency estimate in each
bin, and simulate from it; every simulation across
all bins is used to construct a calibration error;
these simulated calibration errors are collected to
construct a normal approximation for the calibra-
(c)
(d)
(a)
(b)
Figure 1: (a) A skewed distribution of predictions on whether a word has the NN tag (§4.2.2). Calibration curves produced
by equally-spaced binning with bin width equal to 0.02 (b) and 0.1 (c) can have wide confidence intervals. Adaptive binning
(with 1000 points in each bin) (d) gives small confidence intervals and also captures the prediction distribution. The confidence
intervals are estimated as described in §3.1.
tion error estimate. Since we use bin sizes of at
least β ≥ 200 in our experiments, the central limit
theorem justifies these approximations. We report
all calibration errors along with their 95% confi-
dence intervals calculated by Algorithm 2.7
iments, we set the target bin size in Algorithm 1
to be 5,000 and the number of samples in Algo-
rithm 2 to be 10,000.
better
3.3 Visualizing calibration
a model’s
understand
In
order
to
pairs
plot
the
calibration
properties, we
(p1, q1), (p2, q2),··· , (pT , qT )
obtained
from
the adaptive binning procedure to visualize the
calibration curve of the model—this visualization
is known as a calibration or reliability plot.
It
provides finer grained insight into the calibra-
tion behavior in different prediction ranges. A
perfectly calibrated curve would coincide with
the y = x diagonal line. When the curve lies
above the diagonal, the model is underconfident
(q < pq); and when it is below the diagonal, the
model is overconfident (q > pq).
An advantage of plotting a curve estimated from
fixed-size bins, instead of fixed-width bins, is that
the distribution of the points hints at the refinement
aspect of the model’s performance. If the points’
positions tend to cluster in the bottom-left and top-
right corners, that implies the model is making
more refined predictions.
4 Calibration for classification and
tagging models
Using the method described in §3, we assess the
quality of posterior predictions of several classi-
fication and tagging models. In all of our exper-
7A major unsolved issue is how to fairly select the bin
size. If it is too large, the curve is oversmoothed and calibra-
tion looks better than it should be; if it is too small, calibra-
tion looks worse than it should be. Bandwidth selection and
cross-validation techniques may better address this problem
in future work. In the meantime, visualizations of calibration
curves help inform the reader of the resolution of a particular
analysis—if the bins are far apart, the data is sparse, and the
specific details of the curve are not known in those regions.
Introduction
4.1 Naive Bayes and logistic regression
4.1.1
Previous work on Naive Bayes has found its prob-
abilities to have calibration issues, in part due
to its incorrect conditional independence assump-
tions (Niculescu-Mizil and Caruana, 2005; Ben-
nett, 2000; Domingos and Pazzani, 1997). Since
logistic regression has the same log-linear repre-
sentational capacity (Ng and Jordan, 2002) but
does not suffer from the independence assump-
tions, we select it for comparison, hypothesizing
it may have better calibration.
We analyze a binary classification task of Twit-
ter sentiment analysis from emoticons. We col-
lect a dataset consisting of tweets identified by the
Twitter API as English, collected from 2014 to
2015, with the “emoticon trick” (Read, 2005; Lin
and Kolcz, 2012) to label tweets that contain at
least one occurrence of the smiley emoticon “:)”
as “happy” (y = 1) and others as y = 0. The
smiley emoticons are deleted in positive examples.
We sampled three sets of tweets (subsampled from
the Decahose/Gardenhose stream of public tweets)
with Jan-Apr 2014 for training, May-Dec 2014 for
development, and Jan-Apr 2015 for testing. Each
set contains 105 tweets, split between an equal
number of positive and negative instances. We
use binary features based on unigrams extracted
from the twokenize.py8 tokenization. We use the
scikit-learn (Pedregosa et al., 2011) implementa-
tions of Bernoulli Naive Bayes and L2-regularized
logistic regression. The models’ hyperparameters
(Naive Bayes’ smoothing paramter and logistic re-
gression’s regularization strength) are chosen to
8https://github.com/myleott/
ark-twokenize-py
01000020000300000.000.250.500.751.00Prediction StrengthCount0.000.250.500.751.000.000.250.500.751.00Prediction strengthEmpirical frequency0.000.250.500.751.000.000.250.500.751.00Prediction strengthEmpirical frequency0.000.250.500.751.000.000.250.500.751.00Prediction strengthEmpirical frequency(a)
(b)
(a)
(b)
Figure 2: Calibration curve of (a) Naive Bayes and (b) lo-
gistic regression on predicting whether a tweet is a “happy”
tweet.
maximize the F-1 score on the development set.
4.1.2 Results
Naive Bayes attains a slightly higher F-1 score
(NB 73.8% vs. LR 72.9%), but logistic regression
has much lower calibration error:
less than half
as much RMSE (NB 0.105 vs. LR 0.041; Figure
2). Both models have a tendency to be undercon-
fident in the lower prediction range and overconfi-
dent in the higher range, but the tendency is more
pronounced for Naive Bayes.
4.2 Hidden Markov models and conditional
random fields
Introduction
4.2.1
Hidden Markov models (HMM) and linear chain
conditional random fields (CRF) are another com-
monly used pair of analogous generative and dis-
criminative models. They both define a posterior
over tag sequences P (yx), which we apply to
part-of-speech tagging.
We can analyze these models in the binary cal-
ibration framework (§2-3) by looking at marginal
distribution of binary-valued outcomes of parts of
the predicted structures. Specifically, we examine
calibration of predicted probabilities of individual
tokens’ tags (§4.2.2), and of pairs of consecutive
tags (§4.2.3). These quantities are calculated with
the forward-backward algorithm.
To prepare a POS tagging dataset, we ex-
tract Wall Street Journal articles from the En-
glish CoNLL-2011 coreference shared task dataset
from Ontonotes (Pradhan et al., 2011), using the
CoNLL-2011 splits for training, development and
testing. This results in 11,772 sentences for train-
ing, 1,632 for development, and 1,382 for testing,
over a set of 47 possible tags.
We train an HMM with Dirichlet MAP us-
ing one pseudocount for every transition and
word emission. For the CRF, we use the L2-
regularized L-BFGS algorithm implemented in
Figure 3: Calibration curves of (a) HMM, and (b) CRF, on
predictions over all POS tags.
CRFsuite (Okazaki, 2007). We compare an HMM
to a CRF that only uses basic transition (tag-tag)
and emission (tag-word) features, so that it does
not have an advantage due to more features.
In
order to compare models with similar task perfor-
mance, we train the CRF with only 3000 sentences
from the training set, which yields the same accu-
racy as the HMM (about 88.7% on the test set).
In each case, the model’s hyperparameters (the
CRF’s L2 regularizer, the HMM’s pseudocount)
are selected by maximizing accuracy on the devel-
opment set.
4.2.2 Predicting single-word tags
In this experiment, we measure miscalibration of
the two models on predicting tags of single words.
First, for each tag type, we produce a set of 33,306
prediction-label pairs (for every token); we then
concatenate them across the tags for calibration
analysis. Figure 3 shows that the two models
exhibit distinct calibration patterns. The HMM
tends to be very underconfident whereas the CRF
is overconfident, and the CRF has a lower (better)
overall calibration error.
We also examine the calibration errors of the
individual POS tags (Figure 4(a)). We find that
CRF is significantly better calibrated than HMM
in most but not all categories (39 out of 47). For
example, they are about equally calibrated on pre-
dicting the NN tag. The calibration gap between
the two models also differs among the tags.
4.2.3 Predicting two-consecutive-word tags
There is no reason to restrict ourselves to model
predictions of single words; these models define
marginal distributions over larger textual units.
Next we examine the calibration of posterior pre-
dictions of tag pairs on two consecutive words in
the test set. The same analysis may be impor-
tant for, say, phrase extraction or other chunk-
ing/parsing tasks.
CalibErr=0.1048 ± 6.9E−030.000.250.500.751.000.000.250.500.751.00Prediction strengthEmpirical frequencyCalibErr=0.0409 ± 6.2E−030.000.250.500.751.000.000.250.500.751.00Prediction strengthEmpirical frequencyCalibErr=0.0153 ± 5.1E−040.000.250.500.751.000.000.250.500.751.00Prediction strengthEmpirical frequencyCalibErr=0.0081 ± 3.5E−030.000.250.500.751.000.000.250.500.751.00Prediction strengthEmpirical frequencywhich previous mention it attaches to, or NEW if it
is starting a new entity that has not yet been seen
at a previous position in the text. Such a mention-
mention attachment indicates coreference, while
the final entity clustering includes more links im-
plied through transitivity. The model’s generative
process is:
Definition 2 (Antencedent coreference model and
sampling algorithm).
• For i = 1..N, sample
exp(wTf (i, ai, x))
ai ∼ 1
Zi
• Calculate the entity clusters as e := CC(a),
the connected components of the antecedent
graph having edges (i, ai) for i where ai (cid:54)=
NEW.
(cid:81)
Here x denotes all information in the document
that is conditioned on for log-linear features f.
e = {e1, ...eM} denotes the entity clusters, where
each element is a set of mentions. There are M en-
tity clusters corresponding to the number of con-
nected components in a. The model defines a joint
distribution over antecedent decisions P (ax) =
i P (aix); it also defines a joint distribution over
entity clusterings P (ex), where the probability of
an e is the sum of the probabilities of all a vectors
that could give rise to it. In a manner similar to
a distance-dependent Chinese restaurant process
(Blei and Frazier, 2011), it is non-parametric in the
sense that the number of clusters M is not fixed in
advance.
5.2 Sampling-based inference
For both calibration analysis and exploratory ap-
plications, we need to analyze the posterior distri-
bution over entity clusterings. This distribution is
a complex mathematical object; an attractive ap-
proach to analyze it is to draw samples from this
distribution, then analyze the samples.
This antecedent-based model admits a very
straightforward procedure to draw independent e
samples, by stepping through Def. 2:
indepen-
dently sample each ai then calculate the connected
components of the resulting antecedent graph.
By construction, this procedure samples from the
joint distribution of e (even though we never com-
pute the probability of any single clustering e).
Unlike approximate sampling approaches, such
as Markov chain Monte Carlo methods used in
other coreference work to sample e (Haghighi and
Klein, 2007), here there are no questions about
burn-in or autocorrelation (Kass et al., 1998).
Every sample is independent and very fast to
(a)
(b)
Figure 4: Calibration errors of HMM and CRF on predict-
ing (a) single-word tags and (b) two-consecutive-word tags.
Lower errors are better. The last two columns in each graph
are the average calibration errors over the most common la-
bels.
We report results for the top 5 and 100 most fre-
quent tag pairs (Figure 4(b)). We observe a simi-
lar pattern as seen from the experiment on single
tags: the CRF is generally better calibrated than
the HMM, but the HMM does achieve better cali-
bration errors in 29 out of 100 categories.
These tagging experiments illustrate that, de-
pending on the application, different models can
exhibit different levels of calibration.
5 Coreference resolution
We examine a third model, a probabilistic model
for within-document noun phrase coreference,
which has an efficient sampling-based inference
procedure. In this section we introduce it and ana-
lyze its calibration, in preparation for the next sec-
tion where we use it for exploratory data analysis.
5.1 Antecedent selection model
We use the Berkeley coreference resolution sys-
tem (Durrett and Klein, 2013), which was origi-
nally presented as a CRF; we give it an equivalent
a series of independent logistic regressions (see
appendix for details). The primary component of
this model is a locally-normalized log-linear dis-
tribution over clusterings of noun phrases, each
cluster denoting an entity. The model takes a fixed
input of N mentions (noun phrases), indexed by i
in their positional order in the document. It posits
that every mention i has a latent antecedent selec-
tion decision, ai ∈ {1, . . . , i − 1, NEW}, denoting
0.0000.0250.0500.075NNINNNPDTJJAverage (5)Average (all)LabelCalibErrHMMCRF0.000.020.040.06NNP−NNPDT−NNNN−ININ−DTJJ−NNAverage (5)Average (100)LabelCalibErrHMMCRFWe perform this analysis on the develop-
ment section of the English CoNLL-2011 data
(404 documents). Using the sampling inference
method discussed in §5.2, we compute 4.3 mil-
lions prediction-label pairs and measure their cali-
bration error. Our result shows that the model pro-
duces very well-calibrated predictions with less
than 1% CalibErr (Figure 5), though slightly
overconfident on middle to high-valued predic-
tions. The calibration error indicates that it is the
most calibrated model we examine within this pa-
per. This result suggests we might be able to trust
its level of uncertainty.
6 Uncertainty in Entity-based
Exploratory Analysis
6.1 Entity-syntactic event aggregation
We demonstrate one important use of calibration
analysis: to ensure the usefulness of propagating
uncertainty from coreference resolution into a sys-
tem for exploring unannotated text. Accuracy can-
not be calculated since there are no labels; but
if the system is calibrated, we postulate that un-
certainty information can help users understand
the underlying reliability of aggregated extractions
and isolate predictions that are more likely to con-
tain errors.
We illustrate with an event analysis application
to count the number of “country attack events”:
for a particular country of the world, how many
news articles describe an entity affiliated with that
country as the agent of an attack, and how does
this number change over time? This is a simpli-
fied version of a problem where such systems have
been built and used for political science analysis
(Schrodt et al., 1994; Schrodt, 2012; Leetaru and
Schrodt, 2013; Boschee et al., 2013; O’Connor
et al., 2013). A coreference component can im-
prove extraction coverage in cases such as “Rus-
sian troops were sighted . . . and they attacked . . . ”
We use the coreference system examined in §5
for this analysis. To propagate coreference un-
certainty, we re-run event extraction on multiple
coreference samples generated from the algorithm
described in §5.2, inducing a posterior distribution
over the event counts. To isolate the effects of
coreference, we use a very simple syntactic depen-
dency system to identify affiliations and events.
Assume the availability of dependency parses for
a document d, a coreference resolution e, and a
lexicon of country names, which contains a small
set of words w(c) for each country c; for example,
w(FRA) = {france, french}. The binary function
Figure 5: Coreference calibration curve for predicting
whether two mentions belong to the same entity cluster.
compute—only slightly slower than calculating
the MAP assignment (due to the exp and normal-
ization for each ai). We implement this algorithm
by modifying the publicly available implementa-
tion from Durrett and Klein.9
5.3 Calibration analysis
We consider the following inference query: for a
randomly chosen pair of mentions, are they coref-
erent? Even if the model’s accuracy is compara-
tively low, it may be the case that it is correctly
calibrated—if it thinks there should be great vari-
ability in entity clusterings, it may be uncertain
whether a pair of mentions should belong together.
Let (cid:96)ij be 1 if the mentions i and j are predicted
to be coreferent, and 0 otherwise. Annotated data
defines a gold-standard (cid:96)(g)
ij value for every pair
i, j. Any probability distribution over e defines a
marginal Bernoulli distribution for every proposi-
tion (cid:96)ij, marginalizing out e:
1{(i, j) ∈ e}P (e x) (2)
P ((cid:96)ij = 1 x) =
where (i, j) ∈ e is true iff there is an entity in e
that contains both i and j.
(cid:88)
e
In a traditional coreference evaluation of the
the model as-
best-prediction entity clustering,
signs 1 or 0 to every (cid:96)ij and the pairwise precision
and recall can be computed by comparing them to
the corresponding (cid:96)(g)
ij . Here, we instead compare
the qij ≡ P ((cid:96)ij = 1 x, e) prediction strengths
against (cid:96)(g)
ij empirical frequencies to assess pair-
wise calibration, with the same binary calibration
analysis tools developed in §3 by aggregating pairs
with similar qij values. Each qij is computed by
averaging over 1,000 samples, simply taking the
fraction of samples where the pair (i, j) is coref-
erent.
9Berkeley Coreference Resolution System,
version
http://nlp.cs.berkeley.edu/projects/
1.1:
coref.shtml
CalibErr=0.0087 ± 3.3E−030.000.250.500.751.000.000.250.500.751.00Prediction strengthEmpirical frequencyf (c, e; xd) assesses whether an entity e is affiliated
with country c and is described as the agent of an
attack, based on document text and parses xd; f
returns true iff both:10
• There exists a mention i ∈ e described
as country c: either its head word is in
w(c) (e.g. “Americans”), or its head word
has an nmod or amod modifier in w(c)
(e.g. “American forces”, “president of the
U.S.”); and there is only one unique country
c among the mentions in the entity.
• There exists a mention j ∈ e which is the
nsubj or agent argument to the verb “attack”
(e.g. “they attacked”, “the forces attacked”,
“attacked by them”).
For a given c, we first calculate a binary variable
for whether there is at least one entity fulfilling f
in a particular document,
a(d, c, ed) =
f (c, e; xd)
(3)
(cid:95)
e∈ed
(cid:88)
d∈d(t)
and second, the number of such documents in d(t),
the set of New York Times articles published in a
given time period t,
n(t, c, ed(t)) =
a(d, c, ed)
(4)
These quantities are both random variables, since
they depend on e; thus we are interested in the
posterior distribution of n, marginalizing out e,
P (n(t, c, ed(t)) xd(t))
(5)
If our coreference model was highly certain (only
one structure, or a small number of similar struc-
tures, had most of the probability mass in the space
of all possible structures), each document would
have an a posterior near either 0 or 1, and their
sum in Eq. 5 would have a narrow distribution. But
if the model is uncertain, the distribution will be
wider. Because of the transitive closure, the prob-
ability of a is potentially more complex than the
single antecedent linking probability between two
mentions—the affiliation and attack information
can propagate through a long coreference chain.
6.2 Results
We tag and parse a 193,403 article subset of the
Annotated New York Times LDC corpus (Sand-
haus, 2008), which includes articles about world
10Syntactic
are Universal Dependencies
(de Marneffe et al., 2014); more details for the extrac-
tion rules are in the appendix.
relations
news from the years 1987 to 2007 (details in ap-
pendix). For each article, we run the coreference
system to predict 100 samples, and evaluate f on
every entity in every sample.11 The quantity of
interest is the number of articles mentioning at-
tacks in a 3-month period (quarter), for a given
country. Figure 6 illustrates the mean and 95%
posterior credible intervals for each quarter. The
posterior mean m is calculated as the mean of the
samples, and the interval is the normal approxima-
tion m ± 1.96 s, where s is the standard deviation
among samples for that country and time period.
Uncertainty information helps us understand
whether a difference between data points is real.
In the plots of Figure 6, if we had used a 1-best
coreference resolution, only a single line would be
shown, with no assessment of uncertainty. This
is problematic in cases when the model genuinely
does not know the correct answer. For example,
the 1993-1996 period of the USA plot (Figure 6,
top) shows the posterior mean fluctuating from 1
to 5 documents; but when credible intervals are
taken into consideration, we see that model does
not know whether the differences are real, or were
caused by coreference noise.
A similar case is highlighted at the bottom plot
of Figure 6. Here we compare the event counts
for Yugoslavia and NATO, which were engaged in
a conflict in 1999. Did the New York Times de-
vote more attention to the attacks by one particu-
lar side? To a 1-best system, the answer would be
yes. But the posterior intervals for the two coun-
tries’ event counts in mid-1999 heavily overlap,
indicating that the coreference system introduces
too much uncertainty to obtain a conclusive an-
swer for this question. Note that calibration of the
coreference model is important for the credible in-
tervals to be useful; for example, if the model was
badly calibrated by being overconfident (too much
probability over a small set of similar structures),
these intervals would be too narrow, leading to in-
correct interpretations of the event dynamics.
Visualizing this uncertainty gives richer infor-
mation for a potential user of an NLP-based sys-
tem, compared to simply drawing a line based on
a single 1-best prediction.
It preserves the gen-
uine uncertainty due to ambiguities the system was
unable to resolve. This highlights an alternative
use of Finkel et al. (2006)’s approach of sampling
multiple NLP pipeline components, which in that
work was used to perform joint inference. Instead
11We obtained similar results using only 10 samples. We
also obtained similar results with a different query function,
the total number of entities, across documents, that fulfill f.
of focusing on improving an NLP pipeline, we can
pass uncertainty on to exploratory purposes, and
try to highlight to a user where the NLP system
may be wrong, or where it can only imprecisely
specify a quantity of interest.
Finally, calibration can help error analysis. For
a calibrated model, the more uncertain a predic-
tion is, the more likely it is to be erroneous. While
coreference errors comprise only one part of event
extraction errors (alongside issues in parse qual-
ity, factivity, semantic roles, etc.), we can look at
highly uncertain event predictions to understand
the nature of coreference errors relative to our
task. We manually analyzed documents with a
50% probability to contain an “attack”ing country-
affiliated entity, and found difficult coreference
cases.
In one article from late 1990, an “attack” event
for IRQ is extracted from the sentence “But some
political leaders said that they feared that Mr. Hus-
sein might attack Saudi Arabia”. The mention
“Mr. Hussein” is classified as IRQ only when it
is coreferent with a previous mention “President
Saddam Hussein of Iraq”; this occurs only 50%
of the time, since in some posterior samples the
coreference system split apart these two “Hussein”
mentions. This particular document is addition-
ally difficult, since it includes the names of more
than 10 countries (e.g. United States, Saudi Ara-
bia, Egypt), and some of the Hussein mentions are
even clustered with presidents of other countries
(such as “President Bush”), presumably because
they share the “president” title. These types of er-
rors are a major issue for a political analysis task;
further analysis could assess their prevalence and
how to address them in future work.
7 Conclusion
In this work, we argue that the calibration of pos-
terior predictions is a desirable property of prob-
abilistic NLP models, and that it can be directly
evaluated. We also demonstrate a use case of
having calibrated uncertainty: its propagation into
downstream exploratory analysis.
Our posterior simulation approach for ex-
ploratory and error analysis relates to posterior
predictive checking (Gelman et al., 2013), which
analyzes a posterior to test model assumptions;
Mimno and Blei (2011) apply it to a topic model.
One avenue of future work is to investigate
more effective nonparametric regression methods
to better estimate and visualize calibration error,
such as Gaussian processes or bootstrapped kernel
Figure 6: Number of documents with an “attack”ing coun-
try per 3-month period, and coreference posterior uncertainty
for that quantity. The dark line is the posterior mean, and
the shaded region is the 95% posterior credible interval. See
appendix for more examples.
density estimation.
Another important question is: what types of in-
ferences are facilitated by correct calibration? In-
tuitively, we think that overconfidence will lead
to overly narrow confidence intervals; but in what
sense are confidence intervals “good” when cal-
ibration is perfect? Also, does calibration help
joint inference in NLP pipelines? It may also assist
calculations that rely on expectations, such as in-
ference methods like minimum Bayes risk decod-
ing, or learning methods like EM, since calibrated
predictions imply that calculated expectations are
statistically unbiased (though the implications of
this fact may be subtle). Finally, it may be in-
teresting to pursue recalibration methods, which
readjust a non-calibrated model’s predictions to
be calibrated; recalibration methods have been de-
veloped for binary (Platt, 1999; Niculescu-Mizil
and Caruana, 2005) and multiclass (Zadrozny and
Elkan, 2002) classification settings, but we are
unaware of methods appropriate for the highly
structured outputs typical in linguistic analysis.
Another approach might be to directly constrain
CalibErr = 0 during training, or try to reduce it
as a training-time risk minimization or cost objec-
tive (Smith and Eisner, 2006; Gimpel and Smith,
2010; Stoyanov et al., 2011; Brummer and Dod-
dington, 2013).
Calibration is an interesting and important prop-
erty of NLP models. Further work is necessary to
address these and many other questions.
19901995200020050102030USA0102030199519961997199819992000051015Serbia/Yugo.NATOAcknowledgments
Thanks to Erik Learned-Miller, Benjamin Mar-
lin, Craig Greenberg, Phan-Minh Nguyen, Caitlin
Cellier and the CMU ARK Lab for discussion and
comments, and to the anonymous reviewers (espe-
cially R3) for helpful suggestions.
References
David Bamman, Brendan O’Connor, and Noah A.
Smith. Learning latent personas of film charac-
ters. In Proceedings of ACL, 2013.
Paul N. Bennett. Assessing the calibration of naive
Bayes’ posterior estimates. Technical report,
Carnegie Mellon University, 2000.
David M. Blei and Peter I. Frazier. Distance
dependent Chinese restaurant processes. The
Journal of Machine Learning Research, 12:
2461–2488, 2011.
Elizabeth Boschee, Premkumar Natarajan, and
Ralph Weischedel. Automatic extraction of
events from open source text for predictive
forecasting. Handbook of Computational Ap-
proaches to Counterterrorism, page 51, 2013.
Glenn W. Brier. Verification of forecasts expressed
in terms of probability. Monthly weather review,
78(1):1–3, 1950.
Jochen Brocker. Reliability, sufficiency, and the
decomposition of proper scores. Quarterly
Journal of the Royal Meteorological Society,
135(643):1512–1519, 2009.
Niko Brummer
and George Doddington.
Likelihood-ratio
calibration
prior-
weighted proper scoring rules. arXiv preprint
arXiv:1307.7981, 2013. Interspeech 2013.
using
Marie-Catherine de Marneffe, Timothy Dozat,
Natalia Silveira, Katri Haverinen, Filip Gin-
ter, Joakim Nivre, and Christopher D. Man-
ning. Universal Stanford dependencies: A
In Proceedings of
cross-linguistic typology.
LREC, 2014.
Morris H. DeGroot and Stephen E. Fienberg. The
comparison and evaluation of forecasters. The
statistician, pages 12–22, 1983.
Pedro Domingos and Michael Pazzani. On the op-
timality of the simple Bayesian classifier under
zero-one loss. Machine learning, 29(2-3):103–
130, 1997.
Greg Durrett and Dan Klein. A joint model for
entity analysis: Coreference, typing, and link-
ing. Transactions of the Association for Com-
putational Linguistics, 2:477–490, 2014.
Jenny Rose Finkel, Christopher D. Manning, and
Andrew Y. Ng. Solving the problem of cascad-
ing errors: Approximate Bayesian inference for
linguistic annotation pipelines. In Proceedings
of the 2006 Conference on Empirical Methods
in Natural Language Processing, pages 618–
626. Association for Computational Linguis-
tics, 2006.
Andrew Gelman, John B. Carlin, Hal S. Stern,
David B. Dunson, Aki Vehtari, and Donald B.
Rubin. Bayesian data analysis. Chapman and
Hall/CRC, 3rd edition, 2013.
Kevin Gimpel and Noah A. Smith.
Kevin Gimpel and Noah A. Smith. Rich source-
side context for statistical machine translation.
In Proceedings of the Third Workshop on Sta-
tistical Machine Translation, pages 9–17, 2008.
Softmax-
margin CRFs: Training log-linear models with
cost functions. In Human Language Technolo-
gies: The 2010 Annual Conference of the North
American Chapter of the Association for Com-
putational Linguistics, pages 733–736. Associ-
ation for Computational Linguistics, 2010.
Kevin Gimpel, Dhruv Batra, Chris Dyer, and Gre-
gory Shakhnarovich. A systematic exploration
In Pro-
of diversity in machine translation.
ceedings of the 2013 Conference on Empiri-
cal Methods in Natural Language Processing,
pages 1100–1111, Seattle, Washington, USA,
October 2013. Association for Computational
Linguistics. URL http://www.aclweb.
org/anthology/D13-1111.
Tilmann Gneiting and Adrian E. Raftery. Strictly
proper scoring rules, prediction, and estimation.
Journal of the American Statistical Association,
102(477):359–378, 2007.
Joshua Goodman. Parsing algorithms and met-
rics. In Proceedings of the 34th Annual Meet-
ing of the Association for Computational Lin-
guistics, pages 177–183, Santa Cruz, Califor-
nia, USA, June 1996. Association for Com-
putational Linguistics. doi: 10.3115/981863.
981887. URL http://www.aclweb.org/
anthology/P96-1024.
Greg Durrett and Dan Klein. Easy victories and
In
uphill battles in coreference resolution.
EMNLP, pages 1971–1982, 2013.
Aria Haghighi and Dan Klein.
Unsuper-
vised coreference resolution in a nonparametric
Bayesian model. In Annual Meeting, Associa-
tion for Computational Linguistics, volume 45,
page 848, 2007.
in neural information processing systems, 14:
841, 2002.
Robert E. Kass, Bradley P. Carlin, Andrew Gel-
man, and Radford M. Neal. Markov chain
Monte Carlo in practice: a roundtable discus-
sion. The American Statistician, 52(2):93–100,
1998.
Shankar Kumar and William Byrne. Minimum
Bayes-risk decoding for statistical machine
translation.
In Daniel Marcu Susan Dumais
and Salim Roukos, editors, HLT-NAACL 2004:
Main Proceedings, pages 169–176, Boston,
Massachusetts, USA, May 2 - May 7 2004. As-
sociation for Computational Linguistics.
Kalev Leetaru and Philip A. Schrodt. GDELT:
Global data on events, location, and tone, 1979–
In ISA Annual Convention, volume 2,
2012.
page 4, 2013.
Jimmy Lin and Alek Kolcz. Large-scale ma-
chine learning at Twitter. In Proceedings of the
2012 ACM SIGMOD International Conference
on Management of Data, pages 793–804. ACM,
2012.
Michael C. McCord, J. William Murdock, and
Branimir K. Boguraev. Deep parsing in Watson.
IBM Journal of Research and Development, 56
(3.4):3–1, 2012.
David Mimno and David Blei. Bayesian check-
In Proceedings of
ing for topic models.
the 2011 Conference on Empirical Meth-
ods in Natural Language Processing, pages
227–237, Edinburgh, Scotland, UK.,
July
2011. Association for Computational Linguis-
tics.
URL http://www.aclweb.org/
anthology/D11-1021.
Makoto Miwa, Sampo Pyysalo, Tadayoshi Hara,
and Jun’ichi Tsujii. Evaluating dependency
In Pro-
representations for event extraction.
ceedings of
the 23rd International Confer-
ence on Computational Linguistics (Coling
2010), pages 779–787, Beijing, China, Au-
gust 2010. Coling 2010 Organizing Commit-
tee.
URL http://www.aclweb.org/
anthology/C10-1088.
Allan H. Murphy and Robert L. Winkler. A
general framework for forecast verification.
Monthly Weather Review, 115(7):1330–1338,
1987.
Andrew Ng and Michael Jordan. On discrimina-
tive vs. generative classifiers: A comparison of
logistic regression and naive Bayes. Advances
Alexandru Niculescu-Mizil and Rich Caruana.
Predicting good probabilities with supervised
In Proceedings of the 22nd Interna-
learning.
tional Conference on Machine Learning, pages
625–632, 2005.
Brendan O’Connor, Brandon Stewart,
and
Learning to extract inter-
In
Noah A. Smith.
national relations from political context.
Proceedings of ACL, 2013.
Naoaki Okazaki. Crfsuite:
a fast implemen-
tation of conditional random fields (CRFs),
2007. URL http://www.chokkan.org/
software/crfsuite/.
F. Pedregosa, G. Varoquaux, A. Gramfort,
V. Michel, B. Thirion, O. Grisel, M. Blondel,
P. Prettenhofer, R. Weiss, V. Dubourg, J. Van-
derplas, A. Passos, D. Cournapeau, M. Brucher,
M. Perrot, and E. Duchesnay. Scikit-learn: Ma-
chine learning in Python. Journal of Machine
Learning Research, 12:2825–2830, 2011.
John Platt. Probabilistic outputs for support vector
machines and comparisons to regularized like-
In Advances in large margin
lihood methods.
classifiers. MIT Press (2000), 1999. URL
http://research.microsoft.com/
pubs/69187/svmprob.ps.gz.
Sameer Pradhan, Lance Ramshaw, Mitchell Mar-
cus, Martha Palmer, Ralph Weischedel, and Ni-
anwen Xue. CoNLL-2011 shared task: Mod-
eling unrestricted coreference in Ontonotes.
In Proceedings of
the Fifteenth Conference
on Computational Natural Language Learning:
Shared Task, pages 1–27. Association for Com-
putational Linguistics, 2011.
Jonathon Read. Using emoticons to reduce depen-
dency in machine learning techniques for senti-
ment classification. In Proceedings of the ACL
Student Research Workshop, pages 43–48. As-
sociation for Computational Linguistics, 2005.
Evan Sandhaus. The New York Times Anno-
Linguistic Data Consortium,
tated Corpus.
LDC2008T19, 2008.
Philip A. Schrodt.
Precedents, progress, and
prospects in political event data. International
Interactions, 38(4):546–569, 2012.
Philip A. Schrodt, Shannon G. Davis, and Ju-
dith L. Weddle. KEDS – a program for the
machine coding of event data. Social Science
Computer Review, 12(4):561 –587, December
doi: 10.1177/089443939401200408.
http://ssc.sagepub.com/
1994.
URL
content/12/4/561.abstract.
Sameer Singh, Sebastian Riedel, Brian Martin, Ji-
aping Zheng, and Andrew McCallum. Joint in-
ference of entities, relations, and coreference.
In Proceedings of the 2013 Workshop on Auto-
mated Knowledge Base Construction, pages 1–
6. ACM, 2013.
David A. Smith and Jason Eisner. Minimum risk
annealing for training log-linear models. In Pro-
ceedings of the COLING/ACL 2006 Main Con-
ference Poster Sessions, pages 787–794, Syd-
ney, Australia, July 2006. Association for Com-
putational Linguistics. URL http://www.
aclweb.org/anthology/P06-2101.
Veselin Stoyanov, Alexander Ropson, and Jason
Eisner. Empirical risk minimization of graphi-
cal model parameters given approximate infer-
ence, decoding, and model structure. In Interna-
tional Conference on Artificial Intelligence and
Statistics, pages 725–733, 2011.
Kristina Toutanova, Aria Haghighi, and Christo-
pher D. Manning. A global joint model for se-
mantic role labeling. Computational Linguis-
tics, 34(2):161–191, 2008.
John W. Tukey.
Curves as parameters, and
touch estimation. In Proceedings of the Fourth
Berkeley Symposium on Mathematical Statis-
tics and Probability, Volume 1: Contributions
to the Theory of Statistics, pages 681–694,
Berkeley, Calif., 1961. University of Califor-
nia Press. URL http://projecteuclid.
org/euclid.bsmsp/1200512189.
Ashish Venugopal, Andreas Zollmann, Noah A.
Smith, and Stephan Vogel. Wider pipelines: N-
best alignments and parses in MT training. In
Proceedings of AMTA, 2008.
Larry Wasserman. All of nonparametric statistics.
Springer Science & Business Media, 2006.
Bianca Zadrozny and Charles Elkan. Transform-
ing classifier scores into accurate multiclass
probability estimates. In Proceedings of KDD,
pages 694–699. ACM, 2002.
Appendix
1 Sampling a deterministic function of a
random variable
In several places in this paper, we define proba-
bility distributions over deterministic functions of
a random variable, and sample from them by ap-
plying the deterministic function to samples of the
random variable. This should be valid by con-
struction, but we supply the following argument
for further justification.
X is a random variable and g(x) is a determin-
istic function which takes a value of X as its in-
put. Since g depends on a random variable, g(X)
is a random variable as well. The distribution
for g(X), or aspects of it (such as a PMF or in-
dependent samples from it) can be calculated by
marginalizing out X with a Monte Carlo approx-
imation. Assuming g has discrete outputs (as is
the case for the event counting function n, or con-
nected components function CC), we examine the
probability mass function:
pmf(h) ≡ P (g(X) = h)
(6)
(7)
(8)
(9)
(cid:88)
(cid:88)
x
=
=
x
≈ 1
S
(cid:88)
x∼P (X)
P (g(x) = h x) P (x)
1{g(x) = h}P (x)
1{g(x) = h}
Eq. 8 holds because g(x) is a deterministic func-
tion, and Eq. 9 is a Monte Carlo approximation
that uses S samples from P (x).
This implies that a set of g values calculated on
x samples, {g(x(s)) : x(s) ∼ P (x)}, should con-
stitute a sample from the distribution P (g(X)); in
our event analysis section we usually call this the
“posterior” distribution of g(X) (the n(t, c) func-
tion there). In our setting, we do not directly use
the PMF calculation above; instead, we construct
normal approximations to the probability distribu-
tion g(X).
We use this technique in several places. For the
calibration error confidence interval, the calibra-
tion error is a deterministic function of the uncer-
tain empirical label frequencies pi; there, we prop-
agate posterior uncertainty from a normal approx-
imation to the Bernoulli parameter’s posterior (the
pi distribution under the central limit theorem)
through simulation. In the coreference model, the
connected components function is a determinis-
tic function of the antecedent vector; thus repeat-
edly calculating e(s) := CC(a(s)) yields samples
of entity clusterings from their posterior. For the
event analysis, the counting function n(t, c, ed(t))
is a function of the entity samples, and thus can be
recalculated on each—this is a multiple step deter-
ministic pipeline, which postprocesses simulated
random variables.
√
As in other Monte Carlo-based inference tech-
niques (as applied to both Bayesian and frequentist
(e.g. bootstrapping) inference), the mean and stan-
dard deviation of samples drawn from the distribu-
tion constitute the mean and standard deviation of
the desired posterior distribution, subject to Monte
Carlo error due to the finite number of samples,
which by the central limit theorem shrinks at a rate
√
of 1/
S. The Monte Carlo standard error for es-
timating the mean is σ/
S where σ is the stan-
dard deviation. So with 100 samples, the Monte
Carlo standard error for the mean is
100 = 10
times smaller than standard deviation. Thus in the
time series graphs, which are based on S = 100
samples, the posterior mean (dark line) has Monte
Carlo uncertainty that is 10 times smaller than the
vertical gray area (95% CI) around it.
2 Normalization in the coreference
√
model
Durrett and Klein (2013) present their model as a
globally normalized, but fully factorized, CRF:
P (ax) =
1
Z
exp(wTf (i, ai, x))
regex /(SportsOpinion), and whose text body con-
tains a mention of at least one country name.
Country names are taken from the dictionary
country igos.txt based on previous work (http:
//brenocon.com/irevents/).
Country
name matching is case insensitive and uses light
stemming: when trying to match a word against
the lexicon, if a match is not found, it backs off to
stripping the last and last two characters. (This is
usually unnecessary since the dictionary contains
modifier forms.)
POS, NER, and constituent and dependency
parses are produced with Stanford CoreNLP 3.5.2
with default settings except for one change, to use
its shift-reduce constituent parser (for convenience
of processing speed). We treat tags and parses as
fixed and leave their uncertainty propagation for
future work.
When formulating the extraction rules, we ex-
amined frequencies of all syntactic dependencies
within country-affiliated entities, in order to help
find reasonably high-coverage syntactic relations
for the “attack” rule.
4 Event time series graphs
The following pages contain posterior time series
graphs for 20 countries, as described in the sec-
tion on coreference-based event aggregation, in or-
der of decreasing total event frequency. As in the
main paper, the blue line indicates the posterior
mean, and the gray region indicates 95% posterior
credibility intervals, with count aggregation at the
monthly level. The titles are ISO3 country codes.
(cid:89)
i
(cid:89)
i
Since the factor function decomposes indepen-
dently for each random variable ai, their probabil-
ities are actually independent, and can be rewritten
with local normalization,
P (ax) =
1
Zi
exp(wTf (i, ai, x))
This interpretation justifies the use of independent
sampling to draw samples of the joint posterior.
3 Event analysis: Corpus selection,
country affiliation, and parsing
Articles are filtered to yield a dataset about world
news. In the New York Times Annotated Corpus,
every article is tagged with a large set of labels.
We include articles that contain a category whose
label starts with the string Top/News/World, and
exclude articles with any category matching the
19901995200020050102030USA01020301990199520002005010203040IRQ0102030401990199520002005051020ISR051020199019952000200502468GBR02468199019952000200502468PSE0246819901995200020050102030IRN01020301990199520002005051020SRB051020199019952000200502468RUS02468199019952000200502468CHN02468199019952000200502468FRA02468199019952000200502468DEU02468199019952000200502468IND02468199019952000200502468AFG024681990199520002005051015IGONAT051015199019952000200502468JPN02468199019952000200502468KWT02468199019952000200502468PAK02468199019952000200502468HRV02468199019952000200502468LBN02468199019952000200502468SYR02468 |
1810.12343 | 2 | 1810 | 2019-02-18T22:14:21 | Content Selection in Deep Learning Models of Summarization | [
"cs.CL"
] | We carry out experiments with deep learning models of summarization across the domains of news, personal stories, meetings, and medical articles in order to understand how content selection is performed. We find that many sophisticated features of state of the art extractive summarizers do not improve performance over simpler models. These results suggest that it is easier to create a summarizer for a new domain than previous work suggests and bring into question the benefit of deep learning models for summarization for those domains that do have massive datasets (i.e., news). At the same time, they suggest important questions for new research in summarization; namely, new forms of sentence representations or external knowledge sources are needed that are better suited to the summarization task. | cs.CL | cs | Content Selection in Deep Learning Models of Summarization
Chris Kedzie and Kathleen McKeown
Department of Computer Science
Columbia University
9
1
0
2
b
e
F
8
1
]
L
C
.
s
c
[
2
v
3
4
3
2
1
.
0
1
8
1
:
v
i
X
r
a
{kedzie,kathy}@cs.columbia.edu
Abstract
We carry out experiments with deep learning
models of summarization across the domains
of news, personal stories, meetings, and medi-
cal articles in order to understand how content
selection is performed. We find that many so-
phisticated features of state of the art extractive
summarizers do not improve performance over
simpler models. These results suggest that it
is easier to create a summarizer for a new do-
main than previous work suggests and bring
into question the benefit of deep learning mod-
els for summarization for those domains that
do have massive datasets (i.e., news). At the
same time, they suggest important questions
for new research in summarization; namely,
new forms of sentence representations or ex-
ternal knowledge sources are needed that are
better suited to the summarization task.
1
Introduction
Content selection is a central component in many
natural language generation tasks, where, given a
generation goal, the system must determine which
information should be expressed in the output text
(Gatt and Krahmer, 2018).
In summarization,
content selection is usually accomplished through
sentence (and, occasionally, phrase) extraction.
Despite being a key component of both extrac-
tive and abstractive summarization systems, it is
is not well understood how deep learning models
perform content selection with only word and sen-
tence embedding based features as input. Non-
neural network approaches often use frequency
and information theoretic measures as proxies for
content salience (Hong and Nenkova, 2014), but
these are not explicitly used in most neural net-
work summarization systems.
In this paper, we seek to better understand how
deep learning models of summarization perform
content selection across multiple domains (§ 4):
Hal Daum´e III
University of Maryland, College Park
Microsoft Research, New York City
[email protected]
news, personal stories, meetings, and medical
articles (for which we collect a new corpus).1 We
analyze several recent sentence extractive neural
network architectures, specifically considering the
design choices for sentence encoders (§ 3.1) and
sentence extractors (§ 3.2). We compare Recurrent
Neural Network (RNN) and Convolutional Neural
Network (CNN) based sentence representations
to the simpler approach of word embedding aver-
aging to understand the gains derived from more
sophisticated architectures. We also question the
necessity of auto-regressive sentence extraction
(i.e. using previous predictions to inform future
predictions), which previous approaches have
used (§ 2), and propose two alternative models
that extract sentences independently.
Our main results (§ 5) reveal:
1. Sentence position bias dominates the learn-
ing signal for news summarization, though
not for other domains.2 Summary quality
for news is only slightly degraded when con-
tent words are omitted from sentence embed-
dings.
2. Word embedding averaging is as good or bet-
ter than either RNNs or CNNs for sentence
embedding across all domains.
3. Pre-trained word embeddings are as good, or
better than, learned embeddings in five of six
datasets.
4. Non auto-regressive sentence extraction per-
forms as good or better than auto-regressive
extraction in all domains.
Taken together, these and other results in the pa-
per suggest that we are over-estimating the abil-
1Data preprocessing and implementation code can be
https://github.com/kedz/nnsum/
found here:
tree/emnlp18-release
2This is a known bias in news summarization (Nenkova,
2005).
ity of deep learning models to learn robust and
meaningful content features for summarization. In
one sense, this might lessen the burden of apply-
ing neural network models of content to other do-
mains; one really just needs in-domain word em-
beddings. However, if we want to learn something
other than where the start of the article is, we will
need to design other means of sentence represen-
tation, and possibly external knowledge represen-
tations, better suited to the summarization task.
2 Related Work
The introduction of the CNN-DailyMail corpus by
Hermann et al. (2015) allowed for the applica-
tion of large-scale training of deep learning mod-
els for summarization. Cheng and Lapata (2016)
developed a sentence extractive model that uses a
word level CNN to encode sentences and a sen-
tence level sequence-to-sequence model to predict
which sentences to include in the summary. Sub-
sequently, Nallapati et al. (2017) proposed a dif-
ferent model using word-level bidirectional RNNs
along with a sentence level bidirectional RNN for
predicting which sentences should be extracted.
Their sentence extractor creates representations of
the whole document and computes separate scores
for salience, novelty, and location. These works
represent the state-of-the-art for deep learning-
based extractive summarization and we analyze
them further in this paper.
Other recent neural network approaches in-
clude, Yasunaga et al. (2017), who learn a graph-
convolutional network (GCN) for multi-document
summarization. They do not closely examine the
choice of sentence encoder, which is one of the
focuses of the present paper; rather, they study the
best choice of graph structure for the GCN, which
is orthogonal to this work.
Non-neural network learning-based approaches
have also been applied to summarization. Typi-
cally they involve learning n-gram feature weights
in linear models along with other non-lexical word
or structural features (Berg-Kirkpatrick et al.,
2011; Sipos et al., 2012; Durrett et al., 2016).
In this paper, we study representation learning in
neural networks that can capture more complex
word level feature interactions and whose dense
representations are more compatible with current
practices in NLP.
The previously mentioned works have focused
on news summarization. To further understand the
content selection process, we also explore other
domains of summarization. In particular, we ex-
plore personal narrative summarization based on
stories shared on Reddit (Ouyang et al., 2017),
workplace meeting summarization (Carletta et al.,
2005), and medical journal article summarization
(Mishra et al., 2014).
While most work on these summarization
tasks often exploit domain-specific features (e.g.
speaker identification in meeting summarization
(Galley, 2006; Gillick et al., 2009)), we purpose-
fully avoid such features in this work in order to
understand the extent to which deep learning mod-
els can perform content selection using only sur-
face lexical features. Summarization of academic
literature (including medical journals), has long
been a research topic in NLP (Kupiec et al., 1995;
Elhadad et al., 2005), but most approaches have
explored facet-based summarization (Jaidka et al.,
2017), which is not the focus of our work.
3 Methods
The goal of extractive text summarization is to se-
lect a subset of a document's text to use as a sum-
mary, i.e. a short gist or excerpt of the central con-
tent. Typically, we impose a budget on the length
of the summary in either words or bytes. In this
work, we focus on sentence extractive summariza-
tion, where the basic unit of extraction is a sen-
tence and impose a word limit as the budget.
We model the sentence extraction task as a se-
quence tagging problem, following (Conroy and
O'Leary, 2001). Specifically, given a document
containing n sentences s1, . . . , sn we generate a
summary by predicting a corresponding label se-
quence y1, . . . , yn ∈ {0, 1}n, where yi = 1 in-
dicates the i-th sentence is to be included in the
summary. Each sentence is itself a sequence of
(i)si where si
word embeddings si = w
summary word length(cid:80)n
is the length of the sentence in words. The word
budget c ∈ N enforces a constraint that the total
For a typical deep learning model of extractive
summarization there are two main design deci-
sions: a) the choice of sentence encoder which
maps each sentence si to an embedding hi, and b)
the choice of sentence extractor which maps a se-
quence of sentence embeddings h = h1, . . . , hn to
a sequence of extraction decisions y = y1, . . . , yn.
i=1 yi · si ≤ c.
(i)
1 , . . . , w
(cid:76) indicates attention. Green blocks repesent sentence encoder output and red blocks indicates learned "begin
Figure 1: Sentence extractor architectures: a) RNN, b) Seq2Seq, c) Cheng & Lapata, and d) SummaRunner. The
decoding" embeddings. Vertically stacked yellow and orange boxes indicate extractor encoder and decoder hidden
states respectively. Horizontal orange and yellow blocks indicate multi-layer perceptrons. The purple blocks
represent the document and summary state in the SummaRunner extractor.
3.1 Sentence Encoders
We experiment with three architectures for map-
ping sequences of word embeddings to a fixed
length vector: averaging, RNNs, and CNNs. Hy-
perparameter settings and implementation details
can be found in Appendix A.
(cid:80)s
Averaging Encoder Under the averaging en-
coder, a sentence embedding h is simply the aver-
age of its word embeddings, i.e. h = 1s
i=1 wi.
RNN Encoder When using the RNN sentence
encoder, a sentence embedding is the concatena-
tion of the final output states of a forward and
backward RNN over the sentence's word embed-
dings. We use a Gated Recurrent Unit (GRU) for
the RNN cell (Chung et al., 2014).
CNN Encoder The CNN sentence encoder uses
a series of convolutional feature maps to encode
each sentence. This encoder is similar to the con-
volutional architecture of Kim (2014) used for
text classification tasks and performs a series of
"one-dimensional" convolutions over word em-
beddings. The final sentence embedding h is a
concatenation of all the convolutional filter out-
puts after max pooling over time.
3.2 Sentence Extractors
Sentence extractors take sentence embeddings
h1:n and produce an extract y1:n. The sentence
extractor is essentially a discriminative classi-
fier p(y1:nh1:n). Previous neural network ap-
proaches to sentence extraction have assumed
ities p(y1:nh) = (cid:81)n
an auto-regressive model,
leading to a semi-
Markovian factorization of the extractor probabil-
i=1 p(yiy<i, h), where each
is dependent on all previous yj for
prediction yi
all j < i. We compare two such models pro-
posed by Cheng and Lapata (2016) and Nallap-
ati et al. (2017). A simpler approach that does
not allow interaction among the y1:n is to model
i=1 p(yih), which we explore in
two proposed extractor models that we refer to as
the RNN and Seq2Seq extractors. Implementation
details for all extractors are in Appendix B.
p(y1:nh) = (cid:81)n
Previously Proposed Sentence Extractors We
consider two recent state-of-the-art extractors.
The first, proposed by Cheng and Lapata
is built around a sequence-to-sequence
(2016),
model. First, each sentence embedding3 is fed into
an encoder side RNN, with the final encoder state
passed to the first step of the decoder RNN. On
the decoder side, the same sentence embeddings
are fed as input to the decoder and decoder out-
puts are used to predict each yi. The decoder input
is weighted by the previous extraction probability,
inducing the dependence of yi on y<i. See Fig-
ure 1.c for a graphical layout of the extractor.
Nallapati et al. (2017) proposed a sentence ex-
tractor, which we refer to as the SummaRunner
Extractor, that factorizes the extraction probabil-
ity into contributions from different sources. First,
a bidirectional RNN is run over the sentence em-
3Cheng and Lapata (2016) used an CNN sentence en-
coder with this extractor architecture; in this work we pair the
Cheng & Lapata extractor with several different encoders.
a)h1h2h3y1y2y3b)h1h2h3−→hh1h2h3←−hy1y2y3c)h1h2h3h∗h1h2y1y2y3d)h1h2h3y1y2y3beddings4 and the output is concatenated. A repre-
sentation of the whole document is made by aver-
aging the RNN output. A summary representation
is also constructed by taking the sum of the pre-
vious RNN outputs weighted by their extraction
probabilities. Extraction predictions are made us-
ing the RNN output at the i-th step, the document
representation, and i-th version of the summary
representation, along with factors for sentence lo-
cation in the document. The use of the iteratively
constructed summary representation creates a de-
pendence of yi on all y<i. See Figure 1.d for a
graphical layout.
Proposed Sentence Extractors We propose
two sentence extractor models that make a
independence assumption
stronger conditional
i=1 p(yih), essentially making inde-
p(yh) = (cid:81)n
pendent predictions conditioned on h.
RNN Extractor Our first proposed model is
a very simple bidirectional RNN based tagging
model. As in the RNN sentence encoder we use
a GRU cell. The forward and backward outputs
of each sentence are passed through a multi-layer
perceptron with a logsitic sigmoid output to pre-
dict the probability of extracting each sentence.
See Figure 1.a for a graphical layout.
Seq2Seq Extractor One shortcoming of the
RNN extractor is that long range information from
one end of the document may not easily be able
to affect extraction probabilities of sentences at
the other end. Our second proposed model, the
Seq2Seq extractor mitigates this problem with an
attention mechanism commonly used for neural
machine translation (Bahdanau et al., 2014) and
abstractive summarization (See et al., 2017). The
sentence embeddings are first encoded by a bidi-
rectional GRU. A separate decoder GRU trans-
forms each sentence into a query vector which
attends to the encoder output.
The attention
weighted encoder output and the decoder GRU
output are concatenated and fed into a multi-layer
perceptron to compute the extraction probability.
See Figure 1.b for a graphical layout.
4 Datasets
We perform our experiments across six corpora
from varying domains to understand how differ-
4Nallapati et al. (2017) use an RNN sentence encoder with
this extractor architecture; in this work we pair the Sum-
maRunner extractor with different encoders.
Dataset
Train
CNN/DM 287,113
44,382
516
404
98
21,250
NYT
DUC
Reddit
AMI
PubMed
Valid
13,368
5,523
91
24
19
1,250
Test Refs
1
1.93
2
2
1
1
11,490
6,495
657
48
20
2,500
Table 1: Sizes of the training, validation, test splits for
each dataset and the average number of test set human
reference summaries per document.
ent biases within each domain can affect content
selection. The corpora come from the news do-
main (CNN-DailyMail, New York Times, DUC),
personal narratives domain (Reddit), workplace
meetings (AMI), and medical
journal articles
(PubMed). See Table 1 for dataset statistics.
CNN-DailyMail We use the preprocessing and
training, validation, and test splits of See et al.
(2017). This corpus is a mix of news on differ-
ent topics including politics, sports, and entertain-
ment.
New York Times The New York Times (NYT)
corpus (Sandhaus, 2008) contains two types of ab-
stracts for a subset of its articles. The first sum-
mary is an archival abstract and the second is a
shorter online teaser meant to entice a viewer of
the webpage to click to read more. From this col-
lection, we take all articles that have a concate-
nated summary length of at least 100 words. We
create training, validation, and test splits by parti-
tioning on dates; we use the year 2005 as the val-
idation data, with training and test partitions in-
cluding documents before and after 2005 respec-
tively.
DUC We use the single document summariza-
tion data from the 2001 and 2002 Document
Understanding Conferences (DUC) (Over and
Liggett, 2002). We split the 2001 data into train-
ing and validation splits and reserve the 2002 data
for testing.
AMI The AMI corpus (Carletta et al., 2005) is a
collection of real and staged office meetings anno-
tated with text transcriptions, along with abstrac-
tive summaries. We use the prescribed splits.
Extractor Enc. CNN/DM
NYT
DUC 2002
Reddit
AMI
PubMed
M R-2 M R-2 M R-2 M R-2 M R-2 M R-2
9.3
24.1
25.2
17.0
Avg.
RNN 25.1
16.6
16.8
CNN 25.0
17.7
25.2
Avg.
RNN 25.1
16.7
16.9
CNN 25.0
17.7
Avg.
25.0
16.7
RNN 25.0
CNN 25.2
16.9
17.2
Avg.
25.1
16.5
RNN 25.1
CNN 24.9
16.8
31.1
25.0
10.9
11.4
11.4
12.8
13.6
12.0
13.2
13.6
12.6
13.4
13.4
12.5
12.3
16.2
20.1
20.4
20.2
20.9
20.9
20.5
20.7
20.9
20.3
20.5
21.0
20.9
20.4
24.3
32.3
34.7
34.9
33.7
35.7
35.9
35.1
35.6
35.8
35.0
35.4
35.5
34.4
48.9
15.9
19.8
19.7
19.9
20.1
19.7
19.8
20.1
19.7
19.9
19.9
19.7
19.8
24.1
30.0
29.8
29.6
29.0
30.5
30.2
29.9
30.4
30.3
29.9
30.2
30.0
29.3
35.3
24.4
25.4
25.4
25.1
25.6
25.3
25.1
25.3
25.0
25.1
25.4
25.2
25.0
36.2
25.1
26.8
26.8
26.7
27.0
26.7
26.7
27.1
27.0
26.9
26.7
26.5
26.4
31.3
12.3
17.0
16.2
14.4
17.0
16.1
14.2
16.7
16.3
14.3
17.0
16.5
14.5
17.8
21.5
22.7
22.6
22.7
22.8
22.5
22.7
23.1
23.0
23.0
22.3
22.1
22.2
31.8
2.0
5.5
5.2
3.2
5.5
5.3
2.9
6.1
5.0
2.8
5.6
5.4
3.2
8.7
Lead
RNN
Seq2Seq
Cheng
&
Lapata
Summa
Runner
Oracle
--
--
Table 2: METEOR (M) and ROUGE-2 recall (R-2) results across all extractor/encoder pairs. Results that are
statistically indistinguishable from the best system are shown in bold face.
Reddit Ouyang et al. (2017) collected a corpus
of personal stories shared on Reddit5 along with
multiple extractive and abstractive summaries. We
randomly split this data using roughly three and
five percent of the data validation and test respec-
tively.
PubMed We created a corpus of 25,000 ran-
domly sampled medical journal articles from the
PubMed Open Access Subset6. We only included
articles if they were at least 1000 words long and
had an abstract of at least 50 words in length. We
used the article abstracts as the ground truth hu-
man summaries.
4.1 Ground Truth Extract Summaries
Since we do not typically have ground truth ex-
tract summaries from which to create the labels
yi, we construct gold label sequences by greedily
optimizing ROUGE-1, using the algorithm in Ap-
pendix C. We choose to optimize for ROUGE-1
rather than ROUGE-2 similarly to other optimiza-
tion based approaches to summarization (Sipos
et al., 2012; Durrett et al., 2016) which found this
to be the easier target to learn.
5 Experiments
We evaluate summary quality using ROUGE-2
recall (Lin, 2004); ROUGE-1 and ROUGE-LCS
trend similarity in our experiments. We use tar-
get word lengths of 100 words for news, and
75, 290, and 200 for Reddit, AMI, and PubMed
respectively. We also evaluate using METEOR
(Denkowski and Lavie, 2014).7 Summaries are
generated by extracting the top ranked sentences
by model probability p(yi = 1y<i, h), stopping
when the word budget is met or exceeded. We
estimate statistical significance by averaging each
document level score over the five random initial-
izations. We then test the difference between the
best system on each dataset and all other systems
using the approximate randomization test (Riezler
and Maxwell, 2005) with the Bonferroni correc-
tion for multiple comparisons, testing for signifi-
cance at the 0.05 level.
5.1 Training
We train all models to minimize the weighted neg-
ative log-likelihood
(cid:88)
n(cid:88)
s,y∈D
h=enc(s)
i=1
L = −
ω(yi) log p (yiy<i, h)
5www.reddit.com
6https://www.ncbi.nlm.nih.gov/pmc/
tools/openftlist/
7We use the default settings for METEOR and use remove
stopwords and no stemming options for ROUGE, keeping de-
faults for all other parameters.
Ext.
Seq2Seq
C&L
Summa
Runner
Emb. CNN/DM
Fixed
Learn
Fixed
Learn
Fixed
Learn
25.6
25.3
25.3
24.9
25.4
25.1
35.7
(0.3) 35.7
35.6
(0.4) 35.4
35.4
(0.3) 35.2
NYT
DUC
Reddit
AMI
22.8
(0.0) 22.9
23.1
(0.2) 23.0
22.3
(0.2) 22.2
(-0.1)
(0.1)
(0.1)
13.6
13.8
13.6
13.4
13.4
12.6
(-0.2)
(0.2)
(0.8)
5.5
5.8
6.1
6.2
5.6
5.8
(-0.3)
(-0.1)
(-0.2)
(0.8)
PubMed
17.7
16.9
17.7
16.4
17.2
16.8
(1.3)
(0.4)
Table 3: ROUGE-2 recall across sentence extractors when using fixed pretrained embeddings or when embeddings
are updated during training. In both cases embeddings are initialized with pretrained GloVe embeddings. All ex-
tractors use the averaging sentence encoder. When both learned and fixed settings are bolded, there is no signifcant
performance difference. RNN extractor is omitted for space but is similar to Seq2Seq. Difference in scores shown
in parenthesis.
Ablation CNN/DM
25.4
all words
25.3† (0.1)
-nouns
25.3† (0.1)
-verbs
25.3† (0.1)
-adj/adv
25.2† (0.2)
-function
NYT
34.7
34.3† (0.4)
34.4† (0.3)
34.4† (0.3)
34.5† (0.2)
DUC
22.7
22.3† (0.4)
22.4† (0.3)
22.5 (0.2)
22.9† (-0.2)
Reddit
11.4
10.3† (1.1)
10.8 (0.6)
9.5† (1.9)
10.3† (1.1)
AMI
5.5
3.8† (1.7)
5.8 (-0.3)
5.4 (0.1)
6.3† (-0.8)
PubMed
17.0
15.7† (1.3)
16.6† (0.4)
16.8† (0.2)
16.6† (0.4)
Table 4: ROUGE-2 recall after removing nouns, verbs, adjectives/adverbs, and function words. Ablations are
performed using the averaging sentence encoder and the RNN extractor. Bold indicates best performing system. †
indicates significant difference with the non-ablated system. Difference in score from all words shown in paren-
thesis.
over the training data D using stochastic gradient
descent with the ADAM optimizer (Kingma and
Ba, 2014). ω(0) = 1 and ω(1) = N0/N1 where
Ny is the number of training examples with label
y. We trained for a maximum of 50 epochs and the
best model was selected with early stopping on the
validation set according to ROUGE-2. Each epoch
constitutes a full pass through the dataset. The av-
erage stopping epoch was: CNN-DailyMail, 16.2;
NYT, 21.36; DUC, 37.11; Reddit, 36.59; AMI,
19.58; PubMed, 19.84. All experiments were re-
peated with five random initializations. Unless
specified, word embeddings were initialized using
pretrained GloVe embeddings (Pennington et al.,
2014) and we did not update them during training.
Unknown words were mapped to a zero embed-
ding. See Appendix D for more optimization and
training details.
5.2 Baselines
Lead As a baseline we include the lead sum-
mary, i.e.
taking the first x words of the docu-
ment as summary, where x is the target summary
length for each dataset (see the first paragraph of
§ 5). While incredibly simple, this method is still a
competitive baseline for single document summa-
rization, especially on newswire.
Oracle To measure the performance ceiling, we
show the ROUGE/METEOR scores using the ex-
tractive summary which results from greedily op-
timizing ROUGE-1.
I.e., if we had clairvoyant
knowledge of the human reference summary, the
oracle system achieves the (approximate) maxi-
mum possible ROUGE scores. See Appendix C
for a detailed description of the oracle algorithm.
5.3 Results
The results of our main experiment comparing the
different extractors/encoders are shown in Table 2.
Overall, we find no major advantage when us-
ing the CNN and RNN sentence encoders over
the averaging encoder. The best performing en-
coder/extractor pair either uses the averaging en-
coder (five out of six datasets) or the differences
are not statistically significant.
When looking at extractors, the Seq2Seq extrac-
tor is either part of the best performing system
(three out of six datasets) or is not statistically dis-
tinguishable from the best extractor.
Overall, on the news and medical journal do-
mains, the differences are quite small with the dif-
Ext.
Seq2Seq
Order
In-Order
Shuffled
CNN/DM
25.6
21.7
35.7
(3.9) 25.6
NYT
DUC
Reddit
AMI
22.8
(10.1) 21.2
13.6
(1.6) 13.5
(0.1)
5.5
6.0
(-0.5)
PubMed
17.7
14.9
(2.8)
Table 5: ROUGE-2 recall using models trained on in-order and shuffled documents. Extractor uses the averag-
ing sentence encoder. When both in-order and shuffled settings are bolded, there is no signifcant performance
difference. Difference in scores shown in parenthesis.
Hurricane Gilbert swept toward the Dominican Republic
Sunday, and the Civil Defense alerted its heavily populated
south coast to prepare for high winds, heavy rains and high
seas. The storm was approaching from the southeast with
sustained winds of 75 mph gusting to 92 mph. An estimated
100,000 people live in the province, including 70,000 in the
city of Barahona, about 125 miles west of Santo Domingo.
On Saturday, Hurricane Florence was downgraded to a
tropical storm and its remnants pushed inland from the
U.S. Gulf Coast. Tropical Storm Gilbert formed in the east-
ern Caribbean and strengthened into a hurricane Saturday
night.
Hurricane Gilbert swept toward the Dominican Republic
Sunday, and the Civil Defense alerted its heavily populated
south coast to prepare for high winds, heavy rains and high
seas. The storm was approaching from the southeast with
sustained winds of 75 mph gusting to 92 mph. An esti-
mated 100,000 people live in the province, including 70,000
in the city of Barahona, about 125 miles west of Santo
Domingo. Tropical Storm Gilbert formed in the eastern
Caribbean and strengthened into a hurricane Saturday night.
Strong winds associated with the Gilbert brought coastal
flooding, strong southeast winds and up to 12 feet feet to
Puerto Rico's south coast.
Table 6: Example output of Seq2Seq extractor (left) and Cheng & Lapata Extractor (right). This is a typical
example, where only one sentence is different between the two (shown in bold).
ferences between worst and best systems on the
CNN/DM dataset spanning only .56 of a ROUGE
point. While there is more performance variability
in the Reddit and AMI data, there is less distinc-
tion among systems: no differences are significant
on Reddit and every extractor has at least one con-
figuration that is indistinguishable from the best
system on the AMI corpus. This is probably due
to the small test size of these datasets.
Word Embedding Learning Given that learn-
ing a sentence encoder (averaging has no learned
parameters) does not yield significant improve-
ment, it is natural to consider whether learning
word embeddings is also necessary.
In Table 3
we compare the performance of different extrac-
tors using the averaging encoder, when the word
embeddings are held fixed or learned during train-
ing. In both cases, word embeddings are initial-
ized with GloVe embeddings trained on a combi-
nation of Gigaword and Wikipedia. When learn-
ing embeddings, words occurring fewer than three
times in the training data are mapped to an un-
known token (with learned embedding).
In all but one case, fixed embeddings are as
good or better than the learned embeddings. This
is a somewhat surprising finding on the CNN/DM
data since it is reasonably large, and learning em-
beddings should give the models more flexibility
to identify important word features.8 This sug-
8The AMI corpus is an exception here where learning
gests that we cannot extract much generalizable
learning signal from the content other than what
is already present from initialization. Even on
PubMed, where the language is quite different
from the news/Wikipedia articles the GloVe em-
beddings were trained on, learning leads to signif-
icantly worse results.
POS Tag Ablation It is also not well explored
what word features are being used by the encoders.
To understand which classes of words were most
important we ran an ablation study, selectively
removing nouns, verbs (including participles and
auxiliaries), adjectives & adverbs, and function
words (adpositions, determiners, conjunctions).
All datasets were automatically tagged using the
spaCy part-of-speech (POS) tagger9. The em-
beddings of removed words were replaced with
a zero vector, preserving the order and position
of the non-ablated words in the sentence. Abla-
tions were performed on training, validation, and
test partitions, using the RNN extractor with av-
eraging encoder. Table 4 shows the results of the
POS tag ablation experiments. While removing
any word class from the representation generally
hurts performance (with statistical significance),
on the news domains, the absolute values of the
does lead to small performance boosts, however, only in the
Seq2Seq extractor is this diference significant; it is quite pos-
sible that this is an artifact of the very small test set size.
9https://github.com/explosion/spaCy
differences are quite small (.18 on CNN/DM, .41
on NYT, .3 on DUC) suggesting that the model's
predictions are not overly dependent on any par-
ticular word types. On the non-news datasets, the
ablations have a larger effect (max differences are
1.89 on Reddit, 2.56 on AMI, and 1.3 on PubMed).
Removing nouns leads to the largest drop on AMI
and PubMed. Removing adjectives and adverbs
leads to the largest drop on Reddit, suggesting the
intensifiers and descriptive words are useful for
identifying important content in personal narra-
tives. Curiously, removing the function word POS
class yields a significant improvement on DUC
2002 and AMI.
Document Shuffling Sentence position is a
well known and powerful feature for news sum-
marization (Hong and Nenkova, 2014), owing to
the intentional lead bias in the news article writ-
ing10; it also explains the difficulty in beating the
lead baseline for single-document summarization
(Nenkova, 2005; Brandow et al., 1999). In exam-
ining the generated summaries, we found most of
the selected sentences in the news domain came
from the lead paragraph of the document. This
is despite the fact that there is a long tail of sen-
tence extractions from later in the document in the
ground truth extract summaries (31%, 28.3%, and
11.4% of DUC, CNN/DM, and NYT training ex-
tract labels come from the second half of the doc-
ument). Because this lead bias is so strong, it is
questionable whether the models are learning to
identify important content or just find the start of
the document. We conduct a sentence order exper-
iment where each document's sentences are ran-
domly shuffled during training. We then evalu-
ate each model performance on the unshuffled test
data, comparing to the model trained on unshuf-
fled data; if the models trained on shuffled data
drop in performance, then this indicates the lead
bias is the relevant factor.
Table 5 shows the results of the shuffling ex-
periments. The news domains and PubMed suffer
a significant drop in performance when the docu-
ment order is shuffled. By comparison, there is no
significant difference between the shuffled and in-
order models on the Reddit domain, and shuffling
actually improves performance on AMI. This sug-
gest that position is being learned by the models
in the news/journal article domain even when the
10https://en.wikipedia.org/wiki/
Inverted_pyramid_(journalism)
model has no explicit position features, and that
this feature is more important than either content
or function words.
6 Discussion
Learning content selection for summarization in
the news domain is severely inhibited by the lead
bias. The summaries generated by all systems de-
scribed here -- the prior work and our proposed sim-
plified models -- are highly similar to each other and
to the lead baseline. The Cheng & Lapata and
Seq2Seq extractors (using the averaging encoder)
share 87.8% of output sentences on average on the
CNN/DM data, with similar numbers for the other
news domains (see Table 6 for a typical example).
Also on CNN/DM, 58% of the Seq2Seq selected
sentences also occur in the lead summary, with
similar numbers for DUC, NYT, and Reddit. Shuf-
fling reduces lead overlap to 35.2% but the overall
system performance drops significantly; the mod-
els are not able to identify important information
without position.
The relative robustness of the news domain to
part of speech ablation also suggests that models
are mostly learning to recognize the stylistic fea-
tures unique to the beginning of the article, and not
the content. Additionally, the drop in performance
when learning word embeddings on the news do-
main suggests that word embeddings alone do not
provide very generalizable content features com-
pared to recognizing the lead.
The picture is rosier for non-news summariza-
tion where part of speech ablation leads to larger
performance differences and shuffling either does
not inhibit content selection significantly or leads
to modest gains. Learning better word-level rep-
resentations on these domains will likely require
much larger corpora, something which might re-
main unlikely for personal stories and meetings.
The lack of distinction among sentence en-
coders is interesting because it echoes findings in
the generic sentence embedding literature where
word embedding averaging is frustratingly diffi-
cult to outperform (Iyyer et al., 2015; Wieting
et al., 2015; Arora et al., 2016; Wieting and Gim-
pel, 2017). The inability to learn useful sen-
tence representations is also borne out in the Sum-
maRunner model, where there are explicit similar-
ity computations between document or summary
representations and sentence embeddings; these
computations do not seem to add much to the per-
formance as the Cheng & Lapata and Seq2Seq
models which lack these features generally per-
form as well or better. Furthermore, the Cheng
& Lapata and SummaRunner extractors both con-
struct a history of previous selection decisions to
inform future choices but this does not seem to sig-
nificantly improve performance over the Seq2Seq
extractor (which does not). This suggests that we
need to rethink or find novel forms of sentence
representation for the summarization task.
A manual examination of the outputs revealed
some interesting failure modes, although in gen-
eral it was hard to discern clear patterns of be-
haviour other than lead bias. On the news domain,
the models consistently learned to ignore quoted
material in the lead, as often the quotes provide
color to the story but are unlikely to be included in
the summary (e.g. "It was like somebody slugging
a punching bag."). This behavior was most likely
triggered by the presence of quotes, as the quote
attributions, which were often tokenized as sep-
arate sentences, would subsequently be included
in the summary despite also not containing much
information (e.g. Gil Clark of the National Hurri-
cane Center said Thursday).
7 Conclusion
We have presented an empirical study of deep
learning based content selection algorithms for
summarization. Our findings suggest such mod-
els face stark limitations on their ability to learn
robust features for this task and that more work is
needed on sentence representation for summariza-
tion.
8 Acknowledgements
The authors would like to thank the anonymous re-
viewers for their valuable feedback. Thanks goes
out as well to Chris Hidey for his helpful com-
ments. We would also like to thank Wen Xiao
for identifying an error in the oracle results for the
AMI corpus, which as since been corrected.
This research is based upon work supported in
part by the Office of the Director of National Intel-
ligence (ODNI), Intelligence Advanced Research
Projects Activity (IARPA), via contract # FA8650-
17-C-9117. The views and conclusions contained
herein are those of the authors and should not be
interpreted as necessarily representing the official
policies, either expressed or implied, of ODNI,
IARPA, or the U.S. Government. The U.S. Gov-
ernment is authorized to reproduce and distribute
reprints for governmental purposes notwithstand-
ing any copyright annotation therein.
References
Sanjeev Arora, Yingyu Liang, and Tengyu Ma. 2016.
A simple but tough-to-beat baseline for sentence em-
beddings.
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben-
gio. 2014. Neural machine translation by jointly
arXiv preprint
learning to align and translate.
arXiv:1409.0473.
Taylor Berg-Kirkpatrick, Dan Gillick, and Dan Klein.
2011. Jointly learning to extract and compress. In
Proceedings of the 49th Annual Meeting of the Asso-
ciation for Computational Linguistics: Human Lan-
guage Technologies-Volume 1, pages 481 -- 490. As-
sociation for Computational Linguistics.
Ronald Brandow, Karl Mitze, and Lisa Rau. 1999.
Automatic condensation of electronic publications
by sentence selection.
In Jan Fagerberg, David C.
Mowery, and Richard R. Nelson, editors, Advances
in Automatic Text Summarization, chapter 19, pages
293 -- 303. MIT Press, Oxford.
Jean Carletta, Simone Ashby, Sebastien Bourban, Mike
Flynn, Mael Guillemot, Thomas Hain, Jaroslav
Kadlec, Vasilis Karaiskos, Wessel Kraaij, Melissa
Kronenthal, et al. 2005. The ami meeting corpus:
In International Workshop
A pre-announcement.
on Machine Learning for Multimodal Interaction,
pages 28 -- 39. Springer.
Jianpeng Cheng and Mirella Lapata. 2016. Neural
summarization by extracting sentences and words.
arXiv preprint arXiv:1603.07252.
Junyoung Chung, Caglar Gulcehre, KyungHyun Cho,
and Yoshua Bengio. 2014. Empirical evaluation of
gated recurrent neural networks on sequence model-
ing. arXiv preprint arXiv:1412.3555.
John M Conroy and Dianne P O'Leary. 2001. Text
summarization via hidden markov models. In Pro-
ceedings of the 24th annual international ACM SI-
GIR conference on Research and development in in-
formation retrieval, pages 406 -- 407. ACM.
Michael Denkowski and Alon Lavie. 2014. Meteor
universal: Language specific translation evaluation
for any target language. In Proceedings of the EACL
2014 Workshop on Statistical Machine Translation.
Greg Durrett, Taylor Berg-Kirkpatrick, and Dan Klein.
2016. Learning-based single-document summariza-
tion with compression and anaphoricity constraints.
arXiv preprint arXiv:1603.08887.
Noemie Elhadad, M-Y Kan, Judith L Klavans, and
KR McKeown. 2005. Customization in a unified
framework for summarizing medical literature. Ar-
tificial intelligence in medicine, 33(2):179 -- 198.
Michel Galley. 2006. A skip-chain conditional ran-
dom field for ranking meeting utterances by impor-
In Proceedings of the 2006 Conference on
tance.
Empirical Methods in Natural Language Process-
ing, pages 364 -- 372. Association for Computational
Linguistics.
Albert Gatt and Emiel Krahmer. 2018. Survey of the
state of the art in natural language generation: Core
tasks, applications and evaluation. Journal of Artifi-
cial Intelligence Research, 61:65 -- 170.
Dan Gillick, Korbinian Riedhammer, Benoit Favre, and
Dilek Hakkani-Tur. 2009. A global optimization
In Acous-
framework for meeting summarization.
tics, Speech and Signal Processing, 2009. ICASSP
2009. IEEE International Conference on, pages
4769 -- 4772. IEEE.
Xavier Glorot and Yoshua Bengio. 2010. Understand-
ing the difficulty of training deep feedforward neu-
In Proceedings of the thirteenth in-
ral networks.
ternational conference on artificial intelligence and
statistics, pages 249 -- 256.
Karl Moritz Hermann, Tom´as Kocisk´y, Edward
Grefenstette, Lasse Espeholt, Will Kay, Mustafa Su-
leyman, and Phil Blunsom. 2015. Teaching ma-
chines to read and comprehend. In Advances in Neu-
ral Information Processing Systems (NIPS).
Kai Hong and Ani Nenkova. 2014.
Improving the
estimation of word importance for news multi-
In Proceedings of the
document summarization.
14th Conference of the European Chapter of the As-
sociation for Computational Linguistics, pages 712 --
721.
Mohit Iyyer, Varun Manjunatha, Jordan Boyd-Graber,
and Hal Daum´e III. 2015. Deep unordered com-
position rivals syntactic methods for text classifica-
tion. In Proceedings of the 53rd Annual Meeting of
the Association for Computational Linguistics and
the 7th International Joint Conference on Natural
Language Processing (Volume 1: Long Papers), vol-
ume 1, pages 1681 -- 1691.
Kokil Jaidka, Muthu Kumar Chandrasekaran, Sajal
Insights from
the faceted scientific document
International Journal
Rustagi, and Min-Yen Kan. 2017.
cl-scisumm 2016:
summarization shared task.
on Digital Libraries, pages 1 -- 9.
Yoon Kim. 2014.
works for sentence classification.
arXiv:1408.5882.
Convolutional neural net-
arXiv preprint
Julian Kupiec, Jan Pedersen, and Francine Chen. 1995.
A trainable document summarizer. In Proceedings
of the 18th annual international ACM SIGIR confer-
ence on Research and development in information
retrieval, pages 68 -- 73. ACM.
Chin-Yew Lin. 2004. Rouge: A package for auto-
matic evaluation of summaries. Text Summarization
Branches Out.
Rashmi Mishra,
Jiantao Bian, Marcelo Fiszman,
Charlene R Weir, Siddhartha Jonnalagadda, Javed
Mostafa, and Guilherme Del Fiol. 2014. Text sum-
marization in the biomedical domain: a systematic
review of recent research. Journal of biomedical in-
formatics, 52:457 -- 467.
Ramesh Nallapati, Feifei Zhai, and Bowen Zhou. 2017.
Summarunner: A recurrent neural network based se-
quence model for extractive summarization of docu-
ments. In AAAI, pages 3075 -- 3081.
Ani Nenkova. 2005. Automatic text summarization of
newswire: Lessons learned from the document un-
derstanding conference. In AAAI, volume 5, pages
1436 -- 1441.
Jessica Ouyang, Serina Chang, and Kathy McKeown.
2017. Crowd-sourced iterative annotation for narra-
tive summarization corpora. In Proceedings of the
15th Conference of the European Chapter of the As-
sociation for Computational Linguistics: Volume 2,
Short Papers, volume 2, pages 46 -- 51.
Paul Over and Walter Liggett. 2002.
duc:
news
to
generic
duction
of
tems.
gov/projects/duc/guidelines/2002. html.
An
text
Proc. DUC.
intrinsic
summarization
http://wwwnlpir.
Intro-
evaluation
sys-
nist.
Jeffrey Pennington, Richard Socher, and Christopher
Manning. 2014. Glove: Global vectors for word
representation. In Proceedings of the 2014 confer-
ence on empirical methods in natural language pro-
cessing (EMNLP), pages 1532 -- 1543.
Stefan Riezler and John T Maxwell. 2005. On some
pitfalls in automatic evaluation and significance test-
ing for mt. In Proceedings of the ACL workshop on
intrinsic and extrinsic evaluation measures for ma-
chine translation and/or summarization, pages 57 --
64.
Evan Sandhaus. 2008. The new york times annotated
corpus. Linguistic Data Consortium, Philadelphia,
6(12):e26752.
Abigail See, Peter J Liu, and Christopher D Man-
to the point: Summarization
arXiv preprint
ning. 2017. Get
with pointer-generator networks.
arXiv:1704.04368.
Diederik P Kingma and Jimmy Ba. 2014. Adam: A
method for stochastic optimization. arXiv preprint
arXiv:1412.6980.
Ruben Sipos, Pannaga Shivaswamy, and Thorsten
Joachims. 2012. Large-margin learning of submod-
ular summarization models. In Proceedings of the
13th Conference of the European Chapter of the As-
sociation for Computational Linguistics, pages 224 --
233. Association for Computational Linguistics.
John Wieting, Mohit Bansal, Kevin Gimpel, and
Towards universal para-
arXiv preprint
Karen Livescu. 2015.
phrastic sentence embeddings.
arXiv:1511.08198.
John Wieting and Kevin Gimpel. 2017. Revisiting re-
current networks for paraphrastic sentence embed-
dings. arXiv preprint arXiv:1705.00364.
Michihiro Yasunaga, Rui Zhang, Kshitijh Meelu,
Ayush Pareek, Krishnan Srinivasan, and Dragomir
Radev. 2017. Graph-based neural multi-document
summarization. arXiv preprint arXiv:1706.06681.
Content Selection in Deep Learning Models of Summarization
Supplementary Material For:
A Details on Sentence Encoders
We use 200 dimenional word embeddings wi in all models. Dropout is applied to the embeddings during
training. Wherever dropout is applied, the drop probability is .25.
A.1 Details on RNN Encoder
Under the RNN encoder, a sentence embedding is defined as h = [−→h s;←−h 1] where
−→h 0 = 0; −→h i = −−−→GRU(wi,−→h i−1)
←−h s+1 = 0; ←−h i = ←−−−GRU(wi,←−h i+1),
(1)
(2)
and −−−→GRU amd ←−−−GRU indicate the forward and backward GRUs respectively, each with separate parame-
ters. We use 300 dimensional hidden layers for each GRU. Dropout is applied to GRU during training.
A.2 Details on CNN Encoder
The CNN encoder has hyperparameters associated with the window sizes K ⊂ N of the convolutional
the number of words associated with each convolution) and the number of feature maps
filters (i.e.
Mk ∈ N associated with each filter (i.e. the output dimension of each convolution). The CNN sentence
embedding h is computed as follows:
k(cid:88)
j=1
(m,k)
a
i
= b(m,k) +
W
(m,k)
j
(cid:104)
h(m,k) =
h =
max
ReLU
i∈1,...,s−k+1
h(m,k)m ∈ {1, . . . , Mk}, k ∈ K
(cid:17)
(cid:16)
· wi+j−1
(m,k)
a
i
(cid:105)
(3)
(4)
(5)
where b(m,k) ∈ R and W (m,k) ∈ Rk×n(cid:48)
are learned bias and filter weight parameters respectively, and
ReLU(x) = max(0, x) is the rectified linear unit activation. We use window sizes K = {1, 2, 3, 4, 5, 6}
with corresponding feature maps sizes M1 = 25, M2 = 25, M3 = 50, M4 = 50, M5 = 50, M6 = 50,
giving h a dimensionality of 250. Dropout is applied to the CNN output during training.
B Details on Sentence Extractors
B.1 Details on RNN Extractor
−→z 0 = 0; −→z i = −−−→GRU(hi,−→z i−1)
←−z n+1 = 0; ←−z i = ←−−−GRU(hi,←−z i+1)
ai = ReLU (U · [−→z i;←−z i] + u)
p(yi = 1h) = σ (V · ai + v)
(6)
(7)
(8)
(9)
where −−−→GRU and ←−−−GRU indicate the forward and backward GRUs respectively, and each have separate
learned parameters; U, V and u, v are learned weight and bias parameters. The hidden layer size of the
GRU is 300 for each direction and the MLP hidden layer size is 100. Dropout is applied to the GRUs
and to ai.
B.2 Details on Seq2Seq Extrator
−→z 0 = 0; −→z i = −−−→GRUenc(hi,−→z i−1)
←−z n+1 = 0; ←−z i = ←−−−GRUenc(hi,←−z i+1)
−→q i = −−−→GRUdec(hi,−→q i−1)
←−q i = ←−−−GRUdec(hi,←−q i+1)
qi = [−→q i;←−q i], zi = [−→z i;←−z i]
n(cid:88)
exp (qi · zj)
j=1 exp (qi · zj)
(cid:80)n
, ¯zi =
αi,jzj
j=1
αi,j =
ai = ReLU (U · [¯zi; qi] + u)
p(yi = 1h) = σ (V · ai + v) .
The final outputs of each encoder direction are passed to the first decoder steps; additionally, the first step
of the decoder GRUs are learned "begin decoding" vectors −→q 0 and ←−q 0 (see Figure 1.b). Each GRU has
separate learned parameters; U, V and u, v are learned weight and bias parameters. The hidden layer size
of the GRU is 300 for each direction and MLP hidden layer size is 100. Dropout with drop probability
.25 is applied to the GRU outputs and to ai.
B.3 Details on Cheng & Lapata Extractor.
The basic architecture is a unidirectional sequence-to-sequence model defined as follows:
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18)
(19)
(20)
(21)
(22)
(23)
(24)
(25)
z0 = 0;
zi = GRUenc(hi, zi−1)
q1 = GRUdec(h∗, zn)
qi = GRUdec(pi−1 · hi−1, qi−1)
ai = ReLU (U · [zi; qi] + u)
pi = p(yi = 1y<i, h) = σ (V · ai + v)
where h∗ is a learned "begin decoding" sentence embedding (see Figure 1.c). Each GRU has separate
learned parameters; U, V and u, v are learned weight and bias parameters. Note in Equation 20 that
the decoder side GRU input is the sentence embedding from the previous time step weighted by its
probabilitiy of extraction (pi−1) from the previous step, inducing dependence of each output yi on all
previous outputs y<i. The hidden layer size of the GRU is 300 and the MLP hidden layer size is 100.
Dropout with drop probability .25 is applied to the GRU outputs and to ai.
Note that in the original paper, the Cheng & Lapata extractor was paired with a CNN sentence encoder,
but in this work we experiment with a variety of sentence encoders.
B.4 Details on SummaRunner Extractor.
Like the RNN extractor it starts with a bidrectional GRU over the sentence embeddings
It then creates a representation of the whole document q by passing the averaged GRU output states
through a fully connected layer:
−→z 0 = 0; −→z i = −−−→GRU(hi,−→z i−1)
←−z n+1 = 0; ←−z i = ←−−−GRU(hi,←−z i+1),
(cid:33)
(cid:32)
q = tanh
bq + Wq
[−→z i;←−z i]
n(cid:88)
i=1
1
n
A concatentation of the GRU outputs at each step are passed through a separate fully connected layer to
create a sentence representation zi, where
zi = ReLU (bz + Wz[−→z i;←−z i]) .
The extraction probability is then determined by contributions from five sources:
(con)
content a
i
(sal)
salience a
i
(nov)
novelty a
i
(pos)
position a
i
(qrt)
quartile a
i
= W (con)zi,
= zT
i W (sal)q,
= −zT
= W (pos)li,
= W (qrt)ri,
i W (nov) tanh(gi),
(26)
(27)
(28)
(29)
(30)
(31)
where li and ri are embeddings associated with the i-th sentence position and the quarter of the document
containing sentence i respectively. In Equation 29, gi is an iterative summary representation computed
as the sum of the previous z<i weighted by their extraction probabilities,
i−1(cid:88)
j=1
gi =
p(yj = 1y<j, h) · zj.
(32)
Note that the presence of this term induces dependence of each yi to all y<i similarly to the Cheng &
Lapata extractor.
The final extraction probability is the logistic sigmoid of the sum of these terms plus a bias,
(cid:32)
p(yi = 1y<i, h) = σ
+ a
(con)
a
i
(pos)
+a
i
(sal)
i
(qrt)
+ a
i
(nov)
+ a
i
+ b
(cid:33)
.
(33)
The weight matrices Wq, Wz, W (con), W (sal), W (nov), W (pos), W (qrt) and bias terms bq, bz, and b are
learned parameters; The GRUs have separate learned parameters. The hidden layer size of the GRU is
300 for each direction zi, q, and gi have 100 dimensions. The position and quartile embeddings are 16
dimensional each. Dropout with drop probability .25 is applied to the GRU outputs and to zi.
Note that in the original paper, the SummaRunner extractor was paired with an RNN sentence encoder,
but in this work we experiment with a variety of sentence encoders.
C Ground Truth Extract Summary Algorithm
Algorithm 1: ORACLEEXTRACTSUMMARYLABELS
Data: input document sentences s1, s2, . . . , sn,
human reference summary R,
summary word budget c.
1 yi := 0 ∀i ∈ 1, . . . , n
2 S := [ ]
3 while(cid:80)
s∈S WORDCOUNT(s) ≤ c do
// Initialize extract labels to be 0.
// Initialize summary as empty list.
// While summary word count ≤ word budget.
4
5
6
7
8
9
10
11
12
/* Add the next best sentence to the summary if it will improve the ROUGE
score otherwise no improvement can be made so break.
*/
i = arg maxi∈{1,...,n},
yi(cid:54)=1
ROUGE(S + [si], R)
if ROUGE(S + [si], R) > ROUGE(S, R) then
S := S + [si]
yi := 1
else
break
// Add si to the summary sentence list.
// Set the i-th extract label to indicate extraction.
Result: extract summary labels y1, . . . , yn
D Optimizer and initialization settings.
We use a learning rate of .0001 and a dropout rate of .25 for all dropout layers. We also employ gradient
clipping (−5 < ∇θ < 5). Weight matrix parameters are initialized using Xavier initialization with the
normal distribution (Glorot and Bengio, 2010) and bias terms are set to 0. We use a batch size of 32 for
all datasets except AMI and PubMed, which are often longer and consume more memory, for which we
use sizes two and four respectively. For the Cheng & Lapata model, we train for half of the maximum
epochs with teacher forcing, i.e. we set pi = 1 if yi = 1 in the gold data and 0 otherwise when computing
the decoder input pi · hi; we revert to the predicted model probability during the second half training.
|
1910.02228 | 1 | 1910 | 2019-10-05T07:49:12 | On the Limits of Learning to Actively Learn Semantic Representations | [
"cs.CL"
] | One of the goals of natural language understanding is to develop models that map sentences into meaning representations. However, training such models requires expensive annotation of complex structures, which hinders their adoption. Learning to actively-learn (LTAL) is a recent paradigm for reducing the amount of labeled data by learning a policy that selects which samples should be labeled. In this work, we examine LTAL for learning semantic representations, such as QA-SRL. We show that even an oracle policy that is allowed to pick examples that maximize performance on the test set (and constitutes an upper bound on the potential of LTAL), does not substantially improve performance compared to a random policy. We investigate factors that could explain this finding and show that a distinguishing characteristic of successful applications of LTAL is the interaction between optimization and the oracle policy selection process. In successful applications of LTAL, the examples selected by the oracle policy do not substantially depend on the optimization procedure, while in our setup the stochastic nature of optimization strongly affects the examples selected by the oracle. We conclude that the current applicability of LTAL for improving data efficiency in learning semantic meaning representations is limited. | cs.CL | cs | On the Limits of Learning to Actively Learn Semantic Representations
Omri Koshorek1 Gabriel Stanovsky2,4 Yichu Zhou3
Vivek Srikumar3
Jonathan Berant1,2
1Tel-Aviv University, 2Allen Institute for AI
3The University of Utah, 4University of Washington
{omri.koshorek,joberant}@cs.tau.ac.il
[email protected], {flyaway,svivek}@cs.utah.edu
9
1
0
2
t
c
O
5
]
L
C
.
s
c
[
1
v
8
2
2
2
0
.
0
1
9
1
:
v
i
X
r
a
Abstract
One of the goals of natural language under-
standing is to develop models that map sen-
tences into meaning representations. How-
ever, training such models requires expensive
annotation of complex structures, which hin-
ders their adoption. Learning to actively-learn
(LTAL) is a recent paradigm for reducing the
amount of labeled data by learning a policy
that selects which samples should be labeled.
In this work, we examine LTAL for learning
semantic representations, such as QA-SRL.
We show that even an oracle policy that is al-
lowed to pick examples that maximize perfor-
mance on the test set (and constitutes an up-
per bound on the potential of LTAL), does not
substantially improve performance compared
to a random policy. We investigate factors that
could explain this finding and show that a dis-
tinguishing characteristic of successful appli-
cations of LTAL is the interaction between op-
timization and the oracle policy selection pro-
cess. In successful applications of LTAL, the
examples selected by the oracle policy do not
substantially depend on the optimization pro-
cedure, while in our setup the stochastic nature
of optimization strongly affects the examples
selected by the oracle. We conclude that the
current applicability of LTAL for improving
data efficiency in learning semantic meaning
representations is limited.
1
Introduction
The task of mapping a natural language sentence
into a semantic representation, that is, a structure
that represents its meaning, is one of the core goals
of natural language processing. This goal has
led to the creation of many general-purpose for-
malisms for representing the structure of language,
such as semantic role labeling (SRL; Palmer et al.,
2005), semantic dependencies (SDP; Oepen et al.,
2014), abstract meaning representation (AMR;
Banarescu et al., 2013), universal conceptual cog-
nitive annotation (UCCA; Abend and Rappoport,
2013), question-answer driven SRL (QA-SRL; He
et al., 2015), and universal dependencies (Nivre
et al., 2016), as well as domain-specific semantic
representations for particular users in fields such
as biology (Kim et al., 2009; N´edellec et al., 2013;
Berant et al., 2014) and material science (Mysore
et al., 2017; Kim et al., 2019).
Currently, the dominant paradigm for building
models that predict such representations is super-
vised learning, which requires annotating thou-
sands of sentences with their correct structured
representation, usually by experts. This arduous
data collection is the main bottleneck for building
parsers for different users in new domains.
Past work has proposed directions for accelerat-
ing data collection and improving data efficiency
through multi-task learning across different rep-
resentations (Stanovsky and Dagan, 2018; Hersh-
covich et al., 2018), or having non-experts anno-
tate sentences in natural language (He et al., 2015,
2016). One of the classic and natural solutions for
reducing annotation costs is to use active learning,
an iterative procedure for selecting unlabeled ex-
amples which are most likely to improve the per-
formance of a model, and annotating them (Set-
tles, 2009).
Recently, learning to actively-learn (LTAL) has
been proposed (Fang et al., 2017; Bachman et al.,
2017; Liu et al., 2018), where the procedure for se-
lecting unlabeled examples is trained using meth-
ods from reinforcement and imitation learning. In
recent work by Liu et al. (2018), given a labeled
dataset from some domain, active learning is sim-
ulated on this dataset, and a policy is trained to
iteratively select the subset of examples that max-
imizes performance on a development set. Then,
this policy is used on a target domain to select un-
labeled examples for annotation.
If the learned
policy generalizes well, we can reduce the cost
of learning semantic representations. Liu et al.
(2018) and Vu et al. (2019) have shown that such
learned policies significantly reduce annotation
costs on both text classification and named entity
recognition (NER).
In this paper, we examine the potential of LTAL
for learning a semantic representation such as QA-
SRL. We propose an oracle setup that can be con-
sidered as an upper bound to what can be achieved
with a learned policy. Specifically, we use an or-
acle policy that is allowed to always pick a subset
of examples that maximizes its target metric on a
development set, which has the same distribution
as the test set. Surprisingly, we find that even this
powerful oracle policy does not substantially im-
prove performance compared to a policy that ran-
domly selects unlabeled examples on two seman-
tic tasks: QA-SRL span (argument) detection and
QA-SRL question (role) generation.
To elucidate this surprising finding, we perform
a thorough analysis, investigating various factors
that could negatively affect the oracle policy se-
lection process. We examine possible explanatory
factors including: (a) the search strategy in the
unlabeled data space (b) the procedure for train-
ing the QA-SRL model (c) the architecture of the
model and (d) the greedy nature of the selection
procedure. We find that for all factors, it is chal-
lenging to get consistent gains with an oracle pol-
icy over a random policy.
To further our understanding, we replicate the
experiments of Liu et al. (2018) on NER, and com-
pare the properties of a successful oracle policy in
NER to the less successful case of QA-SRL. We
find that optimization stochasticity negatively af-
fects the process of sample selection in QA-SRL;
different random seeds for the optimizer result in
different selected samples. We propose a mea-
sure for quantifying this effect, which can be used
to assess the potential of LTAL in new setups.
To conclude, in this work, we conduct a thor-
ough empirical investigation of LTAL for learn-
ing a semantic representation, and find that it is
difficult to substantially improve data efficiency
compared to standard supervised learning. Thus,
other approaches should be explored for the im-
portant goal of reducing annotation costs in build-
ing such models. Code for reproducing our exper-
iments is available at https://github.com/
koomri/LTAL_SR/.
2 Learning to Actively Learn
Classic pool-based active learning (Settles, 2009)
assumes access to a small labeled datasetSlab and
a large pool of unlabeled examplesSunlab for a tar-
notation and added toSlab. An example heuristic
get task. In each iteration, a heuristic is used to
select L unlabeled examples, which are sent to an-
is uncertainty sampling (Lewis and Gale, 1994),
which at each iteration chooses examples that the
current model is the least confident about.
LTAL proposes to replace the heuristic with a
learned policy πθ, parameterized by θ. At train-
ing time, the policy is trained by simulating active
learning on a labeled dataset and generating train-
ing data from the simulation. At test time, the pol-
icy is applied to select examples in a new domain.
Figure 1 and Algorithm 1 describe this data col-
lection procedure, on which we build our oracle
policy (§3).
In LTAL, we assume a labeled datasetD which
labeled set Slab, a large set Sunlab that will be
treated as unlabeled, and an evaluation set Seval
is partitioned into three disjoint sets: a small
In each iteration i, a model mi
φ is fine-
tuned on each candidate set, producing K mod-
that will be used to estimate the quality of mod-
els. Then, active learning is simulated for B it-
erations.
φ, pa-
rameterized by φ, is first trained on the labeled
dataset. Then, K subsets{Cj}K
j=1 are randomly
sampled fromSunlab, and the model mi
els{mi
φj}K
j=1. The performance of each model is
evaluated onSeval, yielding the scores{s(Cj)}K
j=1.
Let the candidate set with highest accuracy beCi
j=1) are the inputs and
(Slab,Sunlab, mi
φ,{s(Cj)}K
t is the label. ThenCi
t is moved fromSunlab to
Ci
Slab.
train K models overSlab∪Cj. However, a trained
t.
We can create training examples for πθ, where
Simulating active learning is a computationally
expensive procedure. In each iteration we need to
network can potentially lead to a policy that is bet-
ter than standard active learning heuristics.
3 An Oracle Active Learning Policy
Our goal is to examine the potential of LTAL for
learning a semantic representation such as QA-
SRL. Towards this goal, we investigate an oracle
policy that should be an upper bound for what can
be achieved with a learned policy πθ.
The oracle policy is allowed to use Algorithm 1
• Training: The models mi
φj
are affected by the
training procedure in Lines 2 and 5 of Alg. 1.
Different training procedures affect the perfor-
mance of models trained with the oracle policy.
• Search space coverage: Training over all unla-
beled examples in each iteration is intractable, so
the oracle policy randomly samples K subsets,
each with L examples. Because K⋅L<< |