Text recognition method and device, computer device and readable storage medium
By generating and iteratively updating a text connectivity graph, and combining graph convolutional networks and clustering algorithms, the problem of insufficient text recognition accuracy in existing technologies is solved, and more accurate semantic repetition text recognition is achieved.
Patent Information
- Application Number
- CN202510867409.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-06-26
AI Technical Summary
Existing text recognition technologies lack accuracy and struggle to accurately identify text with semantic repetition.
By generating a text connectivity graph, the system obtains the text to be detected and its relationship information, iteratively updates the text connectivity graph, generates target text features based on the iteratively updated text connectivity graph, performs multiple rounds of convolution calculations using a graph convolutional network, and combines clustering algorithms to identify target text with semantic repetition.
It improves the accuracy of text recognition, enabling more accurate identification of semantically repetitive target text from multiple texts to be detected.
Smart Images

Figure CN120373303B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of text processing, in particular to a text recognition method and device, computer equipment and a readable storage medium. BACKGROUND
[0002] With the development of science and technology, a large number of new technologies have emerged in the field of text processing. Among them, identifying whether the semantics of the text is repeated is a relatively important technology. For example, in the process of putting an enterprise technology product online for use, the semantics of the use problem text reported by the customer often presents a certain regularity and repeatability. Identifying the repeated semantics or similar use problem text in the reported use problem text can help reduce the cost of repeated human investment and improve problem solving efficiency.
[0003] In related technologies, the text recognition technology generally extracts text feature information of multiple texts, and performs semantic similarity recognition on the multiple text feature information to determine whether there is text feature information with high semantic similarity between the multiple text feature information. If there is, the text corresponding to the multiple text feature information with high semantic similarity is determined as a semantic repeated text.
[0004] However, the current text recognition method has the problem of inaccuracy. SUMMARY
[0005] Therefore, it is necessary to provide an accurate text recognition method, device, computer equipment, computer readable storage medium and computer program product to solve the above technical problems.
[0006] In a first aspect, the present application provides a text recognition method, which comprises:
[0007] obtaining a to-be-detected text and association relationship information, wherein the association relationship information represents the association relationship between keywords in the to-be-detected text and the association relationship between the to-be-detected text and the keywords;
[0008] generating a text connectivity graph according to the to-be-detected text and the association relationship information, wherein the nodes of the text connectivity graph represent the text features corresponding to the to-be-detected text or the keywords, and the connection edges between the nodes represent the association relationship between the keywords or the association relationship between the to-be-detected text and the keywords;
[0009] iteratively updating the text connectivity graph, and generating a target text feature corresponding to the to-be-detected text according to the iteratively updated text connectivity graph;
[0010] identifying a target text with repeated semantics from the multiple to-be-detected texts by clustering the target text features of the multiple to-be-detected texts.
[0011] In one of the embodiments, the text connectivity graph is iteratively updated, comprising:
[0012] According to the connection edges of each node, the associated nodes of each node are detected respectively;
[0013] According to the associated nodes of each node and the nodes, the text connectivity graph is iteratively updated;
[0014] In the Nth iteration process, according to the associated nodes of each node and the nodes, the text connectivity graph is updated, comprising: each node and the corresponding associated nodes are spliced, wherein N is a positive integer;
[0015] Or,
[0016] According to the association relationship information, the edge type of each connection edge is determined, and according to the edge type, the edge weight of the connection edge is detected;
[0017] According to the connection edges of each node, the associated nodes of each node are detected respectively;
[0018] According to the associated nodes of each node and the nodes, the text connectivity graph is iteratively updated;
[0019] In the Nth iteration process, according to the associated nodes of each node and the nodes, the text connectivity graph is updated, comprising: based on the edge weight, each node and the corresponding associated nodes are fused, wherein N is a positive integer.
[0020] In one of the embodiments, the nodes include keyword nodes and text nodes, the keyword nodes represent the text features corresponding to the keywords, and the text nodes represent the text features corresponding to the to-be-detected text;
[0021] According to the text connectivity graph updated iteratively, the target text features corresponding to the to-be-detected text are generated, comprising:
[0022] The keyword appearance frequency information of the keywords in the to-be-detected text is obtained;
[0023] According to the keyword appearance frequency information, the keyword nodes in the text connectivity graph updated iteratively are weighted to obtain keyword fusion nodes;
[0024] The keyword fusion nodes and the text nodes are spliced to obtain the target text features of the to-be-detected text.
[0025] In one of the embodiments, the method further comprises:
[0026] The part-of-speech of the to-be-detected text is tagged;
[0027] The to-be-detected text after the part-of-speech tagging is segmented to obtain a plurality of segmented words;
[0028] detecting first frequency information, second frequency information and occurrence number information of each of the plurality of segmented words, wherein the first frequency information represents frequency information of the segmented words in the text to be detected, and the second frequency information represents proportion information of texts in which the segmented words exist in the plurality of candidate texts in the preset corpus;
[0029] According to the first frequency information, the second frequency information and the occurrence number information, the key words are screened from the plurality of segmented words.
[0030] In one of the embodiments, the association relationship information includes co-occurrence association relationship, syntax dependency association relationship and global association relationship; and the association relationship information is obtained by:
[0031] In a case where it is detected that the first key word and the second key word both appear in the same text region of the text to be detected, it is determined that the co-occurrence association relationship exists between the first key word and the second key word, wherein the first key word and the second key word are different key words in the text to be detected.
[0032] In a case where it is detected that the syntax of the third key word depends on the syntax of the fourth key word, it is determined that the syntax dependency association relationship exists between the third key word and the fourth key word, wherein the third key word and the fourth key word are different key words in the text to be detected.
[0033] It is determined that the global association relationship exists between each key word and the text to be detected.
[0034] In one of the embodiments, the nodes include key word nodes and text nodes; and the text connectivity graph is generated according to the text to be detected and the association relationship information, including:
[0035] The text features of the text to be detected and the text features of the key words in the text to be detected are extracted;
[0036] The text features of the text to be detected are taken as text nodes in the text connectivity graph, and the text features of the key words are taken as key word nodes in the text connectivity graph;
[0037] In a case where the association relationship information represents that an association relationship exists between two key words, a connection edge between the key word nodes corresponding to the two key words is generated;
[0038] In a case where the association relationship information represents that an association relationship exists between a key word and the text to be detected, a connection edge between the key word node corresponding to the key word and the text node corresponding to the text to be detected is generated.
[0039] In a second aspect, the present application further provides a text recognition device, including:
[0040] The information acquisition module is configured to acquire the to-be-detected text and association relationship information, wherein the association relationship information represents an association relationship between keywords in the to-be-detected text and an association relationship between the to-be-detected text and the keywords.
[0041] The connected graph generation module is configured to generate a text connected graph according to the to-be-detected text and the association relationship information, wherein a node of the text connected graph represents a text feature corresponding to the to-be-detected text or the keywords, and a connection edge between the nodes represents the association relationship between the keywords or represents the association relationship between the to-be-detected text and the keywords.
[0042] The connected graph updating module is configured to iteratively update the text connected graph, and generate a target text feature corresponding to the to-be-detected text according to the iteratively updated text connected graph.
[0043] The text recognition module is configured to recognize a target text with semantic repetition from a plurality of to-be-detected texts by clustering the target text features of the plurality of to-be-detected texts.
[0044] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0045] acquire the to-be-detected text and the association relationship information, wherein the association relationship information represents an association relationship between keywords in the to-be-detected text and an association relationship between the to-be-detected text and the keywords;
[0046] generate a text connected graph according to the to-be-detected text and the association relationship information, wherein a node of the text connected graph represents a text feature corresponding to the to-be-detected text or the keywords, and a connection edge between the nodes represents the association relationship between the keywords or represents the association relationship between the to-be-detected text and the keywords.
[0047] iteratively update the text connected graph, and generate a target text feature corresponding to the to-be-detected text according to the iteratively updated text connected graph.
[0048] recognize a target text with semantic repetition from a plurality of to-be-detected texts by clustering the target text features of the plurality of to-be-detected texts.
[0049] In a fourth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0050] acquire the to-be-detected text and the association relationship information, wherein the association relationship information represents an association relationship between keywords in the to-be-detected text and an association relationship between the to-be-detected text and the keywords;
[0051] According to the to-be-detected text and the association relationship information, a text connectivity graph is generated, wherein a node of the text connectivity graph represents a text feature corresponding to the to-be-detected text or a keyword, and a connection edge between the nodes represents an association relationship between the keywords or an association relationship between the to-be-detected text and the keyword;
[0052] The text connectivity graph is iteratively updated, and a target text feature corresponding to the to-be-detected text is generated according to the text connectivity graph after the iteration update;
[0053] Through clustering of the target text features of the plurality of to-be-detected texts, a target text with semantic repetition is identified from the plurality of to-be-detected texts.
[0054] In a fifth aspect, the present application further provides a computer program product comprising a computer program which, when executed by a processor, implements the following steps:
[0055] The to-be-detected text and the association relationship information are obtained, wherein the association relationship information represents an association relationship between keywords in the to-be-detected text and an association relationship between the to-be-detected text and the keywords;
[0056] According to the to-be-detected text and the association relationship information, a text connectivity graph is generated, wherein a node of the text connectivity graph represents a text feature corresponding to the to-be-detected text or a keyword, and a connection edge between the nodes represents an association relationship between the keywords or an association relationship between the to-be-detected text and the keyword;
[0057] The text connectivity graph is iteratively updated, and a target text feature corresponding to the to-be-detected text is generated according to the text connectivity graph after the iteration update;
[0058] Through clustering of the target text features of the plurality of to-be-detected texts, a target text with semantic repetition is identified from the plurality of to-be-detected texts.
[0059] The text recognition method, device, computer device, computer readable storage medium and computer program product, obtain the to-be-detected text and the association relationship information, wherein the association relationship information represents the association relationship between the keywords in the to-be-detected text and the association relationship between the to-be-detected text and the keywords; generate a text connectivity graph according to the to-be-detected text and the association relationship information, wherein the nodes of the text connectivity graph represent the text features corresponding to the to-be-detected text or the keywords, and the connection edges between the nodes represent the association relationship between the keywords or the association relationship between the to-be-detected text and the keywords; iteratively update the text connectivity graph, and generate the target text feature corresponding to the to-be-detected text according to the iteratively updated text connectivity graph; and cluster the target text features of the plurality of to-be-detected texts to identify the target text with semantic repetition from the plurality of to-be-detected texts. In the entire process, the text connectivity graph is generated based on the to-be-detected text and the association relationship information, so that the nodes in the text connectivity graph represent the text features corresponding to the to-be-detected text or the keywords, and the connection edges between the nodes represent the association relationship between the keywords or the association relationship between the to-be-detected text and the keywords, which is more comprehensive. The text connectivity graph is iteratively updated to further generate the accurate target node feature information of the to-be-detected text. At this time, the process of clustering the target text features of the plurality of to-be-detected texts to identify the target text with semantic repetition from the plurality of to-be-detected texts is more accurate. BRIEF DESCRIPTION OF DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other related drawings without creative labor based on these drawings.
[0061] Figure 1 An application environment diagram of a text recognition method in an embodiment;
[0062] Figure 2 A flowchart of a text recognition method in an embodiment;
[0063] Figure 3 A flowchart of a text recognition method in another embodiment;
[0064] Figure 4 A structural block diagram of a text recognition device in an embodiment;
[0065] Figure 5 An internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0066] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are used to explain the present application and not to limit the present application.
[0067] The text recognition method provided by the embodiments of the present application can be applied in an application environment as shown in the figure. Figure 1 The terminal 102 communicates with the server 104 through a network. The data storage system can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on a cloud or other network server.
[0068] The user inputs the to-be-detected text on the text recognition interface of the terminal 102, and triggers the text recognition control. The terminal 102 responds to the triggering operation of the text recognition control, generates a text recognition request based on the to-be-detected text, the text recognition request carrying the to-be-detected text, and sends the text recognition request to the server 104.
[0069] The server 104 obtains the text recognition request, extracts the to-be-detected text carried by the request from the text recognition request, and obtains the association relationship information of the to-be-detected text, wherein the association relationship information represents the association relationship between the keywords in the to-be-detected text and the association relationship between the to-be-detected text and the keywords; according to the to-be-detected text and the association relationship information, a text connectivity graph is generated, wherein the nodes of the text connectivity graph represent the text features corresponding to the to-be-detected text or the keywords, and the connection edges between the nodes represent the association relationship between the keywords or the association relationship between the to-be-detected text and the keywords; the text connectivity graph is iteratively updated, and according to the text connectivity graph after the iteration update, a target text feature corresponding to the to-be-detected text is generated; and by clustering the target text features of a plurality of to-be-detected texts, a target text with semantic repetition is recognized from the plurality of to-be-detected texts.
[0070] Further, the server 104 can also push the target text with semantic repetition to the terminal 102, which is displayed to the user by the terminal 102.
[0071] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. The server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0072] In one exemplary embodiment, such as Figure 2 As shown, a text recognition method is provided, which can be applied to... Figure 1 Taking server 104 as an example for explanation. Wherein:
[0073] S100, Obtain the text to be detected.
[0074] Among them, the relational information represents the relationships between keywords in the text to be tested, as well as the connections between the text and the keywords. The text to be tested is natural language text composed of at least one number, letter, and character. In text analysis, keywords typically refer to words or phrases that can summarize, represent, or emphasize the theme, content, or intent of the text. These keywords play an important role in the text because they are often key to the reader's understanding of the core information. Generally, keywords usually have a high frequency of occurrence or semantic importance in the text.
[0075] Specifically, the server acquires the text to be detected carried in the text recognition request sent by the terminal. For example, the server can acquire text information such as problem description text or problem solution text, and performs preprocessing operations on the text to be detected to avoid problems caused by data format errors in subsequent text connectivity graph generation and feature extraction. In other words, after acquiring the text to be detected, the server first converts the data format of the text to be detected so that its data format matches the data format used in the server's text recognition process. In addition, the server can also perform data cleaning operations on the text to be detected, such as removing irrelevant information, erroneous information, or noise data, as well as removing redundant spaces, punctuation marks, or special characters, thereby improving the accuracy and consistency of the data.
[0076] Furthermore, words or phrases that can summarize, represent, or emphasize the theme, content, or intent of the text are extracted from the preprocessed text to be detected, and these extracted words or phrases are used as multiple keywords in the text to be detected.
[0077] After extracting the plurality of keywords in the to-be-detected text, the to-be-detected text can be converted into a text connected graph. In order to convert the to-be-detected text into a text connected graph, the association relationship between the to-be-detected text and the plurality of keywords and the association relationship between each keyword and other keywords need to be detected, and the association relationship between the to-be-detected text and the plurality of keywords and the association relationship between each keyword and other keywords are taken as the detected association relationship information. In actual application, the association relationship exists between the to-be-detected text and the plurality of keywords, and the association relationship may exist or may not exist between each keyword and other keywords.
[0078] S200, generating a text connected graph according to the to-be-detected text and the association relationship information.
[0079] The text connected graph is a connected graph containing nodes and edges. The nodes of the text connected graph represent the text features corresponding to the to-be-detected text or the keywords, and the connection edges between the nodes represent the association relationship between the keywords or the association relationship between the to-be-detected text and the keywords.
[0080] Specifically, the text connected graph includes a plurality of nodes, and the nodes are connected through connection edges. Therefore, in the process of generating the text connected graph according to the to-be-detected text and the association relationship information, the keywords in the to-be-detected text and the to-be-detected text are taken as the nodes in the text connected graph, and the connection edges between the nodes are generated based on the association relationship between the keywords and the association relationship between the to-be-detected text and the keywords.
[0081] In an exemplary embodiment, generating the text connected graph according to the to-be-detected text and the association relationship information includes: performing feature extraction on the to-be-detected text to obtain text features of the to-be-detected text, and extracting text features of the keywords from the text features of the to-be-detected text; in addition, the feature extraction can also be directly performed on the keywords to obtain the text features of the keywords; finally, the text connected graph is generated based on the text features of the to-be-detected text and the text features of the keywords.
[0082] Further, taking the feature extraction on the to-be-detected text as an example, the feature extraction can be realized by encoding the to-be-detected text through the BERT pre-training language model, that is, taking the encoding vector of the entire to-be-detected text as the text features of the to-be-detected text.
[0083] S300, iteratively updating the text connected graph, and generating the target text features corresponding to the to-be-detected text according to the iteratively updated text connected graph.
[0084] Specifically, the text connectivity graph is an irregular data structure, and thus, each node in the text connectivity graph needs to be processed through a specific network structure, so that the text connectivity graph can be converted into accurate computer computable target text features.
[0085] For example, the text connectivity graph, which is an irregular data structure, can be subjected to multi-round convolution calculation through a graph convolution network, which is a neural network model specially designed to process graph data.
[0086] S400, identifying the semantically repetitive target text from the plurality of to-be-detected texts by clustering the target text features of the plurality of to-be-detected texts.
[0087] Specifically, the semantic repetition identification of the target text features of the plurality of to-be-detected texts can be achieved by clustering the target text features of the plurality of to-be-detected texts.
[0088] The clustering of the target text features of the plurality of to-be-detected texts to identify the semantically repetitive target text from the plurality of to-be-detected texts includes:
[0089] The clustering of the target text features of the plurality of to-be-detected texts obtains a plurality of text feature clusters, and in a case where any two target text features are detected to be in the same text feature cluster, the two target text features are considered to be semantically repetitive.
[0090] More specifically, the clustering of the target text features of the plurality of to-be-detected texts is performed through an unsupervised clustering algorithm, and the target text features of the plurality of to-be-detected texts are divided into a plurality of text feature clusters. Text data in the same cluster has similar features and patterns, and data representing the same cluster has a higher possibility of being repetitive. In actual applications, the clustering algorithm can be a K-means clustering algorithm, or other clustering algorithms such as hierarchical clustering and Gaussian mixture model clustering.
[0091] Further, in the process of clustering the target text features of the plurality of to-be-detected texts, the number of clusters can be determined as K according to domain knowledge through expert knowledge, and K text feature information in the target text features of the plurality of to-be-detected texts can be randomly selected as initial clustering centers. The Euclidean distance between each target text feature and the clustering center is calculated, and each target text feature is assigned to the nearest clustering center to form K clusters. The average value of all target text features in each cluster is calculated, and the average value is taken as the new clustering center in the cluster. The step of calculating the Euclidean distance between each target text feature and the clustering center is returned until the clustering centers of all clusters no longer change significantly or the maximum number of iterations is reached.
[0092] Then, it is detected whether any two target text features are in the same text feature cluster. If any two target text features are in the same text feature cluster, the two target text features are determined as the target text with semantic repetition.
[0093] In the text recognition method, the to-be-detected text and the association relationship information are obtained, where the association relationship information represents the association relationship between the keywords in the to-be-detected text and the association relationship between the to-be-detected text and the keywords; the text connectivity graph is generated according to the to-be-detected text and the association relationship information, where the nodes of the text connectivity graph represent the text features corresponding to the to-be-detected text or the keywords, and the connection edges between the nodes represent the association relationship between the keywords or the association relationship between the to-be-detected text and the keywords; the text connectivity graph is iteratively updated, and the target text feature corresponding to the to-be-detected text is generated according to the text connectivity graph after the iteration; and the target text with semantic repetition is recognized from the plurality of to-be-detected texts by clustering the target text features of the plurality of to-be-detected texts. In the entire process, the text connectivity graph is generated based on the to-be-detected text and the association relationship information, so that the nodes in the text connectivity graph represent the text features corresponding to the to-be-detected text or the keywords, and the connection edges between the nodes represent the association relationship between the keywords or the association relationship between the to-be-detected text and the keywords, which is more comprehensive. The text connectivity graph is iteratively updated to further generate accurate target node feature information of the to-be-detected text. At this time, the process of clustering the target text features of the plurality of to-be-detected texts and recognizing the target text with semantic repetition from the plurality of to-be-detected texts is more accurate.
[0094] In one exemplary embodiment, the text connectivity graph is iteratively updated, including:
[0095] According to the connection edges of each node, the associated nodes of each node are detected; and the text connectivity graph is iteratively updated according to the associated nodes of each node; where in the Nth iteration process, the text connectivity graph is updated according to the associated nodes of each node, including: splicing each node and the corresponding associated nodes, where N is a positive integer.
[0096] Specifically, the graph convolution network is used to realize the aggregation of neighbor node information, so that the text connectivity graph is iteratively updated through the graph convolution network, that is, the text connectivity graph is iteratively updated according to the associated nodes of each node. At this time, it is necessary to detect the associated nodes of each node according to the connection edges of each node.
[0097] In each iteration process, the corresponding node is updated according to all the associated nodes of each node to realize the aggregation of the neighbor node information, and the updated node is the node introduced with the associated node information, which will be more accurate in the subsequent semantic duplicate identification process. Since the node is aggregated with the associated node in each iteration process, the node information of a longer distance can be aggregated in the next iteration process.
[0098] Further, in each iteration process, the corresponding node is updated according to all the associated nodes of each node, which actually means that each node is spliced with the corresponding associated node to efficiently update the corresponding node.
[0099] The iterative updating of the text connectivity graph further includes:
[0100] According to the association relationship information, the edge type of each connection edge is determined, and the edge weight of the connection edge is detected according to the edge type; according to the connection edge of each node, the associated node of each node is detected; according to each node, the associated node and the edge weight corresponding to the node, the text connectivity graph is iteratively updated; wherein in the Nth iteration process, the text connectivity graph is updated according to each node, the associated node and the edge weight corresponding to the node, including: based on the edge weight, each node is fused with the corresponding associated node, wherein N is a positive integer.
[0101] Specifically, in each iteration process, the corresponding node is updated according to all the associated nodes of each node, which not only can be spliced with the corresponding associated node as in the above example, but also can be weighted and fused with the corresponding associated node. Specifically, the edge weight between each node and the corresponding associated node is related to the type of the connection edge, and the type of the connection edge between nodes can be different, and the weight of the connection edge between nodes is also different.
[0102] Therefore, according to the association relationship information, the edge type of each connection edge can be determined, and the edge weight of the connection edge can be queried according to the edge type, and then the text connectivity graph can be iteratively updated according to each node, the associated node and the edge weight corresponding to the node. In each iteration process, the text connectivity graph is iteratively updated according to each node, the associated node and the edge weight corresponding to the node, that is, based on the edge weight, each node is fused with the corresponding associated node to accurately update the node in the text connectivity graph.
[0103] In an exemplary embodiment, the number of times of iteratively updating the text connectivity graph can be determined by the number of layers of the graph convolution network, for example, using an L-layer graph convolution network to perform convolution calculation on the text connectivity graph to obtain the convolution calculation result of the lth layer and the e th node The result of the L-layer convolution calculation is spliced to obtain the calculation result of each node The convolution calculation result of each layer is to update each node according to the associated nodes of each node, and the multi-layer convolution calculation can make the node learn the information of the nodes farther away.
[0104] In an exemplary embodiment, in the graph convolution network, the number of neighbors (i.e. degree) of different nodes can differ greatly, so before updating the text connected graph according to the associated nodes of each node and the node corresponding to the node, the node feature information of the associated nodes needs to be normalized to ensure that the embedding representation of different nodes has comparability in the numerical range, and to ensure that the aggregated information is stable in value, thereby helping the model to learn more accurate node representation.
[0105] In the above embodiment, by fusing the nodes and the associated nodes of the nodes, the nodes introduce feature information with association relationship, accurately iteratively update the text connected graph, and the iteratively updated text connected graph will be more accurate in subsequent semantic repetition recognition.
[0106] In an exemplary embodiment, the nodes include keyword nodes and text nodes, the keyword nodes represent text features corresponding to keywords, and the text nodes represent text features corresponding to the text to be detected.
[0107] As shown in Figure 3 S300 includes:
[0108] S310, iteratively updating the text connected graph.
[0109] S320, obtaining keyword frequency information of the keywords in the text to be detected.
[0110] S330, according to the keyword frequency information, weighting the keyword nodes in the iteratively updated text connected graph to obtain keyword fusion nodes.
[0111] S340, splicing the keyword fusion nodes and the text nodes to obtain target text features of the text to be detected.
[0112] Specifically, after iteratively updating the text connected graph, since each node in the updated text connected graph has fused the features of the associated nodes, the iteratively updated text connected graph can be converted into computer computable target text features containing feature fusion semantics.
[0113] Since the nodes in the text connectivity graph include keyword nodes and text nodes, and the keyword nodes and the text nodes need to be processed separately in the generation of the target text feature, first, the keyword nodes are processed, that is, the plurality of keyword nodes in the iteratively updated text connectivity graph are weighted to obtain keyword fusion nodes, and then the keyword fusion nodes and the text nodes are spliced to obtain the target text feature of the text to be detected.
[0114] Further, the plurality of keyword nodes in the iteratively updated text connectivity graph are weighted, and the weight corresponding to each keyword node is keyword frequency information of the plurality of keywords in the text to be detected. Therefore, the keyword frequency information of the plurality of keywords in the text to be detected can be obtained first; and the plurality of keyword nodes in the iteratively updated text connectivity graph are accurately weighted according to the keyword frequency information, so as to obtain the keyword fusion nodes.
[0115] In the above embodiment, the plurality of keyword nodes are accurately weighted according to the keyword frequency information of the plurality of keywords in the text to be detected, so that the obtained keyword fusion nodes are more accurate. Since the nodes include not only the plurality of keyword nodes but also the text nodes, the keyword fusion nodes and the text nodes need to be spliced to obtain the accurate target text feature of the text to be detected.
[0116] In an exemplary embodiment, the method further comprises:
[0117] The text to be detected is part-of-speech tagged, the text to be detected after part-of-speech tagging is segmented to obtain a plurality of segmented words, the first frequency information, the second frequency information and the occurrence frequency information of each of the plurality of segmented words are detected, and the keywords are selected from the plurality of segmented words according to the first frequency information, the second frequency information and the occurrence frequency information.
[0118] The segmentation refers to dividing a continuous natural language text into a plurality of words. The first frequency information represents the occurrence frequency information of the segmented word in the text to be detected, and the second frequency information represents the text proportion information of the plurality of candidate texts in the preset corpus. The first frequency information is also called term frequency information, and the second frequency information is also called inverse document frequency information. The term frequency information is used to measure the frequency of a word in a specific text. Generally, the higher the term frequency, the more important the word in the text. The inverse document frequency is used to measure the universality of a word in the entire corpus. If the text containing a word is less, the inverse document frequency value of the word is higher, indicating that the word has good class distinguishing ability.
[0119] Specifically, in the process of dividing a continuous natural language text into multiple words, the part-of-speech tagging technology is needed to make the word division process more accurate. That is, first, the part-of-speech tagging of the to-be-detected text is needed, including nouns, verbs, adjectives, etc., second, the to-be-detected text after part-of-speech tagging is processed to obtain multiple word division words. Further, multiple keywords are selected from the multiple word division words.
[0120] For example, in the case of the to-be-detected text being "beautiful world", with the help of the part-of-speech tagging technology, "beautiful" is tagged as an adjective and "world" is tagged as a noun. At this time, word division can be conveniently performed between "of" and "world", thereby improving the accuracy of the word division process.
[0121] After word division, more important keywords are selected from the multiple word division words, and the selection of the keywords is related to the first frequency information, the second frequency information and the occurrence number information of the word division words. Therefore, first, the first frequency information of each word division word in the to-be-detected text and the second frequency information of the multiple texts in the entire corpus are needed, and then, the multiple initial keywords are selected from the multiple word division words through the first frequency information and the second frequency information of each word division word.
[0122] The keyword selection through the first frequency information and the second frequency information of each word division word is a preliminary selection, and the initial keywords are obtained. The occurrence number information of the multiple initial keywords also needs to be detected, so as to select the multiple keywords with the occurrence number exceeding the preset number threshold from the multiple initial keywords based on the occurrence number information. The multiple keywords are updated to the keyword library.
[0123] In an exemplary embodiment, when word division is performed, a natural language processing library can be used for processing, and a self-constructed high-frequency word library of a field is introduced to improve the accuracy of word division. In practical applications, the natural language processing library is a tool set specially used for processing and understanding human language, which can be spaCy, PaddleNLP, NLTK (Natural Language Toolkit), etc.
[0124] In an exemplary embodiment, after obtaining the plurality of segmented words, the obtained plurality of segmented words need to be de-duplication processed. Specifically, when the plurality of segmented words are obtained, although the contents of two segmented words are the same, but the parts of speech are different, it will be considered as two different segmented words, such as in the sentence "this is an important research work", "research" is a noun, which refers to an activity or achievement of exploration or analysis, in the sentence "he is studying this problem", "research" is a verb, which means the action of exploring or analyzing, at this time, the segmented word takes "research (noun)" and "research (adjective)" as two different segmented words, and does not need to be de-duplicated; In addition, when one of the two segmented words with the same content is a proper noun and the other is a non-proper noun, it can also be considered as two different segmented words, and does not need to be de-duplicated.
[0125] In an exemplary embodiment, the plurality of initial keywords are screened from the plurality of segmented words by the first frequency information and the second frequency information of each of the plurality of segmented words, including: screening the plurality of initial keywords with the first frequency greater than the preset first frequency threshold and the second frequency greater than the preset second frequency information from the plurality of segmented words by the first frequency information and the second frequency information of each of the plurality of segmented words; or,
[0126] For each segmented word, the first frequency information and the second frequency information of each segmented word are multiplied to obtain the target frequency information of each segmented word, and then the plurality of initial keywords with the frequency information greater than the preset frequency threshold are screened from the plurality of segmented words based on the target frequency information.
[0127] In the above embodiment, by performing segmentation processing on the part-of-speech annotated text to be detected, the accuracy of the segmentation processing can be improved, and then the plurality of keywords can be more accurately screened from the plurality of segmented words, reducing the problem of repeated text recognition error, further, by the first frequency information, the second frequency information and the occurrence frequency information of each of the plurality of segmented words, the plurality of keywords can be accurately screened from the plurality of segmented words, and further, without detecting the occurrence frequency information of each of all segmented words, after screening the plurality of initial keywords from the plurality of segmented words, the occurrence frequency information of the plurality of initial keywords is detected, and then the plurality of keywords are screened from the plurality of initial keywords based on the occurrence frequency information, the process is more simple and efficient.
[0128] In an exemplary embodiment, the association relationship information includes co-occurrence association relationship, syntax dependency association relationship and global association relationship.
[0129] The association relationship information includes:
[0130] In a case where it is detected that the first keyword and the second keyword both appear in a same text region of the text to be detected, it is determined that there is a co-occurrence association relationship between the first keyword and the second keyword, wherein the first keyword and the second keyword are different keywords in the text to be detected; in a case where it is detected that a syntax of the third keyword depends on a syntax of the fourth keyword, it is determined that there is a syntax dependency association relationship between the third keyword and the fourth keyword, wherein the third keyword and the fourth keyword are different keywords in the text to be detected; and it is determined that there is a global association relationship between each keyword and the text to be detected.
[0131] Specifically, the association relationship between the text to be detected and each keyword is a global association relationship, and the association relationship between the plurality of keywords can be a co-occurrence association relationship, a syntax dependency association relationship, or both a co-occurrence association relationship and a syntax dependency association relationship.
[0132] Further, in a case where it is detected that the first keyword and the second keyword both appear in a same text region of the plurality of keywords of the text to be detected, for example, if the first keyword and the second keyword appear in a same sentence, it is determined that there is a co-occurrence association relationship between the first keyword and the second keyword, and in a case where it is detected that the third keyword and the fourth keyword of the plurality of keywords of the text to be detected are connected to each other according to a certain syntax rule, wherein the third keyword depends on the fourth keyword in syntax, it is determined that there is a syntax dependency association relationship between the third keyword and the fourth keyword.
[0133] In the above embodiments, by detecting whether there is a co-occurrence association relationship, a syntax dependency association relationship, and a global association relationship between the text to be detected and the keywords, and between the plurality of keywords, the association relationship information of the text to be detected can be accurately obtained.
[0134] In an exemplary embodiment, the node includes a keyword node and a text node, and a text connectivity graph is generated according to the text to be detected and the association relationship information, including:
[0135] Text features of the text to be detected and text features of the keywords in the text to be detected are extracted; the text features of the text to be detected are taken as text nodes in the text connectivity graph, and the text features of the keywords are taken as keyword nodes in the text connectivity graph; in a case where the association relationship information indicates that there is an association relationship between two keywords, a connection edge between the keyword nodes corresponding to the two keywords is generated; and in a case where the association relationship information indicates that there is an association relationship between a keyword and the text to be detected, a connection edge between the keyword node corresponding to the keyword and the text node corresponding to the text to be detected is generated.
[0136] Specifically, the text features of the to-be-detected text and the text features of the keywords in the to-be-detected text are extracted. The text features of the keywords are taken as the keyword nodes in the text connectivity graph, and in addition, a text node is manually added to represent the text features of the to-be-detected text itself. For example, in the case where the keywords in the to-be-detected text are E keywords, the text connectivity graph includes at most E+1 nodes, and the extra node is the text features of the to-be-detected text itself.
[0137] Therefore, based on the text features of the to-be-detected text and the text features of the plurality of keywords, the nodes in the text connectivity graph can be generated, so that the nodes in the text connectivity graph include keyword nodes and text nodes.
[0138] Further, in the text connectivity graph, there are also connection edges between nodes, which are determined based on the association relationship of the to-be-detected text. For example, when the association relationship information of the to-be-detected text indicates that there is an association relationship between a node and another node, an edge can be added between the two nodes with the association relationship. More specifically, when the association relationship information indicates that there is an association relationship between two keywords, a connection edge is generated between the keyword nodes corresponding to the two keywords; when the association relationship information indicates that there is an association relationship between a keyword and the to-be-detected text, a connection edge is generated between the keyword node corresponding to the keyword and the text node corresponding to the to-be-detected text.
[0139] The association relationship in the present application includes co-occurrence association relationship, syntax dependency association relationship and global association relationship, so the connection edge between two nodes also includes co-occurrence association edge, syntax dependency association edge and global association edge. On this basis, if there is a co-occurrence association relationship between two keywords, a co-occurrence association edge is added between the keyword nodes corresponding to the two keywords; if there is a syntax dependency association relationship between two keywords, a syntax dependency association edge is added between the keyword nodes corresponding to the two keywords; if two nodes are keyword nodes and text nodes respectively, a global association edge is added between the two nodes.
[0140] In the above embodiment, by taking the text features of the to-be-detected text as the text node in the text connectivity graph, and taking the text features of the keywords as the keyword nodes in the text connectivity graph, and when the association relationship information of the to-be-detected text indicates that there is an association relationship between a node and another node, an edge can be added between the two nodes with the association relationship, so that the text connectivity graph can be accurately generated.
[0141] In an exemplary embodiment, after obtaining the text recognition result of the to-be-detected text, the correctness of the semantic repetition identification of the plurality of to-be-detected texts can be further enhanced by manual analysis, and a problem solving process can be established to build a repetitive identification knowledge base.
[0142] In an exemplary embodiment, in the process of putting the enterprise technology product into use, the use problems reported by the customer often show certain regularity and repeatability. Identifying the repeated occurrence of semantics or similar use problems, forming a standard process for solving problems, and depositing a problem knowledge base can help reduce the cost of repeated human investment, improve problem solving efficiency, improve platform operation capability, and ensure the stability of enterprise production.
[0143] In the text of the customer's description of the use problem, the keywords often have a higher correlation with the nature of the problem. Extracting and focusing on the keywords can help better locate the nature of the problem. Graph convolutional neural networks process text connected graphs containing nodes and edges, have strong feature learning and pattern recognition capabilities, and are an ideal choice for solving repeated problem identification. By extracting keywords from the text, converting the problem description text into a text connected graph, and using a graph convolutional neural network for semantic learning, the repeated items of the customer's use problem are finally identified, and an enterprise question and answer knowledge base is formed. The specific implementation process needs the participation of 4 components, including:
[0144] (1) Data preprocessing component:
[0145] Obtain all problem description texts to be detected, perform part-of-speech tagging on each problem description text to be detected, perform word segmentation processing on the part-of-speech tagged problem description text to be detected, obtain a plurality of segmented words, and select a plurality of keywords from the plurality of segmented words.
[0146] Detect the TF-IDF (Term Frequency-Inverse Document Frequency) value of each segmented word, select M words with higher TF-IDF values in the problem description text to be detected as initial keywords, detect the occurrence frequency information of the plurality of initial keywords, and select E words with higher occurrence frequencies as keywords based on the occurrence frequency information.
[0147] (2) Connected graph generation component:
[0148] A, connected graph node definition: A connected graph generated from a text contains at most E+1 nodes. Assign an initial feature to each node, that is, encode the problem description text using the BERT pre-training language model, take the vector of the entire text as the initial feature vector of the text node, and take the vector of the keyword corresponding segment as the initial feature vector of the keyword node. The initial feature vectors of the E words in the keyword library are used as the E keyword nodes of the connected graph. Manually construct a text node to represent the text itself.
[0149] B、There are three types of edges in the figure, respectively, co-occurrence association edge: if two keywords appear in the same sentence, a co-occurrence association is added between the keyword nodes corresponding to the two keywords; syntax dependency association edge: if there is a syntax dependency association relationship between two keywords, a syntax dependency association edge is added between the keyword nodes corresponding to the two keywords; global association edge: if two nodes are keyword nodes and text nodes, respectively, a global association edge is added between the two nodes.
[0150] (3) Graph convolution calculation component:
[0151] Through the multi-round convolution calculation of the connected graph by the graph convolution network, the aggregation of neighbor node information is realized, and more distant neighbor information can be captured. Thus, the connected graph is converted into a computer computable feature vector containing feature fusion semantics.
[0152] Using an L-layer graph convolution network to perform convolution calculation, the convolution calculation result of the lth layer and the e th node is obtained , which is taken as the input of the (l+1)th layer convolution network to perform the next round of convolution operation. The results of L-layer convolution calculation are spliced to obtain the calculation result of each node . Among them, in the process of each layer of convolution calculation, the node is updated according to the adjacent node of the node to obtain , wherein in the convolution calculation of different layers, the aggregation between the characteristic information of the representation of nodes with longer distance can be gradually realized.
[0153] Among them, in the process of each round of convolution operation, the text connected graph is updated by splicing each node and the corresponding associated node, wherein N is a positive integer; or, according to the association relationship information, the edge type of each connection edge is determined, and the edge weight of the connection edge is detected according to the edge type; based on the edge weight, each node and the corresponding associated node are fused to update the text connected graph, wherein N is a positive integer.
[0154] Finally, in the updated text connected graph, the feature vector of each keyword node is weighted and averaged to obtain the keyword fusion vector X, and the weight of the weighted average is represented as the frequency of each keyword appearing in the problem description text. X and the feature vector of the text node are spliced to obtain the final feature vector D representing the text.
[0155] (4) Unsupervised clustering component:
[0156] The feature vectors D of a plurality of to-be-detected texts are clustered to obtain a plurality of text feature clusters, the target text features in the same text feature cluster are detected, and the target texts with semantic repetition are identified from the plurality of to-be-detected texts based on the target text features in the same text feature cluster.
[0157] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be alternately executed with at least some of the other steps or steps or stages in the other steps.
[0158] Based on the same inventive concept, the embodiments of the present application also provide a text recognition device for implementing the above-mentioned text recognition method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more text recognition device embodiments provided below can refer to the limitations of the text recognition method in the above text, which will not be repeated here.
[0159] In one exemplary embodiment, as shown in Figure 4 A text recognition device is provided, comprising: an information acquisition module 100, a connected graph generation module 200, a connected graph update module 300, and a text recognition module 400, wherein:
[0160] The information acquisition module 100 is configured to acquire a to-be-detected text and association relationship information, wherein the association relationship information represents the association relationship between keywords in the to-be-detected text and the association relationship between the to-be-detected text and the keywords;
[0161] The connected graph generation module 200 is configured to generate a text connected graph according to the to-be-detected text and the association relationship information, wherein the nodes of the text connected graph represent text features corresponding to the to-be-detected text or the keywords, and the connection edges between the nodes represent the association relationship between the keywords or the association relationship between the to-be-detected text and the keywords;
[0162] The connected graph update module 300 is configured to iteratively update the text connected graph, and generate a target text feature corresponding to the to-be-detected text according to the iteratively updated text connected graph;
[0163] The text recognition module 400 is configured to recognize a target text with semantic repetition from a plurality of to-be-detected texts by clustering the target text features of the plurality of to-be-detected texts.
[0164] In one embodiment, the connected graph updating module 300 is further configured to detect respective associated nodes of each node according to the connection edges of each node; iteratively update the text connected graph according to each node and the associated nodes corresponding to the node; wherein in the Nth iteration process, the text connected graph is updated according to each node and the associated nodes corresponding to the node, including: splicing each node and the corresponding associated nodes, wherein N is a positive integer; or, determining the edge type of each connection edge according to the association relationship information, and detecting the edge weight of the connection edge according to the edge type; detecting respective associated nodes of each node according to the connection edges of each node; iteratively updating the text connected graph according to each node, the associated nodes corresponding to the node, and the edge weight; wherein in the Nth iteration process, the text connected graph is updated according to each node, the associated nodes corresponding to the node, and the edge weight, including: fusing each node and the corresponding associated nodes based on the edge weight, wherein N is a positive integer.
[0165] In one embodiment, the nodes include keyword nodes and text nodes, the keyword nodes representing text features corresponding to keywords, and the text nodes representing text features corresponding to the text to be detected; the connected graph updating module 300 is further configured to obtain keyword frequency information of the keywords in the text to be detected; perform weighted processing on the keyword nodes in the iteratively updated text connected graph according to the keyword frequency information, to obtain keyword fusion nodes; splice the keyword fusion nodes and the text nodes, to obtain target text features of the text to be detected.
[0166] In one embodiment, the text recognition apparatus further includes a keyword obtaining module, the keyword obtaining module being configured to perform part-of-speech tagging on the text to be detected; perform word segmentation processing on the text to be detected after the part-of-speech tagging, to obtain a plurality of segmented words; detect respective first frequency information, second frequency information, and occurrence number information of the plurality of segmented words, wherein the first frequency information represents frequency information of the segmented words in the text to be detected, and the second frequency information represents text proportion information of the segmented words existing in a plurality of candidate texts of a preset corpus; and select keywords from the plurality of segmented words according to the first frequency information, the second frequency information, and the occurrence number information.
[0167] In one embodiment, the association information includes co-occurrence association, syntax dependency association and global association; the information obtaining module 100 is further configured to determine that there is a co-occurrence association between the first keyword and the second keyword when it is detected that the first keyword and the second keyword both appear in the same text region of the text to be detected, wherein the first keyword and the second keyword are different keywords in the text to be detected; determine that there is a syntax dependency association between the third keyword and the fourth keyword when it is detected that the syntax of the third keyword depends on the fourth keyword, wherein the third keyword and the fourth keyword are different keywords in the text to be detected; and determine that there is a global association between each keyword and the text to be detected.
[0168] In one embodiment, the node includes a keyword node and a text node, and the connected graph updating module 300 is further configured to extract text features of the text to be detected and text features of the keywords in the text to be detected; take the text features of the text to be detected as a text node in the text connected graph, and take the text features of the keywords as keyword nodes in the text connected graph; generate a connection edge between the keyword nodes corresponding to two keywords when the association information indicates that there is an association between the two keywords; and generate a connection edge between the keyword node corresponding to a keyword and the text node corresponding to the text to be detected when the association information indicates that there is an association between the keyword and the text to be detected.
[0169] The above modules in the text recognition device can be realized by software, hardware and combinations thereof in whole or in part. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to call and execute the operations corresponding to the above modules by the processor.
[0170] In one exemplary embodiment, a computer device is provided, which can be a server, and the internal structure diagram thereof can be as shown in FIG. 1. Figure 5As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as text to be detected. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with the terminal outside through the network connection. The computer program is executed by the processor to realize a text recognition method.
[0171] Those skilled in the art can understand that, Figure 5 The structure shown in the figure is a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or less components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0172] In one embodiment, a computer device is also provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to realize the steps in each of the above method embodiments.
[0173] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to realize the steps in each of the above method embodiments.
[0174] In one embodiment, a computer program product is provided, including a computer program, and the computer program is executed by a processor to realize the steps in each of the above method embodiments.
[0175] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the processes of the above-mentioned embodiment methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., but is not limited thereto. The processor involved in the embodiments provided in the present application can be a general processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but is not limited thereto.
[0176] The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combinations of the technical features do not exist contradictory, it should be considered as the scope of the present application.
[0177] The above embodiments only express several implementation ways of the present application, and the description is specific and detailed, but it should not be understood as a limitation to the patent scope of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A text recognition method, characterized in that, The method includes: Obtain the text to be detected and the association information, wherein the association information represents the association between keywords in the text to be detected and the association between the text to be detected and the keywords; Based on the text to be detected and the association information, a text connectivity graph is generated, wherein the nodes of the text connectivity graph represent the text features corresponding to the text to be detected or the keywords, and the connecting edges between the nodes represent the association between the keywords, or represent the association between the text to be detected and the keywords; The text connectivity graph is iteratively updated, and target text features corresponding to the text to be detected are generated based on the iteratively updated text connectivity graph. The iterative update of the text connectivity graph includes: performing multiple rounds of convolution calculations on the text connectivity graph using an L-layer graph convolutional network, wherein the convolution calculation result of the e-th node in the l-th layer is used as the input of the (l+1)-th convolutional network, and the results of the L-layer convolution calculations are concatenated to obtain the calculation result of each node. The convolution calculation result of each layer is updated based on the neighboring node information of the node, so that the node learns the node information at a greater distance. By clustering the target text features of multiple texts to be detected, semantically repetitive target texts are identified from the multiple texts to be detected.
2. The method according to claim 1, characterized in that, The iterative update of the text connectivity graph includes: Based on the connection edges of each node, detect the associated nodes of each node. The text connectivity graph is iteratively updated based on each node and its corresponding associated node. In the Nth iteration, the text connectivity graph is updated based on each node and its corresponding associated node, including concatenating each node with its corresponding associated node, where N is a positive integer. or, Based on the association information, determine the edge type of each connecting edge, and detect the edge weight of the connecting edge based on the edge type; Based on the connection edges of each node, detect the associated nodes of each node. The text connectivity graph is iteratively updated based on each node, the associated node corresponding to the node, and the edge weight; In the Nth iteration, the text connectivity graph is updated based on each node, the associated node corresponding to the node, and the edge weight, including: merging each node with the corresponding associated node based on the edge weight, where N is a positive integer.
3. The method according to claim 1, characterized in that, The nodes include keyword nodes and text nodes. The keyword nodes represent the text features corresponding to the keywords, and the text nodes represent the text features corresponding to the text to be detected. The step of generating target text features corresponding to the text to be detected based on the iteratively updated text connectivity graph includes: Obtain the keyword frequency information in the text to be detected; Based on the frequency information of the keywords, the keyword nodes in the iteratively updated text connectivity graph are weighted to obtain the keyword fusion nodes. The keyword fusion node is concatenated with the text node to obtain the target text features of the text to be detected.
4. The method according to claim 1, characterized in that, The method further includes: Part-of-speech tagging is performed on the text to be detected; The text to be detected after part-of-speech tagging is segmented to obtain multiple segmented words; The first frequency information, second frequency information, and occurrence count information of each of the multiple segmented words are detected, wherein the first frequency information represents the occurrence frequency information of the segmented word in the text to be detected, and the second frequency information represents the proportion of texts containing the segmented word in multiple candidate texts of a preset corpus; Keywords are selected from the plurality of segmented words based on the first frequency information, the second frequency information, and the occurrence frequency information.
5. The method according to claim 1, characterized in that, The association information includes co-occurrence associations, syntax dependency associations, and global associations; Obtain relationship information, including: If both the first keyword and the second keyword appear in the same text region of the text to be detected, it is determined that there is a co-occurrence relationship between the first keyword and the second keyword, wherein the first keyword and the second keyword are different keywords in the text to be detected; If the grammatical dependency of the third keyword on the grammatical dependency of the fourth keyword is detected, it is determined that there is a grammatical dependency relationship between the third keyword and the fourth keyword, wherein the third keyword and the fourth keyword are different keywords in the text to be detected; A global association is determined between each keyword and the text to be detected.
6. The method according to claim 1, characterized in that, The nodes include keyword nodes and text nodes. The step of generating a text connectivity graph based on the text to be detected and the association information includes: Extract the text features of the text to be detected and the text features of the keywords in the text to be detected; The text features of the text to be detected are used as text nodes in the text connectivity graph, and the text features of the keywords are used as keyword nodes in the text connectivity graph; When the relationship information indicates that there is a relationship between two keywords, a connection edge is generated between the keyword nodes corresponding to the two keywords. When the association information represents a relationship between the keyword and the text to be detected, a connection edge is generated between the keyword node corresponding to the keyword and the text node corresponding to the text to be detected.
7. A text recognition device, characterized in that, The device includes: The information acquisition module is used to acquire the text to be detected and the association information, wherein the association information represents the association between keywords in the text to be detected and the association between the text to be detected and the keywords; The connected graph generation module is used to generate a text connected graph based on the text to be detected and the association information, wherein the nodes of the text connected graph represent the text features corresponding to the text to be detected or the keywords, and the connecting edges between the nodes represent the association relationship between the keywords, or represent the association relationship between the text to be detected and the keywords; The connected graph update module is used to iteratively update the text connected graph and generate target text features corresponding to the text to be detected based on the iteratively updated text connected graph. The iterative update of the text connected graph includes: performing multiple rounds of convolution calculations on the text connected graph using an L-layer graph convolutional network, wherein the convolution calculation result of the e-th node in the l-th layer is used as the input of the (l+1)-th convolutional network; concatenating the results of the L-layer convolution calculations to obtain the calculation result for each node; wherein the convolution calculation result of each layer is updated based on the neighboring node information of the node, enabling the node to learn information from nodes at greater distances. The text recognition module is used to identify semantically repetitive target text from multiple texts to be detected by clustering the target text features of multiple texts to be detected.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Event clustering / context construction method and related device, equipment and storage medium thereof
CN114357159A