Text processing method, device, electronic device and storage medium

By combining dependent syntax analysis and deep learning model, the linear and nonlinear similarity of event sentences is calculated, and the accuracy of similarity calculation in event homophone digestion is solved, and the automatic answering ability of the intelligent customer service system is improved.

CN116821276BActive Publication Date: 2025-08-29CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211320876.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-26
Publication Date
2025-08-29
Estimated Expiration
2042-10-26

AI Technical Summary

Technical Problem

The prior art lacks accuracy when calculating the similarity between event sentences, especially in the decomposition of event synonyms, and lacks effective methods to improve the accuracy of similarity calculation.

Method used

The trigger words and dependent words of event sentences are extracted using dependent syntax analysis tools, combined with BERT pre-trained model and Bi-LSTM and CNN networks, and the confidence of event pairs is determined through linear and nonlinear similarity calculations, feature information is enriched, and the distinction is determined with a fully connected classifier.

Benefits of technology

It improves the accuracy of event synonyms, reduces the cost of manual feature extraction, improves the discriminant performance of the model, and is suitable for intelligent customer service systems to automatically answer questions, reducing labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116821276B_ABST
    Figure CN116821276B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention provide a text processing method, apparatus, electronic device, and storage medium. The method includes: obtaining event pair data included in a first text; processing the event pair data using a dependency parser to obtain event short sentence pair data corresponding to the event pair data; determining a first linear similarity and a first nonlinear similarity for the event pair data, as well as a second linear similarity and a second nonlinear similarity for the event short sentence pair data; and determining a confidence level for the event pair data based on the event pair data, the event short sentence pair data, the first linear similarity, the first nonlinear similarity, the second linear similarity, and the second nonlinear similarity; the confidence level represents the degree to which the event pair data have a coreference relationship.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to data processing technology, and in particular to a text processing method, device, electronic device and storage medium. Background Art

[0002] With the rapid development of internet technology, the amount of information people interact with online is increasing dramatically, allowing them to access the information they need anytime, anywhere. While the internet provides people with increasingly faster and more diverse information, it also generates a large amount of spam, which causes people to waste considerable effort searching for the information they need, sometimes even returning empty-handed. In the era of big data, processing big data and filtering out valuable information has become a crucial issue. Event extraction can help machines discover valuable event information in text, grouping semantically similar textual content together and thus resolving event syntactical information.

[0003] Event coinference resolution involves determining whether event sentences described in different ways refer to the same real-life event. This process primarily relies on the degree of similarity between the two sentences. The challenge lies in accurately calculating the similarity between two event sentences and improving the accuracy of similarity calculations. Currently, there is no effective solution to this problem. Summary of the Invention

[0004] In view of this, the main purpose of the present invention is to provide a text processing method, device, electronic device and storage medium.

[0005] To achieve the above object, the technical solution of the present invention is achieved as follows:

[0006] An embodiment of the present invention provides a text processing method, including:

[0007] Acquire event pair data included in the first text;

[0008] Using a dependency syntax analysis tool to process the event pair data to obtain event short sentence pair data corresponding to the event pair data;

[0009] Determining a first linear similarity and a first non-linear similarity of the event pair data and determining a second linear similarity and a second non-linear similarity of the event phrase pair data;

[0010] The confidence of the event pair data is determined based on the event pair data, the event phrase pair data, the first linear similarity, the first non-linear similarity, the second linear similarity and the second non-linear similarity; the confidence represents the degree to which the event pair data has a co-referential relationship.

[0011] In the above solution, the process of using a dependency syntax analysis tool to process the event pair data to obtain event short sentence pair data corresponding to the event pair data includes:

[0012] Determining arguments and dependent words of trigger words in the event pair data using the dependency syntax analysis tool;

[0013] determining a first distance between the argument and the trigger word, and determining a second distance between the dependency word and the trigger word;

[0014] Sorting the first distance and the second distance to obtain a sorting result;

[0015] Determine two arguments or trigger words corresponding to the maximum distance in the sorting result, and use the two arguments or trigger words corresponding to the maximum distance as the start word and the end word of the event short sentence pair data;

[0016] The event pair data is intercepted based on the start word and the end word to obtain the event short sentence pair data.

[0017] In the above solution, determining the confidence of the event pair data in the first text based on the event pair data, the event phrase pair data, the first linear similarity, the first non-linear similarity, the second linear similarity, and the second non-linear similarity includes:

[0018] Determining a confidence vector for the event pair data in the first text based on the event pair data, the event phrase pair data, the first linear similarity, the first non-linear similarity, the second linear similarity, and the second non-linear similarity;

[0019] The confidence vector is processed based on a fully connected classifier to obtain the confidence of the event on the data.

[0020] In the above solution, the method further includes:

[0021] A pre-trained model (Bidirectional Encoder Representation from Transformers, BERT) is used to predict the event pair data to obtain word vector pairs corresponding to the event pair data.

[0022] In the above solution, the event pair data includes a plurality of word pair data; and the method further includes:

[0023] Acquire a first information pair and a second information pair of a plurality of word pair data in the event pair data; the first information pair represents a part-of-speech information pair of the word pair data; the second information pair represents a position information pair of the word pair data;

[0024] Based on the word vector pair, the event pair data, the first information pair and the second information pair, a first event vector pair corresponding to the event pair data is determined.

[0025] In the above solution, the method further includes:

[0026] Using a Bi-directional Long Short-Term Memory (Bi-LSTM) network to extract the first event vector pair to obtain a global information pair corresponding to the first event vector pair;

[0027] Using a convolutional neural network (CNN) to extract the first event vector pair to obtain a local information pair corresponding to the first event vector pair;

[0028] fusing the global information pair and the local information pair to obtain a fused vector pair corresponding to the first event vector pair;

[0029] Perform a first global maximum pooling layer process on the fused vector pair to obtain a second event vector pair corresponding to the first event vector pair.

[0030] In the above solution, determining the first linear similarity and the first nonlinear similarity of the event pair data includes:

[0031] determining a first linear similarity and a first nonlinear similarity of the event pair data according to the second event vector pair;

[0032] The first linear similarity includes a first cosine distance; and the first nonlinear similarity includes at least one of a first bilinear distance and a first single-layer network distance.

[0033] In the above solution, the method further includes:

[0034] Determining a first event short sentence vector pair corresponding to the event short sentence pair data based on the word vector pair and the event short sentence pair data;

[0035] Perform a second global maximum pooling layer process on the first event short sentence vector pair to obtain a second event short sentence vector pair corresponding to the first event short sentence vector pair.

[0036] In the above solution, determining the second linear similarity and the second nonlinear similarity of the event phrase pair data includes:

[0037] determining a second linear similarity and a second nonlinear similarity of the event phrase pair data according to the second event phrase vector pair;

[0038] The second linear similarity includes a second cosine distance; and the second nonlinear similarity includes at least one of a second bilinear distance and a second single-layer network distance.

[0039] An embodiment of the present invention provides a text processing device, including:

[0040] A first acquisition module, configured to acquire event pair data included in the first text;

[0041] A first processing module is configured to process the event pair data using a dependency syntax analysis tool to obtain event short sentence pair data corresponding to the event pair data;

[0042] A first determining module is configured to determine a first linear similarity and a first non-linear similarity of the event pair data and a second linear similarity and a second non-linear similarity of the event phrase pair data;

[0043] A second determination module is used to determine the confidence of the event pair data based on the event pair data, the event phrase pair data, the first linear similarity, the first non-linear similarity, the second linear similarity and the second non-linear similarity; the confidence represents the degree to which the event pair data has a synonymous relationship.

[0044] An embodiment of the present invention provides a text processing device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, any of the above methods is implemented.

[0045] An embodiment of the present invention provides a storage medium storing executable instructions. When the executable instructions are executed by a processor, any of the above methods is implemented.

[0046] Embodiments of the present invention provide a text processing method, apparatus, electronic device, and storage medium. The method includes: obtaining event pair data included in a first text; processing the event pair data using a dependency parser to obtain event sentence pair data corresponding to the event pair data; determining a first linear similarity and a first nonlinear similarity for the event pair data, and determining a second linear similarity and a second nonlinear similarity for the event sentence pair data; and determining a confidence level for the event pair data based on the event pair data, the event sentence pair data, the first linear similarity, the first nonlinear similarity, the second linear similarity, and the second nonlinear similarity; the confidence level represents the degree to which the event pair data have a co-referential relationship. By combining the first linear similarity and the first nonlinear similarity for the event pair data and the second linear similarity and the second nonlinear similarity for the event sentence pair data to determine the confidence level for the event pair data, the drawback of only considering the event pair data as a whole when determining the confidence level based on linear similarity can be overcome. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A flowchart illustrating a text processing method according to an embodiment of the present invention;

[0048] Figure 2 This is a technical flow diagram of the BNN system of the text processing method according to an embodiment of the present invention;

[0049] Figure 3 Schematic diagram of the structure of a text processing device according to an embodiment of the present invention;

[0050] Figure 4 The figure is a schematic diagram of a hardware entity structure of a text processing device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0051] To make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the specific technical solutions of the invention will be described in further detail below in conjunction with the accompanying drawings in the embodiments of the present invention. The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0052] There are two main approaches to event syntagm resolution in related technologies. One uses probabilistic or graph-based machine learning methods, which require extensive feature engineering to manually extract features from event sentences and then combine them with machine learning to identify syntagm relationships. The other uses mainstream neural network methods to design a similarity model to calculate the similarity between two event sentences and thus identify syntagm relationships.

[0053] In the machine learning method, the first scholar introduced a series of event pair attributes into the event pair co-reference resolution classifier, such as whether the trigger words, tense, polarity, etc. are consistent. The second scholar designed a maximum entropy classifier and introduced more than 100 features for experiments. The third scholar proposed a joint reasoning model based on Markov chain to correct the erroneous results produced by the classifier. The fourth scholar designed a graph-based model classifier to merge events into an undirected graph, and then remove non-co-reference events from the graph. The fifth scholar first used a clustering algorithm to generate an undirected graph of event co-reference relationships, and then used the optimal cutting algorithm to optimize the graph, deleting the erroneous edges from the undirected graph, thereby optimizing the event co-reference resolution. Teng Jiayue used the maximum entropy classifier model and combined it with a large number of features extracted by tools for research.

[0054] In the neural network method, the sixth researcher first used a convolutional pooling network to extract feature information from the event sentence and the trigger word context, and then introduced event pair matching features to assist in determining whether there is a co-referential relationship between the event pairs. The seventh researcher first used a fully connected layer to perform a dimensionality transformation on the two event sentences, then calculated the cosine distance and Euclidean distance between the two event sentences, and finally used an activation function to derive a confidence level to determine the co-referential relationship. Fang Jie mainly used the attention mechanism to extract important information from the event sentences, and combined the linear similarity between the event sentences with the event pair matching features to determine whether there is a co-referential relationship between the event pairs.

[0055] The above-mentioned related technologies have the following disadvantages:

[0056] First, probability or graph-based machine learning methods require a lot of feature engineering to extract features, which has high labor costs, low accuracy, and poor portability.

[0057] Second, the method proposed by six relevant scholars uses convolutional neural networks to extract the contextual feature information of words in event sentences. It only considers the local information between words in the event sentences, does not consider the relationship between a pair of event sentences, and does not deeply extract the features in the event sentences, resulting in low performance of event co-reference resolution.

[0058] Third, the method proposed by the relevant scholar No. 7 simply performs dimensionality transformation on the event sentences, and does not extract features in depth, resulting in the calculated cosine distance and Euclidean distance between event sentences being inaccurate, which affects the final classification performance.

[0059] Fourth, the input information used by neural network methods is insufficient and often contains errors. They typically only combine the event sentence and the relative distances between each word and the trigger word. Furthermore, they extract the three words before and after the trigger word to form a short event sentence. However, using fixed rules to extract short event sentences can contain errors, which in turn affects the model's discriminative performance.

[0060] To address the above shortcomings, this application proposes a text processing method, device, electronic device, and storage medium. These methods aim to pre-train accurate word vectors to represent event sentences, deeply extract useful feature information from high-dimensional, semantically complex, and structurally complex event sentences, and assist in identifying co-referential relationships by calculating the similarity between event short sentences.

[0061] An embodiment of the present invention proposes a text processing method. The functions implemented by the method can be implemented by calling program code by a processor in a text processing device. Of course, the program code can be stored in a computer storage medium. It can be seen that the computing device includes at least a processor and a storage medium.

[0062] Figure 1 Schematic diagram of the text processing method according to the embodiment of the present invention. Figure 1 As shown, the method includes:

[0063] Step 101: Acquire event pair data included in a first text;

[0064] Step 102: Process the event pair data using a dependency syntax analysis tool to obtain event short sentence pair data corresponding to the event pair data;

[0065] Step 103: determining a first linear similarity and a first non-linear similarity of the event pair data and determining a second linear similarity and a second non-linear similarity of the event phrase pair data;

[0066] Step 104: Determine the confidence of the event pair data based on the event pair data, the event phrase pair data, the first linear similarity, the first non-linear similarity, the second linear similarity, and the second non-linear similarity; the confidence represents the degree to which the event pair data has a co-referential relationship.

[0067] In step 101, the text processing method can be determined according to actual conditions and is not limited here. As an example, the text processing method can be an event homonym resolution method based on BERT pre-training.

[0068] The first text can be determined based on actual circumstances and is not limited here. As an example, the first text can be an event sentence. Obtaining the first text can include determining the event sentence based on corpus in a preset corpus. The preset corpus can be determined based on actual circumstances and is not limited here. As an example, the preset corpus can be one or more of the International Knowledge Base Population Contest corpus and the 2005 Automatic Content Extraction (ACE) corpus.

[0069] The step of obtaining the event pair data included in the first text may include obtaining the first text and preprocessing the first text to obtain the event pair data included in the first text.

[0070] In some embodiments, two event sentences in the first text that need to be judged as having a same-reference relationship are used as event pair data included in the first text.

[0071] In some embodiments, the preprocessing of the first text may include performing data cleaning on the first text in combination with regular expressions and a stop word list; filtering special symbols and stop words in the first text; and restoring words in the first text to their original forms.

[0072] In step 102, the event pair data is processed using a dependency syntax analysis tool to obtain event short sentence pair data corresponding to the event pair data. This can be achieved by processing each of the two event sentences in the event pair data using a dependency syntax analysis tool to obtain two event short sentences corresponding to the two event sentences, and using the two event short sentences as the event short sentence pair data corresponding to the event pair data.

[0073] In step 103, the first linear similarity can be determined based on actual conditions and is not limited here. As an example, the first linear similarity can be the first cosine distance of the event pair data. The second linear similarity can be determined based on actual conditions and is not limited here. As an example, the second linear similarity can be the second cosine distance of the event-phrase pair data.

[0074] The first nonlinear similarity can be determined based on actual conditions and is not limited here. As an example, the first nonlinear similarity can be the first bilinear distance and the first single-layer network distance of the event pair data. The second nonlinear similarity can be determined based on actual conditions and is not limited here. As an example, the second nonlinear similarity can be the second bilinear distance and the second single-layer network distance of the event-phrase pair data.

[0075] In step 104, after determining the confidence of the event-to-data, the method further includes: judging whether the confidence is greater than a preset threshold; if the confidence is greater than the preset threshold, determining that the event-to-data has a same-reference relationship; wherein, the existence of a same-reference relationship between the event-to-data indicates that the degree to which the event-to-data has a same-reference relationship is high; if the confidence is less than or equal to the preset threshold, determining that the event-to-data does not have a same-reference relationship; wherein, the absence of a same-reference relationship between the event-to-data indicates that the degree to which the event-to-data has a same-reference relationship is low. The preset threshold can be determined based on actual conditions and is not limited here. As an example, the confidence can be a value between 0 and 1, and the preset threshold can be 0.5.

[0076] An embodiment of the present invention provides a text processing method, which obtains event pair data included in a first text; processes the event pair data using a dependency parser to obtain event sentence pair data corresponding to the event pair data; determines a first linear similarity and a first nonlinear similarity of the event pair data, and determines a second linear similarity and a second nonlinear similarity of the event sentence pair data; and determines a confidence level of the event pair data based on the event pair data, the event sentence pair data, the first linear similarity, the first nonlinear similarity, the second linear similarity, and the second nonlinear similarity; the confidence level represents the degree to which the event pair data have a co-referential relationship. By combining the first linear similarity and the first nonlinear similarity of the event pair data with the second linear similarity and the second nonlinear similarity of the event sentence pair data to determine the confidence level of the event pair data, the method can overcome the defect that the confidence level determined by linear similarity only considers the event pair data as a whole.

[0077] This embodiment proposes a method combining linear similarity and nonlinear similarity, and uses nonlinear similarity to calculate the similarity between words to make up for the shortcoming that linear similarity can only calculate the similarity between sentences of the entire event.

[0078] In an optional embodiment of the present invention, the process of processing the event pair data using a dependency syntax analysis tool to obtain event sentence pair data corresponding to the event pair data includes:

[0079] Determining arguments and dependent words of trigger words in the event pair data using the dependency syntax analysis tool;

[0080] determining a first distance between the argument and the trigger word, and determining a second distance between the dependency word and the trigger word;

[0081] Sorting the first distance and the second distance to obtain a sorting result;

[0082] Determine two arguments or trigger words corresponding to the maximum distance in the sorting result, and use the two arguments or trigger words corresponding to the maximum distance as the start word and the end word of the event short sentence pair data;

[0083] The event pair data is intercepted based on the start word and the end word to obtain the event short sentence pair data.

[0084] In this embodiment, the dependency parsing tool can be determined according to actual conditions and is not limited here. As an example, the dependency parsing tool can be a Stanford natural language processing tool.

[0085] The trigger word can be determined according to actual conditions and is not limited here. As an example, the trigger word can be a word in the event sentence that starts a process or action process.

[0086] The arguments can be determined according to actual circumstances and are not limited here. As an example, the arguments can be the agent, the patient, the time and place of the event in the event sentence, etc.

[0087] The dependent words can be determined according to actual conditions and are not limited here. As an example, the dependent words can be the subject and object in the event sentence.

[0088] The method of sorting the first distance and the second distance can be determined according to actual conditions and is not limited here. As an example, the first distance and the second distance are arranged in order from small to large to obtain the sorting result.

[0089] This embodiment uses a dependency word analysis tool to obtain the dependent words of the trigger word, and then uses the trigger word, dependent words, and arguments together to determine the starting and ending positions of the event short sentence in the sentence, thereby extracting the event short sentence.

[0090] In an optional embodiment of the present invention, determining the confidence of the event pair data in the first text based on the event pair data, the event phrase pair data, the first linear similarity, the first non-linear similarity, the second linear similarity, and the second non-linear similarity includes:

[0091] Determining a confidence vector for the event pair data in the first text based on the event pair data, the event phrase pair data, the first linear similarity, the first non-linear similarity, the second linear similarity, and the second non-linear similarity;

[0092] The confidence vector is processed based on a fully connected classifier to obtain the confidence of the event on the data.

[0093] In this embodiment, the confidence vector is processed based on the fully connected classifier to obtain the confidence of the event on the data. The confidence vector is processed using a slope (Rectified Linear Unit, relu) activation function in the fully connected classifier to obtain a processed confidence vector; and the processed confidence vector is processed using a logistic regression model (sigmoid) activation function to obtain the confidence of the event on the data.

[0094] In an optional embodiment of the present invention, the method further includes:

[0095] The pre-trained model BERT is used to predict the event pair data to obtain the word vector pairs corresponding to the event pair data.

[0096] In this embodiment, the pre-trained model BERT is used to predict the event pair data to obtain the word vector pair corresponding to the event pair data. The method can be to use the BERT to predict the masked words or sentences by using characters to respectively mask the words of each of the two event sentences in the event pair data or the sentences in the text where each of the two event sentences is located, to obtain two word vectors corresponding to the two event sentences in the event pair data, and use the two word vectors as the word vector pair corresponding to the event pair data.

[0097] This embodiment no longer uses fixed word vectors, but instead uses the BERT pre-trained model for training to obtain accurate word vector expressions.

[0098] In an optional embodiment of the present invention, the event pair data includes a plurality of word pair data; the method further includes:

[0099] Acquire a first information pair and a second information pair of a plurality of word pair data in the event pair data; the first information pair represents a part-of-speech information pair of the word pair data; the second information pair represents a position information pair of the word pair data;

[0100] Based on the word vector pair, the event pair data, the first information pair and the second information pair, a first event vector pair corresponding to the event pair data is determined.

[0101] In this embodiment, the word data can be determined according to actual conditions and is not limited here. As an example, the word data can be words in the event sentence.

[0102] The event pair data may include multiple word pair data, and each event sentence in the two event sentences in the event pair data may include multiple word data, and the multiple word data included in each event sentence in the two event sentences may be used as the multiple word pair data included in the event pair data.

[0103] The method of obtaining the first information pair and the second information pair of the multiple word pair data in the event pair data can be as follows: respectively obtaining the first information and the second information of the multiple word data of each event sentence in the two event sentences in the event pair data, and using the first information and the second information of the multiple word data of each event sentence in the two event sentences as the first information pair and the second information pair of the multiple word pair data in the event pair data.

[0104] The obtaining of the first information pair and the second information pair of the multiple word pair data in the event pair data can be as follows: using the Stanford natural language processing tool to determine the first information pair of the multiple word pair data in the event pair data; and determining the second information pair of the multiple word pair data in the event pair data based on the relative distance between each word pair data in the multiple word pair data and the trigger word of the event pair data.

[0105] The determination of the first event vector pair corresponding to the event pair data based on the word vector pair, the event pair data, the first information pair, and the second information pair may be as follows: encoding the event pair data based on the word vector pair to obtain a first dimensional vector pair; encoding the first information pair based on the word vector pair to obtain a second dimensional vector pair; determining a third dimensional vector pair based on the second information pair; and determining the first event vector pair based on the first dimensional vector pair, the second dimensional vector pair, and the third dimensional vector pair. The first dimensional vector pair may be an event vector pair of the first dimension; the second dimensional vector pair may be a part-of-speech vector pair of the second dimension; the third dimensional vector pair may be a position vector pair of the third dimension; and the first event vector pair may be an event vector pair of the fourth dimension.

[0106] This embodiment concatenates the event sentence, the position information of each word in the event sentence, and the part-of-speech information of each word, thereby enriching the feature information of the input data.

[0107] In an optional embodiment of the present invention, the method further includes:

[0108] Using a long short-term memory network Bi-LSTM to extract the first event vector pair to obtain a global information pair corresponding to the first event vector pair;

[0109] Using a convolutional neural network (CNN) to extract the first event vector pair, to obtain a local information pair corresponding to the first event vector pair;

[0110] fusing the global information pair and the local information pair to obtain a fused vector pair corresponding to the first event vector pair;

[0111] Perform a first global maximum pooling layer process on the fused vector pair to obtain a second event vector pair corresponding to the first event vector pair.

[0112] In this embodiment, the long short-term memory network Bi-LSTM is used to extract the first event vector pair to obtain the global information pair corresponding to the first event vector pair. The Bi-LSTM is used to transmit the word information of each event sentence in the two event sentences of the first event vector in a front-to-back order, and then transmit it in a back-to-front order; obtain the global information of each event sentence in the two event sentences of the first event vector pair; and use the global information of each event sentence in the two event sentences as the global information pair corresponding to the first event vector pair. The number of neurons of the Bi-LSTM can be determined according to actual conditions and is not limited here. As an example, the number of neurons of the Bi-LSTM can be 150. The global information pair can be determined according to actual conditions and is not limited here. As an example, the global information pair can be a global vector pair. The global information pair can be a global vector pair of the fifth dimension.

[0113] The use of a convolutional neural network (CNN) to extract the first event vector pair to obtain the local information pair corresponding to the first event vector pair can be performed by using the CNN to extract the local information of each of the two event sentences of the first event vector; and using the local information of each of the two event sentences as the local information pair corresponding to the first event vector pair. The number of convolution kernels and the convolution kernel window size of the CNN can be determined based on actual conditions and are not limited here. As an example, the number of convolution kernels of the CNN is set to 300 and the convolution kernel window size is 2.

[0114] When the convolution kernel window size is 2, the CNN is used to extract local information between two adjacent words in each of the two event sentences of the first event vector; the local information between two adjacent words in each of the two event sentences is used as the local information pair corresponding to the first event vector pair. The local information pair can be determined based on actual conditions and is not limited here. As an example, the local information pair can be a local vector pair. The local information pair can be a local vector pair of the sixth dimension.

[0115] The fusing of the global information pair and the local information pair to obtain the fused vector pair corresponding to the first event vector pair may be performed by bitwise addition of the global information pair and the local information pair to obtain the fused vector pair corresponding to the first event vector pair. The fused vector pair may be a fused vector pair of the seventh dimension.

[0116] The second event vector pair can be determined according to actual conditions and is not limited here. As an example, the second event vector pair can be an event vector pair of the eighth dimension.

[0117] In an optional embodiment of the present invention, determining the first linear similarity and the first non-linear similarity of the event pair data includes:

[0118] determining a first linear similarity and a first nonlinear similarity of the event pair data according to the second event vector pair;

[0119] The first linear similarity includes a first cosine distance; and the first nonlinear similarity includes at least one of a first bilinear distance and a first single-layer network distance.

[0120] In this embodiment, determining the first linear similarity and the first nonlinear similarity of the event pair data according to the second event vector pair may be determining the first linear similarity and the first nonlinear similarity of the event pair data according to two second event vectors in the second event vector pair.

[0121] In an optional embodiment of the present invention, the method further includes:

[0122] Determining a first event short sentence vector pair corresponding to the event short sentence pair data based on the word vector pair and the event short sentence pair data;

[0123] Perform a second global maximum pooling layer process on the first event short sentence vector pair to obtain a second event short sentence vector pair corresponding to the first event short sentence vector pair.

[0124] In this embodiment, the determination of the first event short sentence vector pair corresponding to the event short sentence pair data based on the word vector pair and the event short sentence pair data can be performed by encoding the event short sentence pair data based on the word vector pair to obtain the first event short sentence vector pair corresponding to the event short sentence pair data; the first event short sentence vector pair can be an event short sentence vector pair of the ninth dimension.

[0125] The second event phrase vector pair can be determined according to actual conditions and is not limited here. As an example, the second event phrase vector pair can be an event phrase vector pair of the tenth dimension.

[0126] In an optional embodiment of the present invention, determining the second linear similarity and the second non-linear similarity of the event phrase pair data includes:

[0127] determining a second linear similarity and a second nonlinear similarity of the event phrase pair data according to the second event phrase vector pair;

[0128] The second linear similarity includes a second cosine distance; and the second nonlinear similarity includes at least one of a second bilinear distance and a second single-layer network distance.

[0129] In this embodiment, determining the second linear similarity and the second nonlinear similarity of the event pair data according to the second event phrase vector pair may be determining the second linear similarity and the second nonlinear similarity of the event pair data according to the two second event phrase vectors in the second event phrase vector pair.

[0130] In some embodiments, the confidence of the event pair data in the first text is determined based on the second event vector pair, the second event phrase vector pair, the first linear similarity, the first non-linear similarity, the second linear similarity, and the second non-linear similarity.

[0131] In some embodiments, the company's current intelligent customer service system still relies heavily on manual customer service to answer customer questions. The method proposed in this embodiment can automatically obtain the answer that best matches the question raised by the customer, thereby reducing labor costs and improving user experience.

[0132] This embodiment effectively enriches the feature information of the input data, and performs one-to-one splicing of words, word position information and word part-of-speech information; uses the BERT pre-training model for training to obtain accurate word vector expression; uses Bi-LSTM to encode event sentences to obtain global vectors, and uses CNN to encode event sentences to obtain local vectors, and combines the two; uses the dependency words, trigger words and arguments of trigger words to extract event short sentences, rather than fixedly extracting three words before and after the trigger word to form an event short sentence; combines linear similarity with nonlinear similarity, and does not only calculate linear similarity, but also calculates nonlinear similarity to make up for the shortcomings of linear similarity; compared with the methods of related technologies, the performance is improved.

[0133] For ease of understanding, here is an example of an event coinference resolution method based on BERT pre-training. The method is applied to an event coinference resolution system (BNN system) based on BERT, Bi-LSTM and CNN. Figure 2 This is a technical flow diagram of the BNN system of the text processing method according to an embodiment of the present invention. Figure 2 As shown, the method includes the following steps:

[0134] Step 1: Preprocess the event sentences.

[0135] The KBP and ACE2005 corpora were used to determine the corpus. The KBP corpus contains 6,538 event sentences, and the ACE2005 corpus contains 5,349 event sentences. The event sentences provided by the corpus were input into the preprocessing module of the BNN system. These event sentences were news texts directly crawled from web pages. Because the crawled text data contains a large amount of irrelevant information such as special symbols and stop words, the preprocessing module required data processing. The preprocessing module primarily used regular expressions and stop word lists to clean the text data, filtering out special symbols and stop words and restoring the original form of each word in the sentence. The processed sentence was used as the input event sentence (Sentence, Sen). The Stanford Natural Language Processing Tool was used to obtain the part-of-speech (Pos) information for each word in the event sentence. Each word in the sentence was then assigned its location (Loc), which was calculated as the relative distance from the trigger word of the event sentence. The preprocessing module takes the two event sentences that need to be judged as the event pair data.

[0136] Step 2: Perform BERT prediction on event sentences.

[0137] Because the accuracy of the information input to the BNN system largely determines the accuracy of event co-reference, previous experiments have mostly used fixed word vectors to represent the input information, which is not accurate enough for event sentences. This example uses the BERT pre-trained model to obtain word vector representations.

[0138] The BERT pre-training model predicts the masked words or sentences by masking them with characters, thereby obtaining vector representations (BMs) of various words. Therefore, there is a strong correlation between the words in the sentence, and there is also strong contextual connectivity and logic between the sentences in the text. This has a significant impact on the experimental results. The formula is shown in (1):

[0139] (1)

[0140] Step 3: Use word vectors to encode event sentences.

[0141] The word vector BM trained using the BERT pre-training model is used to encode the event sentence Sen and part-of-speech information Pos to obtain an event sentence vector SEN with a dimension of a×b and a part-of-speech vector POS with a dimension of a×b. The event sentence vector, part-of-speech vector, and position information with a dimension of a×1 are then horizontally concatenated to form an event vector EB with a dimension of a×(2b+1). The formula is shown in (2):

[0142] (2)

[0143] Step 4: Extract global and local information of event sentences.

[0144] When comparing two event sentences to see if they are related by the same reference, you can first observe whether there are similarities between the two event sentences from the overall structure. If the similarity is not high, there is still a possibility that they are related by the same reference. To do this, you need to compare them word by word to find the relationship between the two.

[0145] To this end, this embodiment first uses Bi-LSTM to extract the global information of the event vector EB, and sets the number of Bi-LSTM neurons to 150. Bi-LSTM will pass the information of the previous words in the event sentence backward in sequence, and then pass the information from the back to the front, observing an event sentence from a global perspective. CNN is also used to extract the local information of the event vector EB, and the number of CNN convolution kernels is set to 300, the convolution kernel window size is 2, and the dimension remains unchanged. Since the convolution kernel window size is 2, the local information between two adjacent words in the event sentence will be extracted. The two networks respectively obtain a global vector GE with a dimension of a×300 and a local vector LE with a dimension of a×300, as shown in formulas (3) and (4):

[0146] (3)

[0147] (4)

[0148] Since the global vector GE and the local vector LE have the same dimension, this embodiment adds the global vector GE and the local vector LE bit by bit to obtain a vector GL with a dimension of a×300. This is equivalent to fusing the global information and local information of each word in the event sentence. Formula (5) is shown:

[0149] (5)

[0150] Finally, the vector GL is passed through the global maximum pooling layer to obtain a vector EX with a dimension of a×1, as shown in formula (6):

[0151] (6)

[0152] Step 5: Extract event short sentences from event sentences.

[0153] In related technologies, researchers typically extract three words before and after a trigger word as an event short sentence to briefly describe the event. This method may extract a sentence with incomplete structural information, thereby incorrectly representing the meaning of the original sentence. To this end, this embodiment optimizes this extraction method. The steps for extracting event short sentences are as follows:

[0154] Step (5.1) uses the Stanford Natural Language Processing tool to obtain the arguments in the event sentence. The arguments mainly include: agent, patient, time and place of the event, etc.

[0155] Step (5.2) uses the dependency word analysis tool to generate the dependent words of the trigger word in the sentence.

[0156] Step (5.3) calculates the distance between each argument and each dependency word and the trigger word, determines the two words farthest from the trigger word before and after it, and uses these two words as the starting and ending positions of the event phrase.

[0157] Step (5.4) extracts the sentence from the starting position to the ending position as the event short sentence.

[0158] For example, consider the sentence "Zhang Junxiong, the newly appointed Executive President, was also invited to attend the inauguration ceremony and delivered a speech." In this sentence, the trigger word is "appointed," and its dependents are "Zhang Junxiong," "President," and "invited." The distances between these three dependents and the trigger word are -3, 2, and 5, respectively. The arguments in the event sentence are "Zhang Junxiong" and "invited," and the distances between these two arguments and the trigger word are -3 and 5, respectively.

[0159] Using the fixed method for extracting short sentences, the event short sentence is "Junxiong the newly appointed Executive President was," which is incomplete. However, using the optimization method proposed in this embodiment, the event short sentence "Zhang Junxiong the newly appointed Executive President was also invited" is extracted by taking the dependent word or argument "Zhang Junxiong" farthest before the trigger word as the starting position and the dependent word or argument "invited" farthest after the trigger word as the ending position.

[0160] According to the above method, the event short sentence is obtained, and the word vector BM is used to encode the event short sentence to obtain the event short sentence vector ES with a dimension of a×b. Then the event short sentence vector ES is passed through the global maximum pooling layer to obtain the event short sentence vector SX with a dimension of a×1. The formula is shown in (7):

[0161] (7)

[0162] Step 6: Calculate the similarity between two event sentences.

[0163] The key to determining whether event sentences have a co-referential relationship lies in calculating their similarity. The accuracy and comprehensiveness of this similarity calculation significantly impacts the model's performance. In related technologies, researchers have only used the cosine distance method to calculate linear similarity between event sentences. Linear similarity considers the relationship between two event sentences from a holistic perspective. If the structural differences between the two sentences are too large, they may be misjudged as non-co-referential. Non-linear similarity, on the other hand, can compensate for the shortcomings of linear similarity by calculating the word-to-word relationship between a pair of events.

[0164] This embodiment proposes three similarity calculation methods: cosine distance C, bilinear distance S, and single-layer network distance L. The formulas are shown in (8), (9), (10), (11), (12), and (13):

[0165] (8)

[0166] (9)

[0167] (10)

[0168] (11)

[0169] (12)

[0170] (13)

[0171] In formula (8), represents the cosine distance corresponding to the event sentence vector. In formula (9), represents the cosine distance corresponding to the event short sentence vector. In formula (10), Represents the weight used to calculate the bilinear distance corresponding to the event sentence vector. In formula (11), Represents the weight used to calculate the bilinear distance corresponding to the event short sentence vector. In formula (12), Represents the weight used to calculate the single-layer network distance corresponding to the event sentence vector; Represents the offset vector used to calculate the single-layer network distance corresponding to the event sentence vector. In formula (13), Represents the weight used to calculate the single-layer network distance corresponding to the event short sentence vector; Represents the offset vector used to calculate the single-layer network distance corresponding to the event short sentence vector.

[0172] Step 7: Output confidence.

[0173] Combine the event sentence vector EX, the event short sentence vector SX, the similarity vector C, the similarity bilinear vector S and the similarity single-layer network vector L to generate the vector P. The formula is shown in (14):

[0174] (14)

[0175] Put the vector P into a fully connected classifier, which uses the relu activation function, as shown in formula (15):

[0176] (15)

[0177] In formula (15), Represents the weight of the activation function corresponding to the vector P; Represents the offset vector of the activation function corresponding to the vector P.

[0178] The confidence level of event co-referencing is obtained through the sigmoid layer, as shown in formula (16):

[0179] (16)

[0180] In formula (16), The weight representing the confidence level; Bias vector representing confidence.

[0181] The confidence score is a value between 0 and 1. If the score is greater than 0.5, it is considered a co-referential relationship; otherwise, it is considered a non-co-referential relationship. To prevent overfitting, this example uses dropout, a strategy widely used in deep learning to address model overfitting, with a value of 0.2.

[0182] Through BERT pre-training and the extraction of global and local information, the BNN system accurately and comprehensively mines the semantic information of text content and converts it into a vector representation. By extracting short event sentences and calculating similarity distances, the model assists in identifying co-referential relationships. This system achieved excellent results in actual testing, improving performance compared to related methods and existing technologies. Table 1 shows the KBP performance results. As shown in Table 1, the performance results are as follows:

[0183]

[0184] Table 1 shows the KBP performance results.

[0185] In Table 1, MUC, B3, BLANC, CEAFe, and Links are performance evaluation methods, and KBP and ACE are test sets.

[0186] As shown in Table 1, the BNN system significantly improves upon the neural network methods of researchers 6 and KBP-TOP, and achieves a 0.6% improvement on average over the machine learning method of researchers 4. Although this improvement is only 0.6%, the neural network method offers advantages over machine learning methods in terms of lower labor costs, higher efficiency, and greater portability.

[0187] An embodiment of the present invention provides a text processing device, Figure 3 FIG. 1 is a schematic diagram showing the structure of a text processing device according to an embodiment of the present invention. Figure 3 As shown, the device 300 includes:

[0188] A first acquisition module 301 is configured to acquire event pair data included in a first text;

[0189] A first processing module 302 is configured to process the event pair data using a dependency syntax analysis tool to obtain event sentence pair data corresponding to the event pair data;

[0190] A first determining module 303 is configured to determine a first linear similarity and a first non-linear similarity of the event pair data and a second linear similarity and a second non-linear similarity of the event phrase pair data;

[0191] The second determination module 304 is used to determine the confidence of the event pair data based on the event pair data, the event phrase pair data, the first linear similarity, the first non-linear similarity, the second linear similarity and the second non-linear similarity; the confidence represents the degree to which the event pair data has a co-reference relationship.

[0192] In other embodiments, the first processing module 302 is further used to use the dependency syntax analysis tool to determine the arguments and dependent words of the trigger word in the event pair data; determine a first distance between the argument and the trigger word, and determine a second distance between the dependency word and the trigger word; sort the first distance and the second distance to obtain a sorting result; determine the two arguments or trigger words corresponding to the maximum distance in the sorting result, and use the two arguments or trigger words corresponding to the maximum distance as the starting word and the ending word of the event short sentence pair data; intercept the event pair data based on the starting word and the ending word to obtain the event short sentence pair data.

[0193] In other embodiments, the second determination module 304 is further used to determine the confidence vector of the event pair data in the first text based on the event pair data, the event phrase pair data, the first linear similarity, the first non-linear similarity, the second linear similarity and the second non-linear similarity; and process the confidence vector based on a fully connected classifier to obtain the confidence of the event pair data.

[0194] In other embodiments, the device 300 further includes: a prediction module, configured to use a pre-trained model BERT to predict the event pair data and obtain word vector pairs corresponding to the event pair data.

[0195] In other embodiments, the event pair data includes a plurality of word pair data; the apparatus 300 further includes: a second acquisition module and a third determination module; wherein,

[0196] The second acquisition module is used to acquire a first information pair and a second information pair of a plurality of word pair data in the event pair data; the first information pair represents a part-of-speech information pair of the word pair data; the second information pair represents a position information pair of the word pair data;

[0197] The third determination module is used to determine a first event vector pair corresponding to the event pair data based on the word vector pair, the event pair data, the first information pair and the second information pair.

[0198] In other embodiments, the apparatus 300 further includes: a first extraction module, a second extraction module, a fusion module, and a second processing module; wherein,

[0199] The first extraction module is configured to extract the first event vector pair using a long short-term memory network Bi-LSTM to obtain a global information pair corresponding to the first event vector pair;

[0200] The second extraction module is configured to extract the first event vector pair using a convolutional neural network (CNN) to obtain a local information pair corresponding to the first event vector pair;

[0201] The fusion module is configured to fuse the global information pair and the local information pair to obtain a fusion vector pair corresponding to the first event vector pair;

[0202] The second processing module is configured to perform a first global maximum pooling layer process on the fused vector pair to obtain a second event vector pair corresponding to the first event vector pair.

[0203] In other embodiments, the first determination module 303 is further used to determine a first linear similarity and a first nonlinear similarity of the event pair data based on the second event vector pair; wherein the first linear similarity includes a first cosine distance; and the first nonlinear similarity includes at least one of a first bilinear distance and a first single-layer network distance.

[0204] In other embodiments, the apparatus 300 further includes: a fourth determining module and a third processing module; wherein,

[0205] The fourth determining module is configured to determine a first event short sentence vector pair corresponding to the event short sentence pair data based on the word vector pair and the event short sentence pair data;

[0206] The third processing module is configured to perform a second global maximum pooling layer processing on the first event short sentence vector pair to obtain a second event short sentence vector pair corresponding to the first event short sentence vector pair.

[0207] In other embodiments, the first determination module 303 is further used to determine a second linear similarity and a second nonlinear similarity of the event phrase pair data based on the second event phrase vector pair; wherein the second linear similarity includes a second cosine distance; and the second nonlinear similarity includes at least one of a second bilinear distance and a second single-layer network distance.

[0208] The description of the above device embodiment is similar to the description of the above method embodiment and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present invention, please refer to the description of the method embodiment of the present invention for understanding.

[0209] It should be noted that in embodiments of the present invention, if the aforementioned text processing method is implemented as a software functional module and sold or used as a standalone product, it may also be stored in a computer-readable storage medium. Based on this understanding, the technical embodiments of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a text processing device (such as a personal computer, server, or network device) to execute all or part of the methods described in various embodiments of the present invention. Such storage media include various media capable of storing program code, such as USB flash drives, removable hard drives, read-only memories (ROMs), magnetic disks, or optical disks. Thus, the embodiments of the present invention are not limited to any specific combination of hardware and software.

[0210] Correspondingly, an embodiment of the present invention further provides a text processing device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, any step in the above-mentioned method is implemented.

[0211] Correspondingly, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, any step in the above-described method is implemented.

[0212] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present invention, please refer to the description of the method embodiments of the present invention for understanding.

[0213] It should be noted that Figure 4 FIG. 1 is a schematic diagram of a hardware entity structure of a text processing device according to an embodiment of the present invention. Figure 4As shown, the hardware entity of the text processing device 400 includes: a processor 401 and a memory 403 . Optionally, the text processing device 400 may further include a communication interface 402 .

[0214] It is understood that memory 403 can be volatile memory or non-volatile memory, or can include both volatile and non-volatile memory. Non-volatile memory can include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disk, or compact disc read-only memory (CD-ROM); magnetic surface memory can include magnetic disk storage or magnetic tape storage. Volatile memory can include random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM).The memory 403 described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memories.

[0215] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 401. Processor 401 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in processor 401. Processor 401 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. Processor 401 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in memory 403. Processor 401 reads information from memory 403 and, in conjunction with its hardware, completes the steps of the above method.

[0216] In an exemplary embodiment, the text processing device may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.

[0217] In the several embodiments provided by the present invention, it should be understood that the disclosed methods and devices can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another observation quantity, or some features can be ignored or not executed. In addition, the communication connection between the various components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0218] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of this embodiment.

[0219] Those skilled in the art will understand that all or part of the steps of the above-mentioned method embodiments can be implemented by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROMs), magnetic disks, optical disks, and other media that can store program codes.

[0220] Alternatively, if the aforementioned integrated units of the embodiments of the present invention are implemented as software functional units and sold or used as independent products, they can also be stored on a computer-readable storage medium. Based on this understanding, the technical embodiments of the embodiments of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product, stored on a storage medium, includes instructions for enabling a text processing device (such as a personal computer, server, or network device) to execute all or part of the methods described in various embodiments of the present invention. The aforementioned storage media include various media capable of storing program code, such as removable storage devices, ROMs, magnetic disks, or optical disks.

[0221] The text processing method, device and computer storage medium described in the examples of the present invention are only taken as examples of the embodiments of the present invention, but are not limited to this. As long as the text processing method, device and computer storage medium are involved, they are within the scope of protection of the present invention.

[0222] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention. The serial numbers of the above-mentioned embodiments of the present invention are for description only and do not represent the advantages and disadvantages of the embodiments.

[0223] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0224] The above description is merely an embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A text processing method, characterized in that: include: Acquire event pair data included in the first text; Using a dependency syntax analysis tool to process the event pair data to obtain event short sentence pair data corresponding to the event pair data; Determining a first linear similarity and a first non-linear similarity of the event pair data and determining a second linear similarity and a second non-linear similarity of the event phrase pair data; Determining the confidence of the event pair data based on the event pair data, the event phrase pair data, the first linear similarity, the first non-linear similarity, the second linear similarity, and the second non-linear similarity; the confidence represents the degree to which the event pair data have a co-referential relationship; The process of using a dependency syntax analysis tool to process the event pair data to obtain event short sentence pair data corresponding to the event pair data includes: Determining arguments and dependent words of trigger words in the event pair data using the dependency syntax analysis tool; determining a first distance between the argument and the trigger word, and determining a second distance between the dependency word and the trigger word; Sorting the first distance and the second distance to obtain a sorting result; Determine two arguments or trigger words corresponding to the maximum distance in the sorting result, and use the two arguments or trigger words corresponding to the maximum distance as the start word and the end word of the event short sentence pair data; The event pair data is intercepted based on the start word and the end word to obtain the event short sentence pair data.

2. The method according to claim 1, characterized in that The determining the confidence of the event pair data in the first text based on the event pair data, the event phrase pair data, the first linear similarity, the first non-linear similarity, the second linear similarity, and the second non-linear similarity includes: Determining a confidence vector for the event pair data in the first text based on the event pair data, the event phrase pair data, the first linear similarity, the first non-linear similarity, the second linear similarity, and the second non-linear similarity; The confidence vector is processed based on a fully connected classifier to obtain the confidence of the event on the data.

3. The method according to claim 1, characterized in that The method further comprises: The pre-trained model BERT is used to predict the event pair data to obtain the word vector pairs corresponding to the event pair data.

4. The method according to claim 3, characterized in that The event pair data includes a plurality of word pair data; the method further includes: Acquire a first information pair and a second information pair of a plurality of word pair data in the event pair data; the first information pair represents a part-of-speech information pair of the word pair data; the second information pair represents a position information pair of the word pair data; Based on the word vector pair, the event pair data, the first information pair and the second information pair, a first event vector pair corresponding to the event pair data is determined.

5. The method according to claim 4, characterized in that The method further comprises: Using a long short-term memory network Bi-LSTM to extract the first event vector pair to obtain a global information pair corresponding to the first event vector pair; Using a convolutional neural network (CNN) to extract the first event vector pair, to obtain a local information pair corresponding to the first event vector pair; fusing the global information pair and the local information pair to obtain a fused vector pair corresponding to the first event vector pair; Perform a first global maximum pooling layer process on the fused vector pair to obtain a second event vector pair corresponding to the first event vector pair.

6. The method according to claim 5, characterized in that Determining a first linear similarity and a first nonlinear similarity of the event pair data includes: determining a first linear similarity and a first nonlinear similarity of the event pair data according to the second event vector pair; The first linear similarity includes a first cosine distance; and the first nonlinear similarity includes at least one of a first bilinear distance and a first single-layer network distance.

7. The method according to claim 3, characterized in that The method further comprises: Determining a first event short sentence vector pair corresponding to the event short sentence pair data based on the word vector pair and the event short sentence pair data; Perform a second global maximum pooling layer process on the first event short sentence vector pair to obtain a second event short sentence vector pair corresponding to the first event short sentence vector pair.

8. The method according to claim 7, characterized in that Determining the second linear similarity and the second nonlinear similarity of the event phrase pair data includes: determining a second linear similarity and a second nonlinear similarity of the event phrase pair data according to the second event phrase vector pair; The second linear similarity includes a second cosine distance; and the second nonlinear similarity includes at least one of a second bilinear distance and a second single-layer network distance.

9. A text processing device, characterized in that: include: A first acquisition module, configured to acquire event pair data included in the first text; A first processing module is configured to process the event pair data using a dependency syntax analysis tool to obtain event short sentence pair data corresponding to the event pair data; A first determining module is configured to determine a first linear similarity and a first non-linear similarity of the event pair data and a second linear similarity and a second non-linear similarity of the event phrase pair data; a second determining module, configured to determine a confidence level of the event pair data based on the event pair data, the event phrase pair data, the first linear similarity, the first non-linear similarity, the second linear similarity, and the second non-linear similarity; the confidence level representing the degree to which the event pair data have a co-referential relationship; The first processing module is further configured to use the dependency syntax analysis tool to determine arguments and dependent words of the trigger word in the event pair data; determine a first distance between the argument and the trigger word, and determine a second distance between the dependent word and the trigger word; and sort the first distance and the second distance to obtain a sorting result; Determine two arguments or trigger words corresponding to the maximum distance in the sorting result, and use the two arguments or trigger words corresponding to the maximum distance as the start word and the end word of the event short sentence pair data; The event pair data is intercepted based on the start word and the end word to obtain the event short sentence pair data.

10. A text processing device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.

11. A storage medium, characterized in that: The storage medium stores executable instructions, and when the executable instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • English event co-reference resolution method and system

    CN109359184A

  • Event description text prediction method and device, equipment and storage medium

    CN114416912A