The invention relates to the field of computer science applied to language. More specifically, the invention relates to a method for automatically constructing inter-language queries for a search engine.
It is known to represent words by fixed-size vectors. It is a distributed representation, insofar as it is not necessary that there be a one-to-one correspondence between the vector dimensions and the linguistic properties of the words distributed according to the dimensions of the space.
A known method, so-called Skip-gram (Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013a, Efficient estimate of word representations in vector space, arXiv preprint arXiv: 1301.3781), enables a word vector learning allowing the processing of a very large amount of data in a short time. So the Skip-gram method enables to process a set of 1.6 billion words in less than a day.
In the state of the art, the queries constructed with the search engines from word vectors can be carried out in one language only.
The invention aims to make it possible to construct, from a query word, queries executable by a search engine in multiple languages. For that purpose, the invention proposes a method for automatically constructing inter-language queries executed by a search engine, characterized in that, from a text file containing a learning corpus comprising all the sentences correspondingly expressed in at least two languages, the words of each of the two languages being each associated with a target vector, said method comprises:
According to one embodiment, in order to allow a user to filter a meaning of said query word among several meanings, said method further comprises:
According to one embodiment, the above-mentioned steps i) to iii) are repeated until some results returned by said search engine are free from the meaning of the query word to be filtered.
According to one embodiment, the step of subtracting is carried out by application of the Gram-Schmidt ortho-normalization method.
According to one embodiment, as each word of said learning corpus is associated with a target vector and a context vector, the step of aligning target vectors comprises:
According to one embodiment, the step of calculating each inter-language cost function is carried out by an iterative method implementing a sliding window in said learning corpus and based on the analysis of a target vector of a word of interest in the window with respect to the context vectors of the other words in the window, so-called context words, located around the word of interest and expressed in the same language as the word of interest.
According to one implementation, the intra-language cost function implemented in the Skip-Gram method is expressed as follows:
According to one embodiment, the steps of calculating the inter-language cost functions of one language with respect to another language are carried out by an iterative method implementing a sliding window in the learning corpus and based on the analysis of a target vector of a word of interest in the window with respect to the context vectors of all the words in the window, including the word of interest expressed in one language different from the language of the word of interest.
According to one embodiment, the inter-language cost function is expressed in the following way:
According to one embodiment, in order to align target vectors of words in an additional language, said method further comprises:
The invention also relates to computer type equipment such as a computer or server comprising a memory for storing software instructions enabling the implementation of the method as previously defined.
The invention will be better understood on reading the following description and examining the annexed figures. These figures must be considered as an illustration only and by no means as a limitation of the invention.
The method according to the present invention is implemented from a text file containing a learning corpus C comprising all the sentences correspondingly expressed in at least two languages, for example the English language “e” and the French language “f”. The words in each of the two languages are each associated with a target vector {right arrow over (w)} and a context vector . The target vector {right arrow over (w)} and context vector each comprises a number of components comprised between 50 and 1000 and, for example, 300.
As illustrated in
For this purpose, as illustrated by the diagram in
Preferably, the steps 201, 202 of calculating each intra-language cost function Je, Jf are carried out by an iterative method implementing a sliding window in the learning corpus C and based on the analysis of a target vector {right arrow over (w)} of a word of interest in the window with respect to the context vectors of the other words in the window, so-called context words, situated around the word of interest and expressed in the same language as the word of interest. The word of interest is not taken into account when calculating the target vectors of the context words.
Specifically, the intra-language cost function J implemented in the Skip-Gram method is expressed for each language as follows:
In addition, steps 203, 204 of calculating cost functions Ωe,f, Ωf,e are carried out, so-called inter-language cost functions, respectively in order to align the target vectors {right arrow over (we)} of the words in the first language e with respect to the context vectors of the words in the second language f, as well as to align the target vectors {right arrow over (wfe)} of the words in the second language f with respect to the context vectors of the words in the first language e.
Preferably, the steps 203, 204 of calculating each inter-language cost function Ωe,f, Ωf,e of one language with respect to another is carried out by an iterative method implementing a sliding window in the learning corpus C and based on the analysis of a target vector {right arrow over (w)} of a word of interest in the window with respect to the context vectors of all the words situated in the window and expressed in the language different from the language of the word of interest.
Specifically, the inter-language cost function Ω is expressed as follows:
The sum of these four cost functions Je, Jf, Ωe,f, Ωf,e previously calculated (see functional block 205) is minimized in order to obtain the aligned targets vectors {right arrow over (we)}, {right arrow over (wf)} in both languages.
It should be noted that it is very simple to adapt the method according to the invention in order to align target vectors {right arrow over (wl)} in an additional language. The only thing to do indeed is calculate the intra-language cost function in order to calculate the target vectors {right arrow over (wl)} and the context vectors in the additional language, as well as the inter-language cost functions in order to align the target vectors {right arrow over (wl)} of the words in the additional language with respect to the target vectors {right arrow over (we)} of the words in one of the language, so-called pivot language, as well to align the target vectors {right arrow over (we)} of the words in the pivot language with respect to the target vectors {right arrow over (wl)} of the words in the additional language.
So, if we want to align the word vectors expressed in the Italian language “i” and if English “e” is defined as a pivot language, the intra-language cost function Ji and the inter-language costs functions Ωi,e and Ωe,i are calculated in addition to the above-mentioned cost functions.
We then minimize the sum of all the cost functions integrating, in addition to the above-mentioned cost functions Je, Jf, Ωe,f and Ωf,e, the cost functions Ji, Ωi,e and Ωe,i calculated for the additional language.
Thus, by taking into account the cost functions for each additional language, the invention can easily enable the alignment of the target vectors {right arrow over (wl)} in more than 15 different languages.
Once the target vectors {right arrow over (w)} are aligned according to the method previously described, it is possible to automatically construct inter-queries language for a search engine.
For this purpose, in a step 102, N words are recovered from each of the languages considered having some closest target vectors {right arrow over (w)} to a target vector {right arrow over (w)} associated with a query word. The determination of the closest target vectors {right arrow over (w)} to one another is carried out by minimization of the Euclidean distance between the vectors.
In a step 103, the queries are then constructed and executed by a search engine from the N words previously recovered from the languages considered. The method also implements a step 104 of displaying the results returned by the search engine.
The invention thus makes it possible to obtain search results relating to the global meaning of a word considered in a plurality of languages, and that without necessarily having knowledge of the different languages because of the use of the aligned target vectors {right arrow over (w)} in the different languages.
In addition, to allow a user to filter a meaning of a query word having several meanings, the method may also comprise:
The above-mentioned steps i) to iii) may be repeated by the user or in an automatic way until results displayed by the search engine are free from the meaning of the query word to be filtered.
The invention is also related to computer type equipment such as a computer or server having a memory for storing software instructions enabling the implementation of the method as previously described.
The person skilled in the art will of course be able to make changes to the above-described method without departing from the scope of the invention defined hereinafter in the claims.
Number | Date | Country | Kind |
---|---|---|---|
1558249 | Sep 2015 | FR | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/EP2016/070971 | 9/6/2016 | WO | 00 |