The present application claims the benefit under 35 U.S.C. § 119 of German Patent Application No. DE 202020102105.2 filed on Apr. 16, 2020, which is expressly incorporated herein by reference in its entirety.
The present invention relates to a device for the automatic analysis of multilingual text, a training system for training the device, a device for an automated generation of a knowledge graph, and a machine-readable memory medium.
An ontology, which is also referred to as a knowledge graph, is a structured representation of entities and relationships between these entities. Ontologies are utilized for exchanging knowledge, in a formal manner, between computer-implemented application programs.
During the extraction of information from texts for filling knowledge graphs, the identification of time expressions also plays an important role: For example, many relationships between entities are valid only for a limited time (for example, the place of residence or the employer of persons). So-called “temporal tagging” deals with the automatic identification of time expressions in texts. Previous works in this regard utilize monolingual models, i.e., language-specific models, which may be applied only to texts in a certain language, but not to texts in other languages.
A method is described in “Domain-Adversarial Training of Neural Networks,” arXiv preprint arXiv: 1505.07818v1, by Yaroslav Ganin et al., 2015, for training a neural network on labeled data from a source domain and unlabeled data from a target domain (i.e., no labeled data from the target domain are necessary). As the training progresses, the approach promotes the emergence of features that are (i) discriminatory for the main learning task in the source domain and (ii) indiscriminate with respect to the shift between the domains. The method described herein is also known as gradient reversal training.
An example embodiment of the present invention may be applied to texts in a plurality of languages. In addition, a transfer power across languages is possible.
Advantageous refinements and further aspects of the present invention are described herein.
When a model learns, for example, from English texts that “today” is a time expression, but the word “heute” never occurs in German training texts, a monolingual model cannot interpret the term “heute” as a concept of time. A multilingual model may know from another source (for example, due to multilingual embeddings), however, that “today” and “heute” have a similar meaning and, as a result, may also correctly identify the word “heute” as a time expression.
In accordance with an example embodiment of the present invention, one solution to this problem may therefore be broken down into two substeps:
In a first aspect, the present invention therefore relates to a device for the automatic analysis of multilingual text in languages from a predefinable plurality of languages. In accordance with an example embodiment of the present invention, the device includes an embedder, which is configured for assigning the numeric representation (i.e., the embedding) to each of the text components (for example, words or parts of words) from the multilingual text, and a temporal tagger, which is configured for identifying and tagging temporal expressions in the multilingual text depending on the assigned embeddings, the embedder being configured for preferably assigning the numeric representations of temporal expressions in such a way that it is not possible to ascertain, on the basis of the numeric representation, in which language the associated text component is written.
It is possible to solve the two aforementioned problems with the aid of a single neural model, which is trained on the data of different languages and, due to adversarial training (in particular, gradient reversal training), generates a multilingual vector space for the word embeddings, in which a discriminator (second neural network) is unable to differentiate the language from which a certain word originates.
The present invention may be utilized for the automatic extraction of temporal expressions from texts. This is an important subaspect of filling knowledge graphs, since many facts are valid only for a certain time. This validity period must be tagged in the knowledge graph, in order not to generate errors during the application of the graph.
In fact, the methods described in Ganin et al. (2015) may be applied, generally, to all expressions occurring in a sentence. Actually, it is provided in one advantageous specific embodiment to not extract the temporal expressions first and then carry out a language identification with gradient reversal, but rather to apply both in parallel, i.e., the language identification with gradient reversal is applied to all expressions, regardless of whether they are temporal expressions, or not. It was now found that the identification of temporal expressions with the aid of this method is advantageous, because temporal expressions have a similar structure across a plurality of languages.
If, instead, one would want to extract, for example, grammatical structures such as accusative objects, or the like, then such a transfer across languages would not be as effective, because an accusative object in one language may have an entirely different grammatical function in another language.
The present invention therefore makes it possible to utilize multilingual models for temporal tagging (instead of monolingual models). This is more advantageous than utilizing rule-based models, since this does not transfer well to new languages.
In experiments, it has been shown that a transfer to unknown languages functions a great deal better with the aid of the model in accordance with an example embodiment of the present invention than with the aid of comparison models from the related art.
One further advantage of one further aspect of the present invention is the utilization of gradient reversal, in order to improve multilingual embedding space (such a method is known from the related art only at higher network layers, and the multilingual embeddings in the input are, there, only a means to an end, but not the focus of the improvement).
This aspect of the present invention may be utilized for the automatic extraction of temporal expressions from texts. This is an important subaspect of filling knowledge graphs, since many facts, i.e., entities and/or relationships, are valid only for a certain time. This validity period may be tagged in the knowledge graph, in order not to generate errors during the application of the knowledge graph.
An (in particular neural) multilingual model is therefore provided, which may automatically extract temporal expressions from texts of different languages, so that these may be inserted into a knowledge graph as additional information in addition to facts.
Moreover, it is provided to train the model with the aid of adversarial training (in particular, gradient reversal training), in order to generate a multilingual word embedding space, in which it is not possible to differentiate languages from one another.
In the adversarial training, it may be provided that a target function for training the temporal tagger alternates with a target function for training the discriminator and ensures, for example, due to gradient reversal, that the embedding vector space is updated in such a way that the discriminator is preferably unable to differentiate the languages from one another. Namely, it was found that this results in semantically similar temporal expressions from different languages receiving similar embeddings.
As the result, the model may be applied to texts of an arbitrary language, without the need to explicitly indicate which language it is. It is also possible to apply the model to languages that do not come from the group of languages on which it was trained. The only precondition is that this language is present in the multilingual embeddings. Herein lies the transfer power of the model with respect to monolingual or rule-based systems.
That means, in a training phase, training data including tagged temporal expressions from different languages may be utilized from the outset. The embedder, in particular a neural model (for example, a state of the art BERT model), is trained on or adapted (in the case of BERT) to these training data. The latter may take place by fine-tuning: BERT is typically pre-trained on a language model task and may be adapted, by fine-tuning, to the target task.
For this purpose, multilingual embeddings may be utilized, i.e., there is a single vector space for the embeddings from all languages. Specifically, the following steps may be carried out:
Initially, the training data may be divided into batches, it being ensured that each batch contains examples from multiple, in particular all, languages.
With the aid of the training batches, the neural model is trained with the aid of adversarial training. In the process,
In order to apply this model, a provided multilingual text, i.e., a single text or a plurality of texts from different languages, may be utilized at the outset.
The trained temporal tagger may now be applied on these texts. The temporal tagger does not need to have information regarding the language from which the text originates, since the embedding space is multilingual and the temporal tagger was trained to identify the time expressions regardless of the language.
These identified temporal expressions may then be utilized, in a known way, for automatically building or filling a knowledge graph.
Specific embodiments of the present invention are explained in greater detail below with reference to the figures.
Alternatively, it is also possible that the text components 10a, 10b are supplied directly to the device 100 for analyzing multilingual text 10. These text components are supplied to the embedder 25, which, in the exemplary embodiment, is given by an artificial neural network, for example, a BERT model, which ascertains an associated numeric representation 12a, 12b for each text component 10a, 10b.
These numeric representations 12a, 12b are supplied to the temporal tagger 30, which is also given by a neural network and ascertains a flag 13a, 13b for each of the numeric representations 12a, 12b, which indicates whether the text component 10a, 10b associated with the particular numeric representation 12a, 12b is a temporal expression, or not.
The flags 13a, 13b are supplied, together with the text components 10a, 10b, to a merger 32, which merges flags 13a, 13b with the particular associated text component 10a, 10b, in order to ascertain, therefrom, temporally tagged text components 11a, 11b.
These may be supplied to an optional knowledge graph builder 40, to which an existing knowledge graph 41 is provided, and which identifies entities and relationships between these entities in the temporally tagged text components 11a, 11b, assigns these identified temporal expressions to the entities and/or to the relationships and takes these into account as a characterization of the particular assigned entities and/or relationships during the generation of the knowledge graph.
The device 100 for the analysis of multilingual text 10 may be, for example, a computer system, the aforementioned components 20, 25, 30, 32, 40 being implemented as computer programs, which are stored on a machine-readable memory medium 101.
These particular estimated languages, encoded in estimated language flags 14a, 14b, are transferred to an evaluator 60, as is also the case for actual language flags 15a, 15b, which indicate, as ground truth, what the actual language of the language components 10a, 10b is. The evaluator 60 now ascertains, with the aid of a cost function, how well estimated language flags 14a, 14b and actual language flags 15a, 15b match and changes parameters of the discriminator 50 in such a way that the match is as good as possible and changes parameters of the embedder 25 in such a way that the match is as poor as possible. Mathematically, this is achieved in that, during the backpropagation of the gradient, the sign of the gradient of the parameters of the embedder 25 and of the gradient of the parameters of the discriminator 50 have opposite signs.
The temporal tagger 30 may be trained as part of the training system 200 or also outside the training system 200. Preferably, the training data are divided into batches, it being ensured that each batch contains examples from all languages. With the aid of these training data, the temporal tagger 30 is trained, so that it identifies preferably all time expressions in the training data and trains the embedder 25 and the discriminator 50 with the aid of the same training data.
The training system 200 may be, for example, a computer system, the aforementioned components 50, 60 being implemented as computer programs, which are stored on a machine-readable memory medium 102.
It is understood that the methods may be completely implemented in software not only as described. They may also be implemented in hardware, or in a mixed form made up of software and hardware.
| Number | Date | Country | Kind |
|---|---|---|---|
| 202020102105.2 | Apr 2020 | DE | national |