WO2022079845A1 - 単語対応装置、学習装置、単語対応方法、学習方法、及びプログラム - Google Patents

単語対応装置、学習装置、単語対応方法、学習方法、及びプログラム Download PDF

Info

Publication number
WO2022079845A1
WO2022079845A1 PCT/JP2020/038837 JP2020038837W WO2022079845A1 WO 2022079845 A1 WO2022079845 A1 WO 2022079845A1 JP 2020038837 W JP2020038837 W JP 2020038837W WO 2022079845 A1 WO2022079845 A1 WO 2022079845A1
Authority
WO
WIPO (PCT)
Prior art keywords
language
span
word
cross
span prediction
Prior art date
Application number
PCT/JP2020/038837
Other languages
English (en)
French (fr)
Inventor
昌明 永田
克己 帖佐
正彬 西野
Original Assignee
日本電信電話株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日本電信電話株式会社 filed Critical 日本電信電話株式会社
Priority to PCT/JP2020/038837 priority Critical patent/WO2022079845A1/ja
Priority to US18/246,796 priority patent/US20230367977A1/en
Priority to JP2022556765A priority patent/JPWO2022079845A1/ja
Publication of WO2022079845A1 publication Critical patent/WO2022079845A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/42Data-driven translation
    • G06F40/45Example-based machine translation; Alignment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • G06N3/0455Auto-encoder networks; Encoder-decoder networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/088Non-supervised learning, e.g. competitive learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/09Supervised learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions

Definitions

  • the present invention relates to a technique for identifying word correspondences between two sentences that are translated into each other.
  • word correspondence Identifying a word or word set that is translated into each other in two sentences that are translated into each other is called word correspondence.
  • the mainstream method of conventional word mapping is to identify word pairs that are translated from each other from statistical information on bilingual data based on the model described in reference [1] used in statistical machine translation. rice field. References are collectively described at the end of this specification.
  • the method using a neural network has achieved a significant improvement in accuracy compared to the statistical method.
  • the accuracy of the method using the neural network was equal to or slightly higher than the accuracy of the statistical method.
  • Non-Patent Document 1 The supervised word correspondence based on the conventional neural machine translation model disclosed in Non-Patent Document 1 is more accurate than the unsupervised word correspondence based on the statistical machine translation model.
  • both the method based on the statistical machine translation model and the method based on the neural machine translation model have a problem that a large amount of bilingual data (about several million sentences) is required for learning the translation model.
  • the present invention has been made in view of the above points, and an object thereof is to realize supervised word correspondence with higher accuracy than the prior art from a smaller amount of supervised data than the prior art.
  • a problem generator that uses a first language sentence and a second language sentence as inputs and generates a cross-language span prediction problem between the first language sentence and the second language sentence, and a problem generation unit.
  • a word correspondence device provided with a span prediction unit that predicts the span that is the answer to the span prediction problem by using a cross-language span prediction model created by using correct answer data consisting of a cross-language span prediction problem and its answer. Will be done.
  • the problem of finding word correspondence in two sentences that are translated into each other is predicted as a word in a sentence in another language or a continuous word string (span) corresponding to each word in a sentence in one language.
  • a cross-language span prediction model using a neural network from a small number of manually created correct answer data, it is possible to realize highly accurate word correspondence. ..
  • the word correspondence device 100 which will be described later, executes the processing related to this word correspondence.
  • HTML tags eg anchor tags ⁇ a> ... ⁇ / a>.
  • the HTML tag can be correctly mapped by identifying the range of the character string of a sentence in another language that is semantically equivalent to the range of the character string based on the word correspondence.
  • F) for converting the sentence F of the original language (source language, source language) to the sentence E of the target language (destination language, target language) is Bayesed. Using the theorem of, we decompose it into the product of the translation model P (F
  • the original language F and the target language E that are actually translated are different from the original language E and the target language F in the translation model P (F
  • the original language sentence X is a word string of length
  • x 1 , x 2 , ..., x
  • the target language sentence Y is a word string y of length
  • y 1 , y 2, ..., y
  • the word correspondence A from the target language to the original language is a 1:
  • a 1 , a 2 , .. ., a
  • a j means that the word y j in the target language sentence corresponds to the word x aj in the target language sentence.
  • the translation probability based on a certain word correspondence A is the product of the lexical translation probability P t (y j
  • of the target language sentence is first determined, and the probability that the jth word of the target language sentence corresponds to the ajth word of the original language sentence Pa a . It is assumed that (a j
  • Model 4 which is often used in word correspondence, includes fertility, which indicates how many words in one language correspond to how many words in another language, and the correspondence between the previous word and the current word.
  • fertility which indicates how many words in one language correspond to how many words in another language, and the correspondence between the previous word and the current word.
  • the word correspondence probability depends on the word correspondence of the immediately preceding word in the target language sentence.
  • word correspondence probabilities are learned using an EM algorithm from a set of bilingual sentence pairs to which word correspondence is not given. That is, the word correspondence model is learned by unsupervised learning.
  • GIZA ++ [16]
  • MGIZA [8] FastAlign [6]
  • GIZA ++ and MGIZA are based on model 4 described in reference [1]
  • FastAlgin is based on model 2 described in reference [1].
  • word correspondence based on a recurrent neural network As a method of unsupervised word correspondence based on a neural network, there are a method of applying a neural network to word correspondence based on HMM [26,21] and a method based on attention in neural machine translation [27,9].
  • Tamura et al. [21] used a recurrent neural network (RNN) to support not only the immediately preceding word but also the word from the beginning of the sentence.
  • RNN recurrent neural network
  • History a ⁇ j a 1: Determine the current word correspondence in consideration of j-1 , and do not model the vocabulary translation probability and the word correspondence probability separately, but use the word correspondence as one model. We are proposing a method to find.
  • Word correspondence based on a recurrent neural network requires a large amount of teacher data (a bilingual sentence with word correspondence) in order to learn a word correspondence model.
  • teacher data a bilingual sentence with word correspondence
  • Neural machine translation realizes conversion from a source language sentence to a target language sentence based on an encoder-decoder model (encoder-decoder model).
  • the encoder is a function enc that represents a non-linear transformation using a neural network.
  • X x 1:
  • x 1 , ..., x
  • Is converted into a sequence of internal states of length
  • s 1 , ..., s
  • is a matrix of
  • the decoder takes the output s 1:
  • the attention mechanism is a mechanism for determining which word information in the original language sentence is used by changing the weight for the internal state of the encoder when generating each word in the target language sentence in the decoder. It is the basic idea of unsupervised word correspondence based on the attention of neural machine translation that the value of this caution is regarded as the probability that two words are translated into each other.
  • Transformer is an encoder / decoder model in which an encoder and a decoder are parallelized by combining self-attention and a feed-forward neural network. Attention between the original language sentence and the target language sentence in Transformer is called cross attention to distinguish it from self-attention.
  • the reduced inner product attention is defined for the query Q ⁇ R lq ⁇ dk , the key K ⁇ R lk ⁇ dk , and the value V ⁇ R lk ⁇ dv as follows.
  • l q is the length of the query
  • l k is the length of the key
  • d k is the number of dimensions of the query and key
  • d v is the number of dimensions of the value.
  • Q, K, and V are defined as follows with W Q ⁇ R d ⁇ dk , W K ⁇ R d ⁇ dk , and W V ⁇ R d ⁇ dv as weights.
  • t j is an internal state when the word of the j-th target language sentence is generated in the decoder.
  • [] T represents a transposed matrix.
  • the word x i of the original language sentence corresponds to each word y j of the target language sentence. It can be regarded as representing the distribution of probabilities.
  • Transformer uses multiple layers (layers) and multiple heads (heads, attention mechanisms learned from different initial values), but here the number of layers and heads is set to 1 for the sake of simplicity.
  • Garg et al. Reported that the average of the cross-attentions of all heads in the second layer from the top was the closest to the correct answer for word correspondence, and identified among multiple heads using the word correspondence distribution Gp thus obtained. Define the following cross-entropy loss for the word correspondence obtained from one head of
  • Equation (15) represents that word correspondence is regarded as a multi-valued classification problem that determines which word in the original language sentence corresponds to the word in the target language sentence.
  • Word correspondence can be thought of as a many-to-many discrete mapping from a word in the original language sentence to a word in the target language sentence.
  • the word correspondence is directly modeled from the original language sentence and the target language sentence.
  • Stengel-Eskin et al. Have proposed a method for discriminatively finding word correspondence using the internal state of neural machine translation [20].
  • the sequence of the internal states of the encoder in the neural machine translation model is s 1 , ..., s
  • the sequence of the internal states of the decoder is t 1 , ..., t
  • the matrix product of the word sequence of the original language sentence projected on the common space and the word sequence of the target language is used as an unnormalized distance scale of s'i and t'j .
  • a convolution operation is performed using a 3 ⁇ 3 kernel Wconv so that the word correspondence depends on the context of the preceding and following words, and a ij is obtained.
  • Binary cross-entropy loss is used as an independent binary classification problem to determine whether each pair corresponds to all combinations of words in the original language sentence and words in the target language sentence.
  • ⁇ a ij indicates whether or not the word x i in the original language sentence and the word y j in the target language sentence correspond to each other in the correct answer data.
  • the hat " ⁇ " that should be placed above the beginning of the character is described before the character.
  • Stengel-Eskin et al. Learned the translation model in advance using the bilingual data of about 1 million sentences, and then used the correct answer data (1,700 to 5,000 sentences) for words created by hand. , Reported that it was able to achieve an accuracy far exceeding FastAlign.
  • the BERT [5] is a language expression model that outputs a word embedding vector in consideration of the context of each word in the input series by using an encoder based on Transformer. Typically, an input sequence is one sentence or two sentences connected with a special symbol in between.
  • BERT a task of learning a blank language model (masked language model) that predicts a masked word in an input sequence from both front and back, and a sentence in which two given sentences are adjacent to each other.
  • a language expression model (language representation model) is pre-trained from a large-scale linguistic data by using the next sentence prediction task to determine whether or not it is.
  • the BERT can output a word embedding vector that captures features related to linguistic phenomena that span not only the inside of one sentence but also two sentences.
  • a language expression model such as BERT may be simply called a language model.
  • [CLS] is a special token for creating a vector that aggregates the information of two input sentences
  • [SEP] is a token that represents a sentence delimiter.
  • the class is predicted from the vector output by BERT for [CLS] using a neural network.
  • BERT was originally created for English, but now BERT for various languages including Japanese has been created and is open to the public.
  • a general-purpose multilingual model multilingual BERT created by extracting monolingual data of 104 languages from Wikipedia and using it is open to the public.
  • the word correspondence based on the conventional recurrent neural network and the unsupervised word correspondence based on the neural machine translation model described as reference techniques can achieve the same or slightly higher accuracy than the unsupervised word correspondence based on the statistical machine translation model. ..
  • Supervised word correspondence based on the conventional neural machine translation model is more accurate than unsupervised word correspondence based on the statistical machine translation model.
  • both the method based on the statistical machine translation model and the method based on the neural machine translation model have a problem that a large amount of bilingual data (about several million sentences) is required for learning the translation model.
  • word correspondence is realized as a process of calculating an answer from a problem of cross-language span prediction.
  • the word correspondence processing is executed using the learned cross-language span prediction model.
  • FIG. 1 shows a word correspondence device 100 and a pre-learning device 200 according to the present embodiment.
  • the word correspondence device 100 is a device that executes word correspondence processing by the technique according to the present invention.
  • the pre-learning device 200 is a device that learns a multilingual model from multilingual data.
  • the word correspondence device 100 has a cross-language span prediction model learning unit 110 and a word correspondence execution unit 120.
  • the language cross-language span prediction model learning unit 110 includes a word-corresponding correct answer data storage unit 111, a language cross-language span prediction problem answer generation unit 112, a language cross-language span prediction correct answer data storage unit 113, a span prediction model learning unit 114, and a language cross-language span prediction unit. It has a model storage unit 115.
  • the cross-language span prediction question answer generation unit 112 may be referred to as a question answer generation unit.
  • the word correspondence execution unit 120 has a cross-language span prediction problem generation unit 121, a span prediction unit 122, and a word correspondence generation unit 123.
  • the cross-language span prediction problem generation unit 121 may be referred to as a problem generation unit.
  • the pre-learning device 200 is a device related to the existing technique.
  • the pre-learning device 200 has a multilingual data storage unit 210, a multilingual model learning unit 220, and a pre-learned multilingual model storage unit 230.
  • the multilingual model learning unit 220 learns a language model by reading monolingual texts of at least two languages for which word correspondence is to be obtained from the multilingual data storage unit 210, and the language model is pre-learned in multiple languages. As a model, it is stored in the pre-learned multilingual model storage unit 230.
  • the pre-learned multilingual model learned by some means may be input to the cross-language span prediction model learning unit 110, so that the pre-learning device 200 is not provided, for example.
  • a general-purpose pre-trained multilingual model that is open to the public may be used.
  • the pre-learned multilingual model in this embodiment is a pre-trained language model using monolingual texts of at least two languages for which word correspondence is required.
  • multilingual BERT is used as the language model, but the language model is not limited thereto.
  • Any pre-learned multilingual model such as XLM-RoBERTa that can output a word embedding vector considering the context for multilingual text may be used.
  • the word correspondence device 100 may be called a learning device. Further, the word correspondence device 100 may include a word correspondence execution unit 120 without providing the language cross-language span prediction model learning unit 110. Further, a device provided with the cross-language span prediction model learning unit 110 independently may be called a learning device.
  • FIG. 2 is a flowchart showing the overall operation of the word correspondence device 100.
  • a pre-learned multilingual model is input to the cross-language span prediction model learning unit 110, and the language cross-language span prediction model learning unit 110 learns a language cross-language span prediction model based on the pre-learned multilingual model. do.
  • the cross-language span prediction model learned in S100 is input to the word correspondence execution unit 120, and the word correspondence execution unit 120 uses the cross-language span prediction model to input sentence pairs (two translations from each other). Generates and outputs the word correspondence in sentence).
  • the cross-language span prediction question answer generation unit 112 reads the word-corresponding correct answer data from the word-corresponding correct answer data storage unit 111, generates the cross-language span prediction correct answer data from the read word-corresponding correct answer data, and generates the cross-language span prediction correct answer data. It is stored in the prediction correct answer data storage unit 113.
  • Cross-language span prediction correct answer data is data consisting of a set of pairs of cross-language span prediction problems (questions and contexts) and their answers.
  • the span prediction model learning unit 114 learns the language cross-language span prediction model from the language cross-language span prediction correct answer data and the pre-learned multilingual model, and stores the learned language cross-language span prediction model in the language cross-language span prediction model storage unit 115. Store in.
  • a pair of a first language sentence and a second language sentence is input to the cross-language span prediction problem generation unit 121.
  • the cross-language span prediction problem generation unit 121 generates a cross-language span prediction problem (question and context) from a pair of input sentences.
  • the span prediction unit 122 performs span prediction for the cross-language span prediction problem generated in S202 using the cross-language span prediction model, and obtains an answer.
  • the word correspondence generation unit 123 generates a word correspondence from the answer to the cross-language span prediction problem obtained in S203.
  • the word correspondence generation unit 123 outputs the word correspondence generated in S204.
  • model in this embodiment is a model of a neural network, and specifically consists of weight parameters, functions, and the like.
  • Both the word-corresponding device and the learning device (collectively referred to as “devices”) in the present embodiment can be realized by, for example, causing a computer to execute a program describing the processing contents described in the present embodiment.
  • the "computer” may be a physical machine or a virtual machine on the cloud.
  • the "hardware” described here is virtual hardware.
  • the above program can be recorded on a computer-readable recording medium (portable memory, etc.), saved, and distributed. It is also possible to provide the above program through a network such as the Internet or e-mail.
  • FIG. 5 is a diagram showing an example of the hardware configuration of the above computer.
  • the computer of FIG. 5 has a drive device 1000, an auxiliary storage device 1002, a memory device 1003, a CPU 1004, an interface device 1005, a display device 1006, an input device 1007, an output device 1008, and the like, which are connected to each other by a bus B, respectively.
  • the program that realizes the processing on the computer is provided by, for example, a recording medium 1001 such as a CD-ROM or a memory card.
  • a recording medium 1001 such as a CD-ROM or a memory card.
  • the program is installed in the auxiliary storage device 1002 from the recording medium 1001 via the drive device 1000.
  • the program does not necessarily have to be installed from the recording medium 1001, and may be downloaded from another computer via the network.
  • the auxiliary storage device 1002 stores the installed program and also stores necessary files, data, and the like.
  • the memory device 1003 reads and stores the program from the auxiliary storage device 1002 when there is an instruction to start the program.
  • the CPU 1004 realizes the function related to the device according to the program stored in the memory device 1003.
  • the interface device 1005 is used as an interface for connecting to a network.
  • the display device 1006 displays a GUI (Graphical User Interface) or the like by a program.
  • the input device 1007 is composed of a keyboard, a mouse, buttons, a touch panel, and the like, and is used for inputting various operation instructions.
  • the output device 1008 outputs the calculation result.
  • the word correspondence process is executed as the process of the cross-language span prediction problem. Therefore, first, the formulation from word correspondence to span prediction will be described using an example. In relation to the word correspondence device 100, the cross-language span prediction model learning unit 110 will be mainly described here.
  • FIG. 6 shows an example of Japanese and English word correspondence data. This is an example of one word correspondence data.
  • one word correspondence data includes a token (word) string in the first language (Japanese), a token string in the second language (English), a corresponding token pair column, and the original text in the first language. It consists of five data of the original text of the second language.
  • the token sequence of the first language Japanese
  • the token sequence of the second language English
  • 0 which is the index of the first element of the token sequence (the leftmost token)
  • it is indexed as 1, 2, 3, ....
  • the first element "0-1" of the third data indicates that the first element "Ashikaga” of the first language corresponds to the second element "ashikaga” of the second language.
  • "24-2 25-2 26-2” means that "de”, "a”, and "ru" all correspond to "was”.
  • word correspondence is formulated as a cross-language span prediction problem similar to the question answering task [18] in SQuaAD format.
  • a question answering system that performs a question answering task in the SQuaAD format is given a "context” and a “question” such as paragraphs selected from Wikipedia, and the question answering system is a "span” in the context. (Span, substring) ”is predicted as“ answer (answer) ”.
  • the word correspondence execution unit 120 in the word response device 100 of the present embodiment regards the target language sentence as a context, regards the word of the original language sentence as a question, and regards the word of the original language sentence as a question.
  • the word or word string in the target language sentence which is the translation of, is predicted as the span of the target language sentence.
  • the cross-language span prediction model in the present embodiment is used.
  • the cross-language span prediction model learning unit 110 of the word correspondence device 100 performs supervised learning of the cross-language span prediction model, but correct answer data is required for learning.
  • a plurality of word correspondence data as illustrated in FIG. 5 are stored as correct answer data in the word correspondence correct answer data storage unit 111 of the language crossing span prediction model learning unit 110, and learning of the language crossing span prediction model. Used for.
  • the cross-language span prediction model is a model that predicts the answer (span) from the question across the language
  • data is generated for learning to predict the answer (span) from the question across the language.
  • the cross-language span prediction problem answer generation unit 112 can use the word correspondence data to input the cross-language span prediction problem in SQuaAD format. Generate a pair of (question) and answer (span, substring).
  • SQuaAD format Generate a pair of (question) and answer (span, substring).
  • FIG. 7 shows an example of converting the word correspondence data shown in FIG. 6 into a span prediction problem in SQuaAD format.
  • the upper half portion shown in FIG. 7A will be described.
  • the sentence of the first language (Japanese) of the word correspondence data is given as the context, and the token "was” of the second language (English) is asked.
  • the answer is "is” the span of the sentence in the first language.
  • the correspondence between "is” and “was” corresponds to the corresponding token pair "24-2 25-2 26-2" of the third data in FIG. That is, the cross-language span prediction question answer generation unit 112 generates a pair of span prediction problem (question and context) and an answer in SQuaAD format based on the corresponding token pair of the correct answer.
  • the span prediction unit 122 of the word correspondence execution unit 120 predicts from the first language sentence (question) to the second language sentence (answer) using the cross-language span prediction model. And, the prediction is made in each direction of the prediction from the second language sentence (question) to the first language sentence (answer). Therefore, even when learning the cross-language span prediction model, learning is performed so as to perform bidirectional prediction in this way.
  • the cross-language span prediction problem answer generation unit 112 of the present embodiment includes a set of questions for predicting the span in a second language sentence from each token of the first language for one word correspondence data, and a first language. Convert each token in two languages into a set of questions that predict the span in a sentence in the first language. That is, the cross-language span prediction question answer generation unit 112 uses one word correspondence data as a set of questions consisting of tokens in the first language, each answer (span in a sentence in the second language), and a second language. Convert to a set of questions consisting of each token of the language and each answer (span in the sentence of the first language).
  • the question is defined as having multiple answers. That is, the cross-language span prediction question answer generation unit 112 generates a plurality of answers to the question. Also, if there is no span corresponding to a token, the question is defined as unanswered. That is, the cross-language span prediction problem answer generation unit 112 has no answer to the question.
  • the language of the question is called the source language
  • the language of the context and the answer (span) is called the target language.
  • the original language is English and the target language is Japanese
  • this question is called a question from "English to Japanese (English-to-Japan)".
  • the cross-language span prediction question answer generation unit 112 of the present embodiment is supposed to generate a question with a context.
  • Fig. 7 (b) shows an example of a question with the context of the original language sentence.
  • Question 2 for the token "was” in the original language sentence, which is the question, the two tokens "Yoshimitsu ASHIKAGA” immediately before in the context and the two tokens "the 3rd” immediately after it have a boundary symbol (' ⁇ ". It is added as a boundary marker).
  • the entire original language sentence is used as the context, and the token that becomes the question is sandwiched between the two boundary symbols.
  • the longer the context is added to the question the better. Therefore, in the present embodiment, the entire original language sentence is used as the context of the question as in Question 3.
  • the paragraph symbol (paragraph mark)' ⁇ ' is used as the boundary symbol.
  • This symbol is called pilcrow in English.
  • Pilcrow belongs to the punctuation of the Unicode character category, is included in the vocabulary of the multilingual BERT, and rarely appears in ordinary texts. It is a boundary symbol that divides the context. Any character or character string that satisfies the same properties may be used as the boundary symbol.
  • the word correspondence data includes a lot of null correspondence (null alignment, no correspondence destination). Therefore, in this embodiment, the formulation of SQuaADv2.0 [17] is used.
  • SQuADv1.1 and SQuADV2.0 The difference between SQuADv1.1 and SQuADV2.0 is that it explicitly deals with the possibility that the answer to the question does not exist in context.
  • the token sequence of the original language sentence is used only for the purpose of creating a question, because the handling of tokenization including word division and case is different depending on the word correspondence data. I am going to use it.
  • the cross-language span prediction question answer generation unit 112 converts the word correspondence data into the SQuaAD format, the original text is used for the question and the context, not the token string. That is, the cross-language span prediction problem answer generation unit 112 generates, as an answer, the start position and end position of the span together with the word or word string of the span from the target language sentence (context), but the start position and end position are the same. , It becomes an index to the character position of the original sentence of the target language sentence.
  • the word correspondence method in the conventional technique inputs a token string. That is, in the case of the word correspondence data in FIG. 6, the first two data are often input.
  • the system by inputting both the original text and the token string to the cross-language span prediction question answer generation unit 112, the system can flexibly respond to arbitrary tokenization.
  • the data of the pair of the language cross-language span prediction problem (question and context) and the answer generated by the language cross-language span prediction question answer generation unit 112 is stored in the language cross-language span prediction correct answer data storage unit 113.
  • the span prediction model learning unit 114 learns the cross-language span prediction model using the correct answer data read from the language cross-language span prediction correct answer data storage unit 113. That is, the span prediction model learning unit 114 inputs the cross-language span prediction problem (question and context) into the cross-language span prediction model, and the cross-language span prediction is performed so that the output of the cross-language span prediction model is the correct answer. Adjust the parameters of the model. This learning is performed by the cross-language span prediction from the first language sentence to the second language sentence and the cross-language span prediction from the second language sentence to the first language sentence.
  • the learned cross-language span prediction model is stored in the cross-language span prediction model storage unit 115. Further, the word correspondence execution unit 120 reads out the language cross-language span prediction model from the language cross-language span prediction model storage unit 115 and inputs it to the span prediction unit 122.
  • the span prediction unit 122 of the word correspondence execution unit 120 in the present embodiment uses the cross-language span prediction model learned by the language cross-language span prediction model learning unit 110 from the pair of input sentences. Generate word correspondence. In other words, word correspondence is generated by performing cross-language span prediction for a pair of input sentences.
  • the span prediction unit 122 of the word correspondence execution unit 120 executes the above task using the language cross-language span prediction model learned by the language cross-language span prediction model learning unit 110.
  • a multilingual BERT [5] is used as a cross-language span prediction model.
  • BERT is a language model created for monolingual tasks such as question answering and natural language inference, but it also works very well for cross-language tasks in this embodiment.
  • the language model used in this embodiment is not limited to BERT.
  • a model similar to the model for the SQuaADv2.0 task disclosed in Document [5] is used as the cross-language span prediction model.
  • These models are pre-trained BERTs with two independent output layers that predict start and end positions in context.
  • the probabilities that each position of the target language sentence becomes the start position and the end position of the answer span are defined as start and end , and the target language span y when the original language span x i: j is given.
  • the score ⁇ X ⁇ Y ijkl of k: l is defined as the product of the probability of the start position and the probability of the end position, and maximizing this product ( ⁇ k, ⁇ l) is defined as the best answer span. ..
  • the cross-language span prediction model in the present embodiment and the model for the SQuaADv2.0 task disclosed in Document [5] have basically the same structure as a neural network, but for the SQuaADv2.0 task.
  • the model uses a monolingual pre-learned language model to fine-tune (additional learning / transfer learning / fine-tuning / fine tune) with training data for tasks that predict spans between the same languages.
  • the cross-language span prediction model of the present embodiment uses a pre-trained multilingual model including two languages related to cross-language span prediction, and is a task of predicting a span between two languages. The difference is that the training data is fine-tuned.
  • the cross-language span prediction model of the present embodiment is configured to be able to output the start position and the end position. ing.
  • the input sequence is first tokenized by a tokenizer (eg WordPiece), then the CJK character (Kanji) is in units of one character. Is divided as.
  • a tokenizer eg WordPiece
  • the CJK character Kanji
  • the start position and end position are indexes to the token inside BERT, but in the cross-language span prediction model of this embodiment, these are used as indexes to the character positions. This makes it possible to handle the token (word) of the input text for which word correspondence is requested and the token inside BERT independently.
  • FIG. 8 shows an answer to the token "Yoshimitsu” in the original language sentence (English) as a question from the context of the target language sentence (Japanese) using the cross-language span prediction model of the present embodiment.
  • the processing that predicts the target language (Japanese) span is shown.
  • "Yoshimitsu” is composed of four BERT tokens.
  • "##" (prefix) indicating the connection with the previous vocabulary is added to the BERT token, which is a token inside BERT.
  • the boundaries of the input tokens are shown by dotted lines.
  • the "input token” and the "BERT token” are distinguished.
  • the former is a word delimiter unit in the learning data, and is a unit shown by a broken line in FIG.
  • the latter is the delimiter unit used inside the BERT and is the unit delimited by a space in FIG.
  • the span is predicted in units of tokens inside the BERT, so the predicted span does not necessarily match the boundary of the input token (word). Therefore, in the present embodiment, for the target language span that does not match the token boundary of the target language, such as "Yoshimitsu", the target language that is completely included in the predicted target language span. In this example, words, that is, "Yoshimitsu”, “(", “Ashikaga” "are associated with the original language token (question).
  • This processing is performed only at the time of prediction, and word correspondence is performed. It is performed by the generation unit 123. At the time of learning, learning is performed based on the loss function that compares the first candidate of the span prediction and the correct answer with respect to the start position and the end position.
  • the cross-language span prediction problem generation unit 121 is in the form of "[CLS] question [SEP] context [SEP]" in which a question and a context are concatenated for each of the input first language sentence and second language sentence.
  • a span prediction problem is created for each question (input token (word)) and output to the span prediction unit 122.
  • question is a contextual question that uses ⁇ as a boundary symbol, such as "" Yoshimitsu ASHIKAGA ⁇ was ⁇ the 3rd Seii Taishogun of the Muromachi Shogunate and reigned from 1368 to 1394.
  • a span prediction problem is generated.
  • the span prediction unit 122 calculates the answer (predicted span) and the probability for each question by inputting each question (question and context) generated by the cross-language span prediction problem generation unit 121, and for each question.
  • the answer (predicted span) and the probability are output to the word correspondence generation unit 123.
  • the above probability is the product of the probability of the start position and the probability of the end position in the best answer span.
  • the processing of the word correspondence generation unit 123 will be described below.
  • the target language span is predicted for the original language token, so that the original language and the target language are the same as the model described in reference [1]. It is asymmetric.
  • a method of symmetry of bidirectional prediction is introduced in order to improve the reliability of word correspondence based on span prediction.
  • the word correspondence generation unit 123 averages the probabilities of the best span for each token in two directions, and if this is equal to or more than a predetermined threshold value, it is considered to correspond. This process is executed by the word correspondence generation unit 123 using the output from the span prediction unit 122 (cross-language span prediction model). As explained with reference to FIG. 8, since the predicted span output as an answer does not always match the word delimiter, the word correspondence generation unit 123 arranges the predicted span to correspond to each word in one direction. It also executes the adjustment process. Specifically, the symmetry of word correspondence is as follows.
  • the ⁇ ijkl is the best span y ⁇ k: ⁇ l predicted from x i: j . It is calculated as the average of the probabilities ⁇ X ⁇ Y ij ⁇ k ⁇ l and the probabilities ⁇ Y ⁇ X ⁇ i ⁇ jkl of the best span x ⁇ i: ⁇ j predicted from y k: l .
  • IA (x) is an indicator function.
  • I A (x) is a function that returns x when A is true and 0 otherwise.
  • x i: j and y k: l correspond to each other when ⁇ ijkl is equal to or larger than the threshold value.
  • the threshold value is set to 0.4.
  • 0.4 is an example, and a value other than 0.4 may be used as the threshold value.
  • Bidirectional averaging has the same effect as grow-diag-final in that it is easy to implement and finds a word correspondence that is intermediate between the set sum and the set product. It should be noted that using the average is an example. For example, a weighted average of the probabilities ⁇ X ⁇ Y ij ⁇ k ⁇ l and the probabilities ⁇ Y ⁇ X ⁇ i ⁇ jkl may be used, or the maximum of these may be used.
  • FIG. 9 shows a symmetry of the span prediction (a) from Japanese to English and the span prediction (b) from English to Japanese by bidirectional averaging.
  • the probability of the best span "language” predicted from “language” ⁇ X ⁇ Y ij ⁇ k ⁇ l is 0.8, and the probability of the best span "language” predicted from "language”.
  • ⁇ Y ⁇ X ⁇ i ⁇ jkl is 0.6, and the average is 0.7. Since 0.7 is equal to or higher than the threshold value, it can be determined that "language” and "language” correspond to each other. Therefore, the word correspondence generation unit 123 generates and outputs a word pair of "language” and "language” as one of the results of word correspondence.
  • the word pair "is” and “de” is predicted only from one direction (from English to Japanese), but it is considered to correspond because the bidirectional average probability is equal to or more than the threshold value.
  • the threshold value 0.4 is a threshold value determined by a preliminary experiment in which the learning data corresponding to Japanese and English words, which will be described later, is divided into halves, one of which is training data and the other of which is test data. This value was used in all experiments described below. Since the span prediction in each direction is done independently, it may be necessary to normalize the score for symmetry, but in the experiment, both directions are learned by one model, so normalization is necessary. There wasn't.
  • the word correspondence device 100 described in the present embodiment does not require a large amount of translation data regarding language pairs to which word correspondence is given, and from a smaller amount of teacher data (correct answer data created manually) than before, from the conventional method. It is possible to realize word correspondence with high-precision supervised learning.
  • Zh-En data was obtained from GALE Chinese-English Parallel Aligned Treebank [12], and includes news broadcasting (roadcasting news), news distribution (news were), Web data, and the like.
  • Chinese is used as a character-by-character (character-tokenized) bilingual text, and cleaning is performed by removing correspondence errors and time stamps, and randomly.
  • the training data was divided into 80%, test data 10%, and reserve 10%.
  • KFTT word correspondence data [14] was used as Japanese-English data.
  • Kyoto Free Translation Task (KFTT) http://www.phontron.com/kftt/index.html
  • KFTT word correspondence data is obtained by manually adding word correspondence to a part of KFTT development data and test data, and consists of 8 development data files and 7 test data files. In the experiment of the technique according to the present embodiment, 8 files of development data were used for training, 4 files of the test data were used for the test, and the rest were reserved.
  • the De-En, Ro-En, and En-Fr data are those described in Ref. [27], and the authors have published a script for preprocessing and evaluation (https://github. com / lilt / alignment-scripts). In the prior art [9], these data are used in the experiment.
  • De-En data is described in Ref. [24] (https://www-i6.informatik.rwth-aachen.de/goldAlignment/).
  • Ro-En data and En-Fr data are provided as a common task of HLT-NAACL-2003 workshop on Building and Using Parallel Texts [13] (https://eecs.engin.umich.edu/). ..
  • the En-Fr data is originally described in Ref.
  • the number of sentences in the De-En, Ro-En, and En-Fr data is 508, 248, and 447.
  • 300 sentences were used for training in this embodiment, and for Ro-En, 150 sentences were used for training. The rest of the statement was used for testing.
  • AER alignment error rate
  • the correct word correspondence (gold word indication) created by hand consists of a reliable correspondence (sure, S) and a possible correspondence (possible, P). However, it is S ⁇ P.
  • the precision, accuracy, and AER of the word correspondence A are defined as follows.
  • FIG. 11 shows a comparison between the technique according to the present embodiment and the conventional technique.
  • the technique according to this embodiment is superior to all the prior art for all five data.
  • the technique according to the present embodiment achieves an F1 score of 86.7, which is the current highest accuracy (state-of-the-art) of word correspondence by supervised learning in the document [20]. It is 13.3 points higher than the reported F1 score of 73.4 for DiscAlign. While the method of document [20] uses 4 million sentence pairs of bilingual data for pre-training the translation model, the technique according to the present embodiment requires pre-training of bilingual data. do not. In Ja-En data, this embodiment achieves an F1 score of 77.6, which is 20 points higher than the GIZA ++ F1 score of 57.8.
  • bidirectional averaging (bidi-avg), which is a method of symmetry in the present embodiment, two-way prediction, intersection product, union, grow-diag-final, bidi-avg are shown in FIG.
  • the alignment word correspondence accuracy is greatly influenced by the orthography of the target language. In languages such as Japanese and Chinese where there is no space between words, the (to-English) span prediction accuracy to English is much higher than the (from-English) span prediction accuracy from English. In such cases, grow-diag-final is better than bidi-avg.
  • FIG. 13 shows a change in word correspondence accuracy when the size of the context of the original language word is changed.
  • Ja-En data was used. It turns out that the context of the source language word is very important in predicting the target language span.
  • the F1 score of this embodiment is 59.3, which is slightly higher than the F1 score of 57.6 of GIZA ++.
  • the context of two words before and after is given, it becomes 72.0, and if the whole sentence is given as the context, it becomes 77.6.
  • FIG. 14 shows a learning curve of the word correspondence method of the present embodiment when Zh-En data is used. It goes without saying that the more learning data there is, the higher the accuracy is, but even with less learning data, the accuracy is higher than the conventional supervised learning method.
  • the F1 score 79.6 of the technique according to the present embodiment when the training data is 300 sentences is based on the F1 score 73.4 when the method of the document [20], which is currently the most accurate, learns using 4800 sentences. 6.2 points higher.
  • the problem of seeking word correspondence in two sentences translated into each other is solved by a word in a sentence in another language corresponding to each word in a sentence in one language or a continuous word.
  • a cross-language span predictor supervised learning
  • a neural network from a small number of manually created correct answer data by regarding the column (span) as a set of problems that independently predict (cross-language span prediction). This realizes highly accurate word correspondence.
  • the cross-language span prediction model is created by fine-tuning a pre-trained multilingual model created using only each monolingual text for multiple languages using a small number of manually created correct answer data. .. For language pairs and regions where the amount of available translations is small compared to traditional methods based on machine translation models such as Transformer, which require millions of pairs of translation data for pre-training of the translation model.
  • machine translation models such as Transformer
  • the word correspondence is converted into a general-purpose problem of a cross-language span prediction task in the SQuaADv2.0 format, thereby facilitating a multilingual pre-learned model and state-of-the-art techniques for question answering. It can be incorporated into the system to improve performance.
  • XLM-RoBERTa [2] can be used to create a model with higher accuracy
  • distimBERT [19] can be used to create a compact model that operates with less computer resources.
  • (Appendix 1) With memory With at least one processor connected to the memory Including The processor Using the first language sentence and the second language sentence as inputs, a cross-language span prediction problem between the first language sentence and the second language sentence is generated.
  • a word-corresponding device that predicts the span that will be the answer to the span prediction problem using a cross-language span prediction model created using correct answer data consisting of a cross-language span prediction problem and its answer.
  • the cross-language span prediction model is a model obtained by performing additional learning of a pre-learned multilingual model using the correct answer data consisting of the cross-language span prediction problem and its answer.
  • Word correspondence device (Appendix 3) The processor predicts the span that will be the answer to the span prediction problem.
  • a bidirectional prediction consisting of a span prediction from the first language sentence to the second language sentence and a span prediction from the second language sentence to the first language sentence is executed, or Addendum 1 or 2 to execute one-way prediction consisting only of span prediction from the first language sentence to the second language sentence or only span prediction from the second language sentence to the first language sentence.
  • Described word correspondence device (Appendix 4) The processor predicts the second span by the question of the first span in the span prediction from the first language sentence to the second language sentence, and the span prediction from the second language sentence to the first language sentence. In Appendix 3, it is determined whether or not the word of the first span corresponds to the word of the second span based on the probability of predicting the first span by the question of the second span. Word correspondence device.
  • a word correspondence method that uses a cross-language span prediction model created using correct answer data consisting of a cross-language span prediction problem and its answer, and performs a span prediction step that predicts the span that is the answer to the span prediction problem.
  • Appendix 8 It is a learning method executed by the learning device.
  • a question answer generation step that generates a cross-language span prediction problem and its answer as correct answer data from word correspondence data having a first language sentence, a second language sentence, and word correspondence information.
  • a learning method including a learning step for generating a cross-language span prediction model using the correct answer data.
  • Appendix 9 A program for making a computer function as each part in the word-corresponding device according to any one of the supplementary items 1 to 4.
  • (Appendix 10) A program for making a computer function as each part in the learning device according to the appendix 5 or 6.
  • (Appendix 11) A non-temporary storage medium that stores a program that can be executed by a computer to perform word correspondence processing. The word correspondence process is Using the first language sentence and the second language sentence as inputs, a cross-language span prediction problem between the first language sentence and the second language sentence is generated.
  • (Appendix 12) A non-temporary storage medium that stores a program that can be executed by a computer to perform a learning process.
  • the learning process is From the word correspondence data having the first language sentence, the second language sentence, and the word correspondence information, the span prediction problem across languages and the answer are generated as correct answer data.
  • a non-temporary storage medium that uses the correct answer data to generate a cross-language span prediction model.
  • Word Correspondence Device 110 Language Crossing Span Prediction Model Learning Unit 111 Word Corresponding Correct Answer Data Storage Unit 112 Language Crossing Span Prediction Question Answer Generation Unit 113 Language Crossing Span Prediction Correct Answer Data Storage Unit 114 Span Prediction Model Learning Unit 115 Language Crossing Span Prediction Model Storage Unit 120 Word correspondence execution unit 121 Single language cross-span prediction problem generation unit 122 Span prediction unit 123 Word correspondence generation unit 200 Pre-learning device 210 Multilingual data storage unit 220 Multilingual model learning unit 230 Pre-learned multilingual model storage unit 1000 Drive device 1001 Recording medium 1002 Auxiliary storage device 1003 Memory device 1004 CPU 1005 Interface device 1006 Display device 1007 Input device

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Machine Translation (AREA)

Abstract

第一言語文と第二言語文とを入力とし、前記第一言語文と前記第二言語文との間の言語横断のスパン予測問題を生成する問題生成部と、言語横断のスパン予測問題とその回答からなる正解データを用いて作成した言語横断スパン予測モデルを用いて、前記スパン予測問題の回答となるスパンを予測するスパン予測部とを備える単語対応装置。

Description

単語対応装置、学習装置、単語対応方法、学習方法、及びプログラム
 本発明は、互いに翻訳になっている2文間の単語対応を同定する技術に関連するものである。
 互いに翻訳になっている二つの文において互いに翻訳になっている単語又は単語集合を同定することを単語対応(word alignment)という。
 互いに翻訳になっている二つの文を入力とし、自動的に単語対応を同定する技術には、多言語処理や機械翻訳に関連する様々な応用がある。例えば、ある言語(例えば英語)の文において付与された人名・地名・組織名等の固有表現に関する注釈を、単語対応に基づいて別の言語(例えば日本語)へ翻訳された文へ写像することにより、その言語の固有表現抽出器の学習データを生成することができる。
 従来の単語対応付けは、統計的機械翻訳で用いられた参考文献[1]に記載のモデルに基づいて、対訳データに関する統計情報から互いに翻訳になっている単語対を同定する方法が主流であった。なお、参考文献については、本明細書の最後にまとめて記載している。
Elias Stengel-Eskin, Tzu ray Su, Matt Post, and Benjamin Van Durme. A Discriminative Neural Model for Cross-Lingual Word Alignment. In Proceedings of the EMNLP-IJCNLP-2019, pp.910-920, 2019.
 機械翻訳については、ニューラルネットワークを用いる手法により、統計的な手法に比べて大幅な精度向上を達成している。しかし、単語対応では、ニューラルネットワークを用いる手法による精度は、統計的な手法による精度と同等かわずかに上回る程度しかなかった。
 非特許文献1に開示されている従来のニューラル機械翻訳モデルに基づく教師あり単語対応は、統計的機械翻訳モデルに基づく教師なし単語対応に比べて精度が高い。しかし、統計的機械翻訳モデルに基づく方法も、ニューラル機械翻訳モデルに基づく方法も、翻訳モデルの学習のために大量(数百万文程度)の対訳データを必要とするという問題点があった。
 本発明は上記の点に鑑みてなされたものであり、従来技術よりも少量の教師データから、従来技術よりも高精度な教師あり単語対応を実現することを目的とする。
 開示の技術によれば、第一言語文と第二言語文とを入力とし、前記第一言語文と前記第二言語文との間の言語横断のスパン予測問題を生成する問題生成部と、
 言語横断のスパン予測問題とその回答からなる正解データを用いて作成した言語横断スパン予測モデルを用いて、前記スパン予測問題の回答となるスパンを予測するスパン予測部と
 を備える単語対応装置が提供される。
 開示の技術によれば、従来技術よりも少量の教師データから、従来技術よりも高精度な教師あり単語対応を実現できる。
本発明の実施の形態における装置構成図である。 処理の全体の流れを示すフローチャートである。 言語横断スパン予測モデルを学習する処理を示すフローチャートである。 単語対応の生成処理を示すフローチャートである。 装置のハードウェア構成図である。 単語対応データの例を示す図である。 英語から日本語への質問の例を示す図である。 スパン予測の例を示す図である。 単語対応の対称化の例を示す図である。 実験に使用したデータ数を示す図である。 従来技術と実施形態に係る技術との比較を示す図である。 対称化の効果を示す図である。 原言語単語の文脈の重要性を示す図である。 中英の訓練データの部分集合を用いて訓練した場合の単語対応精度を示す図である。
 以下、図面を参照して本発明の実施の形態(本実施の形態)を説明する。以下で説明する実施の形態は一例に過ぎず、本発明が適用される実施の形態は、以下の実施の形態に限られるわけではない。
 本実施の形態では、互いに翻訳になっている二つの文において単語対応を求める問題を、ある言語の文の各単語に対応する別の言語の文の単語又は連続する単語列(スパン)を予測する問題(言語横断スパン予測)の集合として捉え、人手により作成された少数の正解データからニューラルネットワークを用いて言語横断スパン予測モデルを学習することにより、高精度な単語対応を実現することとしている。具体的には、後述する単語対応装置100が、この単語対応に係る処理を実行する。
 なお、単語対応の応用として、前述した固有表現抽出器の学習データの生成に加えて、例えば、次のようなものがある。
 ある言語(例えば日本語)のWebページを別の言語(例えば英語)へ翻訳する際に、元の言語の文においてHTMLタグ(例えばアンカータグ<a>...</a>)に囲まれた文字列の範囲と意味的に等価な別の言語の文の文字列の範囲を、単語対応に基づいて同定することにより、HTMLタグを正しく写像することができる。
 また、機械翻訳において、対訳辞書等により入力文の特定の語句に対して特定の訳語を指定したい場合、単語対応に基づいて入力文中の語句に対応する出力文の語句を求め、もしその語句が指定された語句でない場合には指定された語句に置き換えることにより、訳語を制御することができる。
 以下では、まず、本実施の形態に係る技術を理解し易くするために、単語対応に関連する種々の参考技術について説明する。その後に、本実施の形態に係る単語対応装置100の構成及び動作を説明する。
 なお、参考技術等に関連する参考文献の番号と文献名を、明細書の最後にまとめて記載した。下記の説明において関連する参考文献の番号を"[1]"等のように示している。
 (参考技術の説明)
  <統計的機械翻訳モデルに基づく教師なし単語対応>
 参考技術として、まず、統計的機械翻訳モデルに基づく教師なし単語対応について説明する。
 統計的機械翻訳[1]では、原言語(翻訳元言語,source language)の文Fから目的言語(翻訳先言語,target language)の文Eへ変換する翻訳モデルP(E|F)を、ベイズの定理を用いて、逆方向の翻訳モデルP(F|E)と目的言語の単語列を生成する言語モデルP(E)の積に分解する。
Figure JPOXMLDOC01-appb-M000001
 統計的機械翻訳では、原言語の文Fの単語と目的言語の文Eの単語の間の単語対応Aに依存して翻訳確率が決まると仮定し、全ての可能な単語対応の和として翻訳モデルを定義する。
Figure JPOXMLDOC01-appb-M000002
 なお、統計的機械翻訳では、実際に翻訳が行われる原言語Fと目的言語Eと、逆方向の翻訳モデルP(F|E)の中の原言語Eと目的言語Fが異なる。このために混乱が生じるので、以後は、翻訳モデルP(Y|X)の入力Xを原言語、出力Yを目的言語と呼ぶことにする。
 原言語文Xを長さ|X|の単語列x1:|X|=x,x,...,x|X|とし、目的言語文Yを長さ|Y|の単語列y1:|Y|=y,y2,...,y|Y|とするとき、目的言語から原言語への単語対応Aをa1:|Y|=a,a,...,a|Y|と定義する。ここでaは、目的言語文の単語yが目的言語文の単語xajに対応することを表す。
 生成的(generative)な単語対応では、ある単語対応Aに基づく翻訳確率を、語彙翻訳確率P(y|...)と単語対応確率P(a|...)の積に分解する。
Figure JPOXMLDOC01-appb-M000003
 例えば、参考文献[1]に記載のモデル2では、まず目的言語文の長さ|Y|を決め、目的語文のj番目の単語が原言語文のa番目の単語へ対応する確率P(a|j,...)は、目的言語文の長さ|Y|、原言語文の長さ|X|に依存すると仮定する。
Figure JPOXMLDOC01-appb-M000004
 参考文献[1]に記載のモデルとして、最も単純なモデル1から最も複雑なモデル5までの順番に複雑になる5つのモデルがある。単語対応において使用されることが多いモデル4は、ある言語の一つの単語が別の言語のいくつの単語に対応するかを表す繁殖数(fertility)や、直前の単語の対応先と現在の単語の対応先の距離を表す歪み(distortion)を考慮する。
 また、HMMに基づく単語対応[25]では、単語対応確率は、目的言語文における直前の単語の単語対応に依存すると仮定する。
Figure JPOXMLDOC01-appb-M000005
 これらの統計的機械翻訳モデルでは、単語対応が付与されていない対訳文対の集合から、EMアルゴリズムを用いて単語対応確率を学習する。すなわち教師なし学習(unsupervised learning)により単語対応モデルを学習する。
 参考文献[1]に記載のモデルに基づく教師なし単語対応ツールとして、GIZA++[16]、MGIZA[8]、FastAlign[6]等がある。GIZA++とMGIZAは参考文献[1]に記載のモデル4に基づいており、FastAlignは参考文献[1]に記載のモデル2に基づいている。
  <再帰ニューラルネットワークに基づく単語対応>
 次に、再帰ニューラルネットワークに基づく単語対応について説明する。ニューラルネットワークに基づく教師なし単語対応の方法として、HMMに基づく単語対応にニューラルネットワークを適用する方法[26,21]と、ニューラル機械翻訳における注意(attention)に基づく方法がある[27,9]。
 HMMに基づく単語対応にニューラルネットワークを適用する方法について、例えば田村ら[21]は、再帰ニューラルネットワーク(Recurrent Neural Network,RNN)を用いることにより、直前の単語対応だけでなく、文頭からの単語対応の履歴a<=a1:j-1を考慮して現在の単語の対応先を決定し、かつ、語彙翻訳確率と単語対応確率を別々にモデル化するのではなく一つのモデルとして単語対応を求める方法を提案している。
Figure JPOXMLDOC01-appb-M000006
 再帰ニューラルネットワークに基づく単語対応は、単語対応モデルを学習するために大量の教師データ(単語対応が付与された対訳文)を必要とする。しかし、一般に人手で作成した単語対応データは大量には存在しない。教師なし単語対応ソフトウェアGIZA++を用いて自動的に単語対応を付与した対訳文を学習データとした場合、再起ニューラルネットワークに基づく単語対応は、GIZA++と同等又はわずかに上回る程度の精度であると報告されている。
  <ニューラル機械翻訳モデルに基づく教師なし単語対応>
 次に、ニューラル機械翻訳モデルに基づく教師なし単語対応について説明する。ニューラル機械翻訳は、エンコーダデコーダモデル(encoder-decoder model,符号器復号器モデル)に基づいて、原言語文から目的言語文への変換を実現する。
 エンコーダ(encoder,符号器)は、ニューラルネットワークを用いた非線形変換を表す関数encにより長さ|X|の原言語文X=x1:|X|=x,...,x|X|を、長さ|X|の内部状態の系列s1:|X|=s,...,s|X|に変換する。各単語に対応する内部状態の次元数をdとすれば、s1:|X|は|X|×dの行列である。
Figure JPOXMLDOC01-appb-M000007
 デコーダ(decoder,復号器)は、エンコーダの出力s1:|X|を入力として、ニューラルネットワークを用いた非線形変換を表す関数decにより目的言語文のj番目の単語yを文頭から一つずつ生成する。
Figure JPOXMLDOC01-appb-M000008
 ここでデコーダが長さ|Y|の目的言語文Y=y1:|Y|=y,...,y|Y|を生成するとき、デコーダの内部状態の系列をt1:|Y|=t,...,t|Y|と表現する。各単語に対応する内部状態の次元数をdとすれば、t1:|Y|は|Y|×dの行列である。
 ニューラル機械翻訳では、注意(attention)機構を導入することにより、翻訳精度が大きく向上した。注意機構は、デコーダにおいて目的言語文の各単語を生成する際に、エンコーダの内部状態に対する重みを変えることで原言語文のどの単語の情報を利用するかを決定する機構である。この注意の値を、二つの単語が互いに翻訳である確率とみなすのが、ニューラル機械翻訳の注意に基づく教師なし単語対応の基本的な考え方である。
 例として、代表的なニューラル機械翻訳モデルであるTransformer[23]における、原言語文と目的言語文の間の注意(source-target attention,原言語目的言語注意)を説明する。Transformerは、自己注意(self-attention)と順伝播型ニューラルネットワーク(feed-forward neural network)を組み合わせてエンコーダやデコーダを並列化したエンコーダデコーダモデルである。Transformerにおける原言語文と目的言語文の間の注意は、自己注意と区別するためにクロス注意(cross attention)と呼ばれる。
 Transformerは注意として縮小付き内積注意(scaled dot-product attention)を用いる。縮小付き内積注意は、クエリQ∈Rlq×dk、キーK∈Rlk×dk、値V∈Rlk×dvに対して次式のように定義される。
Figure JPOXMLDOC01-appb-M000009
 ここでlはクエリの長さ、lはキーの長さ、dはクエリとキーの次元数、dは値の次元数である。
 クロス注意において、Q,K,Vは、W∈Rd×dk,W∈Rd×dk,W∈Rd×dvを重みとして以下のように定義される。
Figure JPOXMLDOC01-appb-M000010
Figure JPOXMLDOC01-appb-M000011
Figure JPOXMLDOC01-appb-M000012
ここでtは、デコーダにおいてj番目の目的言語文の単語を生成する際の内部状態である。また[]は転置行列を表す。
 このときQ=[t1:|Y|として原言語文と目的言語文の間のクロス注意の重み行列A|Y|×|X|を定義する。
Figure JPOXMLDOC01-appb-M000013
Figure JPOXMLDOC01-appb-M000014
 これは目的言語文のj番目の単語yの生成に対して原言語文の単語xが寄与した割合を表すので、目的言語文の各単語yについて原言語文の単語xが対応する確率の分布を表すとみなすことができる。
 一般にTransformerは複数の層(layer)及び複数のヘッド(head,異なる初期値から学習された注意機構)を使用するが、ここでは説明を簡単にするために層及びヘッドの数を1とした。
 Gargらは、上から2番目の層において全てのヘッドのクロス注意を平均したものが単語対応の正解に最も近いと報告し、こうして求めた単語対応分布Gを用いて複数ヘッドのうちの特定の一つのヘッドから求めた単語対応に対して以下のようなクロスエントロピー損失を定義し、
Figure JPOXMLDOC01-appb-M000015
この単語対応の損失と機械翻訳の損失の重み付き線形和を最小化するようなマルチタスク学習(multi-task learning)を提案した[9]。式(15)は、単語対応を、目的言語文の単語に対して原言語文のどの単語が対応しているかを決定する多値分類の問題とみなしていることを表す。
 Gargらの方法は、単語対応の損失を計算する際には式(10)において、文頭からj番目の単語の直前までt1:i-1ではなく、目的言語文全体t1:|Y|を使用する。また単語対応の教師データGとして、Transformerに基づくself-trainingではなく、GIZA++から得られた単語対応を用いる。これらにより、GIZA++を上回る単語対応精度を得られると報告している[9]。
  <ニューラル機械翻訳モデルに基づく教師あり単語対応>
 次に、ニューラル機械翻訳モデルに基づく教師あり単語対応について説明する。原言語文X=x1:|X|と目的言語文Y=y1:|Y|に対して、単語位置の直積集合の部分集合を単語対応Aと定義する。
Figure JPOXMLDOC01-appb-M000016
 単語対応は、原言語文の単語から目的言語文の単語への多対多の離散的な写像と考えることができる。
 識別的(discriminative)な単語対応では、原言語文と目的言語文から単語対応を直接的にモデル化する。
Figure JPOXMLDOC01-appb-M000017
 例えば、Stengel-Eskinらは、ニューラル機械翻訳の内部状態を用いて識別的に単語対応を求める方法を提案した[20]。Stengel-Eskinらの方法では、まずニューラル機械翻訳モデルにおけるエンコーダの内部状態の系列をs,...,s|X|、デコーダの内部状態の系列をt,...,t|Y|とするとき、パラメータを共有する3層の順伝播ニューラルネットワークを用いて、これらを共通のベクトル空間に射影する。
Figure JPOXMLDOC01-appb-M000018
Figure JPOXMLDOC01-appb-M000019
 共通空間に射影された原言語文の単語系列と目的言語の単語系列の行列積を、s′とt′の正規化されていない距離尺度として用いる。
Figure JPOXMLDOC01-appb-M000020
 更に単語対応が前後の単語の文脈に依存するように、3×3のカーネルWconvを用いて畳み込み演算を行って、aijを得る。
Figure JPOXMLDOC01-appb-M000021
 原言語文の単語と目的言語文の単語の全ての組み合わせについて、それぞれの対が対応するか否かを判定する独立した二値分類問題として、二値クロスエントロピー損失を用いる。
Figure JPOXMLDOC01-appb-M000022
ここで^aijは、原言語文の単語xと目的言語文の単語yが正解データにおいて対応しているか否かを表す。なお、本明細書のテキストにおいては、便宜上、文字の頭の上に置かれるべきハット"^"を文字の前に記載している。
Figure JPOXMLDOC01-appb-M000023
 Stengel-Eskinらは、約100万文の対訳データを用いて翻訳モデルを事前に学習した上で、人手で作成した単語対応の正解データ(1,700文から5,000文)を用いることにより、FastAlignを大きく上回る精度を達成できたと報告している。
  <事前訓練済みモデルBERT>
 続いて、事前訓練済みモデルBERTについて説明する。BERT[5]は、Transformerに基づくエンコーダを用いて、入力系列の各単語に対して前後の文脈を考慮した単語埋め込みベクトルを出力する言語表現モデル(language representation model)である。典型的には、入力系列は一つの文、又は、二つの文を、特殊記号を挟んで連結したものである。
 BERTでは、入力系列の中でマスクされた単語を、前方及び後方の双方向から予測する穴埋め言語モデル(masked language model)を学習するタスク、及び、与えられた二つの文が隣接する文であるか否かを判定する次文予測(next sentence prediction)タスクを用いて、大規模な言語データから言語表現モデル(language representation model)を事前学習(pre-train)する。このような事前学習タスクを用いることにより、BERTは、一つの文の内部だけなく二つの文にまたがる言語現象に関する特徴を捉えた単語埋め込みベクトルを出力することができる。なおBERTのような言語表現モデルを単に言語モデル(language model)と呼ぶこともある。
 事前学習されたBERTに適当な出力層を加え、対象とするタスクの学習データで転移学習(finetune,ファインチューン)すると、意味テキスト類似度、自然言語推論(テキスト含意認識)、質問応答、固有表現抽出等様々なタスクで最高精度を達成できることが報告されている。なお、上記のファインチューンとは、事前学習済みのBERTのパラメータを、目的のモデル(BERTに適当な出力層を加えたモデル)の初期値として使用して、目的のモデルの学習を行うことである。
 意味テキスト類似度、自然言語推論、質問応答のような文の対を入力とするタスクでは、'[CLS]第1文[SEP]第2文[SEP]'のように二つの文を、特殊記号を用いて連結した系列をBERTに入力として与える。ここで[CLS]は二つの入力文の情報を集約するベクトルを作成するための特殊なトークンであり、[SEP]は文の区切りを表すトークンである。
 意味テキスト類似度(semantic text similarity,STS)のように入力された二つの文に対して数値(STSでは0から5まで)を出力するタスクでは、[CLS]に対してBERTが出力するベクトルからニューラルネットワークを用いてその数値を予測する。
 自然言語推論(natural language inference,NLI)のように入力された二つの文に対して「含意する(entrailment)」「矛盾する(contradiction)」「中立(neutral)」のように複数のクラスから一つのクラスを選択するタスクでは、[CLS]に対してBERTが出力するベクトルからニューラルネットワークを用いてそのクラスを予測する。
 質問応答(question answering,QA)のように入力された二つの文に対して片方の文に基づいて他方の文のスパンを予測するタスクでは、[CLS]に対してBERTが出力するベクトルから他方の文に抽出すべきスパンが存在するか否かを予測し、他方の文の各単語に対してBERTが出力するベクトルからその単語が抽出すべきスパンの開始点になる確率及びとその単語が抽出すべきスパンの終了点となる確率を予測する。
 BERTはもともと英語を対象として作成されたが、現在では日本語をはじめ様々な言語を対象としたBERTが作成され一般に公開されている。またWikipediaから104言語の単言語データを抽出し、これを用いて作成された汎用多言語モデルmultilingual BERTが一般に公開されている。
 更に対訳文を用いて穴埋め言語モデルにより事前学習した言語横断(cross language)言語モデルXLMが提案され、言語横断テキスト分類等の応用ではmultilingual BERTより精度が高いと報告されており、事前学習済みのモデルが一般に公開されている[3]。
 (課題について)
 参考技術として説明した従来の再帰ニューラルネットワークに基づく単語対応やニューラル機械翻訳モデルに基づく教師なし単語対応では、統計的機械翻訳モデルに基づく教師なし単語対応と同等又は僅かに上回る精度しか達成できていない。
 従来のニューラル機械翻訳モデルに基づく教師あり単語対応は、統計的機械翻訳モデルに基づく教師なし単語対応に比べて精度が高い。しかし、統計的機械翻訳モデルに基づく方法も、ニューラル機械翻訳モデルに基づく方法も、翻訳モデルの学習のために大量(数百万文程度)の対訳データを必要とするという問題点があった。
 以下、上記の問題点を解決した本実施の形態に係る技術を説明する。
 (実施の形態に係る技術の概要)
 本実施の形態では、単語対応を言語横断スパン予測の問題から回答を算出する処理として実現している。まず、少なくとも単語対応を付与する言語対に関するそれぞれの単言語データから学習された事前学習済み多言語モデルを、人手による単語対応の正解から作成された言語横断スパン予測の正解データを用いてファインチューンすることにより、言語横断スパン予測モデルを学習する。次に、学習された言語横断スパン予測モデルを用いて単語対応の処理を実行する。
 上記のような方法により、本実施の形態では、単語対応を実行するためのモデルの事前学習に対訳データを必要とせず、少量の人手により作成された単語対応の正解データから高精度な単語対応を実現することが可能である。以下、本実施の形態に係る技術をより具体的に説明する。
 (装置構成例)
 図1に、本実施の形態における単語対応装置100と事前学習装置200を示す。単語対応装置100は、本発明に係る技術により、単語対応処理を実行する装置である。事前学習装置200は、多言語データから多言語モデルを学習する装置である。
 図1に示すように、単語対応装置100は、言語横断スパン予測モデル学習部110と単語対応実行部120とを有する。
 言語横断スパン予測モデル学習部110は、単語対応正解データ格納部111、言語横断スパン予測問題回答生成部112、言語横断スパン予測正解データ格納部113、スパン予測モデル学習部114、及び言語横断スパン予測モデル格納部115を有する。なお、言語横断スパン予測問題回答生成部112を問題回答生成部と呼んでもよい。
 単語対応実行部120は、言語横断スパン予測問題生成部121、スパン予測部122、単語対応生成部123を有する。なお、言語横断スパン予測問題生成部121を問題生成部と呼んでもよい。
 事前学習装置200は、既存技術に係る装置である。事前学習装置200は、多言語データ格納部210、多言語モデル学習部220、事前学習済み多言語モデル格納部230を有する。多言語モデル学習部220が、少なくとも単語対応を求める対象となる二つの言語の単言語テキストを多言語データ格納部210から読み出すことにより、言語モデルを学習し、当該言語モデルを事前学習済み多言語モデルとして、事前学習済み多言語モデル格納部230に格納する。
 なお、本実施の形態では、何等かの手段で学習された事前学習済みの多言語モデルが言語横断スパン予測モデル学習部110に入力されればよいため、事前学習装置200を備えずに、例えば、一般に公開されている汎用の事前学習済みの多言語モデルを用いることとしてもよい。
 本実施の形態における事前学習済み多言語モデルは、少なくとも単語対応を求める対象となる二つの言語の単言語テキストを用いて事前に訓練された言語モデルである。本実施の形態では、当該言語モデルとして、multilingual BERTを使用するが、それに限定されない。XLM-RoBERTa等、多言語テキストに対して文脈を考慮した単語埋め込みベクトルを出力できる事前学習済み多言語モデルであればどのような言語モデルを使用してもよい。
 なお、単語対応装置100を学習装置と呼んでもよい。また、単語対応装置100は、言語横断スパン予測モデル学習部110を備えずに、単語対応実行部120を備えてもよい。また、言語横断スパン予測モデル学習部110が単独で備えられた装置を学習装置と呼んでもよい。
 (単語対応装置100の動作概要)
 図2は、単語対応装置100の全体動作を示すフローチャートである。S100において、言語横断スパン予測モデル学習部110に、事前学習済み多言語モデルが入力され、言語横断スパン予測モデル学習部110は、事前学習済み多言語モデルに基づいて、言語横断スパン予測モデルを学習する。
 S200において、単語対応実行部120に、S100で学習された言語横断スパン予測モデルが入力され、単語対応実行部120は、言語横断スパン予測モデルを用いて、入力文対(互いに翻訳である二つの文)における単語対応を生成し、出力する。
  <S100>
 図3のフローチャートを参照して、上記のS100における言語横断スパン予測モデルを学習する処理の内容を説明する。ここでは、事前学習済み多言語モデルが既に入力され、スパン予測モデル学習部124の記憶装置に事前学習済み多言語モデルが格納されているとする。また、単語対応正解データ格納部111には、単語対応正解データが格納されている。
 S101において、言語横断スパン予測問題回答生成部112は、単語対応正解データ格納部111から、単語対応正解データを読み出し、読み出した単語対応正解データから言語横断スパン予測正解データを生成し、言語横断スパン予測正解データ格納部113に格納する。言語横断スパン予測正解データは、言語横断スパン予測問題(質問と文脈)とその回答の対の集合からなるデータである。
 S102において、スパン予測モデル学習部114は、言語横断スパン予測正解データ及び事前学習済み多言語モデルから言語横断スパン予測モデルを学習し、学習した言語横断スパン予測モデルを言語横断スパン予測モデル格納部115に格納する。
  <S200>
 次に、図4のフローチャートを参照して、上記のS200における単語対応を生成する処理の内容を説明する。ここでは、スパン予測部122に言語横断スパン予測モデルが既に入力され、スパン予測部122の記憶装置に格納されているものとする。
 S201において、言語横断スパン予測問題生成部121に、第一言語文と第二言語文の対を入力する。S202において、言語横断スパン予測問題生成部121は、入力された文の対から言語横断スパン予測問題(質問と文脈)を生成する。
 次に、S203において、スパン予測部122は、言語横断スパン予測モデルを用いて、S202で生成された言語横断スパン予測問題に対してスパン予測を行って回答を得る。
 S204において、単語対応生成部123は、S203で得られた言語横断スパン予測問題の回答から、単語対応を生成する。S205において、単語対応生成部123は、S204で生成した単語対応を出力する。
 なお、本実施の形態における"モデル"は、ニューラルネットワークのモデルであり、具体的には、重みのパラメータ、関数等からなるものである。
 (ハードウェア構成例)
 本実施の形態における単語対応装置及び学習装置(総称して「装置」と呼ぶ)はいずれも、例えば、コンピュータに、本実施の形態で説明する処理内容を記述したプログラムを実行させることにより実現可能である。なお、この「コンピュータ」は、物理マシンであってもよいし、クラウド上の仮想マシンであってもよい。仮想マシンを使用する場合、ここで説明する「ハードウェア」は仮想的なハードウェアである。
 上記プログラムは、コンピュータが読み取り可能な記録媒体(可搬メモリ等)に記録して、保存したり、配布したりすることが可能である。また、上記プログラムをインターネットや電子メール等、ネットワークを通して提供することも可能である。
 図5は、上記コンピュータのハードウェア構成例を示す図である。図5のコンピュータは、それぞれバスBで相互に接続されているドライブ装置1000、補助記憶装置1002、メモリ装置1003、CPU1004、インタフェース装置1005、表示装置1006、入力装置1007、出力装置1008等を有する。
 当該コンピュータでの処理を実現するプログラムは、例えば、CD-ROM又はメモリカード等の記録媒体1001によって提供される。プログラムを記憶した記録媒体1001がドライブ装置1000にセットされると、プログラムが記録媒体1001からドライブ装置1000を介して補助記憶装置1002にインストールされる。但し、プログラムのインストールは必ずしも記録媒体1001より行う必要はなく、ネットワークを介して他のコンピュータよりダウンロードするようにしてもよい。補助記憶装置1002は、インストールされたプログラムを格納すると共に、必要なファイルやデータ等を格納する。
 メモリ装置1003は、プログラムの起動指示があった場合に、補助記憶装置1002からプログラムを読み出して格納する。CPU1004は、メモリ装置1003に格納されたプログラムに従って、当該装置に係る機能を実現する。インタフェース装置1005は、ネットワークに接続するためのインタフェースとして用いられる。表示装置1006はプログラムによるGUI(Graphical User Interface)等を表示する。入力装置1007はキーボード及びマウス、ボタン、又はタッチパネル等で構成され、様々な操作指示を入力させるために用いられる。出力装置1008は演算結果を出力する。
 (具体的な処理内容の説明)
 以下、本実施の形態における単語対応装置100の処理内容をより具体的に説明する。
  <単語対応からスパン予測への定式化>
 前述したように、本実施の形態では、単語対応の処理を言語横断スパン予測問題の処理として実行することとしている。そこで、まず、単語対応からスパン予測への定式化について、例を用いて説明する。単語対応装置100との関連では、ここでは主に言語横断スパン予測モデル学習部110について説明する。
   ――単語対応データについて――
 図6に、日本語と英語の単語対応データの例を示す。これは一つの単語対応データの例である。図6に示すとおり、一つの単語対応データは、第一言語(日本語)のトークン(単語)列、第二言語(英語)のトークン列、対応するトークン対の列、第一言語の原文、第二言語の原文の5つデータから構成される。
 第一言語(日本語)のトークン列、第二言語(英語)のトークン列はいずれもインデックス付けされている。トークン列の最初の要素(最も左にあるトークン)のインデックスである0から始まり、1、2、3、...のようにインデックス付けされている。
 例えば、3つ目のデータの最初の要素"0-1"は、第一言語の最初の要素"足利"が、第二言語の二番目の要素"ashikaga"に対応することを表す。また、"24-2 25-2 26-2"は、"で"、"あ"、"る"がいずれも"was"に対応することを表す。
 本実施の形態では、単語対応を、SQuAD形式の質問応答タスク[18]と同様の言語横断スパン予測問題として定式化している。
 SQuAD形式の質問応答タスクを行う質問応答システムには、Wikipediaから選択された段落等の「文脈(context)」と「質問(question)」が与えられ、質問応答システムは、文脈の中の「スパン(span,部分文字列)」を「回答(answer)」として予測する。
 上記のスパン予測と同様にして、本実施の形態の単語応答装置100における単語対応実行部120は、目的言語文を文脈と見なし、原言語文の単語を質問と見なして、原言語文の単語の翻訳となっている、目的言語文の中の単語又は単語列を、目的言語文のスパンとして予測する。この予測には、本実施の形態における言語横断スパン予測モデルが用いられる。
   ――言語横断スパン予測問題回答生成部112について――
 本実施の形態では、単語対応装置100の言語横断スパン予測モデル学習部110において言語横断スパン予測モデルの教師あり学習を行うが、学習のためには正解データが必要である。
 本実施の形態では、図5に例示したような単語対応データが複数個、言語横断スパン予測モデル学習部110の単語対応正解データ格納部111に正解データとして格納され、言語横断スパン予測モデルの学習に使用される。
 ただし、言語横断スパン予測モデルは、言語横断で質問から回答(スパン)を予測するモデルであるため、言語横断で質問から回答(スパン)を予測する学習を行うためのデータ生成を行う。具体的には、単語対応データを言語横断スパン予測問題回答生成部112への入力とすることで、言語横断スパン予測問題回答生成部112が、単語対応データから、SQuAD形式の言語横断スパン予測問題(質問)と回答(スパン、部分文字列)の対を生成する。以下、言語横断スパン予測問題回答生成部112の処理の例を説明する。
 図7に、図6に示した単語対応データをSQuAD形式のスパン予測問題に変換する例を示す。
 まず、図7の(a)で示す上半分の部分について説明する。図7における上半分(文脈、質問1、回答の部分)には、単語対応データの第一言語(日本語)の文が文脈として与えられ、第二言語(英語)のトークン"was"が質問1として与えられ、その回答が第一言語の文のスパン"である"であることが示されている。この"である"と"was"との対応は、図6の3つ目のデータの対応トークン対"24-2 25-2 26-2"に相当する。つまり、言語横断スパン予測問題回答生成部112は、正解の対応トークン対に基づいて、SQuAD形式のスパン予測問題(質問と文脈)と回答の対を生成する。
 後述するように、本実施の形態では、単語対応実行部120のスパン予測部122が、言語横断スパン予測モデルを用いて、第一言語文(質問)から第二言語文(回答)への予測と、第二言語文(質問)から第一言語文(回答)への予測のそれぞれの方向についての予測を行う。従って、言語横断スパン予測モデルの学習時にも、このように双方向で予測を行うように学習を行う。
 なお、上記のように双方向で予測を行うことは一例である。第一言語文(質問)から第二言語文(回答)への予測のみ、又は、第二言語文(質問)から第一言語文(回答)への予測のみの片方向だけの予測を行うこととしてもよい。例えば、英語教育等において、英語文と日本語文が同時に表示されていて、英語文の任意の文字列(単語列)をマウス等で選択してその対訳となる日本語文の文字列(単語列)をその場で計算して表示する処理などの場合には、片方向だけの予測でよい。
 そのため、本実施の形態の言語横断スパン予測問題回答生成部112は、一つの単語対応データを、第一言語の各トークンから第二言語の文の中のスパンを予測する質問の集合と、第二言語の各トークンから第一言語の文の中のスパンを予測する質問の集合に変換する。つまり、言語横断スパン予測問題回答生成部112は、一つの単語対応データを、第一言語の各トークンからなる質問の集合及びそれぞれの回答(第二言語の文の中のスパン)と、第二言語の各トークンからなる質問の集合及びそれぞれの回答(第一言語の文の中のスパン)とに変換する。
 もしも一つのトークン(質問)が複数のスパン(回答)に対応する場合は、その質問は複数の回答を持つと定義する。つまり、言語横断スパン予測問題回答生成部112は、その質問に対して複数の回答を生成する。また、もしも、あるトークンに対応するスパンがない場合、その質問は回答がないと定義する。つまり、言語横断スパン予測問題回答生成部112は、その質問に対する回答をなしとする。
 本実施の形態では、質問の言語を原言語(source language)と呼び、文脈と回答(スパン)の言語を目的言語(target language)と呼んでいる。図7に示す例では、原言語は英語であり、目的言語は日本語であり、この質問を「英語から日本語(English-to-Japanese)」への質問と呼ぶ。
 もしも質問が"of"のような高頻度の単語であった場合、原言語文に複数回出現する可能性があるので、原言語文におけるその単語の文脈を考慮しなければ、目的言語文の対応するスパンを見つけることが難しくなる。そこで、本実施の形態の言語横断スパン予測問題回答生成部112は、文脈付きの質問を生成することとしている。
 図7の(b)で示す下半分の部分に、原言語文の文脈付きの質問の例を示す。質問2では、質問である原言語文のトークン"was"に対して、文脈の中の直前の二つのトークン"Yoshimitsu ASHIKAGA"と直後の二つのトークン"the 3rd"が'¶'を境界記号(boundary marker)として付加されている。
 また、質問3では、原言語文全体を文脈として使用し、2つの境界記号で質問となるトークンを挟むようにしている。実験で後述するように、質問に付加される文脈は長ければ長いほどよいので、本実施の形態では、質問3のように原言語文全体を質問の文脈として使用している。
 上記のとおり、本実施の形態では、境界記号として段落記号(paragraph mark)'¶'を使用している。この記号は英語ではピルクロウ(pilcrow)と呼ばれる。ピルクロウは、ユニコード文字カテゴリ(Unicode character category)の句読点(punctuation)に所属し、多言語BERTの語彙の中に含まれ、通常のテキストにはほとんど出現しないことから、本実施の形態において、質問と文脈を分ける境界記号としている。同様の性質を満足する文字又は文字列であれば、境界記号は何を使用してもよい。
 また、単語対応データの中には、空対応(null alignment,対応先がないこと)が多く含まれている。そこで、本実施の形態では、SQuADv2.0[17]の定式化を使用している。SQuADv1.1とSQuADV2.0の違いは、質問に対する回答が文脈の中に存在しない可能性を明示的に扱うことである。
 つまり、SQuADV2.0の形式では、回答できない質問には回答できないことが明示的に示されるため、単語対応データの中の空対応(null alignment,対応先がないこと)に対して、適切に質問と回答(回答できないこと)を生成できる。
 単語対応データに依存して、単語分割を含むトークン化(tokenization)や大文字小文字(casing)の扱いが異なるので、本実施の形態では、原言語文のトークン列は、質問を作成する目的だけに使用することとしている。
 そして、言語横断スパン予測問題回答生成部112が、単語対応データをSQuAD形式に変換する際には、質問と文脈には、トークン列ではなく、原文を使用する。すなわち、言語横断スパン予測問題回答生成部112は、回答として、目的言語文(文脈)からスパンの単語又は単語列とともに、スパンの開始位置と終了位置を生成するが、その開始位置と終了位置は、目的言語文の原文の文字位置へのインデックスとなる。
 なお、従来技術における単語対応手法は、トークン列を入力とする場合が多い。すなわち、図6の単語対応データの例でいえば、最初の2つのデータが入力であることが多い。それに対して本実施の形態では、原文とトークン列の両方を言語横断スパン予測問題回答生成部112への入力とすることにより、任意のトークン化に対して柔軟に対応できるシステムになっている。
 言語横断スパン予測問題回答生成部112により生成された、言語横断スパン予測問題(質問と文脈)と回答の対のデータは、言語横断スパン予測正解データ格納部113に格納される。
  ――スパン予測モデル学習部114について――
 スパン予測モデル学習部114は、言語横断スパン予測正解データ格納部113から読み出した正解データを用いて、言語横断スパン予測モデルの学習を行う。すなわち、スパン予測モデル学習部114は、言語横断スパン予測問題(質問と文脈)を言語横断スパン予測モデルに入力し、言語横断スパン予測モデルの出力が正解の回答になるように、言語横断スパン予測モデルのパラメータを調整する。この学習は、第一言語文から第二言語文への言語横断スパン予測と、第二言語文から第一言語文への言語横断スパン予測のそれぞれで行われる。
 学習された言語横断スパン予測モデルは、言語横断スパン予測モデル格納部115に格納される。また、単語対応実行部120により、言語横断スパン予測モデル格納部115から言語横断スパン予測モデルが読み出され、スパン予測部122に入力される。
 言語横断スパン予測モデルの詳細を以下で説明する。また、単語対応実行部120の処理の詳細も以下で説明する。
  <多言語BERTを用いた言語横断スパン予測>
 既に説明したとおり、本実施の形態における単語対応実行部120のスパン予測部122は、言語横断スパン予測モデル学習部110により学習された言語横断スパン予測モデルを用いて、入力された文の対から単語対応を生成する。つまり、入力された文の対に対して言語横断スパン予測を行うことで、単語対応を生成する。
  ――言語横断スパン予測モデルについて――
 本実施の形態において、言語横断スパン予測のタスクは次のように定義される。
 長さ|X|文字の原言語文X=x...x|X|、及び、長さ|Y|文字の目的言語文Y=y...y|Y|があるとする。原言語文において文字位置iから文字位置jまでの原言語トークンxi:j=x...xに対して、目的言語文において文字位置kから文字位置lまでの目的言語スパンyk:l=y...yを抽出することが言語横断スパン予測のタスクである。
 単語対応実行部120のスパン予測部122は、言語横断スパン予測モデル学習部110により学習された言語横断スパン予測モデルを用いて、上記のタスクを実行する。本実施の形態では、言語横断スパン予測モデルとして多言語BERT[5]を用いている。
 もともとBERTは質問応答や自然言語推論のような単言語タスクのために作成された言語モデルであるが、本実施の形態における言語横断タスクに対しても非常に良く機能する。なお、本実施の形態において使用する言語モデルはBERTに限定されるわけではない。
 より具体的には、本実施の形態においては、一例として、文献[5]に開示されたSQuADv2.0タスク用のモデルと同様のモデルを言語横断スパン予測モデルとして使用している。これらのモデル(SQuADv2.0タスク用のモデル、言語横断スパン予測モデル)は、事前訓練されたBERTに文脈中の開始位置と終了位置を予測する二つの独立した出力層を加えたモデルである。
 言語横断スパン予測モデルにおいて、目的言語文の各位置が回答スパンの開始位置と終了位置になる確率をpstart及びpendとし、原言語スパンxi:jが与えられた際の目的言語スパンyk:lのスコアωX→Y ijklを開始位置の確率と終了位置の確率の積と定義し、この積を最大化する(^k,^l)を最良回答スパン(best answer span)としている。
Figure JPOXMLDOC01-appb-M000024
Figure JPOXMLDOC01-appb-M000025
 SQuADv2.0タスク用のモデル及び言語横断スパン予測モデルのようなBERTのSQuADモデルでは、まず質問と文脈が連結された"[CLS]question[SEP]context[SEP]"という系列を入力とする。ここで[CLS]と[SEP]は、それぞれ分類トークン(classification token)と分割トークン(separator token)と呼ぶ。そして開始位置と終了位置はこの系列に対するインデックスとして予測される。回答が存在しない場合を想定するSQuADv2.0モデルでは、回答が存在しない場合、開始位置と終了位置は[CLS]へのインデックスとなる。
 本実施の形態における言語横断スパン予測モデルと、文献[5]に開示されたSQuADv2.0タスク用のモデルとは、ニューラルネットワークとしての構造は基本的には同じであるが、SQuADv2.0タスク用のモデルは単言語の事前学習済み言語モデルを使用し、同じ言語の間でスパンを予測するようなタスクの学習データでfine-tune(追加学習/転移学習/微調整/ファインチューン)するのに対して、本実施の形態の言語横断スパン予測モデルは、言語横断スパン予測に係る二つの言語を含む事前学習済み多言語モデルを使用し、二つの言語の間でスパンを予測するようなタスクの学習データでfine-tuneする点が異なっている。
 なお、既存のBERTのSQuADモデルの実装では、回答文字列を出力するだけであるが、本実施の形態の言語横断スパン予測モデルは、開始位置と終了位置を出力することができるように構成されている。
 BERTの内部において、つまり、本実施の形態の言語横断スパン予測モデルの内部において、入力系列は最初にトークナイザ(例:WordPiece)によりトークン化され、次にCJK文字(漢字)は一つの文字を単位として分割される。
 既存のBERTのSQuADモデルの実装では、開始位置や終了位置はBERT内部のトークンへのインデックスであるが、本実施の形態の言語横断スパン予測モデルではこれを文字位置へのインデックスとしている。これにより単語対応を求める入力テキストのトークン(単語)とBERT内部のトークンとを独立に扱うことを可能としている。
 図8は、本実施の形態の言語横断スパン予測モデルを用いて、質問となる原言語文(英語)の中のトークン"Yoshimitsu"に対して、目的言語文(日本語)の文脈から、回答となる目的言語(日本語)スパンを予測した処理を示している。図8に示すとおり、"Yoshimitsu"は4つのBERTトークンから構成されている。なお、BERT内部のトークンであるBERTトークンには、前の語彙との繋がりを表す「##」(接頭辞)が追加されている。また、入力トークンの境界は点線で示されている。なお、本実施の形態では、「入力トークン」と「BERTトークン」を区別している。前者は学習データにおける単語区切りの単位であり、図8において破線で示されている単位である。後者はBERTの内部で使用されている区切りの単位であり、図8において空白で区切られている単位である。
 図8に示す例では、回答として、"義満","義満(あしかがよしみつ","足利義満","義満(","義満(あしかがよし"の5つの候補が示され、"義満"が正解である。
 BERTにおいては、BERT内部のトークンを単位としてスパンを予測するので、予測されたスパンは、必ずしも入力のトークン(単語)の境界と一致しない。そこで、本実施の形態では、"義満(あしかがよし"のように目的言語のトークン境界と一致しない目的言語スパンに対しては、予測された目的言語スパンに完全に含まれている目的言語の単語、すなわちこの例では"義満","(","あしかが"を原言語トークン(質問)に対応させる処理を行っている。この処理は、予測時だけに行われるものであり、単語対応生成部123により行われる。学習時には、スパン予測の第1候補と正解を開始位置及び終了位置に関して比較する損失関数に基づく学習が行われる。
  ――言語横断スパン予測問題生成部121、スパン予測部122について――
 言語横断スパン予測問題生成部121は、入力された第一言語文と第二言語文のそれぞれに対し、質問と文脈が連結された"[CLS]question[SEP]context[SEP]"の形式のスパン予測問題を質問(入力トークン(単語))毎に作成し、スパン予測部122へ出力する。ただし、questionは、前述したように、「"Yoshimitsu ASHIKAGA ¶ was ¶ the 3rd Seii Taishogun of the Muromachi Shogunate and reigned from 1368 to1394.」のように、¶を境界記号に使用した文脈付きの質問としている。
 言語横断スパン予測問題生成部121により、第一言語文(質問)から第二言語文(回答)へのスパン予測の問題と、第二言語文(質問)から第一言語文(回答)へのスパン予測の問題が生成される。
 スパン予測部122は、言語横断スパン予測問題生成部121により生成された各問題(質問と文脈)を入力することで、質問毎に回答(予測されたスパン)と確率を算出し、質問毎の回答(予測されたスパン)と確率を単語対応生成部123に出力する。
 なお、上記の確率は、最良回答スパンにおける開始位置の確率と終了位置の確率の積である。単語対応生成部123の処理については以下で説明する。
  <単語対応の対称化>
 本実施の形態の言語横断スパン予測モデルを用いたスパン予測では、原言語トークンに対して目的言語スパンを予測するので、参考文献[1]に記載のモデルと同様に、原言語と目的言語は非対称である。本実施の形態では、スパン予測に基づく単語対応の信頼性を高めるために、双方向の予測を対称化する方法を導入している。
 まず、参考として、単語対応を対称化する従来例を説明する。参考文献[1]に記載のモデルに基づく単語対応を対称化する方法は、文献[16]により最初に提案された。代表的な統計翻訳ツールキットMoses[11]では、集合積(intersection)、集合和(union)、grow-diag-final等のヒューリスティクスが実装され、grow-diag-finalがデフォールトである。二つの単語対応の集合積(共通集合)は、適合率(precision)が高く、再現率(recall)が低い。二つの単語対応の集合和(和集合)は、適合率が低く、再現率が高い。grow-diag-finalは集合積と集合和の中間的な単語対応を求める方法である。
  ――単語対応生成部123について――
 本実施の形態では、単語対応生成部123が、各トークンに対する最良スパンの確率を、二つの方向について平均し、これが予め定めた閾値以上であれば、対応しているとみなす。この処理は、単語対応生成部123が、スパン予測部122(言語横断スパン予測モデル)からの出力を用いて実行する。なお、図8を参照して説明したとおり、回答として出力される予測されたスパンは必ずしも単語区切りと一致しないので、単語対応生成部123は、予測スパンを片方向の単語単位の対応になるよう調整する処理も実行する。単語対応の対称化について、具体的には下記のとおりである。
 文Xにおいて開始位置i、終了位置jのスパンをxi:jとする。文Yにおいて開始位置k、終了位置lのスパンをyk:lとする。トークンxi:jがスパンyk:lを予測する確率をωX→Y ijklとし、トークンyk:lがスパンxi:jを予測する確率をωY→X ijklとする。トークンxi:jとトークンyk:lの対応aijklの確率をωijklとするとき、本実施の形態では、ωijklを、xi:jから予測した最良スパンy^k:^lの確率ωX→Y ij^k^lと、yk:lから予測した最良スパンx^i:^jの確率ωY→X ^i^jklの平均として算出する。
Figure JPOXMLDOC01-appb-M000026
 ここでIA(x)は指標関数(indicator function)である。I(x)は、Aが真のときxを返し、それ以外は0を返す関数である。本実施の形態では、ωijklが閾値以上のときにxi:jとyk:lが対応するとみなす。ここでは閾値を0.4とする。ただし、0.4は例であり、0.4以外の値を閾値として使用してもよい。
 本実施の形態で使用する対称化の方法を双方向平均(bidirectional average,bidi-avg)と呼ぶことにする。双方向平均は、実装が簡単であり、集合和と集合積の中間となる単語対応を求めるという点では、grow-diag-finalと同等の効果がある。なお、平均を用いることは一例である。例えば、確率ωX→Y ij^k^lと確率ωY→X ^i^jklの重み付き平均を用いてもよいし、これらのうちの最大値を用いてもよい。
 図9に、日本語から英語へのスパン予測(a)と英語から日本語へのスパン予測(b)を双方向平均により対称化したもの(c)を示す。
 図9の例において、例えば、"言語"から予測した最良スパン"language"の確率ωX→Y ij^k^lが0.8であり、"language"から予測した最良スパン"言語"の確率ωY→X ^i^jklが0.6であり、その平均が0.7である。0.7は閾値以上であるので、"言語"と"language"は対応すると判断できる。よって、単語対応生成部123は、"言語"と"language"の単語対を、単語対応の結果の1つとして生成し、出力する。
 図9の例において、"is"と"で"という単語対は、片方向(英語から日本語)からしか予測されていないが、双方向平均確率が閾値以上なので対応しているとみなされる。
 閾値0.4は、後述する日本語と英語の単語対応の学習データを半分に分け、片方を訓練データ、もう片方をテストデータとする予備実験により決定した閾値である。後述する全ての実験でこの値を使用した。各方向のスパン予測は独立に行われるので、対称化のためにスコアを正規化する必要が生じる可能性があるが、実験では双方向を一つのモデルで学習しているので正規化の必要はなかった。
  (実施の形態の効果)
 本実施の形態で説明した単語対応装置100により、単語対応を付与する言語対に関する大量の対訳データを必要とせず、従来よりも少量の教師データ(人手により作成された正解データ)から、従来よりも高精度な教師あり単語対応を実現できる。
 (実験について)
 本実施の形態に係る技術を評価するために、単語対応の実験を行ったので、以下、実験方法と実験結果について説明する。
  <実験データについて>
 図10に、中国語-英語(Zh-En)、日本語-英語(Ja-En)、ドイツ語-英語(De-En)、ルーマニア語-英語(Ro-En)、英語-フランス語(En-Fr)の5つの言語対について、人手により作成した単語対応の正解(gold word alignment)の訓練データとテストデータの文数を示す。また、図10の表にはリザーブしておくデータの数も示されている。
 従来技術[20]を用いた実験では、Zh-Enデータを使用し、従来技術[9]の実験では、De-En,Ro-En,En-Frのデータを使用した。本実施の形態の技術に係る実験では、世界で最も遠い(distant)言語対の一つであるJa-Enデータを加えた。
 Zh-Enデータは、GALE Chinese-English Parallel Aligned Treebank[12]から得たもので、ニュース放送(broadcasting news)、ニュース配信(news wire)、Webデータ等を含む。文献[20]に記載されている実験条件にできるだけ近付けるために、中国語が文字単位で分割された(character tokenized)対訳テキストを使用し、対応誤りやタイムスタンプ等を取り除いてクリーニングし、無作為に訓練データ80%,テストデータ10%,リザーブ10%に分割した。
 日本語-英語データとして、KFTT単語対応データ[14]を用いた。Kyoto Free Translation Task (KFTT)(http://www.phontron.com/kftt/index.html)は、京都に関する日本語Wikipediaの記事を人手により翻訳したものであり、44万文の訓練データ、1166文の開発データ、1160文のテストデータから構成される。KFTT単語対応データは、KFTTの開発データとテストデータの一部に対して人手で単語対応を付与したもので、開発データ8ファイルとテストデータ7ファイルからなる。本実施の形態に係る技術の実験では、開発データ8ファイルを訓練に使用し、テストデータのうち4ファイルをテストに使用して、残りはリザーブとした。
 De-En,Ro-En,En-Frデータは、文献[27]に記載されているものである、著者らは前処理と評価のためのスクリプトを公開している(https://github.com/lilt/alignment-scripts)。従来技術[9]では、これらのデータを実験に使用している。De-Enデータは文献[24](https://www-i6.informatik.rwth-aachen.de/goldAlignment/)に記載されている。Ro-EnデータとEn-Frデータは、HLT-NAACL-2003 workshop on Building and Using Parallel Texts[13](https://eecs.engin.umich.edu/)の共通タスクとして提供されたものである。En-Frデータは、もともと文献[15]に記載されている。De-En,Ro-En,En-Frデータの文数は508,248,447である。De-EnとEn-Frについて、本実施の形態では300文を訓練に使用し、Ro-Enについては150 文を訓練に使用した。残りの文はテストに使用した。
  <単語対応の精度の評価尺度>
 単語対応の評価尺度として、本実施の形態では、適合率(precision)と再現率(recall)に対して等しい重みをもつF1スコアを用いる。
Figure JPOXMLDOC01-appb-M000027
 一部の従来研究はAER(alignment error rate,単語誤り率)[16]しか報告していないので、従来技術と本実施の形態に係る技術との比較のためにAERも使用する。
 人手で作成した正解単語対応(gold word alignment)が確実な対応(sure,S)と可能な対応(possible,P)から構成されるとする。ただしS⊆Pである。単語対応Aの適合率(precision)、再現率(recall)、AERを以下のように定義する。
Figure JPOXMLDOC01-appb-M000028
Figure JPOXMLDOC01-appb-M000029
Figure JPOXMLDOC01-appb-M000030
 文献[7]では、AERは適合率を重視し過ぎるので欠陥があると指摘している。つまり、システムにとって確信度が高い少数の対応点だけを出力すると、不当に小さい(=良い)値を出すことができる。従って、本来、AERは使用すべきではない。しかし、従来手法では、文献[9]がAERを使用している。もしも、sureとpossibleの区別をすると、再現率と適合率は、sureとpossibleの区別をしない場合と異なることに注意が必要である。5つのデータのうち、De-EnとEn-Frにはsure とpossibleの区別がある。
  <単語対応の精度の比較>
 図11に、本実施の形態に係る技術と従来技術との比較を示す。5つの全てのデータについて本実施の形態に係る技術は全ての従来技術よりも優れている。
 例えばZh-Enデータでは、本実施の形態に係る技術はF1スコア86.7を達成し、教師あり学習による単語対応の現在最高精度(state-of-the-art)である文献[20]に報告されているDiscAlignのF1スコア73.4より13.3ポイント高い。文献[20]の方法は、翻訳モデルを事前訓練するために4百万文対の対訳データを使用しているのに対して、本実施の形態に係る技術では事前訓練に対訳データを必要としない。Ja-Enデータでは、本実施の形態はF1スコア77.6を達成し、これはGIZA++のF1スコア57.8より20ポイント高い。
 De-EN,Ro-EN,En-Frデータについては、教師なし学習による単語対応の現在最高精度を達成している文献[9]の方法がAERのみを報告しているので、本実施の形態でもAERで評価する。比較のために同じデータに対するMGIZAのAERや従来の他の手法のAERも記載する[22,10]。
 実験に際して、De-Enデータはsureとpossibleの両方の単語対応点を本実施の形態の学習に使用したが、En-Frデータはとても雑音が多いのでsureだけを使用した。De-En,Ro-En,En-Frデータに対する本実施の形態のAERは、11.4,12.2,4.0であり、文献[9]の方法より明らかに低い。
 教師あり学習の精度と教師なし学習の精度の精度を比較することは、機械学習の評価としては明らかに不公平である。もともと評価用に人手で作成された正解データよりも少ない量の正解データ(150文から300文程度)を使って、従来報告されている最高精度を上回る精度を達成できることができるので、教師あり単語対応は高い精度を得るための実用的な方法であることを示すことがこの実験の目的である。
  <対称化の効果>
 本実施の形態における対称化の方法である双方向平均(bidi-avg)の有効性を示すために、図12に二方向の予測、集合積、集合和、grow-diag-final,bidi-avgの単語対応精度を示す。alignment単語対応精度は目的言語の正書法に大きく影響される。日本語や中国語のように単語と単語の間にスペースを入れない言語では、英語への(to-English)スパン予測精度は、英語からの(from-English)スパン予測精度より大きく高い。このような場合、grow-diag-finalの方がbidi-avgより良い。一方、ドイツ語、ルーマニア語、フランス語のように単語間にスペースを入れる言語では、英語へのスパン予測と英語からのスパン予測に大きな違いはなく、bidi-avgよりgrow-diag-finalの方がよい。En-Frデータでは集合積が、一番精度が高いが、これはもともとデータに雑音が多いためであると思われる。
  <原言語文脈の重要性>
 図13に、原言語単語の文脈の大きさを変えた際の単語対応精度の変化を示す。ここではJa-Enデータを使用した。原言語単語の文脈は目的言語スパンの予測に非常に重要であることがわかる。
 文脈がない場合、本実施の形態のF1スコアは59.3であり、GIZA++のF1スコア57.6よりわずかに高い程度である。しかし前後2単語の文脈を与えるだけで72.0になり、文全体を文脈として与えると77.6になる。
  <学習曲線>
 図14に、Zh-Enデータを使った場合における本実施の形態の単語対応手法の学習曲線を示す。学習データが多ければ多いほど精度が高いのは当然であるが、少ない学習データでも従来の教師あり学習手法より精度が高い。学習データが300文の際の本実施の形態に係る技術のF1スコア79.6は、現在最高精度である文献[20]の手法が4800文を使って学習した際のF1スコア73.4より6.2ポイント高い。
 (実施の形態のまとめ)
 以上説明したように、本実施の形態では、互いに翻訳になっている二つの文において単語対応を求める問題を、ある言語の文の各単語に対応する別の言語の文の単語又は連続する単語列(スパン)を独立に予測する問題(言語横断スパン予測)の集合として捉え、人手により作成された少数の正解データからニューラルネットワークを用いて言語横断スパン予測器を学習(教師あり学習)することにより、高精度な単語対応を実現している。
 言語横断スパン予測モデルは、複数の言語についてそれぞれの単言語テキストだけを使って作成された事前学習済み多言語モデルを、人手により作成された少数の正解データを用いてファインチューニングすることにより作成する。Transformer等の機械翻訳モデルをベースとする従来手法が翻訳モデルの事前学習に数百万文対の対訳データを必要とするのと比較すると、利用できる対訳文の量が少ない言語対や領域に対しても本実施の形態に係る技術を適用することができる。
 本実施の形態では、人手により作成された正解データが300文程度あれば、従来の教師あり学習や教師なし学習を上回る単語対応精度を達成することができる。文献[20]によれば、300文程度の正解データは数時間で作成することができるので、本実施の形態により、現実的なコストで高い精度の単語対応を得ることができる。
 また、本実施の形態では、単語対応を、SQuADv2.0形式の言語横断スパン予測タスクという汎用的な問題に変換したことにより、多言語の事前学習済みモデルや質問応答に関する最先端の技術を容易に取り入れて性能向上を図ることができる。例えば、より高い精度のモデルを作るためにXLM-RoBERTa[2]を用いたり、より少ない計算機資源で動くコンパクトなモデルを作るためにdistilmBERT[19]を使うことが可能である。
 (付記)
 本明細書には、少なくとも下記付記各項の単語対応装置、学習装置、単語対応方法、プログラム、及び記憶媒体が開示されている。なお、下記の付記項1、7、11の「言語横断のスパン予測問題とその回答からなる正解データを用いて作成した言語横断スパン予測モデルを用いて、前記スパン予測問題の回答となるスパンを予測する」について、「言語横断のスパン予測問題とその回答からなる」は「正解データ」に係り、「....正解データを用いて作成した」は「言語横断スパン予測モデル」に係る。
(付記項1)
 メモリと、
 前記メモリに接続された少なくとも1つのプロセッサと、
 を含み、
 前記プロセッサは、
 第一言語文と第二言語文とを入力とし、前記第一言語文と前記第二言語文との間の言語横断のスパン予測問題を生成し、
 言語横断のスパン予測問題とその回答からなる正解データを用いて作成した言語横断スパン予測モデルを用いて、前記スパン予測問題の回答となるスパンを予測する
 単語対応装置。
(付記項2)
 前記言語横断スパン予測モデルは、前記言語横断のスパン予測問題とその回答からなる前記正解データを用いて事前学習済み多言語モデルの追加学習を行うことにより得られたモデルである
 付記項1に記載の単語対応装置。
(付記項3)
 前記プロセッサは、前記スパン予測問題の回答となるスパンを予測する際に、
 前記第一言語文から前記第二言語文へのスパン予測と、前記第二言語文から前記第一言語文へのスパン予測とからなる双方向の予測を実行する、又は、
 前記第一言語文から前記第二言語文へのスパン予測のみ、あるいは、前記第二言語文から前記第一言語文へのスパン予測のみからなる片方向の予測を実行する
 付記項1又は2に記載の単語対応装置。
(付記項4)
 前記プロセッサは、前記第一言語文から前記第二言語文へのスパン予測における第一スパンの質問により第二スパンを予測する確率と、前記第二言語文から前記第一言語文へのスパン予測における、前記第二スパンの質問により前記第一スパンを予測する確率とに基づいて、前記第一スパンの単語と前記第二スパンの単語とが対応するか否かを判断する
 付記項3に記載の単語対応装置。
(付記項5)
 メモリと、
 前記メモリに接続された少なくとも1つのプロセッサと、
 を含み、
 前記プロセッサは、
 第一言語文と第二言語文と単語対応情報とを有する単語対応データから、言語横断のスパン予測問題とその回答とを正解データとして生成し、
 前記正解データを用いて、言語横断スパン予測モデルを生成する
 学習装置。
(付記項6)
 前記スパン予測問題は、質問と文脈とを有し、前記質問は、当該質問の言語の文脈が境界記号を介して付された文脈付き質問である
 付記項5に記載の学習装置。
(付記項7)
 コンピュータが、
 第一言語文と第二言語文とを入力とし、前記第一言語文と前記第二言語文との間の言語横断のスパン予測問題を生成する問題生成ステップと、
 言語横断のスパン予測問題とその回答からなる正解データを用いて作成した言語横断スパン予測モデルを用いて、前記スパン予測問題の回答となるスパンを予測するスパン予測ステップと
 を行う単語対応方法。
(付記項8)
 学習装置が実行する学習方法であって、
 第一言語文と第二言語文と単語対応情報とを有する単語対応データから、言語横断のスパン予測問題とその回答とを正解データとして生成する問題回答生成ステップと、
 前記正解データを用いて、言語横断スパン予測モデルを生成する学習ステップと
 を備える学習方法。
(付記項9)
 コンピュータを、付記項1ないし4のうちいずれか1項に記載の単語対応装置における各部として機能させるためのプログラム。
(付記項10)
 コンピュータを、付記項5又は6に記載の学習装置における各部として機能させるためのプログラム。
(付記項11)
 単語対応処理を実行するようにコンピュータによって実行可能なプログラムを記憶した非一時的記憶媒体であって、
 前記単語対応処理は、
 第一言語文と第二言語文とを入力とし、前記第一言語文と前記第二言語文との間の言語横断のスパン予測問題を生成し、
 言語横断のスパン予測問題とその回答からなる正解データを用いて作成した言語横断スパン予測モデルを用いて、前記スパン予測問題の回答となるスパンを予測する
 非一時的記憶媒体。
(付記項12)
 学習処理を実行するようにコンピュータによって実行可能なプログラムを記憶した非一時的記憶媒体であって、
 前記学習処理は、
 第一言語文と第二言語文と単語対応情報とを有する単語対応データから、言語横断のスパン予測問題とその回答とを正解データとして生成し、
 前記正解データを用いて、言語横断スパン予測モデルを生成する
 非一時的記憶媒体。
 以上、本実施の形態について説明したが、本発明はかかる特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。
 (参考文献)
[1] Peter F. Brown, Stephen A. Della Pietra, Vincent J. Della Pietra, and Robert L. Mercer. The Mathematics of Statistical Machine Translation: Parameter Estimation. Computational Linguistics,Vol. 19, No. 2, pp. 263-311, 1993.
[2] Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzm´an, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. Unsupervised Cross-lingual Representation Learning at Scale. arXiv:1911.02116, 2019.
[3] Alexis Conneau and Guillaume Lample. Cross-lingual Language Model Pretraining. In Proceedings of NeurIPS-2019, pp. 7059-7069, 2019.
[4] John DeNero and Dan Klein. The Complexity of Phrase Alignment Problems. In Proceedings of the ACL-2008, pp. 25-28, 2008.
[5] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the NAACL-2019, pp. 4171-4186, 2019.
[6] Chris Dyer, Victor Chahuneau, and Noah A. Smith. A Simple, Fast, and Effective Reparameterization of IBM Model 2. In Proceedings of the NAACL-HLT-2013, pp. 644-648, 2013.
[7] Alexander Fraser and Daniel Marcu. MeasuringWord Alignment Quality for Statistical Machine Translation. Computational Linguistics, Vol. 33, No. 3, pp. 293-303, 2007.
[8] Qin Gao and Stephan Vogel. Parallel Implementations of Word Alignment Tool. In Proceedings of ACL 2008 workshop on Software Engineering, Testing, and Quality Assurance for Natural Language Processing, pp. 49-57, 2008.
[9] Sarthak Garg, Stephan Peitz, Udhyakumar Nallasamy, and Matthias Paulik. Jointly Learning to Align and Translate with Transformer Models. In Proceedings of the EMNLP-IJCNLP-2019, pp.4452-4461, 2019.
[10] Aria Haghighi, John Blitzer, John DeNero, and Dan Klein. Better Word Alignments with Supervised ITG Models. In Proceedings of the ACL-2009, pp. 923-931, 2009.
[11] Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, Chris Dyer, Ondrej Bojar, Alexandra Constantin, and Evan Herbst. Moses: Open Source Toolkit for Statistical Machine Translation. In Proceedings of the ACL-2007, pp. 177-180, 2007.
[12] Xuansong Li, Stephen Grimes, Stephanie Strassel, Xiaoyi Ma, Nianwen Xue, Mitch Marcus, and Ann Taylor. GALE Chinese-English Parallel Aligned Treebank - Training. Web Download, 2015. LDC2015T06.
[13] Rada Mihalcea and Ted Pedersen. An Evaluation Exercise for Word Alignment. In Proceedings of the HLT-NAACL 2003 Workshop on Building and Using Parallel Texts: Data Driven Machine Translation and Beyond, pp. 1-10, 2003.
[14] Graham Neubig. Kyoto Free Translation Task alignment data package. http://www.phontron.com/kftt/, 2011.
[15] Franz Josef Och and Hermann Ney. Improved Statistical Alignment Models. In Proceedings of ACL-2000, pp. 440-447, 2000.
[16] Franz Josef Och and Hermann Ney. A Systematic Comparison of Various Statistical Alignment Models. Computational Linguistics, Vol. 29, No. 1, pp. 19-51, 2003.
[17] Pranav Rajpurkar, Robin Jia, and Percy Liang. Know What You Don't Know: Unanswerable Questions for SQuAD. In Proceedings of the ACL-2018, pp. 784-789, 2018.
[18] Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: 100,000+ Questions for Machine Comprehension of Text. In Proceedings of EMNLP-2016, pp. 2383-2392, 2016.
[19] Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. arXiv:1910.01108, 2019.
[20] Elias Stengel-Eskin, Tzu ray Su, Matt Post, and Benjamin Van Durme. A Discriminative Neural Model for Cross-Lingual Word Alignment. In Proceedings of the EMNLP-IJCNLP-2019, pp. 910-920, 2019.
[21] Akihiro Tamura, Taro Watanabe, and Eiichiro Sumita. Recurrent Neural Networks for Word Alignment Model. In Proceedings of the ACL-2014, pp. 1470-1480, 2014.
[22] Ben Taskar, Simon Lacoste-Julien, and Dan Klein. A Discriminative Matching Approach to Word Alignment. In Proceedings of the HLT-EMNLP-2005, pp. 73-80, 2005.
[23] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention Is All You Need. In Proceedings of the NIPS 2017, pp. 5998-6008, 2017.
[24] David Vilar, Maja Popovi´c, and Hermann Ney. AER: Do we need to "improve" our alignments? In Proceedings of IWSLT-2006, pp. 2005-212, 2006.
[25] Stephan Vogel, Hermann Ney, and Christoph Tillmann. HMM-Based Word Alignment in Statistical Translation. In Proceedings of COLING-1996, 1996.
[26] Nan Yang, Shujie Liu, Mu Li, Ming Zhou, and Nenghai Yu. Word Alignment Modeling with Context Dependent Deep Neural Network. In Proceedings of the ACL-2013, pp. 166-175, 2013.
[27] Thomas Zenkel, Joern Wuebker, and John DeNero. Adding Interpretable Attention to Neural Translation Models Improves Word Alignment. arXiv:1901.11359, 2019.
100 単語対応装置
110 言語横断スパン予測モデル学習部
111 単語対応正解データ格納部
112 言語横断スパン予測問題回答生成部
113 言語横断スパン予測正解データ格納部
114 スパン予測モデル学習部
115 言語横断スパン予測モデル格納部
120 単語対応実行部
121 単言語横断スパン予測問題生成部
122 スパン予測部
123 単語対応生成部
200 事前学習装置
210 多言語データ格納部
220 多言語モデル学習部
230 事前学習済み多言語モデル格納部
1000 ドライブ装置
1001 記録媒体
1002 補助記憶装置
1003 メモリ装置
1004 CPU
1005 インタフェース装置
1006 表示装置
1007 入力装置

Claims (9)

  1.  第一言語文と第二言語文とを入力とし、前記第一言語文と前記第二言語文との間の言語横断のスパン予測問題を生成する問題生成部と、
     言語横断のスパン予測問題とその回答からなる正解データを用いて作成した言語横断スパン予測モデルを用いて、前記スパン予測問題の回答となるスパンを予測するスパン予測部と
     を備える単語対応装置。
  2.  前記言語横断スパン予測モデルは、前記言語横断のスパン予測問題とその回答からなる前記正解データを用いて事前学習済み多言語モデルの追加学習を行うことにより得られたモデルである
     請求項1に記載の単語対応装置。
  3.  前記スパン予測部は、
     前記第一言語文から前記第二言語文へのスパン予測と、前記第二言語文から前記第一言語文へのスパン予測とからなる双方向の予測を実行する、又は、
     前記第一言語文から前記第二言語文へのスパン予測のみ、あるいは、前記第二言語文から前記第一言語文へのスパン予測のみからなる片方向の予測を実行する
     請求項1又は2に記載の単語対応装置。
  4.  前記第一言語文から前記第二言語文へのスパン予測における第一スパンの質問により第二スパンを予測する確率と、前記第二言語文から前記第一言語文へのスパン予測における、前記第二スパンの質問により前記第一スパンを予測する確率とに基づいて、前記第一スパンの単語と前記第二スパンの単語とが対応するか否かを判断する単語対応生成部
     を備える請求項3に記載の単語対応装置。
  5.  第一言語文と第二言語文と単語対応情報とを有する単語対応データから、言語横断のスパン予測問題とその回答とを正解データとして生成する問題回答生成部と、
     前記正解データを用いて、言語横断スパン予測モデルを生成する学習部と
     を備える学習装置。
  6.  前記スパン予測問題は、質問と文脈とを有し、前記質問は、当該質問の言語の文脈が境界記号を介して付された文脈付き質問である
     請求項5に記載の学習装置。
  7.  単語対応装置が実行する単語対応方法であって、
     第一言語文と第二言語文とを入力とし、前記第一言語文と前記第二言語文との間の言語横断のスパン予測問題を生成する問題生成ステップと、
     言語横断のスパン予測問題とその回答からなる正解データを用いて作成した言語横断スパン予測モデルを用いて、前記スパン予測問題の回答となるスパンを予測するスパン予測ステップと
     を備える単語対応方法。
  8.  学習装置が実行する学習方法であって、
     第一言語文と第二言語文と単語対応情報とを有する単語対応データから、言語横断のスパン予測問題とその回答とを正解データとして生成する問題回答生成ステップと、
     前記正解データを用いて、言語横断スパン予測モデルを生成する学習ステップと
     を備える学習方法。
  9.  コンピュータを、請求項1ないし4のうちいずれか1項に記載の単語対応装置における各部として機能させるためのプログラム、又は、コンピュータを、請求項5又は6に記載の学習装置における各部として機能させるためのプログラム。
PCT/JP2020/038837 2020-10-14 2020-10-14 単語対応装置、学習装置、単語対応方法、学習方法、及びプログラム WO2022079845A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/JP2020/038837 WO2022079845A1 (ja) 2020-10-14 2020-10-14 単語対応装置、学習装置、単語対応方法、学習方法、及びプログラム
US18/246,796 US20230367977A1 (en) 2020-10-14 2020-10-14 Word alignment apparatus, learning apparatus, word alignment method, learning method and program
JP2022556765A JPWO2022079845A1 (ja) 2020-10-14 2020-10-14

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2020/038837 WO2022079845A1 (ja) 2020-10-14 2020-10-14 単語対応装置、学習装置、単語対応方法、学習方法、及びプログラム

Publications (1)

Publication Number Publication Date
WO2022079845A1 true WO2022079845A1 (ja) 2022-04-21

Family

ID=81208975

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2020/038837 WO2022079845A1 (ja) 2020-10-14 2020-10-14 単語対応装置、学習装置、単語対応方法、学習方法、及びプログラム

Country Status (3)

Country Link
US (1) US20230367977A1 (ja)
JP (1) JPWO2022079845A1 (ja)
WO (1) WO2022079845A1 (ja)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015170168A (ja) * 2014-03-07 2015-09-28 国立研究開発法人情報通信研究機構 単語アライメントスコア算出装置、単語アライメント装置、及びコンピュータプログラム
US20200175015A1 (en) * 2018-11-29 2020-06-04 Koninklijke Philips N.V. Crf-based span prediction for fine machine learning comprehension

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015170168A (ja) * 2014-03-07 2015-09-28 国立研究開発法人情報通信研究機構 単語アライメントスコア算出装置、単語アライメント装置、及びコンピュータプログラム
US20200175015A1 (en) * 2018-11-29 2020-06-04 Koninklijke Philips N.V. Crf-based span prediction for fine machine learning comprehension

Also Published As

Publication number Publication date
US20230367977A1 (en) 2023-11-16
JPWO2022079845A1 (ja) 2022-04-21

Similar Documents

Publication Publication Date Title
Tabassum et al. Code and named entity recognition in stackoverflow
Roark et al. Processing South Asian languages written in the Latin script: the Dakshina dataset
US20050216253A1 (en) System and method for reverse transliteration using statistical alignment
Harish et al. A comprehensive survey on Indian regional language processing
Masmoudi et al. Transliteration of Arabizi into Arabic script for Tunisian dialect
Younes et al. Romanized tunisian dialect transliteration using sequence labelling techniques
Anbukkarasi et al. Neural network-based error handler in natural language processing
Sitender et al. Sanskrit to universal networking language EnConverter system based on deep learning and context-free grammar
Chakrawarti et al. Machine translation model for effective translation of Hindi poetries into English
Sharma et al. Word prediction system for text entry in Hindi
Jamro Sindhi language processing: A survey
WO2022113306A1 (ja) 対応装置、学習装置、対応方法、学習方法、及びプログラム
Das et al. Multilingual Neural Machine Translation System for Indic to Indic Languages
Park et al. Simple and effective neural coreference resolution for Korean language
WO2022079845A1 (ja) 単語対応装置、学習装置、単語対応方法、学習方法、及びプログラム
Hwang et al. Linear‐time Korean morphological analysis using an action‐based local monotonic attention mechanism
Yadav et al. Different Models of Transliteration-A Comprehensive Review
Shibli et al. Automatic back transliteration of romanized bengali (banglish) to bengali
Sowmya Lakshmi et al. Automatic English to Kannada back-transliteration using combination-based approach
Kaur et al. Roman to gurmukhi social media text normalization
Muzaffar et al. A Qualitative Evaluation of Google’s Translate: A Comparative Analysis of English-Urdu Phrase-based Statistical Machine Translation (PBSMT) and Neural Machine Translation (NMT) Systems
De Silva Singlish to sinhala converter using machine learning
Dalai et al. Deep Learning-based POS Tagger and Chunker for Odia Language Using Pre-trained Transformers
Angle et al. Kannada morpheme segmentation using machine learning
Gakis et al. Construction of a Modern Greek grammar checker through Mnemosyne formalism

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20957674

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022556765

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20957674

Country of ref document: EP

Kind code of ref document: A1