Hostname: page-component-74656f9884-rngvg Total loading time: 0 Render date: 2026-11-06T05:14:06.449Z Has data issue: false hasContentIssue false

Towards syntax-aware token embeddings

Published online by Cambridge University Press:  08 July 2020

Diana Nicoleta Popa*
Affiliation:
Laboratoire d’Informatique de Grenoble, Université Grenoble Alpes, 700 Avenue Centrale, 38401 Saint-Martin-d’Hères, France Naver Labs Europe, 6 Chemin de Maupertuis, 38240 Meylan, France
Julien Perez
Affiliation:
Naver Labs Europe, 6 Chemin de Maupertuis, 38240 Meylan, France
James Henderson
Affiliation:
Idiap Research Institute, 19 Rue Marconi, 1920 Martigny, Switzerland
Eric Gaussier
Affiliation:
Laboratoire d’Informatique de Grenoble, Université Grenoble Alpes, 700 Avenue Centrale, 38401 Saint-Martin-d’Hères, France
*
*Corresponding author. E-mail: diana.popa@imag.fr
Rights & Permissions [Opens in a new window]

Abstract

Distributional semantic word representations are at the basis of most modern NLP systems. Their usefulness has been proven across various tasks, particularly as inputs to deep learning models. Beyond that, much work investigated fine-tuning the generic word embeddings to leverage linguistic knowledge from large lexical resources. Some work investigated context-dependent word token embeddings motivated by word sense disambiguation, using sequential context and large lexical resources. More recently, acknowledging the need for an in-context representation of words, some work leveraged information derived from language modelling and large amounts of data to induce contextualised representations. In this paper, we investigate Syntax-Aware word Token Embeddings (SATokE) as a way to explicitly encode specific information derived from the linguistic analysis of a sentence in vectors which are input to a deep learning model. We propose an efficient unsupervised learning algorithm based on tensor factorisation for computing these token embeddings given an arbitrary graph of linguistic structure. Applying this method to syntactic dependency structures, we investigate the usefulness of such token representations as part of deep learning models of text understanding. We encode a sentence either by learning embeddings for its tokens and the relations between them from scratch or by leveraging pre-trained relation embeddings to infer token representations. Given sufficient data, the former is slightly more accurate than the latter, yet both provide more informative token embeddings than standard word representations, even when the word representations have been learned on the same type of context from larger corpora (namely pre-trained dependency-based word embeddings). We use a large set of supervised tasks and two major deep learning families of models for sentence understanding to evaluate our proposal. We empirically demonstrate the superiority of the token representations compared to popular distributional representations of words for various sentence and sentence pair classification tasks.

Information

Type
Article
Copyright
© The Author(s), 2020. Published by Cambridge University Press
Figure 0

Figure 1. Example of relations that hold for one sentence: relations from the syntactic dependency parse (in grey and red) + adjacency relations (in blue): det (determiner), nsubj (nominal subject), prep (prepositional modifier), pobj (object of preposition), adjc (adjacency). The nsubj relation is marked in red to emphasise our focus within further analysis.

Figure 1

Figure 2. Example of a matrix for the dependency relation NSUBJ for sentence s.

Figure 2

Figure 3. Matrices form the tensor $T^{(s)}$ for sentence s.

Figure 3

Figure 4. (a) Sentence graph decomposition for sentence s; (b) Legend.

Figure 4

Figure 5. General architecture for sentence pair classification.

Figure 5

Table 1. Examples of sentences for the sentence understanding tasks considered

Figure 6

Table 2. Examples of sentence pairs used for the evaluation of paraphrase detection (MSR) and textual entailment recognition (SICK, SNLI-20k). S1, S2 denote the two sentences involved (or not) in a paraphrase relation. H stands for the entailed hypothesis and T stands for the entailing text in a textual entailment relation

Figure 7

Table 3. Data statistics for the sentence understanding datasets considered: number of classes (# classes), number of sentences (# instances), total number of unique word types in the corpus (# types), total number of word tokens in the corpus (# tokens), percentage of tokens in the corpus that are replaced by the UNKNOWN_POS tag (% oov), ratio between the total number of word types and the total number of word tokens as a measure of vocabulary richness: the larger the value, the more the vocabulary is diverse (ratio div)

Figure 8

Table 4. Data statistics for the sentence pair classification datasets considered: number of classes (# classes), number of sentences (# instances), total number of unique word types in the corpus (# types), total number of word tokens in the corpus (# tokens), percentage of tokens in the corpus that are replaced by the UNKNOWN_POS tag (% oov), ratio between the total number of word types and the total number of word tokens as a measure of vocabulary richness: the larger the value, the more the vocabulary is diverse (ratio div)

Figure 9

Table 5. Data characteristics. Underlined are the ‘appropriate’ datasets.

Figure 10

Table 6. Examples of sentences for which a SUBJ dependency relation is not detected due to the fact that the subject is implicit: the parts marked by [] are added artificially to emphasise the missing information

Figure 11

Table 7. Examples of sentences for which the SUBJ dependency relation is not labelled as such due to the fact that sentences are not grammatically correct

Figure 12

Table 8. Best run parameters for each task: $\alpha $ denotes the learning rate, dp the dropout keep probability, nbh the number of hidden states, nbf the number of filters and fsz the filter sizes

Figure 13

Table 9. Sentence classification and sentence pair classification results in terms of accuracy (%). Comparison of the results obtained using the proposed syntactically aware token embeddings (SATokE 300d) to results obtained using standard pre-trained word type embeddings: GloVe (Pennington et al. 2014) and Dep-based WE (Levy and Goldberg 2014a), including results using positional encodings and self-attention. Best results for each architecture (LSTM, CNN) are in bold. Best overall results across architectures are in bold underlined

Figure 14

Table 10. Comparison of the results obtained using the proposed syntactically aware token embeddings (SATokE 300-dimensional) to results obtained using the 1024-dimensional ELMo token embeddings (Peters et al. 2018). Best results for each architecture (LSTM, CNN) are in bold. Best overall results across architectures are in bold underlined

Figure 15

Table 11. Comparison of the results obtained using the proposed syntactically aware token embeddings (SATokE 300-dimensional) to results obtained using the 256-dimensional ELMo token embeddings (Peters et al. 2018). Best results for each architecture (LSTM, CNN) are in bold. Best overall results across architectures are in bold underlined

Figure 16

Table 12. Sentence classification and sentence pair classification results in terms of accuracy (%). Comparison of the proposed syntactically-aware token embeddings (SATokE 300d) to token embeddings computed using the 2-steps setting (SATokE 300d 2-steps) and to token embeddings computed using only adjacency information from the sentence graph (SATokE 300d only adjacency). Best results are in bold

Figure 17

Table 13. Examples of challenging sentence pairs correctly classified using SATokE but misclassified using word type embeddings as input

Figure 18

Table 14. Examples of challenging sentence pairs correctly classified using SATokE but misclassified using the ELMo token embeddings as input

Figure 19

Table 15. Examples of most similar words to a given token