Opinion role labeling model training method and device
By translating and annotating corpus samples, models suitable for different languages are trained based on the existing view role labeling model, which solves the problem that cross-language applications cannot be realized in the existing technology, and a more general view role recognition model is realized.
Patent Information
- Application Number
- CN202110188109.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-18
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-02-18
AI Technical Summary
The prior art cannot realize the cross-lingual application of the view role recognition process based on the existing view role labeling model.
By obtaining the first corpus sample corresponding to the first view role annotation model, it is translated into the second corpus corresponding to the second language, and annotating the second corpus according to the first corpus sample and the first view role label. , obtain the second corpus sample, and finally perform model training based on the second corpus sample to obtain the second view role labeling model suitable for the second language.
Based on the existing view role annotation model, the view role recognition model is applied across languages, which enhances the universality and ease of use of the view role recognition process.
Smart Images

Figure CN114970500B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for training a viewpoint role labeling model, a device for training a viewpoint role labeling model, an electronic device, and a storage device. Background Art
[0002] Opinion role labeling is used to analyze "who expressed what opinion on what" in a text sentence. The main identification objects include the opinion holder (holder), the expression verb (expression), and the opinion content (target). In general, the expression part is known by default, and the holder and target parts need to be identified. The opinion role labeling model is widely used in scenarios such as information extraction, opinion aggregation, and public opinion analysis. It is used to identify the information of the opinion holder and the opinion content expressed by the opinion holder from the input text, and can be used to identify important roles related to the opinion from the text information. Due to the differences between texts in different languages, different languages correspond to different opinion role labeling models. How to realize the cross-language application of the opinion role identification process based on the existing opinion role labeling model is a problem that needs to be solved at present. Summary of the invention
[0003] The present application provides a method, device, electronic device and computer-readable storage medium for training a viewpoint role labeling model to solve the problem in the prior art that it is impossible to implement cross-language application of the viewpoint role identification process based on the existing viewpoint role labeling model.
[0004] This application provides a method for training a viewpoint role labeling model, including:
[0005] Obtaining a first corpus sample corresponding to a first opinion role labeling model, wherein the first corpus sample is labeled with a first opinion role label, and the first opinion role labeling model is used to identify a first target opinion holder and a first target opinion content expressed by the first target opinion holder from an input first language text;
[0006] translating the first corpus sample into a second corpus corresponding to a second language;
[0007] According to the first corpus sample and the first opinion role label, annotating the second corpus with opinion role information to obtain a second corpus sample, wherein the second corpus sample is annotated with a second opinion role label;
[0008] Model training is performed based on the second corpus sample to obtain a second opinion role labeling model, where the second opinion role model is used to identify a second target opinion holder and the second target opinion content expressed by the second target opinion holder from the input second language text.
[0009] As an implementation manner, the first opinion role label includes: a first opinion holder label corresponding to an opinion holder in the first corpus sample, a first expression label corresponding to an expression verb in the first corpus sample, and a first opinion label corresponding to an opinion content in the first corpus sample;
[0010] The second opinion role label includes: a second opinion holder label corresponding to the opinion holder in the second corpus sample, a second expression label corresponding to the expression verb in the second corpus sample, and a second opinion label corresponding to the opinion content in the second corpus sample; wherein the opinion holder in the first corpus sample and the opinion holder in the second corpus sample are the same opinion holders corresponding to different languages, the expression verb in the first corpus sample and the expression verb in the second corpus sample are the same expression verbs corresponding to different languages, and the opinion content in the first corpus sample and the opinion content in the second corpus sample are the same opinion content corresponding to different languages.
[0011] As an implementation manner, the step of labeling the second corpus with viewpoint role information according to the first corpus sample and the first viewpoint role label to obtain the second corpus sample includes:
[0012] Determine the opinion holders in the second corpus according to the opinion holders in the first corpus sample, determine the expression verbs in the second corpus according to the expression verbs in the first corpus sample, and determine the opinion content in the second corpus according to the opinion content in the first corpus sample;
[0013] Annotating the opinion holders in the second corpus based on the first opinion holder label to obtain the second opinion holder label; annotating the expression verbs in the second corpus based on the first expression label to obtain the second expression label; annotating the opinion content in the second corpus based on the first opinion label to obtain the second opinion label;
[0014] The second corpus annotated with the second opinion holder label, the second expression label, and the second opinion label is determined as the second corpus sample.
[0015] As an implementation mode, the method further includes: performing text segmentation processing on the first corpus sample and the second corpus respectively, and obtaining word alignment probabilities between each segmentation in the first corpus sample and each segmentation in the second corpus;
[0016] Determining the opinion holder in the second corpus according to the opinion holder in the first corpus sample includes: obtaining candidate text segments corresponding to the opinion holder in the second corpus; obtaining a segmentation in the second corpus that has a maximum word alignment probability with the segmentation contained in the opinion holder in the first corpus sample, and determining the shortest continuous text segment containing the segmentation in the candidate text segments as the opinion holder in the second corpus;
[0017] Correspondingly, determining the expression verb in the second corpus according to the expression verb in the first corpus sample includes: obtaining the shortest continuous text segment in the second corpus, which is composed of the segment words corresponding to the expression verb in the first corpus sample and has the maximum word alignment probability, and determining the shortest continuous text segment as the expression verb in the second corpus;
[0018] Correspondingly, determining the opinion content in the second corpus based on the opinion content in the first corpus sample includes: obtaining alternative text segments corresponding to the opinion content in the second corpus; obtaining the segmentation in the second corpus that has the maximum word alignment probability corresponding to the segmentation contained in the opinion content in the first corpus sample, and determining the shortest continuous text segment containing the segmentation in the alternative text segments as the opinion content in the second corpus.
[0019] As an implementation mode, the method further includes: performing text segmentation processing on the first corpus sample and the second corpus respectively, and obtaining word alignment probabilities between each segmentation in the first corpus sample and each segmentation in the second corpus;
[0020] The step of labeling the second corpus with viewpoint role information according to the first corpus sample and the first viewpoint role label to obtain the second corpus sample includes:
[0021] Obtaining a word segment in the second corpus that has a maximum word alignment probability with the expression verb in the first corpus sample, and determining a text segment composed of the word segment as the expression verb in the second corpus;
[0022] Determining the opinion holder and the opinion content corresponding to the expression verb in the first corpus sample;
[0023] Obtaining a word in the second corpus that has a maximum word alignment probability with a word contained in the opinion holder in the first corpus sample, and determining the shortest continuous text segment containing the word as the opinion holder in the second corpus;
[0024] A word segment in the second corpus having a maximum word alignment probability corresponding to a word segment included in the opinion content in the first corpus sample is obtained, and the shortest continuous text segment including the word segment is determined as the opinion content in the second corpus.
[0025] As an implementation mode, the method further includes: checking the accuracy of the text segmentation processing.
[0026] As an implementation manner, the method further includes: checking the accuracy of determining the shortest continuous text segment.
[0027] As an implementation manner, the method further includes: checking the accuracy of the maximum word alignment probability.
[0028] As an implementation manner, after translating the first corpus sample into a second corpus corresponding to a second language, it also includes: detecting whether a translation result of translating the first corpus sample into the second corpus corresponding to the second language is incorrect, and / or detecting whether the second corpus is suitable for the usage environment of the second language.
[0029] As an implementation mode, performing model training based on the second corpus sample to obtain the second opinion role labeling model includes: adopting the model framework corresponding to the first opinion role labeling model, and performing model training based on the second corpus sample to obtain the second opinion role labeling model.
[0030] As an implementation method, the model framework includes: a word vector representation layer, a bidirectional prediction encoding layer and a CRF decoding layer.
[0031] The present application also provides a viewpoint role labeling model training device, comprising:
[0032] a first corpus sample obtaining unit, for obtaining a first corpus sample corresponding to a first opinion role labeling model, wherein the first corpus sample is labeled with a first opinion role label, and the first opinion role labeling model is used to identify a first target opinion holder and a first target opinion content expressed by the first target opinion holder from an input first language text;
[0033] A second corpus obtaining unit, configured to translate the first corpus sample into a second corpus corresponding to a second language;
[0034] A second corpus sample obtaining unit, configured to annotate the second corpus with viewpoint role information according to the first corpus sample and the first viewpoint role label, to obtain a second corpus sample, wherein the second corpus sample is annotated with a second viewpoint role label;
[0035] A model training unit is used to perform model training based on the second corpus sample to obtain a second opinion role labeling model, wherein the second opinion role model is used to identify a second target opinion holder and a second target opinion content expressed by the second target opinion holder from an input second language text.
[0036] As an implementation manner, the first opinion role label includes: a first opinion holder label corresponding to an opinion holder in the first corpus sample, a first expression label corresponding to an expression verb in the first corpus sample, and a first opinion label corresponding to an opinion content in the first corpus sample;
[0037] The second opinion role label includes: a second opinion holder label corresponding to the opinion holder in the second corpus sample, a second expression label corresponding to the expression verb in the second corpus sample, and a second opinion label corresponding to the opinion content in the second corpus sample; wherein the opinion holder in the first corpus sample and the opinion holder in the second corpus sample are the same opinion holders corresponding to different languages, the expression verb in the first corpus sample and the expression verb in the second corpus sample are the same expression verbs corresponding to different languages, and the opinion content in the first corpus sample and the opinion content in the second corpus sample are the same opinion content corresponding to different languages.
[0038] As an implementation manner, the second corpus sample obtaining unit is specifically used for:
[0039] Determine the opinion holders in the second corpus according to the opinion holders in the first corpus sample, determine the expression verbs in the second corpus according to the expression verbs in the first corpus sample, and determine the opinion content in the second corpus according to the opinion content in the first corpus sample;
[0040] Annotating the opinion holders in the second corpus based on the first opinion holder label to obtain the second opinion holder label; annotating the expression verbs in the second corpus based on the first expression label to obtain the second expression label; annotating the opinion content in the second corpus based on the first opinion label to obtain the second opinion label;
[0041] The second corpus annotated with the second opinion holder label, the second expression label, and the second opinion label is determined as the second corpus sample.
[0042] As an embodiment, the device further includes:
[0043] A word alignment probability obtaining unit, used to perform text segmentation processing on the first corpus sample and the second corpus respectively, and obtain the word alignment probability between each segmentation in the first corpus sample and each segmentation in the second corpus;
[0044] Determining the opinion holder in the second corpus according to the opinion holder in the first corpus sample includes: obtaining candidate text segments corresponding to the opinion holder in the second corpus; obtaining a segmentation in the second corpus that has a maximum word alignment probability with the segmentation contained in the opinion holder in the first corpus sample, and determining the shortest continuous text segment containing the segmentation in the candidate text segments as the opinion holder in the second corpus;
[0045] Correspondingly, determining the expression verb in the second corpus according to the expression verb in the first corpus sample includes: obtaining the shortest continuous text segment in the second corpus, which is composed of the segment words corresponding to the expression verb in the first corpus sample and has the maximum word alignment probability, and determining the shortest continuous text segment as the expression verb in the second corpus;
[0046] Correspondingly, determining the opinion content in the second corpus based on the opinion content in the first corpus sample includes: obtaining alternative text segments corresponding to the opinion content in the second corpus; obtaining the segmentation in the second corpus that has the maximum word alignment probability corresponding to the segmentation contained in the opinion content in the first corpus sample, and determining the shortest continuous text segment containing the segmentation in the alternative text segments as the opinion content in the second corpus.
[0047] As an embodiment, the device further includes:
[0048] A word alignment probability obtaining unit, used to perform text segmentation processing on the first corpus sample and the second corpus respectively, and obtain the word alignment probability between each segmentation in the first corpus sample and each segmentation in the second corpus;
[0049] The second corpus sample obtaining unit is specifically used for:
[0050] Obtaining a word segment in the second corpus that has a maximum word alignment probability with the expression verb in the first corpus sample, and determining a text segment composed of the word segment as the expression verb in the second corpus;
[0051] Determining the opinion holder and the opinion content corresponding to the expression verb in the first corpus sample;
[0052] Obtaining a word in the second corpus that has a maximum word alignment probability with a word contained in the opinion holder in the first corpus sample, and determining the shortest continuous text segment containing the word as the opinion holder in the second corpus;
[0053] A word segment in the second corpus having a maximum word alignment probability corresponding to a word segment included in the opinion content in the first corpus sample is obtained, and the shortest continuous text segment including the word segment is determined as the opinion content in the second corpus.
[0054] As an embodiment, the device further includes:
[0055] The text segmentation accuracy checking unit is used to check the accuracy of the text segmentation processing.
[0056] As an embodiment, the device further includes:
[0057] The text segment accuracy checking unit is used to check the accuracy of the shortest continuous text segment.
[0058] As an embodiment, the device further includes:
[0059] The word alignment probability accuracy checking unit is used to check the accuracy of the maximum word alignment probability.
[0060] As an embodiment, the device further includes:
[0061] A detection unit is used to detect whether a translation result of translating the first corpus sample into the second corpus corresponding to the second language is incorrect after translating the first corpus sample into the second corpus corresponding to the second language, and / or to detect whether the second corpus is suitable for the usage environment of the second language.
[0062] As an implementation manner, the model training unit is specifically used to: adopt a model framework corresponding to the first viewpoint role labeling model, and perform model training based on the second corpus sample to obtain the second viewpoint role labeling model.
[0063] As an implementation method, the model framework includes: a word vector representation layer, a bidirectional prediction encoding layer and a CRF decoding layer.
[0064] The present application also provides an electronic device, including:
[0065] Processor; and
[0066] The memory is used to store a program of a method for training a viewpoint role labeling model. After the device is powered on and the program of the method for training a viewpoint role labeling model is run by the processor, the following steps are performed:
[0067] Obtaining a first corpus sample corresponding to a first opinion role labeling model, wherein the first corpus sample is labeled with a first opinion role label, and the first opinion role labeling model is used to identify a first target opinion holder and a first target opinion content expressed by the first target opinion holder from an input first language text;
[0068] translating the first corpus sample into a second corpus corresponding to a second language;
[0069] According to the first corpus sample and the first opinion role label, annotating the second corpus with opinion role information to obtain a second corpus sample, wherein the second corpus sample is annotated with a second opinion role label;
[0070] Model training is performed based on the second corpus sample to obtain a second opinion role labeling model, where the second opinion role model is used to identify a second target opinion holder and the second target opinion content expressed by the second target opinion holder from the input second language text.
[0071] The present application also provides a storage device storing a program of a method for training a viewpoint role labeling model, wherein the program is executed by a processor to perform the following steps:
[0072] Obtaining a first corpus sample corresponding to a first opinion role labeling model, wherein the first corpus sample is labeled with a first opinion role label, and the first opinion role labeling model is used to identify a first target opinion holder and a first target opinion content expressed by the first target opinion holder from an input first language text;
[0073] translating the first corpus sample into a second corpus corresponding to a second language;
[0074] According to the first corpus sample and the first opinion role label, annotating the second corpus with opinion role information to obtain a second corpus sample, wherein the second corpus sample is annotated with a second opinion role label;
[0075] Model training is performed based on the second corpus sample to obtain a second opinion role labeling model, where the second opinion role model is used to identify a second target opinion holder and the second target opinion content expressed by the second target opinion holder from the input second language text.
[0076] Compared with the prior art, this application has the following advantages:
[0077] The present application provides a method for training a viewpoint role information labeling model, comprising: obtaining a first corpus sample corresponding to a first viewpoint role labeling model, the first corpus sample being labeled with a first viewpoint role label, the first viewpoint role labeling model being used to identify a first target viewpoint holder and a first target viewpoint content expressed by the first target viewpoint holder from an input first language text; translating the first corpus sample into a second corpus corresponding to a second language; labeling the second corpus with viewpoint role information according to the first corpus sample and the first viewpoint role label to obtain a second corpus sample, the second corpus sample being labeled with a second viewpoint role label; and performing model training based on the second corpus sample to obtain a second viewpoint role labeling model, the second viewpoint role model being used to identify a second target viewpoint holder and a second target viewpoint content expressed by the second target viewpoint holder from an input second language text. By using this method, a second corpus sample can be obtained based on an existing opinion role labeling model applicable to a first language and based on a first corpus sample used in training the model, and a second opinion role labeling model applicable to a second language can be obtained by training with the second corpus sample. This method can realize cross-language application of the opinion role identification process based on the existing opinion role labeling model, thereby enhancing the versatility and ease of use of the opinion role identification process. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] Figure 1 is a flow chart of the viewpoint role labeling model training method provided in the first embodiment of the present application;
[0079] Figure 1-A This is a schematic diagram of viewpoint role information annotation provided in the first embodiment of the present application;
[0080] Figure 1-B It is a schematic diagram of the model framework provided in the first embodiment of the present application;
[0081] Figure 2 It is a unit block diagram of a model training device provided in the second embodiment of the present application;
[0082] Figure 3 It is a schematic diagram of the logical structure of an electronic device provided in the third embodiment of the present application. DETAILED DESCRIPTION
[0083] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0084] For the opinion role identification scenario, in order to realize the cross-language application of the opinion role identification process based on the existing opinion role labeling model and enhance the versatility and ease of use of the opinion role identification process, the present application provides a opinion role labeling model training method, an opinion role labeling model training device corresponding to the method, an electronic device and a computer-readable storage medium. The following provides embodiments to describe the above-mentioned method, device, electronic device and computer-readable storage medium in detail.
[0085] The first embodiment of the present application provides a method for training a viewpoint role labeling model, the execution subject of which can be a computing device application used to train and obtain a viewpoint role labeling model. Figure 1 Provide explanation.
[0086] like Figure 1 As shown, in step S101, a first corpus sample corresponding to a first viewpoint role labeling model is obtained.
[0087] The opinion role labeling model is used to identify the information of the opinion holder and the opinion content expressed by the opinion holder from the input text, that is, the opinion role labeling model can analyze "who expressed what opinion on what" in the input text, and it is widely used in scenarios such as information extraction, opinion classification and aggregation, and public opinion analysis. Based on the differences between texts in different languages, different languages correspond to different opinion role labeling models. The above-mentioned first opinion role labeling model refers to the opinion role labeling model that has been trained and is suitable for the first language, that is, the first opinion role labeling model is used to identify the first target opinion holder and the first target opinion content expressed by the first target opinion holder from the input first language text. The first corpus sample is the sample data used when training the above-mentioned first opinion role labeling model. The first corpus sample is labeled with a first opinion role label. The first opinion role label can specifically refer to: the first opinion holder label corresponding to the opinion holder in the first corpus sample, the first expression label corresponding to the expression verb in the first corpus sample, and the first opinion label corresponding to the opinion content in the first corpus sample. For example, when the first opinion role labeling model is an opinion role labeling model applicable to English, in the corresponding first corpus sample "He then clarified aposture wherein A would cooperate with B as much as possible", "He" is the opinion holder, and the corresponding first opinion holder label can be "holder", "clarified" is the expression verb, and the corresponding first expression label can be "expression", and "A would cooperate with B" is the opinion content, and the corresponding first opinion label can be "target".
[0088] like Figure 1 As shown, in step S102, the first corpus sample is translated into a second corpus corresponding to a second language.
[0089] After obtaining the first corpus sample corresponding to the first opinion role labeling model in the above step, this step is used to translate the first corpus sample into a second corpus corresponding to the second language, and the process can be implemented using a text translation application. For example, in this embodiment, the second language is Chinese, and the first corpus sample "He then clarified aposture wherein A would cooperate with B as much as possible" is translated into the second corpus "Then, he clarified the attitude that A would cooperate with B as much as possible".
[0090] In this embodiment, after translating the first corpus sample into the second corpus corresponding to the second language, it is necessary to detect whether the translation result is wrong. For example, the first corpus sample is "The man had sidelined C after accusing him", and the translated incorrect text is "This man had sidelined C after accusing C", so the incorrect text needs to be modified, and the modified second corpus is "After accusing C, the man sidelined him". In addition to the above detection of whether the translation result is wrong, it is also necessary to detect whether the second corpus obtained by translation is suitable for the language environment of the second language. For example, the first corpus sample is "The guards seized 87kg of XXX on the border", and the translated text is "The guards seized 87kg of XXX at the border". This text does not conform to the expression of the Chinese context, and the modified second corpus is "The soldiers seized 87kg of XXX at the border".
[0091] like Figure 1 As shown, in step S103, the second corpus is annotated with viewpoint role information according to the first corpus sample and the first viewpoint role label to obtain a second corpus sample.
[0092] After the first corpus sample is translated into the second corpus corresponding to the second language in the above step, this step is used to annotate the second corpus with the opinion role information according to the first corpus sample obtained above and the first opinion role label annotated with the first corpus sample, so as to obtain the second corpus sample annotated with the second opinion role label. Corresponding to the first opinion role label annotated with the above first corpus sample, the second opinion role label may specifically refer to: the second opinion holder label corresponding to the opinion holder in the second corpus sample, the second expression label corresponding to the expression verb in the second corpus sample, and the second opinion label corresponding to the opinion content in the second corpus sample; wherein the opinion holder in the first corpus sample and the opinion holder in the second corpus sample are the same opinion holders corresponding to different languages, the expression verb in the first corpus sample and the expression verb in the second corpus sample are the same expression verbs corresponding to different languages, and the opinion content in the first corpus sample and the opinion content in the second corpus sample are the same opinion content corresponding to different languages.
[0093] Taking the above-mentioned first corpus sample "He then clarified a posture wherein A would cooperate with B as much as possible" and the second corpus obtained by translation "Then, he clarified A's attitude of cooperating with B as much as possible" as examples, after the second corpus is annotated with the opinion role information, "he" is the opinion holder, and its corresponding second opinion holder label can also be "holder", "clarify" is the expression verb, and its corresponding second expression label can be "expression", and "A will cooperate with B as much as possible" is the opinion content, and its corresponding second opinion label can be "target".
[0094] In this embodiment, if Figure 1-A As shown, the process of labeling the second corpus with the viewpoint role information according to the first corpus sample and the first viewpoint role label to obtain the second corpus sample can be implemented in the following two ways:
[0095] Method 1:
[0096] First, the first corpus sample and the second corpus are respectively subjected to text segmentation processing, and the word alignment probability between each segmentation in the first corpus sample and each segmentation in the second corpus is obtained; the text segmentation processing process can be implemented based on the existing text segmentation method, which will not be repeated here. The word alignment probability refers to the translation probability between words in parallel corpora, which is used to indicate the strength of association between each segmentation in the first corpus sample and each segmentation in the second corpus. Specifically, the word alignment probability between each segmentation in the first corpus sample and each segmentation in the second corpus can be obtained based on the existing word alignment model, which will not be repeated here.
[0097] Secondly, the opinion holders in the second corpus are determined according to the opinion holders in the first corpus sample, the expression verbs in the second corpus are determined according to the expression verbs in the first corpus sample, and the opinion content in the second corpus is determined according to the opinion content in the first corpus sample. The above-mentioned determination of the opinion holders in the second corpus according to the opinion holders in the first corpus sample may specifically refer to: obtaining the candidate text segment corresponding to the opinion holder in the second corpus; obtaining the segmentation in the second corpus that has the maximum word alignment probability corresponding to the segmentation contained in the opinion holder in the first corpus sample, and determining the shortest continuous text segment containing the segmentation in the above-mentioned candidate text segment as the opinion holder in the second corpus. The above-mentioned determination of the expression verbs in the second corpus according to the expression verbs in the first corpus sample may specifically refer to: obtaining the shortest continuous text segment composed of the segmentations in the second corpus that have the maximum word alignment probability corresponding to the expression verbs in the first corpus sample, and determining the shortest continuous text segment as the expression verb in the second corpus. The above-mentioned determining the opinion content in the second corpus based on the opinion content in the first corpus sample may specifically refer to: obtaining alternative text segments corresponding to the opinion content in the second corpus; obtaining the segmentation in the second corpus that has the maximum word alignment probability corresponding to the segmentation contained in the opinion content in the first corpus sample, and determining the shortest continuous text segment containing the segmentation in the alternative text segment as the opinion content in the second corpus.
[0098] Then, the opinion holders in the second corpus are labeled based on the first opinion holder label to obtain the second opinion holder label; the expression verbs in the second corpus are labeled based on the first expression label to obtain the second expression label; and the opinion content in the second corpus is labeled based on the first opinion label to obtain the second opinion label.
[0099] Finally, the second corpus annotated with the second opinion holder label, the second expression label and the second opinion label is determined as the second corpus sample.
[0100] Method 2:
[0101] First, the first corpus sample and the second corpus are respectively subjected to text segmentation processing, and the word alignment probability between each segmentation in the first corpus sample and each segmentation in the second corpus is obtained.
[0102] Secondly, obtain the segmented words in the second corpus that have the maximum word alignment probability with the expression verb in the first corpus sample, and determine the text segment composed of the segmented words as the expression verb in the second corpus;
[0103] Then, the opinion holders and the opinion contents corresponding to the expression verbs in the first corpus sample are determined;
[0104] Thirdly, obtain the segmentation in the second corpus that has the maximum word alignment probability with the segmentation contained in the opinion holder in the first corpus sample, and determine the shortest continuous text segment containing the segmentation as the opinion holder in the second corpus;
[0105] Finally, the segmentation in the second corpus with the maximum word alignment probability corresponding to the segmentation contained in the opinion content in the first corpus sample is obtained, and the shortest continuous text segment containing the segmentation is determined as the opinion content in the second corpus.
[0106] It should be noted that, in the above process of determining the expression verbs in the second corpus, the opinion holders in the second corpus, and the opinion content in the second corpus, it is also necessary to check the accuracy of text segmentation, the accuracy of determining the shortest continuous text segment, and the accuracy of the maximum word alignment probability. For example, errors in determining word boundaries (whether the segmentation has more or fewer words) are checked, errors in defining the boundaries of the shortest continuous text segment (whether the text segment has more or fewer words) are checked, and whether the translation results of the words with the maximum word alignment probability match are checked to ensure the accuracy of the opinion role information labeling process and the subsequent model training process.
[0107] like Figure 1 As shown, in step S104, model training is performed based on the second corpus sample to obtain a second viewpoint role labeling model.
[0108] Based on the above steps of labeling the opinion role information of the second corpus according to the first corpus sample and the first opinion role label to obtain the second corpus sample, this step is used to use the second corpus sample labeled with the second opinion role label as a training sample and perform model training to obtain a second opinion role labeling model suitable for the second language. The second opinion role labeling model is used to identify the second target opinion holder and the second target opinion content expressed by the second target opinion holder from the input second language text.
[0109] In this embodiment, the model training based on the second corpus sample may specifically adopt the model framework corresponding to the first viewpoint role labeling model, and perform model training based on the second corpus sample to obtain the second viewpoint role labeling model. Figure 1-BAs shown, the above model framework can be a BiLSTM-CRF model framework, which includes a word vector representation layer, a bidirectional prediction encoding layer (BiLSTM, Bi-directional Long Short-Term Memory) and a CRF decoding layer. Among them, the word vector representation layer is used to vectorize the input text. For example, for each word, its word embedding representation can be obtained by querying the table, which contains the vector representation generated by external pre-training, and the input text is decomposed into a field sequence and input into the pre-trained BERT model to obtain the word-level representation output by BERT (the word-level representation can also be obtained by averaging the covering word blocks of each word). Finally, the word embedding representation and the word-level representation are connected to obtain the final word vector representation. The BiLSTM layer is used to learn the context information of the sequence, and the CRF decoding layer is used to learn the dependency information between labels. The BiLSTM is composed of a forward LSTM and a backward LSTM. Its input is the above word vector representation. By learning the context information, the score probability of each word corresponding to each label is output. CRF is a sequence labeling model. The output of BiLSTM is used as the input of the CRF decoding layer. The CRF decoding layer obtains the final prediction result by learning the sequential dependency information between labels. It can correct the output of the BiLSTM layer by learning the transition probability between labels in the data set to ensure the rationality of the predicted labels.
[0110] The method for training a viewpoint role labeling model provided in an embodiment of the present application first obtains a first corpus sample corresponding to a first viewpoint role labeling model, the first corpus sample is labeled with a first viewpoint role label, the first viewpoint role labeling model is a trained viewpoint role labeling model suitable for a first language, and is used to identify a first target viewpoint holder and a first target viewpoint content expressed by the first target viewpoint holder from an input text in the first language; after translating the first corpus sample into a second corpus corresponding to a second language, the second corpus is labeled with viewpoint role information according to the first corpus sample and the first viewpoint role label to obtain a second corpus sample, the second corpus sample being labeled with a second viewpoint role label; finally, model training is performed based on the second corpus sample to obtain a second viewpoint role labeling model, the second viewpoint role model being used to identify a second target viewpoint holder and a second target viewpoint content expressed by the second target viewpoint holder from an input text in the second language. By using this method, a second corpus sample can be obtained based on a first corpus sample used in training a viewpoint role labeling model that has been trained for a first language, and a second viewpoint role labeling model suitable for a second language can be obtained by training the second corpus sample. This method can realize cross-language application of the viewpoint role identification process based on the existing viewpoint role labeling model, thereby enhancing the versatility and ease of use of the viewpoint role identification process.
[0111] Corresponding to the opinion role labeling model training method provided in the first embodiment of the present application, the second embodiment of the present application provides an opinion role labeling model training device.
[0112] like Figure 2 As shown, the viewpoint role labeling model training device includes:
[0113] A first corpus sample obtaining unit 201 obtains a first corpus sample corresponding to a first opinion role labeling model, wherein the first corpus sample is labeled with a first opinion role label, and the first opinion role labeling model is used to identify a first target opinion holder and a first target opinion content expressed by the first target opinion holder from an input first language text;
[0114] A second corpus obtaining unit 202, configured to translate the first corpus sample into a second corpus corresponding to a second language;
[0115] A second corpus sample obtaining unit 203 is used to annotate the second corpus with viewpoint role information according to the first corpus sample and the first viewpoint role label to obtain a second corpus sample, wherein the second corpus sample is annotated with a second viewpoint role label;
[0116] The model training unit 204 is used to perform model training based on the second corpus sample to obtain a second opinion role labeling model, wherein the second opinion role model is used to identify the second target opinion holder and the second target opinion content expressed by the second target opinion holder from the input second language text.
[0117] As an implementation manner, the first opinion role label includes: a first opinion holder label corresponding to an opinion holder in the first corpus sample, a first expression label corresponding to an expression verb in the first corpus sample, and a first opinion label corresponding to an opinion content in the first corpus sample;
[0118] The second opinion role label includes: a second opinion holder label corresponding to the opinion holder in the second corpus sample, a second expression label corresponding to the expression verb in the second corpus sample, and a second opinion label corresponding to the opinion content in the second corpus sample; wherein the opinion holder in the first corpus sample and the opinion holder in the second corpus sample are the same opinion holders corresponding to different languages, the expression verb in the first corpus sample and the expression verb in the second corpus sample are the same expression verbs corresponding to different languages, and the opinion content in the first corpus sample and the opinion content in the second corpus sample are the same opinion content corresponding to different languages.
[0119] As an implementation manner, the second corpus sample obtaining unit is specifically used for:
[0120] Determine the opinion holders in the second corpus according to the opinion holders in the first corpus sample, determine the expression verbs in the second corpus according to the expression verbs in the first corpus sample, and determine the opinion content in the second corpus according to the opinion content in the first corpus sample;
[0121] Annotating the opinion holders in the second corpus based on the first opinion holder label to obtain the second opinion holder label; annotating the expression verbs in the second corpus based on the first expression label to obtain the second expression label; annotating the opinion content in the second corpus based on the first opinion label to obtain the second opinion label;
[0122] The second corpus annotated with the second opinion holder label, the second expression label, and the second opinion label is determined as the second corpus sample.
[0123] As an embodiment, the device further includes:
[0124] A word alignment probability obtaining unit, used to perform text segmentation processing on the first corpus sample and the second corpus respectively, and obtain the word alignment probability between each segmentation in the first corpus sample and each segmentation in the second corpus;
[0125] Determining the opinion holder in the second corpus according to the opinion holder in the first corpus sample includes: obtaining candidate text segments corresponding to the opinion holder in the second corpus; obtaining a segmentation in the second corpus that has a maximum word alignment probability with the segmentation contained in the opinion holder in the first corpus sample, and determining the shortest continuous text segment containing the segmentation in the candidate text segments as the opinion holder in the second corpus;
[0126] Correspondingly, determining the expression verb in the second corpus according to the expression verb in the first corpus sample includes: obtaining the shortest continuous text segment in the second corpus, which is composed of the segment words corresponding to the expression verb in the first corpus sample and has the maximum word alignment probability, and determining the shortest continuous text segment as the expression verb in the second corpus;
[0127] Correspondingly, determining the opinion content in the second corpus based on the opinion content in the first corpus sample includes: obtaining alternative text segments corresponding to the opinion content in the second corpus; obtaining the segmentation in the second corpus that has the maximum word alignment probability corresponding to the segmentation contained in the opinion content in the first corpus sample, and determining the shortest continuous text segment containing the segmentation in the alternative text segments as the opinion content in the second corpus.
[0128] As an embodiment, the device further includes:
[0129] A word alignment probability obtaining unit, used to perform text segmentation processing on the first corpus sample and the second corpus respectively, and obtain the word alignment probability between each segmentation in the first corpus sample and each segmentation in the second corpus;
[0130] The second corpus sample obtaining unit is specifically used for:
[0131] Obtaining a word segment in the second corpus that has a maximum word alignment probability with the expression verb in the first corpus sample, and determining a text segment composed of the word segment as the expression verb in the second corpus;
[0132] Determining the opinion holder and the opinion content corresponding to the expression verb in the first corpus sample;
[0133] Obtaining a word in the second corpus that has a maximum word alignment probability with a word contained in the opinion holder in the first corpus sample, and determining the shortest continuous text segment containing the word as the opinion holder in the second corpus;
[0134] A word segment in the second corpus having a maximum word alignment probability corresponding to a word segment included in the opinion content in the first corpus sample is obtained, and the shortest continuous text segment including the word segment is determined as the opinion content in the second corpus.
[0135] As an embodiment, the device further includes:
[0136] The text segmentation accuracy checking unit is used to check the accuracy of the text segmentation processing.
[0137] As an embodiment, the device further includes:
[0138] The text segment accuracy checking unit is used to check the accuracy of the shortest continuous text segment.
[0139] As an embodiment, the device further includes:
[0140] The word alignment probability accuracy checking unit is used to check the accuracy of the maximum word alignment probability.
[0141] As an embodiment, the device further includes:
[0142] A detection unit is used to detect whether a translation result of translating the first corpus sample into the second corpus corresponding to the second language is incorrect after translating the first corpus sample into the second corpus corresponding to the second language, and / or to detect whether the second corpus is suitable for the usage environment of the second language.
[0143] As an implementation manner, the model training unit is specifically used to: adopt a model framework corresponding to the first viewpoint role labeling model, and perform model training based on the second corpus sample to obtain the second viewpoint role labeling model.
[0144] As an implementation method, the model framework includes: a word vector representation layer, a bidirectional prediction encoding layer and a CRF decoding layer.
[0145] It should be noted that for the detailed description of the device provided in the second embodiment of the present application, reference can be made to the relevant description of the first embodiment of the present application, which will not be repeated here.
[0146] Corresponding to the opinion role labeling model training method provided in the first embodiment of the present application, the third embodiment of the present application provides an electronic device.
[0147] like Figure 3 As shown, the electronic device includes:
[0148] Processor 301;
[0149] and a memory 302 for storing a program of a method for training a viewpoint role labeling model. After the device is powered on and the program of the method for training a viewpoint role labeling model is run by the processor, the following steps are performed:
[0150] Obtaining a first corpus sample corresponding to a first opinion role labeling model, wherein the first corpus sample is labeled with a first opinion role label, and the first opinion role labeling model is used to identify a first target opinion holder and a first target opinion content expressed by the first target opinion holder from an input first language text;
[0151] translating the first corpus sample into a second corpus corresponding to a second language;
[0152] According to the first corpus sample and the first opinion role label, annotating the second corpus with opinion role information to obtain a second corpus sample, wherein the second corpus sample is annotated with a second opinion role label;
[0153] Model training is performed based on the second corpus sample to obtain a second opinion role labeling model, where the second opinion role model is used to identify a second target opinion holder and the second target opinion content expressed by the second target opinion holder from the input second language text.
[0154] As an implementation manner, the first opinion role label includes: a first opinion holder label corresponding to an opinion holder in the first corpus sample, a first expression label corresponding to an expression verb in the first corpus sample, and a first opinion label corresponding to an opinion content in the first corpus sample;
[0155] The second opinion role label includes: a second opinion holder label corresponding to the opinion holder in the second corpus sample, a second expression label corresponding to the expression verb in the second corpus sample, and a second opinion label corresponding to the opinion content in the second corpus sample; wherein the opinion holder in the first corpus sample and the opinion holder in the second corpus sample are the same opinion holders corresponding to different languages, the expression verb in the first corpus sample and the expression verb in the second corpus sample are the same expression verbs corresponding to different languages, and the opinion content in the first corpus sample and the opinion content in the second corpus sample are the same opinion content corresponding to different languages.
[0156] As an implementation manner, the step of labeling the second corpus with viewpoint role information according to the first corpus sample and the first viewpoint role label to obtain the second corpus sample includes:
[0157] Determine the opinion holders in the second corpus according to the opinion holders in the first corpus sample, determine the expression verbs in the second corpus according to the expression verbs in the first corpus sample, and determine the opinion content in the second corpus according to the opinion content in the first corpus sample;
[0158] Annotating the opinion holders in the second corpus based on the first opinion holder label to obtain the second opinion holder label; annotating the expression verbs in the second corpus based on the first expression label to obtain the second expression label; annotating the opinion content in the second corpus based on the first opinion label to obtain the second opinion label;
[0159] The second corpus annotated with the second opinion holder label, the second expression label, and the second opinion label is determined as the second corpus sample.
[0160] As an implementation mode, the electronic device further performs the following steps: performing text segmentation processing on the first corpus sample and the second corpus respectively, and obtaining word alignment probabilities between each segmentation in the first corpus sample and each segmentation in the second corpus;
[0161] Determining the opinion holder in the second corpus according to the opinion holder in the first corpus sample includes: obtaining candidate text segments corresponding to the opinion holder in the second corpus; obtaining a segmentation in the second corpus that has a maximum word alignment probability with the segmentation contained in the opinion holder in the first corpus sample, and determining the shortest continuous text segment containing the segmentation in the candidate text segments as the opinion holder in the second corpus;
[0162] Correspondingly, determining the expression verb in the second corpus according to the expression verb in the first corpus sample includes: obtaining the shortest continuous text segment in the second corpus, which is composed of the segment words corresponding to the expression verb in the first corpus sample and has the maximum word alignment probability, and determining the shortest continuous text segment as the expression verb in the second corpus;
[0163] Correspondingly, determining the opinion content in the second corpus based on the opinion content in the first corpus sample includes: obtaining alternative text segments corresponding to the opinion content in the second corpus; obtaining the segmentation in the second corpus that has the maximum word alignment probability corresponding to the segmentation contained in the opinion content in the first corpus sample, and determining the shortest continuous text segment containing the segmentation in the alternative text segments as the opinion content in the second corpus.
[0164] As an implementation mode, the electronic device further performs the following steps: performing text segmentation processing on the first corpus sample and the second corpus respectively, and obtaining word alignment probabilities between each segmentation in the first corpus sample and each segmentation in the second corpus;
[0165] The step of labeling the second corpus with viewpoint role information according to the first corpus sample and the first viewpoint role label to obtain the second corpus sample includes:
[0166] Obtaining a word segment in the second corpus that has a maximum word alignment probability with the expression verb in the first corpus sample, and determining a text segment composed of the word segment as the expression verb in the second corpus;
[0167] Determining the opinion holder and the opinion content corresponding to the expression verb in the first corpus sample;
[0168] Obtaining a word in the second corpus that has a maximum word alignment probability with a word contained in the opinion holder in the first corpus sample, and determining the shortest continuous text segment containing the word as the opinion holder in the second corpus;
[0169] A word segment in the second corpus having a maximum word alignment probability corresponding to a word segment included in the opinion content in the first corpus sample is obtained, and the shortest continuous text segment including the word segment is determined as the opinion content in the second corpus.
[0170] As an implementation manner, the electronic device further performs the following step: checking the accuracy of the text segmentation processing.
[0171] As an implementation manner, the electronic device further performs the following step: checking the accuracy of determining the shortest continuous text segment.
[0172] As an implementation manner, the electronic device further performs the following step: checking the accuracy of the maximum word alignment probability.
[0173] As an implementation mode, after translating the first corpus sample into a second corpus corresponding to a second language, the electronic device further performs the following steps: detecting whether a translation result of translating the first corpus sample into the second corpus corresponding to the second language is incorrect, and / or detecting whether the second corpus is suitable for the usage environment of the second language.
[0174] As an implementation mode, performing model training based on the second corpus sample to obtain the second opinion role labeling model includes: adopting the model framework corresponding to the first opinion role labeling model, and performing model training based on the second corpus sample to obtain the second opinion role labeling model.
[0175] As an implementation method, the model framework includes: a word vector representation layer, a bidirectional prediction encoding layer and a CRF decoding layer.
[0176] It should be noted that for the detailed description of the electronic device provided in the third embodiment of the present application, reference can be made to the relevant description of the first embodiment of the present application, which will not be repeated here.
[0177] Corresponding to the opinion role labeling model training method provided in the first embodiment of the present application, the fourth embodiment of the present application provides a storage device storing a program of the opinion role labeling model training method, the program is executed by a processor to perform the following steps:
[0178] Obtaining a first corpus sample corresponding to a first opinion role labeling model, wherein the first corpus sample is labeled with a first opinion role label, and the first opinion role labeling model is used to identify a first target opinion holder and a first target opinion content expressed by the first target opinion holder from an input first language text;
[0179] translating the first corpus sample into a second corpus corresponding to a second language;
[0180] According to the first corpus sample and the first opinion role label, annotating the second corpus with opinion role information to obtain a second corpus sample, wherein the second corpus sample is annotated with a second opinion role label;
[0181] Model training is performed based on the second corpus sample to obtain a second opinion role labeling model, where the second opinion role model is used to identify a second target opinion holder and the second target opinion content expressed by the second target opinion holder from the input second language text.
[0182] It should be noted that for the detailed description of the storage device provided in the fourth embodiment of the present application, reference can be made to the relevant description of the first embodiment of the present application, which will not be repeated here.
[0183] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
[0184] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0185] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0186] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0187] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0188] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
Claims
1. A method for training a viewpoint role labeling model, characterized in that: include: Obtaining a first corpus sample corresponding to a first opinion role labeling model, wherein the first corpus sample is labeled with a first opinion role label, and the first opinion role labeling model is used to identify a first target opinion holder and a first target opinion content expressed by the first target opinion holder from an input first language text; translating the first corpus sample into a second corpus corresponding to a second language; According to the first corpus sample and the first opinion role label, annotating the second corpus with opinion role information to obtain a second corpus sample, wherein the second corpus sample is annotated with a second opinion role label; Model training is performed based on the second corpus sample to obtain a second opinion role labeling model, where the second opinion role model is used to identify a second target opinion holder and the second target opinion content expressed by the second target opinion holder from the input second language text.
2. The method according to claim 1, characterized in that: The first opinion role label includes: a first opinion holder label corresponding to an opinion holder in the first corpus sample, a first expression label corresponding to an expression verb in the first corpus sample, and a first opinion label corresponding to opinion content in the first corpus sample; The second opinion role label includes: a second opinion holder label corresponding to the opinion holder in the second corpus sample, a second expression label corresponding to the expression verb in the second corpus sample, and a second opinion label corresponding to the opinion content in the second corpus sample; wherein the opinion holder in the first corpus sample and the opinion holder in the second corpus sample are the same opinion holders corresponding to different languages, the expression verb in the first corpus sample and the expression verb in the second corpus sample are the same expression verbs corresponding to different languages, and the opinion content in the first corpus sample and the opinion content in the second corpus sample are the same opinion content corresponding to different languages.
3. The method according to claim 2, characterized in that The step of labeling the second corpus with viewpoint role information according to the first corpus sample and the first viewpoint role label to obtain the second corpus sample includes: Determine the opinion holders in the second corpus according to the opinion holders in the first corpus sample, determine the expression verbs in the second corpus according to the expression verbs in the first corpus sample, and determine the opinion content in the second corpus according to the opinion content in the first corpus sample; Annotating the opinion holders in the second corpus based on the first opinion holder label to obtain the second opinion holder label; annotating the expression verbs in the second corpus based on the first expression label to obtain the second expression label; annotating the opinion content in the second corpus based on the first opinion label to obtain the second opinion label; The second corpus annotated with the second opinion holder label, the second expression label, and the second opinion label is determined as the second corpus sample.
4. The method according to claim 3, characterized in that Also includes: Performing text segmentation processing on the first corpus sample and the second corpus respectively, and obtaining word alignment probabilities between each segmentation in the first corpus sample and each segmentation in the second corpus; The step of determining the opinion holders in the second corpus according to the opinion holders in the first corpus sample includes: obtaining candidate text segments corresponding to the opinion holders in the second corpus; A word segment in the second corpus having a maximum word alignment probability corresponding to a word segment included in the opinion holder in the first corpus sample is obtained, and the shortest continuous text segment including the word segment in the candidate text segment is determined as the opinion holder in the second corpus.
5. The method according to claim 4, characterized in that The method of determining the expression verbs in the second corpus based on the expression verbs in the first corpus sample includes: obtaining the shortest continuous text segment in the second corpus that is composed of participles having the maximum word alignment probability corresponding to the expression verbs in the first corpus sample, and determining the shortest continuous text segment as the expression verb in the second corpus.
6. The method according to claim 4, characterized in that The method of determining the opinion content in the second corpus based on the opinion content in the first corpus sample includes: obtaining alternative text segments corresponding to the opinion content in the second corpus; obtaining a segmentation in the second corpus that has a maximum word alignment probability corresponding to the segmentation contained in the opinion content in the first corpus sample, and determining the shortest continuous text segment containing the segmentation in the alternative text segments as the opinion content in the second corpus.
7. The method according to claim 2, characterized in that: Also includes: Performing text segmentation processing on the first corpus sample and the second corpus respectively, and obtaining word alignment probabilities between each segmentation in the first corpus sample and each segmentation in the second corpus; The step of labeling the second corpus with viewpoint role information according to the first corpus sample and the first viewpoint role label to obtain the second corpus sample includes: Obtaining a word segment in the second corpus that has a maximum word alignment probability with the expression verb in the first corpus sample, and determining a text segment composed of the word segment as the expression verb in the second corpus; Determining the opinion holder and the opinion content corresponding to the expression verb in the first corpus sample; Obtaining a word in the second corpus that has a maximum word alignment probability with a word contained in the opinion holder in the first corpus sample, and determining the shortest continuous text segment containing the word as the opinion holder in the second corpus; A word segment in the second corpus having a maximum word alignment probability corresponding to a word segment included in the opinion content in the first corpus sample is obtained, and the shortest continuous text segment including the word segment is determined as the opinion content in the second corpus.
8. The method according to claim 4 or 7, characterized in that: Also includes: The accuracy of the text segmentation processing is checked.
9. The method according to any one of claims 4 to 7, characterized in that: Also includes: The accuracy of determining the boundary range of the shortest continuous text segment is checked.
10. The method according to any one of claims 4 to 7, characterized in that: Also includes: The accuracy of the maximum word alignment probability is checked.
11. The method according to claim 1, characterized in that: After translating the first corpus sample into a second corpus corresponding to a second language, the method further includes: Detecting whether a translation result of translating the first corpus sample into a second corpus corresponding to a second language is incorrect, and / or detecting whether the second corpus is suitable for a usage environment of the second language.
12. The method according to claim 1, characterized in that The performing model training based on the second corpus sample to obtain the second viewpoint role labeling model includes: adopting a model framework corresponding to the first viewpoint role labeling model, and performing model training based on the second corpus sample to obtain the second viewpoint role labeling model.
13. The method according to claim 12, characterized in that The model framework includes: a word vector representation layer, a bidirectional prediction encoding layer and a CRF decoding layer.
14. A viewpoint role labeling model training device, characterized in that: include: a first corpus sample obtaining unit, for obtaining a first corpus sample corresponding to a first opinion role labeling model, wherein the first corpus sample is labeled with a first opinion role label, and the first opinion role labeling model is used to identify a first target opinion holder and a first target opinion content expressed by the first target opinion holder from an input first language text; A second corpus obtaining unit, configured to translate the first corpus sample into a second corpus corresponding to a second language; A second corpus sample obtaining unit, configured to annotate the second corpus with viewpoint role information according to the first corpus sample and the first viewpoint role label, to obtain a second corpus sample, wherein the second corpus sample is annotated with a second viewpoint role label; A model training unit is used to perform model training based on the second corpus sample to obtain a second opinion role labeling model, wherein the second opinion role model is used to identify a second target opinion holder and a second target opinion content expressed by the second target opinion holder from an input second language text.
15. An electronic device, characterized in that: include: processor; as well as The memory is used to store a program of a method for training a viewpoint role labeling model. After the device is powered on and the program of the method for training a viewpoint role labeling model is run by the processor, the following steps are performed: Obtaining a first corpus sample corresponding to a first opinion role labeling model, wherein the first corpus sample is labeled with a first opinion role label, and the first opinion role labeling model is used to identify a first target opinion holder and a first target opinion content expressed by the first target opinion holder from an input first language text; translating the first corpus sample into a second corpus corresponding to a second language; According to the first corpus sample and the first opinion role label, annotating the second corpus with opinion role information to obtain a second corpus sample, wherein the second corpus sample is annotated with a second opinion role label; Model training is performed based on the second corpus sample to obtain a second opinion role labeling model, where the second opinion role model is used to identify a second target opinion holder and the second target opinion content expressed by the second target opinion holder from the input second language text.
16. A storage device, characterized in that: A program for training a viewpoint role labeling model is stored, and the program is executed by a processor to perform the following steps: Obtaining a first corpus sample corresponding to a first opinion role labeling model, wherein the first corpus sample is labeled with a first opinion role label, and the first opinion role labeling model is used to identify a first target opinion holder and a first target opinion content expressed by the first target opinion holder from an input first language text; translating the first corpus sample into a second corpus corresponding to a second language; According to the first corpus sample and the first opinion role label, annotating the second corpus with opinion role information to obtain a second corpus sample, wherein the second corpus sample is annotated with a second opinion role label; Model training is performed based on the second corpus sample to obtain a second opinion role labeling model, where the second opinion role model is used to identify a second target opinion holder and the second target opinion content expressed by the second target opinion holder from the input second language text.
Citation Information
Patent Citations
Semantic role labeling method based on synergetic neural network
CN102662931A
Universal public opinion information emotion recognition method for user role
CN108959243A