Chinese machine reading comprehension method and device based on pinyin embedding enhancement and multi-layer information fusion
By using pinyin embedding enhancement and multi-layer information fusion, the problem of model comprehension error in Chinese machine reading comprehension was solved, and the model's accuracy in processing Chinese text and its ability to handle complex linguistic phenomena was improved.
Patent Information
- Application Number
- CN202410567560.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-05-09
AI Technical Summary
In Chinese machine reading comprehension tasks, due to the complexity and ambiguity of the Chinese language, existing models are prone to errors when understanding Chinese text, and the lack of large-scale labeled data leads to poor performance.
By using a method based on Pinyin embedding enhancement and multi-layer information fusion, and utilizing Pinyin embedding vectors and the outputs of encoders at different levels of the BERT model, word-level, low-level, and high-level information fusion is performed to improve the model's ability to understand Chinese text.
It improves the performance of Chinese machine reading comprehension models, enabling them to capture word polysemy and contextual information more accurately, and enhances the model's ability to handle complex linguistic phenomena.
Smart Images

Figure CN118964537B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an extractive machine reading comprehension method in the field of natural language processing, and particularly to a Chinese extractive machine reading comprehension method and apparatus based on pinyin embedding enhancement and multi-layer information fusion. Technical Background
[0002] Extractive machine reading comprehension tasks aim to enable models to find accurate answers from given text, often directly extracted from the original text without generating new content. These tasks typically involve understanding the question and the text, as well as the ability to locate relevant information within the given text.
[0003] Research on neural network-based reading comprehension models focuses on employing bidirectional encoding or attention mechanisms to facilitate sufficient information interaction between the question and the text, emphasizing the parts relevant to the question, or utilizing part-of-speech tagging, syntactic analysis, and other methods to deeply understand the semantic information of the question and the text. However, these approaches all rely on large amounts of labeled data, especially in specific domains, where massive amounts of labeled data are required to achieve good performance. In the field of English machine reading comprehension, due to the relatively simple structure of the English language and abundant datasets, many advanced models and techniques have been widely applied and have achieved good results. In contrast, Chinese machine reading comprehension tasks present a greater challenge due to the complexity and ambiguity of the Chinese language, as well as the scarcity of Chinese datasets.
[0004] Chinese has a rich vocabulary and grammatical structure, with a large number of polyphonic characters and ambiguous words, making models more prone to errors when understanding Chinese text. Furthermore, the flexible and varied sentence structure in Chinese requires consideration of more contextual information, increasing the difficulty for models. Therefore, for Chinese machine reading comprehension tasks, it is necessary to address the polysemy of the Chinese language and improve the model's ability to accurately understand polysemous words and contextual information. Thus, developing a model that can alleviate the polysemy of Chinese words while capturing more contextual information is of great significance for building machine reading comprehension-based applications. Summary of the Invention
[0005] The present invention aims to overcome the above-mentioned shortcomings of the prior art and provide a Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion.
[0006] This invention improves the performance of machine reading comprehension models by fusing information from word-level, low-level, and high-level representation vectors, based on the unique pinyin information in Chinese and the different meanings of words understood by different layers of the model.
[0007] This invention is achieved through the following technical solution: a Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion, comprising the following steps:
[0008] Step 1: Preprocess the dataset by converting it into triplets consisting of context C, question Q, and answer A. The dataset D can be specifically represented as {D}. i |D i = (C, Q, A), 1 ≤ i ≤ n}, where n represents the size of the dataset D, and D i Let A represent the i-th data in the dataset, and let A be a continuous substring in the context C.
[0009] Step 2: Perform Chinese word segmentation on the data obtained in Step 1 to obtain the word sequence of the text. Then, pass the obtained Chinese word sequence through a convolutional network to obtain the pinyin embedding vector PE of the Chinese words.
[0010] Step 3: Based on the data obtained in Step 1, the paragraph and question are concatenated using the identifiers [CLS] and [SEP], and then input into BERT. BERT's wordpiece Chinese word segmentation is used to obtain the word embedding vector E for each word. token ;
[0011] Step 4: Based on the pinyin embedding PE and word embedding E obtained in Step 2 and Step 3 respectively token A fully connected layer is used to obtain a fused word embedding FE that fuses the pinyin embedding vector. This is then combined with the segment embedding E of the input sequence. seg and position embedding E pos Add them together to obtain the complete embedding vector w of the input sequence;
[0012] Step 5: Perform BERT encoding based on the sequence embedding vector obtained in Step 4, so as to obtain the encoded vector representations output by different encoding layers;
[0013] Step 6: Based on the operations in Step 5, perform multi-layer attention fusion calculation on the encoded representations obtained from the first six layers of the BERT model encoder and the word embedding representations obtained in Step 5 to obtain a context representation vector v that fuses low-level question semantic information. Cl Where C represents the context and l represents low-level information fusion;
[0014] Step 7: Input the context encoding representation obtained in Step 6 and the question encoding representation of the sixth layer into the seventh layer encoder. This will sequentially produce the encoding representations of the seventh to eleventh layers encoder. Then, perform multi-layer attention fusion calculation with the word embedding vector from Step 5 and the low-level encoding representation obtained in Step 6 to obtain the context representation vector v that fuses high-level question semantic information. ChWhere C represents the context and h represents high-level information fusion;
[0015] Step 8: Based on the high-level context representation obtained in Step 7 and the problem representation vector of the eleventh-layer encoder, input them into the last encoder. Utilize the encoder's self-attention to obtain the final context semantic vector that fuses multi-layer information. Where C represents the context, Q represents the question, m and n represent the lengths of the context and the question, respectively, and L... 12 This represents the encoded representation obtained from the twelfth layer encoder, where h represents the low-level encoded vector.
[0016] Step 9: Based on the sentence vector representation obtained in Step 8, predict the probability distribution of each position as the starting and ending point of the answer using the softmax function. Finally, traverse all possible combinations of starting and ending points and select the combination with the largest probability product to determine the span of the answer.
[0017] Furthermore, the step 2, which involves obtaining the pinyin embedding using a convolutional network model, specifically refers to: assuming the number of pinyin syllables for each Chinese character is len, randomly initializing a pd-dimensional vector for each pinyin syllable to form a pinyin matrix. Convert Chinese text into a Pinyin sequence x = [x1, x2, ..., x...] lx The PV is used to map each pinyin sequence to a corresponding pinyin vector, resulting in the matrix px = [x1, x2, ..., x]. lx ]. Where x i =PV(x i ), 1≤i≤lx, representing the pinyin x i The corresponding pinyin vector, lx, represents the number of Chinese characters. By performing convolution on the pinyin sequence and then max pooling, the pinyin embedding representation PE is obtained.
[0018] Furthermore, the embedding vector w from step 4 can be represented as w = FE + E seg +E pos , where FE = concat(E token ,PE)W fc +b fc W fc W represents the weights of the fully connected layer. fc Indicates the bias of the fully connected layer.
[0019] Furthermore, step 5, which describes the encoding operation of the input sequence embedding using BERT, specifically refers to using the encoder in BERT to model the semantic information of the words in the input sequence, obtaining the encoding output of each layer of the input sequence. Given the input sequence embedding w, it is input into the BERT model:
[0020]
[0021] Where C represents the context paragraph, Q represents the question, m and n represent the length of the context and the length of the question, respectively, and L... i Let l represent the encoded representation obtained from the i-th layer encoder, where 1 ≤ i ≤ 6, and l represents the lower-level encoded vector. Similarly, the encoded representations of the first six layers encoder can be obtained.
[0022] Furthermore, the attention fusion computation described in step 6 specifically refers to: defining two sets of vectors related to the context and the question. and The word-level and the encoding vectors from the first six layers are concatenated to fuse all low-level information from question Q into the context C:
[0023]
[0024] W C and W Q Let v represent the learnable weight matrix, v represent the weight vector, and then the attention weights are obtained through a softmax operation: Finally obtained Next, BiLSTM was used to obtain... and Encoding the representation vector yields the context representation vector of the low-level fused information:
[0025] Furthermore, the high-level information fusion described in step 7 specifically refers to obtaining information through the seventh coding layer. Here, h represents the higher-level encoding operation. Similarly, the encoding representations for layers seven through eleven can be obtained, resulting in... and By fusing the high-level semantic information in question Q into the context, we obtain... Similarly, BiLSTM is used to fuse low-level vectors. High-level fusion vector and Constructing a contextual representation of high-level fused information:
[0026] Furthermore, the context semantic vector that integrates multi-layer information mentioned in step 8 specifically refers to: using the last layer encoder of BERT to perform self-attention calculation on the high-level context representation to obtain the context encoding vector of all layers of information in the fusion problem:
[0027] Furthermore, regarding step 9, using the softmax function to predict the probability of each position as the start and end point specifically means: assuming the input context length is M, the model will output P. start and P end :
[0028]
[0029] Among them, s i and e i Let P represent the scores for the i-th position predicted by the model as the starting and ending points of the answer. Ultimately, the starting and ending points with the highest joint probability are selected: P joint (i,j)=P start (i)×P end (j) By traversing all possible combinations of start and end points, select the one that makes P... joint The largest possible combination (i,j) is the final span of the answer.
[0030] As described above, the model uses the cross-entropy loss function to measure the difference between the model's predicted answer and the actual answer. The specific calculation formula is as follows:
[0031]
[0032] Among them, y start and y end These represent the true label vectors at the start and end positions of the actual answer, respectively. Finally, the losses at the start and end positions are weighted and summed to obtain the complete loss function:
[0033] Loss = λ·Loss start +(1-λ)·Loss end (4)
[0034] Here, λ is a weighting parameter used to balance the loss at the start and end positions.
[0035] A second aspect of the present invention relates to a Chinese machine reading comprehension device based on pinyin embedding enhancement and multi-layer information fusion, comprising a memory and one or more processors, wherein the memory stores executable code, and the one or more processors execute the executable code to implement the Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion of the present invention.
[0036] A third aspect of the invention relates to a computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the Chinese machine reading comprehension method of the present invention based on pinyin embedding enhancement and multi-layer information fusion.
[0037] The beneficial effects of this invention are:
[0038] This invention employs pinyin embedding enhancement and multi-layer information fusion to achieve Chinese machine reading comprehension tasks. By enhancing word vectors through pinyin embedding, the model can acquire more dimensional word-level information. Furthermore, through multi-layer information fusion, attention is fused between word-level, low-level vector representations, and high-level vector representations of the input text, fully integrating question information into the context. This allows the model to capture more comprehensive semantic information and improve its ability to handle complex linguistic phenomena. The Chinese machine reading comprehension method based on pinyin embedding and multi-layer information fusion constructed in this invention aims to achieve better performance by acquiring richer and more comprehensive interactive information. Attached Figure Description
[0039] Figure 1 This is a flowchart of the method proposed in this invention.
[0040] Figure 2 This invention presents the architecture of a reading comprehension model based on pinyin embedding and multi-layer information fusion.
[0041] Figure 3 This is a graph showing the trend of model loss changes in this invention. Detailed Implementation
[0042] To better explain the present invention, the detailed implementation steps will be described below with reference to the accompanying drawings and examples.
[0043] Example 1
[0044] This invention proposes a Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion. The technical solution adopted includes the following steps:
[0045] Step 1: Obtain the Chinese machine reading comprehension dataset. The dataset is the CMRC2018 reading comprehension dataset. For ease of description, a context paragraph and a question-answer pair are selected as examples: Context = "A complex sentence is a sentence consisting of a main clause and a subordinate clause. Subordinate clauses are usually divided into three types: relative clauses, adverbial clauses, and noun clauses.", Question = "What is a complex sentence?", Answer = "A complex sentence is a sentence consisting of a main clause and a subordinate clause."
[0046] Step 2: Use the Chinese word segmentation tool jieba to perform word segmentation on the data, obtaining the word lists of Context and Question. The word segmentation in this embodiment is: C = ['main-subordinate', 'complex sentence', 'is', 'composed of', 'one','main clause', 'and', 'one','subordinate clause', 'The complex sentence formed by.', 'The subordinate clause', 'is usually', 'divided into', 'three', 'types:', 'attributive clause','adverbial clause', 'and','noun clause', '.'] and Q = ['What', 'is', 'a','main-subordinate', 'complex sentence', '?']. Then use the open-source Chinese word pinyin library pypinyin to process the words obtained by word segmentation to get the correct pinyin. In addition to letters, pinyin also has tones. In the experiments of this invention, numbers are used to represent tones, which are appended to the pinyin sequence, and the length of the pinyin sequence is fixed at 8. The insufficient parts are filled with the special character "-". In this embodiment, for example, "main-subordinate" is converted to [zhu3----cong2---];
[0047] Step 3: We manually define the mapping dictionary of pinyin characters, pinyin_map = {<t1,x1>,<t2,x2>,…,<t 32 ,x 32 >}, where t i represents the characters that make up the pinyin, and x i represents the set id number. 32 is the size of the mapping dictionary of all pinyin characters. Since there are 26 characters that make up pinyin, plus 4 tones, and the padding character, a total of 32 are designed; Table 1 is the mapping comparison table of pinyin characters:
[0048]
[0049] Convert the input pinyin characters into a pinyin sequence pinyin_ids through the mapping dictionary of pinyin characters; In this embodiment, including the special identifier, there are a total of 48 pinyin numbers, and we can get
[0050]
[0051] Step 4: Obtain the pinyin embedding matrix PV through random initialization k×pd , where k represents the number of entries in the pinyin dictionary, pd represents the dimension of pinyin embedding, and the pinyin embedding matrix PV is a parameter for model training. Convert the pinyin sequence into a vector representation PE = max_pooling(CNN(PV(pinyin_ids), C, H, W = pd)) lx×CWhere pinyin_ids represents the pinyin sequence, which is converted into a pinyin vector through the pinyin embedding matrix PV, C represents the convolution channel, and lx represents the number of Chinese characters in the input sequence. The functions CNN() and max_pooling() both return vectors. In this embodiment, the number of convolution channels C = 300 and lx = 48, which can be used to obtain the pinyin embedding matrix PE of the context. 48×300 :
[0052]
[0053] Step 5: Concatenate the context and question using special identifiers [CLS] and [SEP] to obtain the input sequence for the BERT model. Use BERT's built-in word segmentation tool to segment the input sequence, and then obtain the word vector representation E of each word using the BERT pre-trained vocabulary. token Through a fully connected layer, PE is connected to word embedding E. token The fusion process yields a vector FE = concat(E) enhanced with pinyin embedding. token ,PE)W fc +b fc W fc It is the weight matrix, b fc It is a bias; in this embodiment, W fc The dimension is 1068×768, and the embedding vector of the fused pinyin embedding is...
[0054]
[0055] Then use segment embedding E seg and position embedding E pos Adding the enhanced word embedding (FE) to the complete embedding vector yields the complete embedding vector. Where lx represents the length of the input sequence after concatenating the context and the question, and d embed It is the embedding dimension of the model. This indicates that the vector is added element by element;
[0056] Step 6: The BERT model encodes the complete embedding vector and performs multi-layer information attention fusion calculation on the six low-level encoded vectors and the embedding vector to obtain a context vector representation that integrates semantic information from both the word level and the low-level question. in in This indicates concatenation of vectors, where l represents a low-level encoding operation. Similarly, WH can also be obtained. Q Then, after passing through BiLSTM... The vector is encoded with the sixth-layer context vector to obtain a low-level fused information representation. In this embodiment, the obtained low-level information fusion context representation v Cl
[0057]
[0058] Similarly, based on the obtained vector representation v Cl The input is fed into the seventh layer encoder to obtain... It can obtain high-level encoding representations from the seventh to the eleventh level, and word-level embeddings w C and low-level fusion information By performing multi-layer information attention fusion, a contextual representation incorporating high-level semantic information into question Q is obtained. in Similarly, we can obtain WH Q Then, after passing through BiLSTM... The vector is encoded with the context vector of the eleventh layer to obtain a high-level fused information representation. In this embodiment, the vector representation of the high-level information fusion of context C is as follows:
[0059]
[0060] Finally, the last encoder layer of BERT is used to fuse the high-level information representation vector v. Ch Encode the vector from the eleventh layer to obtain the final hidden vector v. output In this embodiment, the final encoded output of the input sequence is
[0061]
[0062] Step 7: Based on the encoded vector representation of the input sequence and the context, calculate the probability P of each word in the context sequence as the starting position for predicting the answer. start (i) and the probability P that represents the ending position of the answer. end (i), finally take the value that makes P joint (i,j)=P start (i)×P end (j) The combination with the largest result.
[0063] In this embodiment, the highest joint probability obtained is 0.246156, where the calculated P... start (0) = 0.562, P end(19) = 0.438. Combining these two results in the highest joint probability. Therefore, the starting position is 0, and the ending position is 19. The continuous sequence between these two positions is the answer to the problem. Furthermore, the corresponding loss L... start It is 0.62, L end The loss is 0.78. The weighted sum of the two losses is used to obtain the complete loss for the predicted answer.
[0064] At this point, the training of one sample of the Chinese machine reading comprehension model based on pinyin embedding enhancement and multi-layer information fusion has been completed. Repeat the above steps to calculate the complete loss for each data sample, and finally optimize and fine-tune the model.
[0065] Example 2
[0066] This embodiment relates to a Chinese machine reading comprehension device based on pinyin embedding enhancement and multi-layer information fusion, including a memory and one or more processors. The memory stores executable code, and when the one or more processors execute the executable code, they are used to implement the Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion of Embodiment 1.
[0067] Example 3
[0068] This embodiment relates to a computer-readable storage medium storing a program that, when executed by a processor, implements the Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion as described in Embodiment 1.
[0069] For those skilled in the art, the above content is only used to illustrate the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, etc., made within the essential spirit of the present invention should be included within the scope of protection of the invention.
Claims
1. A Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion, comprising the following steps: Step 1: Preprocess the dataset by converting it into triplets consisting of context C, question Q, and answer A. Represent the dataset D as {D}. i |D i = (C, Q, A), 1 ≤ i ≤ n}, where n represents the size of the dataset D, and D i Let A represent the i-th data point in the dataset, and let answer A be a continuous substring in context C. Step 2: Perform Chinese word segmentation on the data obtained in Step 1 to obtain the word sequence of the text. Then, pass the obtained Chinese word sequence through a convolutional network to obtain the pinyin embedding vector PE of the Chinese words. Step 3: Based on the data obtained in Step 1, the paragraph and question are concatenated using the identifiers [CLS] and [SEP], and then input into BERT. BERT's wordpiece Chinese word segmentation is used to obtain the word embedding vector E for each word. token ; Step 4: Based on the pinyin embedding (PE) and word embedding (E) obtained in Steps 2 and 3 respectively. token A fused word embedding FE, which combines the pinyin embedding vectors, is obtained through a fully connected layer; then it is combined with the segment embedding E of the input sequence. seg and position embedding E pos Add them together to obtain the complete embedding vector w of the input sequence; Step 5: Perform BERT encoding based on the sequence embedding vector obtained in Step 4, so as to obtain the encoded vector representations output by different encoding layers; Step 6: Based on the operations in Step 5, perform multi-layer attention fusion calculation on the encoded representations obtained from the first six layers of the BERT model encoder and the word embedding representations obtained in Step 5 to obtain a context representation vector v that fuses low-level question semantic information. Cl Where C represents the context and l represents low-level information fusion; Step 7: Input the context encoding representation obtained in Step 6 and the question encoding representation of the sixth layer into the seventh layer encoder. This will sequentially produce the encoding representations of the seventh to eleventh layers encoder. Then, perform multi-layer attention fusion calculation with the word embedding vector from Step 5 and the low-level encoding representation obtained in Step 6 to obtain the context representation vector v that fuses high-level question semantic information. Ch Where C represents the context and h represents high-level information fusion; Step 8: Based on the high-level context representation obtained in Step 7 and the problem representation vector of the eleventh-layer encoder, input them into the last encoder. Utilize the encoder's self-attention to obtain the final context semantic vector that fuses multi-layer information. Where C represents the context, Q represents the question, m and n represent the lengths of the context and the question, respectively, and L... 12 This represents the encoded representation obtained from the twelfth layer encoder, where h represents the low-level encoded vector; Step 9: Based on the sentence vector representation obtained in Step 8, predict the probability distribution of each position as the starting and ending point of the answer using the softmax function. Finally, traverse all possible combinations of starting and ending points and select the combination with the largest probability product to determine the span of the answer.
2. The Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion as described in claim 1, characterized in that, Step 2 specifically includes: Let the number of pinyin syllables for each Chinese character be len, and randomly initialize a pd-dimensional vector for each pinyin syllable to form a pinyin matrix. Convert Chinese text into a Pinyin sequence x = [x1, x2, ..., x...] lx The PV is used to map each pinyin sequence to a corresponding pinyin vector, resulting in the matrix px = [x1, x2, ..., x]. lx ]; where x i =PV(x i ), 1≤i≤lx, representing the pinyin x i The corresponding pinyin vector, lx, represents the number of Chinese characters; by performing convolution on the pinyin sequence and then max pooling, the pinyin embedding representation PE is obtained.
3. The Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion as described in claim 1, characterized in that, The embedding vector w in step 4 can be represented using energy as w = FE + E seg +E pos , where FE = concat(E token ,PE)W fc +b fc W fc W represents the weights of the fully connected layer. fc Indicates the bias of the fully connected layer.
4. The Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion as described in claim 1, characterized in that, Step 5 specifically includes: using the encoder in BERT to model the semantic information of words in the input sequence, obtaining the encoding output of each layer of the input sequence; given the embedding vector w of the input sequence, inputting it into the BERT model: Where C represents the context paragraph, Q represents the question, m and n represent the length of the context and the length of the question, respectively, and L... i Let l represent the encoded representation obtained by the i-th layer encoder, where 1 ≤ i ≤ 6, and l represents the low-level encoded vector; similarly, the encoded representations of the first six layers encoder can be obtained.
5. The Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion as described in claim 4, characterized in that, Step 6 specifically includes: defining two sets of vectors related to the context and the question. and The word-level and the encoding vectors from the first six layers are concatenated to fuse all low-level information from question Q into the context C: W C and W Q Let v represent the learnable weight matrix, v represent the weight vector, and then the attention weights are obtained through a softmax operation: Finally obtained Next, BiLSTM was used to obtain... and Encoding the representation vector yields the context representation vector of the low-level fused information:
6. The Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion as described in claim 5, characterized in that, Step 7 specifically includes: obtaining through the seventh coding layer Where h represents higher-level encoding operations; the encoding representation from level 7 to level 11 is as follows: and By fusing the high-level semantic information in question Q into the context, we obtain... Constructing a contextual representation of high-level fused information:
7. The Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion as described in claim 6, characterized in that, Step 8, which involves fusing multi-layered information into a contextual semantic vector, specifically refers to: using the last encoder layer of BERT to perform self-attention calculation on the high-level context representation to obtain a context encoding vector containing all layers of information in the fusion problem.
8. The Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion as described in claim 1, characterized in that, Step 9 specifically includes: assuming the input context length is M, the model will output P. start and P end : Among them, s i and e i Let P represent the scores for the i-th position predicted by the model as the starting and ending points of the answer, respectively; ultimately, the starting and ending points with the highest joint probability are selected: P joint (i,j)=P start (i)×P end (j) By traversing all possible combinations of start and end points, select the one that makes P... joint The largest possible combination (i,j) is the final range of the answer. The model uses the cross-entropy loss function to measure the difference between the model's predicted answer and the actual answer. The specific calculation formula is as follows: Among them, y start and y end Let the true label vectors represent the start and end positions of the actual answer, respectively. Finally, the losses at the start and end positions are weighted and summed to obtain the complete loss function: Loss=λ·Loss start +(1-λ)·Loss end (4) Here, λ is a weighting parameter used to balance the loss at the start and end positions.
9. A Chinese machine reading comprehension device based on pinyin embedding enhancement and multi-layer information fusion, characterized in that, The method includes a memory and one or more processors, wherein the memory stores executable code, and the one or more processors execute the executable code to implement the Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, It stores a program that, when executed by a processor, implements the Chinese machine reading comprehension method based on pinyin embedding enhancement and multi-layer information fusion as described in any one of claims 1-8.
Citation Information
Patent Citations
Method for generating Chinese word vector with multi-submodule information
CN111160020A
Chinese short text similarity calculation method based on CNN and pinyin features
CN115525735A