Inference device, learning device, inference method, method for generating trained model, inference program, and learning program

JPWO2024236749A5Active Publication Date: 2025-04-22MITSUBISHI ELECTRIC CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2025503169
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-04-22
Estimated Expiration
2043-05-17

AI Technical Summary

Technical Problem

Language models trained with randomly collected data often fail to understand human concepts like race, gender, and culture, leading to the generation of ethically inappropriate sentences.

Method used

An inference device that uses a mask data acquisition unit, word string acquisition unit, and control information acquisition unit to infer candidate words based on a trained model, ensuring ethically appropriate sentence generation by replacing masked portions with contextually relevant words.

Benefits of technology

The solution enables the generation of ethically appropriate sentences by accurately inferring candidate words based on control words and context, improving the understanding of human concepts in language models.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The purpose of the present disclosure is to obtain an inference device that generates an ethically appropriate sentence. An inference device according to the present disclosure comprises: a mask data acquisition unit that acquires a character string including a mask portion; a word string acquisition unit that divides the character string for each word and acquires a word string composed of a plurality of words; a control information acquisition unit that acquires, as a control word, an adjective expression representing the nature or state of a thing; and an inference unit that infers a candidate word for the mask portion from the control word and the word string, and that outputs a character string in which the mask portion and the candidate word are swapped.
Need to check novelty before this filing date? Find Prior Art

Description

Inference device, learning device, inference method, trained model generation method, inference program, and learning program

[0001] The present disclosure relates to an inference device, a learning device, an inference method, a method for generating a trained model, an inference program, and a learning program.

[0002] In recent years, language models using AI (Artificial Intelligence) have achieved significant improvements in accuracy. For example, Patent Document 1 proposes a language model using an attention-based sequence-to-sequence network.

[0003] Patent No. 6884871

[0004] However, training a language model requires a large amount of text data, and if training is performed using randomly collected data, the language model may reflect human discriminatory feelings toward race, gender, ethnicity, culture, etc., and an inference device using such a language model may generate ethically inappropriate sentences.

[0005] The present disclosure has been made to solve the above-mentioned problems, and aims to provide an inference device that generates ethically appropriate sentences.

[0006] The inference device according to the present disclosure includes a mask data acquisition unit that acquires a character string including a mask portion, a word string acquisition unit that divides the character string into words and acquires a word string consisting of a plurality of words, a control information acquisition unit that acquires an adjective that expresses the nature or state of a thing as a control word, and an inference unit that infers a candidate word for the mask portion from the control word and the word string, and outputs a character string in which the mask portion and the candidate word are swapped.

[0007] The inference device according to the present disclosure includes a control information acquisition unit that acquires, as control words, adjectives that express the properties or states of things, and an inference unit that infers candidate words for the masked portion from the control words and word strings, and outputs a string in which the masked portion and the candidate words are swapped. Therefore, by inferring candidate words based on the control words, it is possible to generate ethically appropriate sentences.

[0008] FIG. 1 is a configuration diagram showing the configuration of a language processing system 10 according to the first embodiment. FIG. 1 is a configuration diagram showing the configuration of a learning device 100 according to the first embodiment. FIG. 2 is a conceptual diagram showing a specific example of processing by a morphological analysis unit 121 according to the first embodiment. FIG. 3 is a conceptual diagram showing a specific example of processing by a lexicalization unit 122 according to the first embodiment. FIG. 4 is a conceptual diagram showing an example of a word string. FIG. 5 is a conceptual diagram showing an example of a trained model. FIG. 6 is a conceptual diagram showing a specific example of adjective-argument PMI. FIG. 7 is a hardware configuration diagram showing an example of the hardware configuration of a computer that implements the learning device 100 according to the first embodiment. FIG. 8 is a flowchart showing the operation of the learning device 100 according to the first embodiment. FIG. 9 is a configuration diagram showing the configuration of a language model storage device 300 according to the first embodiment. FIG. 10 is a configuration diagram showing the configuration of an inference device 200 according to the second embodiment. FIG. 11 is a conceptual diagram showing a specific example of a word string including a masked portion. FIG. 12 is a conceptual diagram showing a specific example of a forward Ngram likelihood. FIG. 13 is a conceptual diagram for explaining a specific example of processing by a first inference unit 251 to acquire self-mutual information using a trained model. FIG. 14 is a hardware configuration diagram showing an example of the hardware configuration of a computer that implements the inference device 200 according to the first embodiment. Fig. 1 is a flowchart showing the operation of an inference device 200 according to embodiment 1. Fig. 2 is a configuration diagram showing the configuration of a language processing system 2010 according to embodiment 2. Fig. 3 is a configuration diagram showing the configuration of a learning device 2100 according to embodiment 2. Fig. 4 is a conceptual diagram for explaining a specific example of the processing of a bias removal unit according to embodiment 2.

[0009] 1 is a diagram showing the configuration of a language processing system 10 according to embodiment 1. The language processing system 10 includes a learning device 100, an inference device 200, and a language model storage device 300.

[0010] The language processing system 10 automatically generates sentences and can be used, for example, in chatbots and automated voice response systems. As will be described later, the language processing system 10 generates sentences by inferring words that fit the masked portion of a string of characters that includes a masked portion. Here, a string of characters and a sentence are treated as synonyms.

[0011] First, the learning phase in which the learning device 100 generates a trained model will be described, and then the inference phase in which the inference device 200 performs inference using the trained model will be described.

[0012] In addition, in the present disclosure, the trained model refers to an adjective-term PMI (Pointwise Mutual Information) model described below.

[0013] 2 is a diagram showing the configuration of the learning device 100 according to embodiment 1. The learning device 100 includes a learning data acquisition unit 110, a word string acquisition unit 120, a type determination unit 130, an Ngram model generation unit 140, and a learning unit 150.

[0014] The training data acquisition unit 110 acquires a character string D1 as training data included in a training data set. More specifically, the training data acquisition unit 110 acquires multiple character strings by dividing the text data input as training data into sentences. In other words, hereinafter, one character string corresponds to one sentence.

[0015] The learning data set is stored in a storage device (not shown), and the learning data acquisition unit 110 acquires the learning data from the storage device during learning.

[0016] The word string acquisition unit 120 divides the character string D1 acquired by the training data acquisition unit 110 into words to acquire a word string D3 consisting of multiple words. Here, the word string D3 means a set of multiple words with part-of-speech information.

[0017] In addition, dividing into words does not only mean dividing a string directly into words, but also includes dividing a string into larger units, such as phrases, and then dividing into words, or dividing into smaller units, such as morphemes, and then concatenating the morphemes to divide into words.

[0018] In the first embodiment, the word string acquiring unit 120 includes a morphological analysis unit 121 and a lexicalization unit 122 .

[0019] The morphological analysis unit 121 divides the character string D1 acquired by the training data acquisition unit 110 into morphemes, which are the smallest grammatical units, and acquires a morpheme string D2 consisting of a plurality of morphemes with part-of-speech information.

[0020] A specific example of the processing of the morphological analysis unit 121 will be described with reference to FIG. 3 . FIG. 3 is a conceptual diagram illustrating a specific example of the processing of the morphological analysis unit 121. For example, when a character string such as "Installing nets to protect against crows is effective" is input, the morphological analysis unit 121 divides the string into "crow," "measures," "to," "net," "to," "install," "to do," "of," "is," "effective," "target," "desu," and ".". Then, part-of-speech information is assigned, such as "crow" being a noun and "ni" being a particle. Further, more detailed grammatical information, such as common noun or case particle, may be assigned. For example, the UniDic classification may be used for this part-of-speech information. UniDic is an electronic dictionary of Japanese text. Note that an electronic dictionary other than UniDic may be used as long as it can assign part-of-speech information similar to that of UniDic.

[0021] The lexicalization unit 122 connects the morphemes included in the morpheme sequence D2 output by the morphological analysis unit 121 based on the part-of-speech information to obtain a word sequence D3. Here, lexicalization refers to the process of connecting the preceding and following morphemes included in the morpheme sequence to generate a word. Since UniDic uses short units, which are linguistic units defined with an emphasis on uniformity based on the smallest unit, such lexicalization is performed to handle the meaning of words.

[0022] In the following, a word will be defined as a combination of one or more morphemes, i.e., both unconnected morphemes that can form a word on their own, and connected morphemes.

[0023] The following describes in detail the processing of the lexicalization unit 122. The lexicalization unit 122 inputs the morpheme string output by the morphological analysis unit 121, checks the part of speech of each morpheme, concatenates morphemes that can be concatenated, and outputs a lexicalized morpheme string.

[0024] The lexicalization unit 122 concatenates morphemes when a morpheme preceding a morpheme is a prefix or a morpheme following a morpheme is a suffix. The lexicalization unit 122 also assigns the part of speech of the concatenated morpheme to the part of speech of the morpheme concatenated at the end.

[0025] A specific example of the processing of the lexicalization unit 122 will be described with reference to Fig. 4. Fig. 4 is a conceptual diagram showing a specific example of the processing of the lexicalization unit 122. For example, when the morpheme string "crow," "countermeasure," "to," "net," "o," "install," "suru," "no," "ha," "effect," "target," "desu," and "." described in Fig. 3 are input, the lexicalization unit 122 generates the vocabulary "effective" by concatenating "effect" and "target," which are adjacent to "target," because the part of speech of "target" is a suffix.

[0026] As another example, when morphological analysis is performed on the character string "Installing nets to protect against crows is ineffective," the morphological analysis unit 121 first divides the character string into morphemes: "crow," "measures," "to," "net," "to," "install," "to," "of," "is," "ineffective," "effective," "target," "is," and "."

[0027] Then, since "hi" is a prefix, the lexicalization unit 122 combines "effect" and "hi" that follow "hi" to form "ineffective," and further combines "ineffective" and "target" to generate the word "ineffective."

[0028] The type determination unit 130 determines the type D4 of a sentence indicated by the word string D3 acquired by the word string acquisition unit 120. The type determination unit 130 outputs the determined sentence type D4 to the learning unit 150. The sentence type D4 determined here is either an affirmative sentence, a negative sentence, or an interrogative sentence.

[0029] The processing of the type determination unit 130 will be described in detail. The type determination unit 130 determines the type of sentence based on the part-of-speech information and word notation included in the word string, for example, according to the following rules: If the sentence ends with "?" (auxiliary symbol), the type of sentence is determined to be a question. If the last word excluding the auxiliary symbol at the end of the sentence is "nai (particle)," the type of sentence is determined to be a negative sentence. For sentences other than those mentioned above, the type of sentence is determined to be an affirmative sentence.

[0030] The type determination unit 130 may use other existing determination methods. For example, a method for determining whether a sentence is a negative sentence may be a method for automatically detecting negative elements and the focus of negation in a sentence. Furthermore, whether a sentence is a question or not may be determined based on whether an expression commonly used in questions, such as "kana," "kane," "ka," "noka," or "darou" is used at the end of the sentence.

[0031] The Ngram model generation unit 140 generates an Ngram model D5 based on the word string D3 acquired by the word string acquisition unit 120. The Ngram model generation unit 140 outputs the generated Ngram model D5 to the Ngram model storage unit 310 included in the language model storage device 300.

[0032] Here, the Ngram model is a language model in which the occurrence probability of each word depends only on the N-1 words immediately before or after the word.

[0033] The Ngram model generation unit 140 generates a word w in a word string consisting of m words as shown in FIG. i N chain "w i-N+1 , ..., w i-1 , w i For ", the forward Ngram likelihood is calculated using the following formula:

[0034]

[0035] In addition, the Ngram model generation unit 140 generates a backward N-chain “w i , w i+1 , ..., w i+N-1 The backward Ngram likelihood for " is calculated using the following formula:

[0036]

[0037] The Ngram model generation unit 140 generates the N-chain “w i-N+1 , ..., w i-1 , w i ” and the corresponding forward Ngram likelihood pair, and the N-chain “w i , w i+1 , ..., w i+N-1 An Ngram model is generated by storing pairs of " and the corresponding backward Ngram likelihood. Hereinafter, the log-likelihoods obtained from the Ngram model, that is, the forward Ngram likelihood and the backward Ngram likelihood, will be collectively referred to as Ngram likelihood.

[0038] The learning unit 150 receives an adjective that describes the nature or state of an object and two words as input, and generates a trained model D6 that outputs the mutual information between the adjective and the two words based on the occurrence probability of the words included in the word string D3 in the training dataset.

[0039] More specifically, the learning unit 150 generates the trained model D6 based on the occurrence probability in the training dataset of a first word, which is an adjective expression included in the word sequence D3, the occurrence probability in the training dataset of a second word included in the word sequence D3, the occurrence probability in the training dataset of a third word included in the word sequence, and the simultaneous occurrence probability in the training dataset of the first word, the second word, and the third word.

[0040] Here, an adjective is either an adjective, an adjectival verb, or an adjectival noun. An adjectival noun refers to a noun that becomes an adjectival verb by adding "na" (the attributive form of the auxiliary verb "da") to it, such as "safety" (anxiety) or "anxiety" (worry). When using the UniDic classification, adjectives can be classified into adjectives, adjectival nouns, noun-common noun-possible adjectival nouns, noun-common noun-possible sa-variant adjectival nouns, suffix-noun-possible adjectival nouns, suffix-adjectival nouns, and suffix-adjectival nouns.

[0041] Furthermore, in the first embodiment, the learning unit 150 inputs an adjective expression, two words, and a sentence type, and generates a trained model D6 that outputs self-mutual information.

[0042] More specifically, the learning unit 150 receives as input the type of sentence determined by the type determination unit, an adjective, and two words, and generates a fourth-order tensor that outputs the mutual information between the adjective and the two words as the learned model D6.

[0043] The following describes the details of the tensor learning process performed by the learning unit 150. First, the learning unit 150 classifies the word strings D3 by sentence type D4. Next, for each sentence type D4, the learning unit 150 counts the total number of words Z and the number of occurrences c(w) of each word w.

[0044] Next, the learning unit 150 compares the adjective A and the word w for each sentence type D4. x and w y The number of simultaneous occurrences c(A, w x , w y ) and c(A, w y , w x ) are counted. More specifically, from each word string, an arbitrary adjective (A) and two words (w x , w y ) and extract the permutation (A, w x , w y ) and permutation (A, w y , w x ) is added one by one for all word sequences. Here, the reverse order is also added to make it robust to sparseness, but as will be described later, it is also possible to generate an asymmetric tensor without adding the reverse order. Also, for words that appear more than once in a word sequence, it is possible to count them only once, and x =w y The diagonal elements may be treated differently from the off-diagonal elements depending on the purpose.

[0045] Then, the learning unit 150 calculates the stored triplet of adjective and term PMI values ​​(Personal Mutual Information) using Equations 3 to 7.

[0046]

[0047]

[0048]

[0049]

[0050]

[0051] In this case, w = A is the first word of the adjective, w = w x is the second word, w = w y is the third word, and P(A), P(w x ), P(w y ), P(A, w x , w y ) is the probability of occurrence of each. x , w y When the triplet of PMI(A, w x , w y ) is negative, PMI(A, w x , w y ) and store it.

[0052] Finally, the learning unit 150 generates a trained model D6 by integrating the triplet of adjective-term PMI values ​​for each sentence type D4 into one fourth-order tensor based on Equation 8.

[0053]

[0054] Fig. 6 is a conceptual diagram showing an example of a generated trained model. In Fig. 6, due to the constraints of representation on paper, the fourth-order tensor is represented as three rectangular parallelepipeds, and mutual information is given at each point of the rectangular parallelepiped specified by the sentence type and three words. The dimension of the sentence type G (first argument) is 3, the dimension of the adjective A (second argument) is p, and the dimension of the word w x (third argument) and the word w y The dimension of (the fourth argument) is q. Both p and q are positive integers, where p indicates the number of adjectives in the word dictionary (vocabulary size of adjectives), and q indicates the total number of words in the word dictionary (total vocabulary size).

[0055] Here, for example, if the type of sentence is "affirmative sentence", the adjective A is "good", and the word w x If is "person", then w y When words that are highly related to "people" and "good," such as "love," "grow," "protect," and "thrive," are input, PMI(G, A, w x , wy ) indicates a large value. For example, if the sentence type is "negative sentence", the adjective expression is A "good", and the word w x If is a "person", then w y When words such as "die," "hurt," "lose," and "sad" are input, PMI(G, A, w x , w y ) indicates a large value. Furthermore, for example, if the type of sentence is "affirmative sentence", the adjective A is "good", and the word w x , w y When word pairs such as "all" and "heal", "happiness" and "call", and "bad" and "heal" are input, PMI(G, A, w x , w y ) indicates a large value. For example, if the sentence type is "affirmative sentence", the adjective expression is A "good", and the word w x , w y When word pairs such as "wound" and "are", "person" and "die", and "treatment" and "become" are input, PMI(G, A, w x , w y ) indicates a small value. In this way, by calculating the information amount of "good" not just for a single word but for a word pair, it is possible to accurately calculate the likelihood according to the context of the input sentence. A training sample of the mutual information calculated by Equation 8 is shown in Figure 7.

[0056] Next, a description will be given of the hardware configuration of the learning device 100 in embodiment 1. Each function of the learning device 100 is realized by a computer. Fig. 8 is a configuration diagram showing an example of the hardware configuration of a computer that realizes the learning device 100.

[0057] The hardware shown in FIG. 8 includes a processing device 1000 such as a CPU (Central Processing Unit), and a storage device 1001 such as a ROM (Read Only Memory) or a hard disk.

[0058] 2 are realized by the processing device 1000 executing a program stored in the storage device 1001. Here, the above configuration is not limited to a configuration realized by a single processing device 1000 and storage device 1001, but may be a configuration realized by a plurality of processing devices 1000 and storage devices 1001.

[0059] Furthermore, the method of realizing each function of the learning device 100 is not limited to the combination of hardware and programs described above, but may be realized by hardware alone, such as an LSI (Large Scale Integrated Circuit) in which a program is implemented in a processing device, or some functions may be realized by dedicated hardware and some functions may be realized by a combination of a processing device and a program.

[0060] The learning device 100 according to the first embodiment is configured as described above.

[0061] Next, a description will be given of the operation of the learning device 100 according to embodiment 1. Fig. 9 is a flowchart showing the operation of the learning device 100 according to embodiment 1. The operation of the learning device 100 corresponds to a method for generating a trained model, and a program that causes a computer to execute the operation of the learning device 100 corresponds to a learning program.

[0062] Furthermore, the operation of the learning data acquisition unit 110 corresponds to a learning data acquisition process, the operation of the word string acquisition unit 120 corresponds to a word string acquisition process, the operation of the type discrimination unit 130 corresponds to a type discrimination process, the operation of the Ngram model generation unit 140 corresponds to an Ngram model generation process, and the operation of the learning unit 150 corresponds to a learning process.

[0063] First, in step S1, the learning data acquisition unit 110 acquires a character string D1 as learning data included in the learning data set.

[0064] Next, in step S2, the morphological analysis unit 121 divides the character string D1 acquired by the training data acquisition unit 110 in step S1 into morphemes, which are the smallest grammatical units, and acquires a morpheme string D2 consisting of multiple morphemes with part-of-speech information.

[0065] Next, in step S3, the lexicalization unit 122 concatenates the morphemes included in the morpheme string D2 acquired by the morphological analysis unit 121 in step S2 based on the part-of-speech information to acquire a word string D3.

[0066] Next, in step S4, the type determining unit 130 determines the type of sentence D4 indicated by the word string D3 acquired by the word string acquiring unit 120 based on the part-of-speech information and word spellings included in the word string D3.

[0067] Next, in step S5 , the Ngram model generation unit 140 counts the number of occurrences of N-chain word strings included in the word string D3 acquired by the word string acquisition unit 120 .

[0068] Next, in step S6, the learning unit 150 counts the number of occurrences of each word included in the word string D3, and the number of occurrences of triplet pairs each consisting of an adjective and two other words extracted from the word string.

[0069] Next, in step S7, the training data acquisition unit 110 determines whether there is training data to be processed next in the training data set. If the training data acquisition unit 110 determines that there is data to be processed next, it returns to step S1 to acquire the next training data, but if it determines that there is no data to be processed next, it proceeds to steps S8-9 to cause the Ngram model generation unit 140 and the training unit 150 to generate the Ngram model D5 and the trained model D6, respectively.

[0070] In step S8, the Ngram model generation unit 140 calculates the forward Ngram likelihood and the backward Ngram likelihood of each N-chain based on the number of occurrences of the N-chain word string counted in step S5, and generates an Ngram model D5 by storing each N-chain in association with the forward Ngram likelihood and the backward Ngram likelihood.

[0071] In step S9, the learning unit 150 calculates the probability of occurrence of each word and each triplet based on the number of occurrences of each word and each triplet counted in step S6. Then, the learning unit 150 calculates the self-mutual information of each triplet based on the probability of occurrence of each word and each triplet, and generates a trained model D6 by storing the sentence type, triplet, and self-mutual information in association with each other.

[0072] Through the above-described operations, the learning device 100 according to embodiment 1 can generate a trained model that inputs an adjective that describes the nature or state of an object and two words, and outputs the self-mutual information between the adjective and the two words, thereby generating a trained model that can infer ethically appropriate candidate words that have a large amount of self-mutual information with an adjective that has a positive meaning, and ultimately can generate ethically appropriate sentences using the trained model.

[0073] Furthermore, the learning device 100 according to embodiment 1 determines the type of sentence indicated by a word string, inputs the sentence type in addition to an adjective and two words, and generates a trained model that outputs self-mutual information. Therefore, by outputting self-mutual information for each sentence type, it is possible to generate a trained model that can infer candidate words with greater accuracy.

[0074] Furthermore, the learning device 100 according to embodiment 1 divides a character string into morphemes, which are the smallest grammatical units, obtains a morpheme string consisting of multiple morphemes with part-of-speech information, and concatenates the morphemes included in the morpheme string based on the part-of-speech information to obtain a word string. Therefore, by generating words that summarize the meanings of the morphemes, it is possible to generate a trained model that can infer candidate words with greater accuracy.

[0075] For example, if "effect" and "target" were processed separately, "effect" would be recognized as an adjective and the self-mutual information with "target" would be learned because "effect" is a noun and "target" is a suffix-morpheme. However, by combining "effect" and "target" and processing them as the word "effective," it is possible to learn the self-mutual information for words whose meaning is easier for humans to understand. Furthermore, by treating prefixes such as "not" and "not" in conjunction with the following morpheme, it is possible to properly learn the self-information of antonyms.

[0076] <Inference Phase> Next, the inference phase in which sentences are generated using the trained model (adjective-term PMI model) generated in the learning phase will be described.

[0077] First, before describing the inference device 200, we will describe the language model storage device 300. Fig. 10 is a configuration diagram showing the configuration of the language model storage device 300 according to embodiment 1. The language model storage device 300 includes an Ngram model storage unit 310, a trained model storage unit 320, and a neural language model storage unit 330.

[0078] The Ngram model storage unit 310 stores the Ngram model generated by the Ngram model generation unit 140 .

[0079] The trained model storage unit 320 stores the trained model generated by the training unit 150.

[0080] The neural language model storage unit 330 stores a neural language model generated by a learning device (not shown) separate from the learning device 100. The neural language model will be described in detail later.

[0081] The language model storage device 300 is realized by a storage device such as a ROM (Read Only Memory) or a hard disk. The language model storage device 300 may be realized by one server, by multiple servers distributed on the cloud, or as part of an edge storage device. For example, when the language processing system 10 is used in an automatic response system for robots, each model may be stored in a server that collectively manages the robots, or each model may be stored in the robot itself.

[0082] Next, we will explain inference device 200. Figure 11 is a configuration diagram showing the configuration of inference device 200 according to embodiment 1. Inference device 200 includes a mask data acquisition unit 210, a word string acquisition unit 220, a type determination unit 230, a control information acquisition unit 240, and an inference unit 250.

[0083] The mask data acquisition unit 210 acquires a character string D11 that includes a mask portion. Here, the mask portion refers to a portion in the character string where a normal word is missing and a special word [MASK] is applied. Here, the word that is replaced with the special word [MASK] is the subject of inference by the inference device 200. The mask data is text data that indicates the character string D11 that includes the mask portion.

[0084] The word string acquisition unit 220 divides the character string D11 acquired by the mask data acquisition unit 210 into words to acquire a word string D13 consisting of multiple words, and performs the same processing as the word string acquisition unit 120 provided in the learning device 100.

[0085] The word string acquisition unit 220 includes a morphological analysis unit 221 and a lexicalization unit 222 .

[0086] The morphological analysis unit 221 divides the character string D11 acquired by the mask data acquisition unit 210 into morphemes, which are the smallest grammatical units, and acquires a morpheme string D12 consisting of multiple morphemes with part-of-speech information, and performs the same processing as the morphological analysis unit 121.

[0087] The lexicalization unit 222 connects the morphemes included in the morpheme string based on the part-of-speech information to obtain the word string D13, and performs the same processing as the lexicalization unit 122.

[0088] The type determination unit 230 determines the type D14 of the sentence indicated by the word string 13, and performs the same processing as the type determination unit 130 included in the learning device 100.

[0089] The control information acquisition unit 240 acquires control information D15 through user input. More specifically, the control information acquisition unit 240 acquires adjectives that represent the properties or states of things as control words, and acquires weighting coefficients of self-mutual information and Ngram likelihood as control strengths. Here, the weighting coefficients of self-mutual information and Ngram likelihood are interpreted as weighting coefficients for the adjective-term PMI model and Ngram model.

[0090] The control information acquisition unit 240 acquires control information D15 from an input by a user or designer of the language processing system 10 via an input device (not shown), such as a keyboard or a touch panel. The input from the user or designer may be made at the time of inference, or control information D15 input in advance may be stored and the stored control information D15 may be read out at the time of inference.

[0091] The control strength may also be set for each type of sentence, for example, a large value for affirmative sentences, a small value for negative sentences, and an intermediate value for interrogative sentences, such as 0.8 for affirmative sentences, 0.2 for negative sentences, and 0.5 for interrogative sentences.

[0092] The inference unit 250 infers candidate words for the masked portion and outputs a character string D19 in which the masked portion and the inferred candidate words are swapped, and includes a first inference unit 251, a second inference unit 252, and an inference result integration unit 253. As will be described later, in the first embodiment, the inference unit 250 infers candidate words for the masked portion from the control words acquired by the control information acquisition unit 30 and the word string D13 acquired by the word string acquisition unit 220.

[0093] The inference unit 250 outputs the character string in which the masked portion and the inferred candidate word have been replaced to a display or speaker, thereby conveying the character string, i.e., the generated sentence, to the user.

[0094] The following describes the first inference section 251, the second inference section 252, and the inference result integration section 253 included in the inference section 250.

[0095] The first inference unit 251 infers candidate words for the masked portion from the control words acquired by the control information acquisition unit 30 and the word string D13 acquired by the word string acquisition unit 220.

[0096] More specifically, the first inference unit 251 takes the control word, the words included in the word string, and the candidate words as input, and infers the candidate words using a trained model that outputs the self-mutual information of the control word, the words included in the word string, and the candidate words.

[0097] Furthermore, the first inference unit 251 infers candidate words using the mutual information obtained from the trained model and the Ngram likelihood obtained from the Ngram model.

[0098] For example, when the length of the word string is m and the masked portion is the nth word in the word string, the first inference unit 251 can infer a candidate word based on the following Equation 9: where α is the control strength and β is the flooring coefficient.

[0099]

[0100] The following describes details of the processing of the first inference unit 251. When Formula 9 is used as is, only one candidate word is determined, but in the following processing, the first inference unit 251 selects, from top to bottom, multiple words with the highest likelihood in the argmax function of Formula 9, and outputs a set of the selected multiple candidate words to the inference result integration unit 253 as a first candidate word group D16.

[0101] First, the first inference unit 251 acquires the sentence type D14 from the type determination unit 230 , the word string D13 from the word string acquisition unit 220 , and the control information D15 (control words and control strength) from the control information acquisition unit 240 .

[0102] Next, the first inference unit 251 inserts N-1 special words [NULL] in order to take into account the preceding connection at the beginning of the sentence and the following connection at the end of the sentence.

[0103] The first inference unit 251 finds the special word [MASK] from the word string and n Let's say.

[0104] The first inference unit 251 n The N-1 words before and after the word are extracted as N-chain words in the forward and backward directions, respectively.

[0105] The first inference unit 251 extracts and determines words to be included in [MASK] from a word dictionary, and obtains forward Ngram likelihood and backward Ngram likelihood using an Ngram model.

[0106] A specific example of the process of acquiring Ngram likelihood from an Ngram model will be described with reference to Figures 12 to 14. Here, for simplicity, N=3.

[0107] 12 is a conceptual diagram showing a specific example of a word string including a mask portion. For example, the word string to be estimated for [MASK] is assumed to be "net", "wo", "[MASK]", "suru", and ".".

[0108] At this time, the forward Ngrams are arranged in descending order of forward Ngram likelihood as shown in FIG. 13, and for example, the likelihood of "use" is acquired as 9.397643358 and the likelihood of "through" is acquired as 9.146110803.

[0109] Similarly, the backward Ngrams are arranged in descending order of backward Ngram likelihood as shown in FIG. 14, and for example, the likelihood of "existence" is acquired as 8.709336799, and the likelihood of "introduction" is acquired as 8.144842576.

[0110] Next, the inference of candidate words using a trained model will be described. The first inference unit 251 acquires the trained model D6 from the trained model storage unit 320.

[0111] The first inference unit 251 generates a set of three words, where the first word is a control word, the second word is a word included in the word string, and the third word is a word included in the word dictionary.

[0112] The first inference unit 251 uses the trained model to obtain the self-mutual information of the generated triplet for the sentence type D14.

[0113] A specific example of a process for acquiring self-mutual information from a trained model will be described with reference to FIG. 15 .

[0114] As in the case of the Nrgam model, the word string in Fig. 12 is used as an input, and the control word is assumed to be "good."

[0115] In this case, the sentence type G is a "positive sentence", the adjective A is "good" input as a control word, and the word w x "Net", "to", "to do", ".", candidate words w y As the input, words contained in the dictionary such as "installation," "creation," and "removal" are input, and mutual information is obtained for each input.

[0116] The first inference unit 251 calculates the Ngram likelihood and the self-mutual information for all words in the dictionary, and then sorts the candidate words in descending order of the sum of these (hereinafter referred to as the first likelihood).

[0117] The first inference unit 251 outputs, from among the candidate words sorted by first likelihood, those having a first likelihood equal to or greater than a preset threshold value as a first candidate word group D16 to the inference result integration unit 253.

[0118] The second inference unit 252 infers candidate words for the masked portion using a neural language model D17. A neural language model is a language model that uses a neural network, and known existing neural language models include, for example, a language model that uses a recurrent neural network and a language model that uses an attention mechanism such as a Transformer or BERT (Bidirectional Encoder Representations from Transformers).

[0119] Here, as an example, a case where a forward propagation neural language model using a forward propagation neural network is used will be described.

[0120] In a feedforward neural language model, like the Ngram model, the next word is predicted using a chain of N-1 words. When the nth word is a masked part, the n-N+1th to n-1th words are converted into a one-hot vector as input and input to a feedforward neural network.

[0121] Then, a linear transformation is performed on the vector output from the feedforward neural network to convert it into a vector of the same dimension as the vocabulary size of the word dictionary, and then the vector is substituted into a softmax function.

[0122] The vector output from the softmax function above is the probability distribution of the nth word, and each element of the vector corresponds to the occurrence probability of a word in the dictionary.

[0123] Therefore, by performing maximum likelihood estimation using the vector output from the softmax function, candidate words for the masked portion can be inferred.

[0124] Here, a forward propagation neural network has been described as an example, but it is also possible to use an existing neural language model, such as a language model using a recurrent neural network as described above, or a language model using an attention mechanism such as a Transformer or BERT (Bidirectional Encoder Representations from Transformers).

[0125] The second inference unit 252 outputs to the inference result integration unit 253, as a second candidate word group D18, those candidate words inferred using the neural language model D17 whose likelihood obtained from the neural language model (hereinafter referred to as second likelihood) is equal to or greater than a predetermined threshold.

[0126] The inference result integration unit 253 determines candidate words that are commonly included in the first candidate word group D16, which is a set of multiple candidate words inferred by the first inference unit 251, and the second candidate word group D18, which is a set of multiple candidate words inferred by the second inference unit 252, as candidate words to be replaced with the masked portion.

[0127] For example, if the candidate words included in the first candidate word group are "introduction," "installation," and "utilization," and the candidate words included in the second candidate word group are "attack," "destruction," and "installation," the word included in both the first and second candidate word groups is "installation," so the output integration unit 270 determines that the word to be placed in the masked portion is "installation."

[0128] In addition, if there are multiple candidate words included in the first candidate word group and the second candidate word group, the candidate word in the second candidate word group that has the highest second likelihood among the commonly included candidate words may be determined as the candidate word to replace the masked portion.

[0129] This is because neural language models generally have high inference accuracy, so candidate words included in the second candidate word group are more likely to be words appropriate to the context, and if a candidate word among them is also included in the first candidate word group, it is considered not to be an ethically inappropriate word. In other words, in this case, it is equivalent to using the adjective-term PMI model to remove ethically inappropriate words from the candidate words inferred by the neural language model.

[0130] Next, a description will be given of the hardware configuration of inference device 200 in embodiment 1. Each function of inference device 200 is realized by a computer. Fig. 16 is a configuration diagram showing an example of the hardware configuration of a computer that realizes inference device 200.

[0131] The hardware shown in FIG. 16 includes a processing device 1100 such as a CPU (Central Processing Unit), and a storage device 1101 such as a ROM (Read Only Memory) or a hard disk.

[0132] 11 are realized by the processing device 1100 executing a program stored in the storage device 1101. Here, the above configuration is not limited to a configuration realized by a single processing device 1100 and storage device 1101, but may be a configuration realized by a plurality of processing devices 1100 and storage devices 1101.

[0133] Furthermore, the method of realizing each function of the inference device 200 is not limited to the combination of hardware and programs described above, but may be realized by hardware alone, such as an LSI (Large Scale Integrated Circuit) in which a program is implemented in a processing device, or some functions may be realized by dedicated hardware and some functions may be realized by a combination of a processing device and a program.

[0134] Inference device 200 according to the first embodiment is configured as described above.

[0135] Next, an explanation will be given of the operation of inference device 200 according to embodiment 1. Fig. 17 is a flowchart showing the operation of inference device 200 according to embodiment 1. The operation of inference device 200 corresponds to an inference method, and a program that causes a computer to execute the operation of inference device 200 corresponds to an inference program.

[0136] Furthermore, the operation of the mask data acquisition unit 210 corresponds to the mask data acquisition process, the operation of the word string acquisition unit 220 corresponds to the word string acquisition process, the operation of the type discrimination unit 230 corresponds to the type discrimination process, the operation of the control information acquisition unit 240 corresponds to the control information acquisition process, and the operation of the inference unit 250 corresponds to the inference process.

[0137] First, in step S11, the mask data acquisition unit 210 acquires a character string D11 including a mask portion.

[0138] Next, in step S12, the morphological analysis unit 221 divides the character string D11 acquired by the mask data acquisition unit 210 in step S11 into morphemes, which are the smallest grammatical units, and acquires a morpheme string D12 consisting of multiple morphemes with part-of-speech information.

[0139] Next, in step S13, the lexicalization unit 222 concatenates the morphemes included in the morpheme string D12 acquired by the morphological analysis unit 221 in step S12 based on the part-of-speech information to acquire a word string D13.

[0140] Next, in step S14, the type determining unit 230 determines the type of sentence D14 indicated by the word string D13 acquired by the word string acquiring unit 220 based on the part-of-speech information and word spellings included in the word string D13.

[0141] Next, in step S15, the control information acquisition unit 240 acquires control information D15 (control words and control strength) based on input from the user.

[0142] Next, in step S16, the first inference unit 251 acquires the learned model D6 from the learned model storage unit 320 and the Ngram model D5 from the Ngram model storage unit 310, and infers candidate words for the masked portion using the mutual information obtained from the learned model D6 and the Ngram likelihood obtained from the Ngram model D5. The first inference unit 251 outputs multiple candidate words whose first likelihoods are equal to or greater than a preset threshold to the inference result integration unit 253 as a first candidate word group D16.

[0143] Next, in step S17, the second inference unit 252 acquires the neural language model D17 from the neural language model storage unit 330, and infers candidate words for the masked portion using the acquired neural language model D17. The second inference unit 252 outputs multiple candidate words whose second likelihoods are equal to or greater than a preset threshold to the inference result integration unit 253 as a second candidate word group D18.

[0144] Finally, in step S18, the inference result integration unit 253 compares the first candidate word group D16 with the second candidate word group D18 and determines the candidate words that are commonly included as the final inference result. The inference result integration unit 253 outputs a character string D19 in which the masked portion has been replaced with the candidate words determined as the final inference result to an external display or speaker.

[0145] Through the above operations, the inference device 200 according to the first embodiment can infer ethically appropriate candidate words by inferring candidate words for the masked portion from adjectives and word strings that express the properties or states of things, thereby generating ethically appropriate sentences. In this example, the generated sentence is a character string in which the masked portion and candidate words are swapped.

[0146] For example, if "good" or "beautiful" is input as a control word, candidate words highly related to "good" or "beautiful" are inferred. Words highly related to "good" or "beautiful" are considered to be ethically appropriate words, so when a user or designer inputs a control word with a positive meaning, reasoning device 200 can infer ethically appropriate candidate words and generate ethically appropriate sentences.

[0147] Furthermore, the inference device 200 according to embodiment 1 infers candidate words using a trained model that takes as input a control word, a word contained in a word string, and a candidate word, and outputs the mutual self-information between the control word, the word contained in the word string, and the candidate word. This makes it possible to infer candidate words that are highly related to the control word and the word contained in the word string, and to generate natural and ethically appropriate sentences.

[0148] Furthermore, the inference device 200 according to embodiment 1 determines the type of sentence indicated by a word string, and infers candidate words using a trained model that inputs the sentence type in addition to adjectives, words included in the word string, and candidate words, and outputs self-mutual information, thereby enabling more accurate inference of candidate words.

[0149] Furthermore, the inference device 200 according to embodiment 1 divides a character string into morphemes, which are the smallest grammatical units, to obtain a morpheme string consisting of a plurality of morphemes with part-of-speech information, and then concatenates the morphemes included in the morpheme string based on the part-of-speech information to obtain a word string. Therefore, by generating words that summarize the meanings of the morphemes, candidate words can be inferred with greater accuracy.

[0150] <Modification> A modification of the language processing system 10 according to the first embodiment will be described.

[0151] The learning device 100 and the inference device 200 according to the first embodiment are configured to distinguish between types of sentences in order to infer candidate words with greater accuracy. However, if accuracy is not required or if it is desired to reduce the amount of calculation required, the type may not be distinguished, or only positive sentences may be learned.

[0152] Furthermore, the learning device 100 and the inference device 200 acquire one sentence as a character string and process each sentence individually, but if the type of sentence is not to be determined, multiple sentences may be processed as one character string.

[0153] In the first embodiment, inference device 200 uses not only the adjective-term PMI model but also the Ngram model and the neural language model to infer candidate words with higher accuracy, but if accuracy is not required or if it is desired to reduce calculations, it is also possible to infer candidate words using only the adjective-term PMI model, or to infer candidate words using only the Ngram model or the neural language model in addition to the adjective-term PMI model. Furthermore, if the Ngram model is not used, control strength is not required, so it is sufficient to acquire only the control word as control information.

[0154] Although the inference device 200 is configured to acquire one word as the control word, it may also acquire multiple words. When multiple words are used as control words, for example, the PMIs in Equation 9 are summed for all control words.

[0155] The order of the steps in the flowchart may be changed as appropriate. For example, the process of generating a trained model in step S9 may be performed before the process of generating an Ngram model in step S8, or the processes of steps S8 and S9 may be performed simultaneously.

[0156] Furthermore, for example, the processing by the second inference unit 252 in step S17 may be performed before the processing by the first inference unit 251 in step S16, or the processing by steps S16 and S17 may be performed simultaneously. The same applies to the other steps.

[0157] The trained model is x And lol y Although the case where w is symmetric has been described, it may also be asymmetric. x And lol y Although the reverse order of the permutations is also added to make it robust to sparseness, it is also possible to distinguish the meaning of the word order without adding the reverse order.

[0158] Second Embodiment Next, a second embodiment will be described. In the second embodiment, a bias removal unit that removes bias between two words is added to the configuration of the first embodiment.

[0159] In today's world where diversity is highly valued, it may be ethically inappropriate to rank two objects as superior or inferior. The learning device 2100 of the second embodiment performs a process to remove bias between two words from a trained model, thereby eliminating bias in the objects represented by the two words and preventing the generation of ethically inappropriate sentences.

[0160] The configuration of a language processing system 2010 according to embodiment 2 will be described. Fig. 18 is a block diagram showing the configuration of the language processing system 2010 according to embodiment 2. An inference device 2200 included in the language processing system 2010 has the same configuration as the inference device 200 according to embodiment 1, except that it infers candidate words using a bias-removed trained model instead of the trained model described in embodiment 1, and a language model storage device 2300 has the same configuration as the language model storage device 300 according to embodiment 1, except that it stores a bias-removed trained model instead of the trained model described in embodiment 1.

[0161] The following describes the configuration of a learning device 2100 according to embodiment 2. Fig. 19 is a diagram showing the configuration of the learning device 2100 according to embodiment 2. The learning device 2100 includes a learning data acquisition unit 2110, a word string acquisition unit 2120, a type determination unit 2130, an Ngram model generation unit 2140, a learning unit 2150, and a bias removal unit 2160.

[0162] The learning data acquisition unit 2110, word string acquisition unit 2120, type determination unit 2130, Ngram model generation unit 2140, and learning unit 2150 perform the same processes as those in the first embodiment.

[0163] In addition, the hardware configuration of the learning device 2100 is the same as the hardware configuration of the learning device 100 according to embodiment 1 shown in FIG. 8, and the bias removal unit 2160 is realized by executing a program stored in the memory device 1001 on the processing device 1000.

[0164] The bias removal unit 2160 removes bias between two words by performing a bias removal process on the trained model D6 generated by the training unit 2150. More specifically, when the words from which bias is to be removed are a first bias word and a second bias word, the bias removal unit 2160 performs a bias removal process on the trained model D6 such that the self-mutual information output by the trained model when the first bias word is input to the trained model D6 is the same as the self-mutual information output by the trained model D6 when a second bias word different from the first bias word is input, thereby generating a bias-removed trained model D26.

[0165] In the second embodiment, the bias removal unit 2160 averages the values ​​of the mutual information using the following formulas 10 to 13.

[0166]

[0167]

[0168]

[0169]

[0170] A specific example of the processing by the bias removal unit 2160 will be described with reference to Fig. 20. Fig. 20 is a conceptual diagram for explaining a specific example of the processing by the bias removal unit 2160.

[0171] For example, a case will be described where the first bias word is "dog" and the second bias word is "cat." In this case, by substituting X="dog" and Y="cat" in Equations 10 to 13, the self-mutual information when the set of three words in the trained model includes "dog" and the self-mutual information when the set includes "cat" can be made the same value.

[0172] The learning device 2100 according to embodiment 2 can generate a trained model with no superiority or inferiority between two words by generating a trained model with the bias removed using the bias removal unit 2160 as described above, and the inference device 2200 can avoid discriminatory expressions between two objects by inferring candidate words using the trained model with the bias removed.

[0173] The modified example of the first embodiment can also be applied to the language processing system 2010 according to the second embodiment.

[0174] Up to this point, the description has been given taking the case where the character string to be processed is Japanese as an example, but this is not limiting. Both Embodiments 1 and 2 can also be applied to languages ​​other than Japanese, such as English. In this case, by using a training data set, dictionary, etc. that are appropriate for the language to be applied, it is possible to realize an inference device, learning device, and language processing system for languages ​​other than Japanese.

[0175] The learning device and inference device according to the present disclosure are suitable for use in systems that automatically generate sentences and engage in dialogue with people, such as chatbots and automatic voice response systems.

[0176] 10, 2010 Language processing system, 100, 2100 Learning device, 200, 2200 Inference device, 300, 2300 Language model storage device, 110, 2110 Learning data acquisition unit, 120, 2120 Word string acquisition unit, 121, 2121 Morphological analysis unit, 122, 2122 Lexicalization unit, 130, 2130 Type discrimination unit, 140, 2140 Ngram model generation unit, 150, 2150 Learning unit, 210 Mask data acquisition unit, 220 Word string acquisition unit, 221 Morphological analysis unit, 222 Lexicalization unit, 230 Type discrimination unit, 240 Control information acquisition unit, 250 Inference unit, 251 First inference unit, 252 Second inference unit, 253 Inference result integration unit, 310 Ngram model storage unit, 320 trained model storage unit, 330 neural language model storage unit.

Claims

1. a mask data acquisition unit that acquires a character string including a mask portion; a word string acquisition unit that divides the character string into words and acquires a word string consisting of a plurality of words; a control information acquisition unit that acquires an adjective that represents a property or a state of an object as a control word; an inference unit that infers a candidate word for the masked portion from the control word and the word string, and outputs the character string in which the masked portion and the candidate word are replaced; An inference device comprising:

2. The word string acquisition unit a morpheme analysis unit that divides the character string into morphemes, which are the smallest grammatical units, and acquires a morpheme string consisting of a plurality of morphemes with part-of-speech information; a lexicalization unit that acquires the word string by concatenating morphemes included in the morpheme string based on the part-of-speech information; 2. The inference device according to claim 1, further comprising:

3. The inference unit infers the candidate word using a trained model that receives the control word, a word included in the word string, and the candidate word as input, and outputs self-mutual information between the control word, the word included in the word string, and the candidate word.

3. The inference device according to claim 1 or 2.

4. a type determination unit that determines a type of sentence indicated by the word string, The inference unit infers the candidate words using the trained model that inputs the control word, the words included in the word string, the candidate words, and the sentence type, and outputs the self-mutual information.

4. The inference device according to claim 3.

5. The inference unit infers the candidate words using the self-mutual information obtained from the trained model and the Ngram likelihood obtained from an Ngram model.

4. The inference device according to claim 3.

6. the control information acquisition unit acquires a weighting coefficient of the self mutual information and the Ngram likelihood as a control strength; The inference unit infers the candidate words by performing maximum likelihood estimation of the sum of the self mutual information and the Ngram likelihood based on the control strength.

6. The inference device according to claim 5.

7. The inference unit is a first inference unit that infers candidate words for the masked portion using the trained model; a second inference unit for inferring candidate words for the masked portion using a neural language model; an inference result integration unit that determines a candidate word included in common in a first candidate word group, which is a set of a plurality of candidate words inferred by the first inference unit, and a second candidate word group, which is a set of a plurality of candidate words inferred by the second inference unit, as a candidate word to be replaced with the masked portion; 4. The inference device according to claim 3, further comprising:

8. a learning data acquisition unit that acquires character strings as learning data included in a learning dataset; a word string acquisition unit that divides the character string into words and acquires a word string consisting of a plurality of words; a learning unit that receives an adjective that expresses a property or state of an object and two words and generates a trained model that outputs self-mutual information between the adjective and the two words based on the occurrence probability of words included in the word string in the training dataset; A learning device comprising:

9. The learning unit generates the trained model based on an occurrence probability in a training data set of a first word that is the adjective expression included in the word string, an occurrence probability in the training data set of a second word included in the word string, an occurrence probability in the training data set of a third word included in the word string, and a simultaneous occurrence probability in the training data set of the first word, the second word, and the third word.

9. The learning device according to claim 8.

10. a type determination unit that determines a type of sentence indicated by the word string, The learning unit inputs the type of sentence in addition to the adjective expression and the two words, and generates the learned model that outputs the self-mutual information.

10. The learning device according to claim 8 or 9.

11. The word string acquisition unit a morpheme analysis unit that divides the character string into morphemes, which are the smallest grammatical units, and acquires a morpheme string consisting of a plurality of morphemes with part-of-speech information; a lexicalization unit that acquires the word string by concatenating morphemes included in the morpheme string based on the part-of-speech information; The learning device according to claim 8, further comprising:

12. The learning device further comprises: a bias removal unit that performs a bias removal process on the trained model to set a self-mutual information output by the trained model when a first bias word is input to the trained model to be equal to a self-mutual information output by the trained model when a second bias word different from the first bias word is input; The learning device according to claim 8, further comprising:

13. A mask data acquisition step in which a computer acquires a character string including a mask portion; a word string acquisition step in which the computer divides the character string into words and acquires a word string consisting of a plurality of words; A control information acquisition step in which the computer acquires an adjective that represents a property or a state of an object as a control word; an inference step in which a computer infers a candidate word for the masked portion from the control word and the word string, and outputs the character string in which the masked portion and the candidate word are replaced; A method of inference comprising:

14. An inference program that causes a computer to execute all the steps according to claim 13.

15. A method for generating training data by a computer, comprising: a training data acquisition step of acquiring character strings as training data included in a training dataset; a word string acquisition step in which the computer divides the character string into words and acquires a word string consisting of a plurality of words; a learning step in which a computer inputs an adjective that expresses the nature or state of an object and two words, and generates a trained model that outputs self-mutual information between the adjective and the two words based on the occurrence probability of words included in the word string in the training dataset; How to generate a trained model including:

16. A learning program that causes a computer to execute all the steps according to claim 15.