Vector acquisition method, vector acquisition device, and vector acquisition program
The vector acquisition method enhances the accuracy of similarity calculations by generating compound vectors through adjustment vectors from a trained model, addressing the limitations of existing methods in handling words without pre-trained vectors.
Patent Information
- Application Number
- JP2021041736
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-03-15
- Publication Date
- 2025-04-14
- Estimated Expiration
- 2041-03-15
AI Technical Summary
Existing methods for calculating similarity between words using pre-trained models are inaccurate for words without corresponding vectors or insufficient classification accuracy.
A vector acquisition method that uses a trained model to generate adjustment vectors for words in sentences, allowing for the creation of compound vectors for compound words by averaging adjustment vectors from multiple sentences.
Improves the classification accuracy of compound vectors by reflecting the relationship between words divided from compound words within the context of a sentence, enhancing the accuracy of similarity calculations.
Smart Images

Figure 0007661073000001 
Figure 0007661073000002 
Figure 0007661073000003
Abstract
Description
[Technical field]
[0001] The technology disclosed in this specification relates to obtaining vectors corresponding to words. [Background technology]
[0002] Conventionally, there has been known a technique for assigning a vector corresponding to a word and further calculating a similarity between words using the vector (see, for example, Patent Document 1). [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2020-74205 A Summary of the Invention [Problem to be solved by the invention]
[0004] When calculating the similarity between words as described above, it is possible to utilize vectors corresponding to each word that are pre-stored in the trained model.
[0005] The trained model generates the above vectors by training using a large amount of text, so the similarity between words can be easily calculated by using the above vectors that are stored in advance.
[0006] On the other hand, for words for which no corresponding vector is stored in the trained model, or for words for which the classification accuracy of the vector stored in the trained model is insufficient, it may not be possible to calculate the similarity between words with high accuracy.
[0007] The technology disclosed in this specification has been made in consideration of the problems described above, and is a technology for improving the classification accuracy of vectors corresponding to words. [Means for solving the problem]
[0008] A vector acquisition method according to a first aspect of the technology disclosed in the present specification uses a trained model that holds an initial vector, which is a vector that has been trained in advance in correspondence with each of a plurality of words, and is capable of outputting an adjusted vector, which is a vector obtained by adjusting the initial vector in response to an input of a sentence composed of the plurality of words, in correspondence with each of the words in the sentence. , executed by a computer A vector acquisition method, comprising: The process is carried out by the processing circuit of the computer executing a program stored in a storage device, inputting at least one of the sentences including at least two of the words split from the compound word into the trained model; and adjusting the adjustment vector corresponding to at least one of the words split from the compound word in the input sentence. of , the output from the trained model Let and using the adjustment vector output from the trained model to obtain a composite vector, which is the vector corresponding to the compound word.
[0009] A vector acquisition method which is a second aspect of the technology disclosed in the present specification is related to the vector acquisition method which is the first aspect, and the step of inputting the sentence into the trained model is a step of inputting the sentence including the word which is split from the compound word for which the corresponding initial vector is not held in the trained model into the trained model.
[0010] A vector acquisition method which is a third aspect of the technology disclosed in the present specification is related to the vector acquisition method which is the first or second aspect, and further includes a step of calculating a similarity between a plurality of words including the compound word, using the vectors corresponding to each of the plurality of words including the compound vector acquired using the adjustment vector.
[0011] A vector acquisition method which is a fourth aspect of the technology disclosed in the present specification is related to the vector acquisition method which is any one of the first to third aspects, and the step of acquiring the composite vector is a step of acquiring the composite vector by using an average value of the adjustment vectors which correspond to the same word which is divided from the compound word and which are contained in each of the multiple sentences.
[0012] A vector acquisition method which is a fifth aspect of the technology disclosed in the present specification is related to the vector acquisition method which is any one of the first to fourth aspects, and the step of acquiring the composite vector is a step of acquiring the composite vector by averaging the vectors corresponding to each of the words divided from the compound word.
[0013] A vector acquisition method which is a sixth aspect of the technology disclosed in the present specification is related to a vector acquisition method which is any one of the first to fifth aspects, and the trained model is a language encoding model based on a transformer.
[0014] A vector acquisition method which is a seventh aspect of the technology disclosed in the present specification is related to the vector acquisition method which is any one of the first to sixth aspects, and the step of inputting the sentence into the trained model is a step of inputting the sentence including the compound word into the trained model.
[0015] A vector acquisition device that is an eighth aspect of the technology disclosed in the present specification is a vector acquisition device that uses a trained model that holds an initial vector, which is a vector that has been trained in advance corresponding to each of a plurality of words, and is capable of outputting an adjustment vector, which is a vector obtained by adjusting the initial vector in response to input of a sentence composed of the plurality of words, corresponding to each of the words in the sentence, and is equipped with an input unit that treats the word that can be divided into a plurality of the words as a compound word, and inputs at least one sentence that includes at least two of the words divided from the compound word into the trained model, and an acquisition unit that acquires a compound vector, which is the vector corresponding to the compound word, using the adjustment vector that corresponds to at least one of the words divided from the compound word in the input sentence, which is output from the trained model.
[0016] A vector acquisition program which is a ninth aspect of the technology disclosed in the present specification is a vector acquisition program having a plurality of computer-executable instructions to be executed by one or more processors, which uses a trained model that holds an initial vector, which is a vector that has been trained in advance corresponding to each of a plurality of words, and that is capable of outputting an adjustment vector, which is a vector obtained by adjusting the initial vector in response to input of a sentence composed of the plurality of words, corresponding to each of the words in the sentence, and which has a plurality of instructions executable by a computer to be executed by one or more processors. The word which can be divided into a plurality of the words is treated as a compound word, and the plurality of instructions executed by the processor cause the computer to input at least one of the sentences including at least two of the words divided from the compound word into the trained model, and cause the computer to acquire a compound vector, which is the vector corresponding to the compound word, using the adjustment vector corresponding to at least one of the words divided from the compound word in the input sentence, which is output from the trained model. Effect of the Invention
[0017] According to at least the first, eighth and ninth aspects of the technology disclosed in the present specification, a composite vector corresponding to a compound word can be obtained by using an adjustment vector, thereby improving the classification accuracy of the composite vector.
[0018] Furthermore, objects, features, aspects and advantages associated with the technology disclosed herein will become more apparent from the detailed description set forth below and the accompanying drawings. [Brief description of the drawings]
[0019] [Figure 1] FIG. 2 is a diagram illustrating an example of a hardware configuration of a vector acquisition device according to an embodiment. [Diagram 2] FIG. 2 is a diagram illustrating an example of a functional configuration of a vector acquisition device according to an embodiment. [Diagram 3] FIG. 1 is a diagram illustrating an example of a trained model used in an embodiment. [Figure 4] 13 is a flowchart illustrating an example of an operation of the vector acquisition device. [Diagram 5] FIG. 13 is a diagram showing a specific example of an operation in which a compound vector is obtained and further a similarity of a compound word is calculated. [Figure 6] FIG. 13 is a diagram showing a specific example of an operation in which a compound vector is obtained and further a similarity of a compound word is calculated. [Figure 7] FIG. 13 is a diagram showing a specific example of an operation in which a compound vector is obtained and further a similarity of a compound word is calculated. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0020] Hereinafter, the embodiments will be described with reference to the accompanying drawings. In the following embodiments, detailed features are shown for the purpose of explaining the technology, but they are merely examples and are not necessarily all essential features for enabling the embodiments to be implemented.
[0021] The drawings are schematic, and for the sake of convenience, configurations may be omitted or simplified as appropriate. The size and positional relationship of the configurations shown in different drawings are not necessarily described accurately, and may be changed as appropriate. Hatching may be used in drawings such as plan views that are not cross-sectional views to facilitate understanding of the contents of the embodiments.
[0022] In the following description, the same components are denoted by the same reference numerals, and their names and functions are also the same. Therefore, detailed descriptions thereof may be omitted to avoid duplication.
[0023] Furthermore, in the description in this specification, when a certain component is described as "comprising," "including," or "having," unless otherwise specified, this is not an exclusive expression that excludes the presence of other components.
[0024] Furthermore, even if ordinal numbers such as "first" or "second" are used in the descriptions in this specification, these terms are used for convenience to facilitate understanding of the contents of the embodiments, and the contents of the embodiments are not limited to the orders that may result from these ordinal numbers.
[0025] <Embodiment Mode> A vector acquisition device, a vector acquisition method, and a vector acquisition program according to the present embodiment will be described below.
[0026] <Configuration of the vector acquisition device> FIG. 1 is a diagram showing an example of a hardware configuration of a vector acquisition device 100 according to this embodiment.
[0027] As shown in the example of FIG. 1, the vector acquisition device 100 is a computer having installed therein at least a program 105 used for acquiring vectors corresponding to words, and includes a central processing unit (CPU) 102, a memory 103, a hard disk drive (HDD) 104, and a display 101.
[0028] In the vector acquisition device 100, the corresponding program 105 is installed in the HDD 104. The program 105 may be installed by writing data read from an external storage medium 106, such as a compact disc (i.e., CD), a digital versatile disc (i.e., DVD), or a universal serial bus (i.e., USB) memory, to the HDD 104, or by writing data received via a network 107 to the HDD 104.
[0029] In addition, the HDD 104 may be replaced with other types of secondary storage devices, such as a solid state drive (SSD), a random access memory (RAM) disk, etc.
[0030] In the vector acquisition device 100, a program 105 installed in a HDD 104 is loaded into a memory 103, and the loaded program 105 is executed by a CPU 102. In this way, the computer executes the program 105 and functions as the vector acquisition device 100.
[0031] At least a part of the processing performed by CPU 102 may be performed by a processor other than CPU 102. For example, at least a part of the processing performed by CPU 102 may be performed by a graphics processing unit (GPU) or the like. Furthermore, at least a part of the processing performed by CPU 102 may be performed by hardware that does not execute a program.
[0032] FIG. 2 is a diagram showing an example of a functional configuration of the vector acquisition device 100 according to this embodiment.
[0033] As shown in FIG. 2, the vector acquisition device 100 includes at least an input unit 18 and an acquisition unit 12. The vector acquisition device 100 may also include a trained model 10, a similarity calculation unit 14, a recording unit 22, and an output unit 20. The input unit 18 and the output unit 20 are realized by the display 101 of FIG. 1 or the like. The recording unit 22 is realized by at least one of the memory 103 and the HDD 104 of FIG. 1, for example. The trained model 10, the acquisition unit 12, and the similarity calculation unit 14 are realized by, for example, causing the CPU 102 of FIG. 1 to execute the program 105.
[0034] The input unit 18 inputs data of a sentence composed of a plurality of words to the trained model 10. It is assumed that the input sentence contains a compound word that is a word that can be divided into a plurality of words.
[0035] The trained model 10 is a training model in which machine learning has been performed in advance using a neural network, etc. The trained model 10 includes an input layer to which sentence data divided into words, etc. by preprocessing such as morphological analysis is input, an embedding layer that assigns (embeds) a multidimensional vector as a distributed representation for each word in the data output from the input layer, and a hidden layer that adjusts the vector (weight) assigned to each word output from the embedding layer.
[0036] The embedding layer holds vectors for each word (i.e., initial vectors) obtained by learning using a large amount of learning data.
[0037] The hidden layer is divided into multiple layers, and the vectors (weights) are adjusted in each hidden layer. Here, the hidden layer that corresponds to the final layer among the multiple layers is called the final hidden layer.
[0038] For example, the BERT model, which is a language encoding model based on a transformer, can be used as the trained model 10. Note that the trained model 10 is not limited to the BERT model, and may be OpenAI GPT, ALBERT, XLNet, etc., which are based on a transformer.
[0039] In addition, although the trained model 10 is described in this embodiment as a configuration provided in the vector acquisition device 100, it may also be provided outside the vector acquisition device 100 and referenced depending on the operation of the vector acquisition device 100.
[0040] In addition, in this embodiment, the trained model 10 is assumed to include a hidden layer, but it may further include an output layer that provides output for any task using the adjustment vector described below.
[0041] The acquiring unit 12 acquires vectors (including initial vectors and adjustment vectors) from the trained model 10. The acquiring unit 12 can acquire the initial vectors from an embedding layer in the trained model 10. The acquiring unit 12 can acquire the adjustment vectors from a hidden layer (mainly the final hidden layer) in the trained model 10. The acquired vectors can be recorded in the recording unit 22.
[0042] Furthermore, the acquiring unit 12 can generate and acquire a composite vector, which is a vector corresponding to a compound word, based on the vector acquired from the trained model 10. The acquired composite vector can be recorded in the recording unit 22.
[0043] The similarity calculation unit 14 can calculate the similarity between words. Specifically, the similarity calculation unit 14 can calculate the cosine similarity between vectors corresponding to each word. Furthermore, when the calculated value is greater than a predetermined threshold value, the similarity calculation unit 14 can determine that the words are similar to each other. The calculated similarity and the corresponding determination result can be recorded in the recording unit 22.
[0044] The output section 20 can output at least one of the vector (including the composite vector) acquired by the acquisition section 12, the similarity calculated by the similarity calculation section 14, and the corresponding determination result.
[0045] Here, a description will be given of an example of the trained model 10. Fig. 3 is a diagram showing an example of the trained model 10 used in this embodiment.
[0046] As shown in Figure 3, the trained model 10 includes an input layer 30 to which sentence data divided into words and the like is input, an embedding layer 32 that assigns a multidimensional vector to each word in the data output from the input layer 30, and a hidden layer 34 (including a final hidden layer 36) that adjusts the vector (weight) assigned to each word output from the embedding layer 32.
[0047] 3, the hidden layer 34 is divided into a plurality of layers, and the vectors (weights) are adjusted stepwise in each hidden layer 34. Here, the hidden layer that is the final layer is referred to as the final hidden layer 36.
[0048] <About the operation of the vector acquisition device> Next, the operation of the vector obtaining device 100 (the operation of obtaining a composite vector and the operation of calculating similarity between words) will be described with reference to Fig. 4, Fig. 5, Fig. 6, and Fig. 7. Fig. 4 is a flowchart showing an example of the operation of the vector obtaining device 100.
[0049] As shown in an example in Fig. 4, first, the input unit 18 inputs sentence data consisting of a plurality of words to the input layer 30 of the trained model 10 (step ST01 in Fig. 4). Note that the input sentence data is data that has been previously divided into words, etc., by preprocessing such as morphological analysis.
[0050] As described above, it is assumed that the input sentence contains compound words that can be divided into multiple words. In addition, in this embodiment, it is assumed that the compound words contain words whose corresponding initial vectors are not held in the trained model 10 (hereinafter, also referred to as non-held words). Note that the non-held words do not have to be included in the data of the input sentence.
[0051] Next, in the embedding layer 32, a vector is assigned to each word in the data output from the input layer 30 of the trained model 10 (step ST02 in FIG. 4). In this embodiment, a vector (i.e., an initial vector) acquired by training using a large amount of training data is assigned to each word, but the initial vector may be updated by an adjustment vector.
[0052] Here, since the input sentence contains a compound word that is a non-retained word, an initial vector corresponding to the compound word is not retained in the trained model 10. Therefore, the compound word is further divided to generate words, and an initial vector is assigned to each divided word.
[0053] Note that even if a compound word in an input sentence is not a non-retained word (i.e., a corresponding compound vector is retained as an initial vector in the trained model 10), an initial vector corresponding to each word obtained by splitting the compound word may be assigned. For example, when a compound vector of a compound word specialized for sentences used in a specific field is desired, the initial vector of each word split using sentences in that field can be further adjusted, and the already registered compound vector can be updated to a vector suitable for the specific field.
[0054] Next, in the hidden layer 34 consisting of multiple layers, the vector for each word is adjusted (step ST03 in FIG. 4). Through this adjustment, the context of the input sentence is reflected, and an adjusted vector in which the initial vector is adjusted is generated for each word.
[0055] Next, the acquisition unit 12 acquires a vector from the trained model 10 (step ST04 in FIG. 4).
[0056] The acquisition unit 12 can acquire vectors corresponding to all words in the input sentence, but acquires at least one adjustment vector corresponding to a word divided from a compound word. The adjustment vector is mainly acquired from the final hidden layer 36.
[0057] Next, the acquisition unit 12 generates and acquires a composite vector corresponding to the compound word based on the vectors (including at least one adjustment vector) corresponding to each word divided from the compound word (step ST05 in FIG. 4). As a method for generating the composite vector, for example, a method (arithmetic mean) of combining vectors corresponding to all words divided from the compound word can be adopted, but other methods (for example, geometric mean or harmonic mean, etc.) may also be adopted.
[0058] In this manner, the vector acquisition device 100 can acquire a compound vector corresponding to a compound word.
[0059] In the above example, a case was shown in which the compound word itself was included in the input sentence, but the words obtained by splitting the compound word may be written in a dispersed manner in the input sentence, or may be written in an order different from that of the compound word in the input sentence.
[0060] Furthermore, it is sufficient that at least two of the words obtained by dividing the compound word are included in the input sentence. The input sentence does not have to be one, and other words obtained by dividing the compound word that are not included in the input sentence may be included in other input sentences.
[0061] In addition, the acquisition unit 12 does not need to acquire adjustment vectors for all words obtained by dividing a compound word. In other words, the acquisition unit 12 may acquire initial vectors corresponding to some of the words obtained by dividing a compound word, and generate a compound vector using the initial vectors.
[0062] The acquisition unit 12 may also generate an adjustment vector corresponding to the same word obtained by dividing a compound word multiple times. Then, based on the multiple adjustment vectors corresponding to the same word, the acquisition unit 12 may, for example, synthesize these vectors to create a unique corresponding vector and use it to generate a composite vector.
[0063] Furthermore, the similarity calculation unit 14 can calculate the similarity between one word in the input sentence and another word in the input sentence (step ST06 in FIG. 4). In particular, the similarity calculation unit 14 can calculate the similarity between a compound word (including a non-retained word) in the input sentence and another word in the input sentence. In addition, when the calculated value is larger than a predetermined threshold value, the similarity calculation unit 14 can determine that the words are similar to each other.
[0064] In the above, the words for which similarity is calculated are limited to those within the same sentence, but the words for which similarity is calculated may span multiple sentences.
[0065] Then, the output unit 20 can output at least one of the vector (including the composite vector) acquired by the acquisition unit 12, the similarity calculated by the similarity calculation unit 14, and the corresponding judgment result, all of which can be recorded in the recording unit 22 (step ST07 in FIG. 4). For example, the words can be displayed on the display 101 in descending order of similarity.
[0066] 5, 6 and 7 are diagrams showing a specific example of the operation in which a compound vector is obtained as described above and the similarity between compound words is calculated.
[0067] First, a vector is assigned to each word in the sentence data input to the input layer 30 of the trained model 10. In Fig. 5, of the words divided by morphological analysis or the like, vector T1 is assigned to "print", vector T2 to "circuit", vector T3 to "base", vector T4 to "plate", vector T5 to "of", vector T6 to "trace", vector T7 to "wo", vector T8 to "formation", and vector T9 to ".".
[0068] Here, "circuit," "base," and "board" were originally a compound word "circuit board," which was further divided to generate the words.
[0069] Next, these vectors are adjusted respectively in multiple layers of the hidden layer 34 of the trained model 10.
[0070] Next, the acquisition unit 12 acquires vectors from the trained model 10. In particular, the acquisition unit 12 acquires adjustment vectors (vectors T2, T3, and T4 in FIG. 5) corresponding to words divided from a compound word, as shown in FIG.
[0071] Next, the obtaining unit 12 generates a vector corresponding to the compound word (ie, circuit board) based on the vector T2, the vector T3, and the vector T4.
[0072] Next, the similarity calculation unit 14 calculates the similarity between one word and other words.
[0073] Fig. 7 is a diagram showing an example of the result of similarity calculated by the similarity calculation unit 14. In Fig. 7, the upper part shows multiple synonyms for the compound word when the vector of the word split from the compound word is set as the corresponding initial vector held in the trained model 10, and the lower part shows multiple synonyms for the compound word when the vector of the word split from the compound word is set as the adjustment vector output from the trained model 10 by the above operation. Here, synonyms are words whose similarity between words is equal to or greater than a predetermined threshold value.
[0074] As shown in the example in Figure 7, when comparing the upper and lower rows, the lower row lists words that are more appropriate as synonyms for compound words (not just words with similar character strings, but words that have a similar meaning to the compound word).This shows that the operation shown in Figure 4 causes the compound vector corresponding to the compound word to reflect the context in the sentence, improving the classification accuracy.
[0075] <Effects of the above-described embodiment> Next, examples of effects produced by the above-described embodiments are shown. In the following description, the effects are described based on the specific configurations shown as examples in the above-described embodiments, but they may be replaced with other specific configurations shown as examples in the present specification as long as the same effects are produced. In other words, for convenience, only one of the corresponding specific configurations may be described as a representative below, but the representatively described specific configuration may be replaced with another corresponding specific configuration.
[0076] According to the embodiment described above, in the vector acquisition method, a word that can be divided into a plurality of words is defined as a compound word. Then, at least one sentence including at least two of the words divided from the compound word is input to the trained model 10. Then, an adjustment vector corresponding to at least one of the words divided from the compound word in the input sentence is output from the trained model 10. Then, the adjustment vector output from the trained model 10 is used to acquire a compound vector that is a vector corresponding to the compound word.
[0077] According to this configuration, since a composite vector corresponding to a compound word can be obtained by using an adjustment vector, the relationship between words separated from the compound word in the input sentence can be reflected in the composite vector, thereby improving the classification accuracy (expression accuracy) of the composite vector.
[0078] Unless otherwise specified, the order in which the processes are performed may be changed.
[0079] Furthermore, even if other configurations, examples of which are shown in this specification, are appropriately added to the above configuration, i.e., other configurations in this specification that were not mentioned as the above configuration are appropriately added, the same effect can be produced.
[0080] Furthermore, according to the embodiment described above, the step of inputting a sentence to the trained model 10 is a step of inputting a sentence including a word split from a compound word for which a corresponding initial vector is not held in the trained model 10 to the trained model 10. With this configuration, a composite vector for which an initial vector is not held can be acquired by using an adjustment vector. Therefore, compared to a case in which a corresponding initial vector is acquired from the embedding layer 32 and a composite vector is generated based on the initial vector, the relationship in the sentence between the words split from the compound word is reflected in the composite vector. Therefore, the classification accuracy (representation accuracy) of the composite vector can be improved.
[0081] Furthermore, according to the embodiment described above, the vector acquisition method includes a step of calculating the similarity between a plurality of words including a compound word, using vectors corresponding to each of the plurality of words including the composite vector acquired using the adjustment vector. With this configuration, the similarity between words can be calculated using the composite vector with improved classification accuracy (representation accuracy), thereby improving the accuracy of the similarity calculation.
[0082] According to the embodiment described above, the step of obtaining a composite vector is a step of obtaining a composite vector by using an average value of adjustment vectors corresponding to the same word divided from a compound word contained in each of a plurality of sentences. With such a configuration, the difference between the same words in a plurality of sentences is taken into consideration, and the classification accuracy (representation accuracy) of the obtained composite vector can be improved.
[0083] According to the embodiment described above, the step of obtaining a composite vector is a step of obtaining a composite vector by averaging vectors corresponding to each word divided from a compound word. According to such a configuration, a composite vector is obtained by combining a plurality of vectors, so that the classification accuracy (representation accuracy) of the obtained composite vector can be improved.
[0084] According to the embodiment described above, the trained model 10 is a language encoding model based on a transformer. With this configuration, it is possible to improve the classification accuracy of the generated vector by taking into account the context of the sentence.
[0085] Furthermore, according to the embodiment described above, the step of inputting a sentence into the trained model 10 is a step of inputting a sentence including a compound word into the trained model 10. With this configuration, all words split from a compound word are included in one sentence, so that adjustment vectors corresponding to these words can be efficiently output. Furthermore, since the compound word is used as is in the sentence, the relationship in the sentence between the words split from the compound word also conforms to the meaning of the compound word, so that the classification accuracy (expression accuracy) of the adjustment vector to be output can be improved.
[0086] According to the embodiment described above, the vector acquisition device is a vector acquisition device that uses a trained model 10 that holds an initial vector, which is a vector previously trained corresponding to each of a plurality of words, and is capable of outputting an adjusted vector, which is a vector obtained by adjusting the initial vector in response to an input of a sentence composed of a plurality of words, corresponding to each word in the sentence. The vector acquisition device includes an input unit 18 and an acquisition unit 12. The input unit 18 inputs at least one sentence including at least two of the words split from a compound word to the trained model 10. The acquisition unit 12 acquires a compound vector, which is a vector corresponding to a compound word, using an adjustment vector corresponding to at least one of the words split from the compound word in the input sentence, which is output from the trained model 10.
[0087] Furthermore, according to the embodiment described above, the vector acquisition device includes a CPU 102 which is a processing circuit that executes a program, and a HDD 104 which is a storage device that stores the executed program 105. Then, the CPU 102 executes the program 105 to realize the following operations.
[0088] That is, at least one sentence including at least two of the words split from the compound word is input to the trained model 10. Then, a compound vector, which is a vector corresponding to the compound word, is obtained using an adjustment vector corresponding to at least one of the words split from the compound word in the input sentence, which is output from the trained model 10.
[0089] According to such a configuration, a composite vector corresponding to a compound word can be obtained by using an adjustment vector, so that classification accuracy (expression accuracy) of the composite vector can be improved.
[0090] Furthermore, the same effect can be achieved even if other configurations, examples of which are shown in this specification, are appropriately added to the above configuration, i.e., even if other configurations in this specification that were not mentioned as the above configuration are appropriately added.
[0091] According to the embodiment described above, the vector acquisition program causes the computer to input at least one sentence including at least two of the words split from the compound word to the trained model 10 by a plurality of instructions executed by the processor (CPU 102). The computer then acquires a compound vector, which is a vector corresponding to the compound word, by using an adjustment vector corresponding to at least one of the words split from the compound word in the input sentence, which is output from the trained model 10.
[0092] According to such a configuration, a composite vector corresponding to a compound word can be obtained by using an adjustment vector, so that classification accuracy (expression accuracy) of the composite vector can be improved.
[0093] Furthermore, the same effect can be achieved even if at least one of the other configurations whose examples are shown in this specification is appropriately added to the above configuration, that is, even if another configuration whose examples are shown in this specification but not mentioned as the above configuration is appropriately added.
[0094] The above program may be recorded on a computer-readable portable recording medium such as a magnetic disk, a flexible disk, an optical disk, a compact disk, a Blu-ray Disc (registered trademark), or a DVD. The portable recording medium on which the program for realizing the above functions is recorded may be commercially distributed.
[0095] <Modifications of the above-described embodiments> In the embodiments described above, the dimensions, shapes, relative positional relationships, and implementation conditions of each component may be described, but these are merely examples in all respects and are not limiting.
[0096] Thus, numerous variations and equivalents not shown are contemplated within the scope of the technology disclosed herein, including, for example, modifying, adding, or omitting at least one component.
[0097] In addition, in the embodiments described above, when a material name is mentioned without being specifically specified, it is understood that the material may contain other additives, such as an alloy, unless a contradiction arises.
[0098] Furthermore, each of the components described in the above embodiments is envisioned as either software or firmware, or as corresponding hardware, and in both concepts, each component is referred to as a "unit" or a "processing circuit" (circuitry), etc. [Explanation of symbols]
[0099] 10 Pre-trained models 12 Acquisition Department 14 Similarity calculation unit 18 Input section 20 Output section 22 Recording Section 30 Input Layer 32 Embedding Layer 34 Hidden Layer 36 Final hidden layer 100 Vector Acquisition Device 101 Display 102 CPU 103 Memory 104 HDD 105 Programs 106 External storage medium 107 Network
Claims
1. A vector acquisition method executed by a computer, the method using a trained model that holds an initial vector, which is a vector trained in advance corresponding to each of a plurality of words, and is capable of outputting an adjusted vector, which is a vector obtained by adjusting the initial vector in response to an input of a sentence composed of the plurality of words, corresponding to each of the words in the sentence; A word that can be divided into a plurality of said words is regarded as a compound word, The process is carried out by the processing circuit of the computer executing a program stored in a storage device, inputting at least one of the sentences, the sentence including at least two of the words to be split from the compound word, into the trained model; outputting, from the trained model, the adjustment vector corresponding to at least one of the words divided from the compound word in the input sentence; and acquiring a composite vector, which is the vector corresponding to the compound word, by using the adjustment vector output from the trained model. How to get vectors.
2. The vector acquisition method according to claim 1, The step of inputting the sentence into the trained model is a step of inputting the sentence including the word to be split from the compound word for which the corresponding initial vector is not held in the trained model into the trained model. How to get vectors.
3. The vector acquisition method according to claim 1 or 2, The method further includes a step of calculating a similarity between a plurality of the words including the compound word by using the vectors corresponding to the plurality of the words including the compound vector obtained by using the adjustment vector. How to get vectors.
4. A vector acquisition method according to any one of claims 1 to 3, The step of acquiring the composite vector is a step of acquiring the composite vector by using an average value of the adjustment vectors corresponding to the same word divided from the compound word, which are included in each of the plurality of sentences. How to get vectors.
5. A vector acquisition method according to any one of claims 1 to 4, The step of obtaining the composite vector is a step of obtaining the composite vector by averaging the vectors corresponding to the respective words divided from the compound word. How to get vectors.
6. A vector acquisition method according to any one of claims 1 to 5, The trained model is a transformer-based language encoding model. How to get vectors.
7. A vector acquisition method according to any one of claims 1 to 6, The step of inputting the sentence into the trained model is a step of inputting the sentence including the compound word into the trained model. How to get vectors.
8. a vector acquisition device that uses a trained model that holds an initial vector, which is a vector that has been trained in advance corresponding to each of a plurality of words, and is capable of outputting an adjusted vector, which is a vector obtained by adjusting the initial vector in response to an input of a sentence composed of the plurality of words, corresponding to each of the words in the sentence; A word that can be divided into a plurality of said words is regarded as a compound word, an input unit that inputs at least one sentence including at least two of the words divided from the compound word into the trained model; and an acquisition unit that acquires a composite vector, which is the vector corresponding to the compound word, by using the adjustment vector corresponding to at least one of the words divided from the compound word in the input sentence, which is output from the trained model. Vector acquisition device.
9. A vector acquisition program having a plurality of computer-executable instructions to be executed by one or a plurality of processors, the program using a trained model that holds an initial vector, which is a vector that has been trained in advance corresponding to each of a plurality of words, and is capable of outputting an adjusted vector, which is a vector obtained by adjusting the initial vector in response to an input of a sentence composed of the plurality of words, corresponding to each of the words in the sentence; A word that can be divided into a plurality of said words is regarded as a compound word, The instructions executed by the processor include: causing the computer to input at least one of the sentences, the sentence including at least two of the words to be split from the compound word, into the trained model; causing the computer to obtain a composite vector, which is the vector corresponding to the compound word, by using the adjustment vector output from the trained model and corresponding to at least one of the words in the input sentence that are divided from the compound word; Vector acquisition program.
Citation Information
Patent Citations
Increment learning method and device of word embedding and electronic equipment
CN108509422A
Search information processing method and system, server and computer readable medium
CN111858860A
Recording and playback system
JP1977050709A
Synonym dictionary creation apparatus, synonym dictionary creation program, and synonym dictionary creation method
JP2019049873A
Device, method and program for learning phrase vector
JP2019144708A