Information positioning method, storage medium and device
By fusing the chapter analysis results of the document to be predicted with the pre-trained aggregation tree, using the parent-child nodes in the aggregation tree to represent the document chapter hierarchy relationship, the problem of difficulty in obtaining a large number of labeling operations and labeling data in information positioning is solved, and efficient Chapter positioning and information extraction.
Patent Information
- Application Number
- CN202111642081.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-11-04
- Filing Date
- 2021-12-29
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2041-12-29
AI Technical Summary
In the prior art, a large number of document labeling operations are required when positioning information in the prior art, and large-scale labeling data is difficult to obtain, resulting in low chapter positioning efficiency.
By obtaining the chapter analysis results of the document to be predicted and the pre-trained aggregation tree, the two are fused using a preset clustering algorithm to assign the chapter tree label information to the document to be predicted, and the document chapter level is represented by the parent-child node form in the aggregation tree. Relationships to achieve accurate chapter positioning.
It reduces the number of documents that need to be marked, saves document labeling costs and resources, improves information positioning efficiency, and builds an aggregation tree by marking a small number of documents, achieving efficient chapter positioning.
Smart Images

Figure CN114385776B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an information locating method, storage medium and device. Background Art
[0002] Different documents have different chapter structures and expressions. As the length of a document increases, the user's need to quickly locate a chapter in the document increases.
[0003] Traditional chapter location methods include: labeling a large number of document samples to obtain label information. When locating information in a document, based on the label information input by the user, the chapter position matching the label information is found in the document to obtain the chapter location result.
[0004] However, in order to improve the accuracy of chapter positioning, a large amount of document annotation is required. The more patterns observed, the more accurate the information positioning. However, the larger the amount of annotation, the lower the efficiency of chapter positioning. And it is difficult to obtain large-scale annotation data in many scenarios. Summary of the invention
[0005] The embodiments of the present disclosure provide an information locating method, a storage medium and a device to at least solve the technical problems in the prior art that a large number of document annotation operations are required for information locating and that it is difficult to obtain large-scale annotation data.
[0006] According to one aspect of an embodiment of the present disclosure, there is provided an information positioning method, including:
[0007] Get the document to be predicted;
[0008] Performing chapter analysis on the document to be predicted to obtain a first single text chapter tree corresponding to the document to be predicted; the first single text chapter tree includes at least one node to be predicted, each node to be predicted is used to store chapter information corresponding to the chapter to be predicted, the parent node of the node to be predicted is used to store chapter information of the previous chapter of the chapter to be predicted corresponding to the node to be predicted, and the child node of the node to be predicted is used to store chapter information of the next chapter of the chapter corresponding to the node to be predicted;
[0009] Obtaining a pre-trained aggregation tree; the aggregation tree is obtained by fusing a second single text chapter tree corresponding to an unlabeled document and a third single text chapter tree corresponding to an labeled document using a preset clustering algorithm; the preset clustering algorithm is used to cluster nodes having the same node features to obtain aggregation nodes; at least one aggregation node in the aggregation tree has corresponding label information; and
[0010] The first single-text chapter tree is merged with the aggregation tree using the preset clustering algorithm to assign label information of the aggregation tree to the first single-text chapter tree, thereby obtaining label information of each node to be predicted in the first single-text chapter tree, and the label information is used to locate the chapter position of the chapter to be predicted.
[0011] According to another aspect of an embodiment of the present disclosure, a storage medium is further provided, the storage medium including a stored program, wherein when the program is running, a processor executes any one of the methods described above.
[0012] According to another aspect of the embodiments of the present disclosure, there is also provided an information positioning device, including:
[0013] A document acquisition module is used to acquire the document to be predicted;
[0014] A chapter analysis module, configured to perform chapter analysis on the document to be predicted to obtain a first single text chapter tree corresponding to the document to be predicted; the first single text chapter tree includes at least one node to be predicted, each node to be predicted is used to store chapter information corresponding to the chapter to be predicted, the parent node of the node to be predicted is used to store chapter information of the previous chapter of the chapter to be predicted corresponding to the node to be predicted, and the child node of the node to be predicted is used to store chapter information of the next chapter of the chapter corresponding to the node to be predicted;
[0015] An aggregation tree acquisition module, used to acquire a pre-trained aggregation tree; the aggregation tree is obtained by fusing the second single text chapter tree corresponding to the unlabeled document and the third single text chapter tree corresponding to the labeled document using a preset clustering algorithm; the preset clustering algorithm is used to cluster nodes with the same node features to obtain aggregation nodes; at least one aggregation node in the aggregation tree has corresponding label information; and
[0016] A tree fusion module is used to use the preset clustering algorithm to fuse the first single-text chapter tree with the aggregation tree, so as to assign the label information of the aggregation tree to the first single-text chapter tree, and obtain the label information of each node to be predicted in the first single-text chapter tree, and the label information is used to locate the chapter position of the chapter to be predicted.
[0017] According to another aspect of the embodiments of the present disclosure, there is also provided an information locating device, including: a processor; and
[0018] A memory, connected to the processor, configured to provide the processor with instructions for processing the following processing steps:
[0019] Get the document to be predicted;
[0020] Performing chapter analysis on the document to be predicted to obtain a first single text chapter tree corresponding to the document to be predicted; the first single text chapter tree includes at least one node to be predicted, each node to be predicted is used to store chapter information corresponding to the chapter to be predicted, the parent node of the node to be predicted is used to store chapter information of the previous chapter of the chapter to be predicted corresponding to the node to be predicted, and the child node of the node to be predicted is used to store chapter information of the next chapter of the chapter corresponding to the node to be predicted;
[0021] Obtaining a pre-trained aggregation tree; the aggregation tree is obtained by fusing a second single text chapter tree corresponding to an unlabeled document and a third single text chapter tree corresponding to an labeled document using a preset clustering algorithm; the preset clustering algorithm is used to cluster nodes having the same node features to obtain aggregation nodes; at least one aggregation node in the aggregation tree has corresponding label information; and
[0022] The first single-text chapter tree is merged with the aggregation tree using the preset clustering algorithm to assign label information of the aggregation tree to the first single-text chapter tree, thereby obtaining label information of each node to be predicted in the first single-text chapter tree, and the label information is used to locate the chapter position of the chapter to be predicted.
[0023] In the disclosed embodiment, a chapter analysis is performed on the document to be predicted to obtain a first single text chapter tree corresponding to the document to be predicted; a pre-trained aggregation tree is obtained, and at least one aggregation node in the aggregation tree has corresponding label information; and a preset clustering algorithm is used to merge the first single text chapter tree with the aggregation tree to assign the label information of the aggregation tree to the first single text chapter tree, and obtain the label information of each node to be predicted in the first single text chapter tree, and the label information is used to locate the chapter position of the chapter to be predicted; since the hierarchical relationship between document chapters can be represented in the form of parent-child nodes in the aggregation tree, the preset clustering algorithm can determine the identity of the nodes, and therefore, the first single text chapter tree is merged into the aggregation tree to achieve accurate chapter positioning. At the same time, by annotating a small number of documents and using annotated documents and unannotated data to construct an aggregation tree, the number of documents that need to be annotated can be reduced, document annotation costs and resources can be saved, and information positioning efficiency can be improved. This solves the technical problems that a large number of document annotation operations are required for information positioning in the prior art, and large-scale annotation data acquisition is difficult. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present application. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
[0025] Figure 1is a hardware structure block diagram of a computing device for implementing the method according to Embodiment 1 of the present disclosure;
[0026] Figure 2 is a flowchart of the information positioning method according to the first aspect of Embodiment 1 of the present disclosure;
[0027] Figure 3 is a schematic diagram of the construction and application process of the aggregation tree according to the first aspect of Embodiment 1 of the present disclosure;
[0028] Figure 4 is a schematic diagram of the pre-training process of the aggregation tree according to the first aspect of Embodiment 1 of the present disclosure;
[0029] Figure 5 is a schematic diagram of the training process of the aggregation tree according to the first aspect of Embodiment 1 of the present disclosure;
[0030] Figure 6 is a schematic diagram of the prediction process of the aggregation tree according to the first aspect of Embodiment 1 of the present disclosure;
[0031] Figure 7 is a schematic diagram of an information locating device according to the first aspect of Embodiment 2 of the present disclosure; and
[0032] Figure 8 It is a schematic diagram of the information locating device described in the first aspect of Embodiment 3 of the present disclosure. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only embodiments of a part of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present disclosure.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0035] First, some nouns or terms that appear in the process of describing the embodiments of the present disclosure are subject to the following explanations:
[0036] Tree: A data structure that consists of a hierarchical set of n (n≥1) finite nodes.
[0037] Node: A tree component that contains a data element and several branches pointing to its subtrees.
[0038] Single text chapter tree: A chapter tree consisting of a document. The chapter tree includes at least one node, each node is used to store chapter information of the corresponding chapter, the parent node of the node is used to store the chapter information of the previous chapter of the chapter corresponding to the node, and the child node of the node is used to store the chapter information of the next chapter of the chapter corresponding to the node.
[0039] Aggregate chapter tree: An aggregate tree formed by merging multiple single-text chapter trees.
[0040] Example 1
[0041] According to this embodiment, a method embodiment of an information positioning method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0042] The method embodiment provided in this embodiment can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computing device for implementing an information positioning method. Figure 1As shown, the computing device may include one or more processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory for storing data, and a transmission device for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0043] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components of the computing device. As involved in the embodiments of the present disclosure, the data processing circuitry acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0044] The memory can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the information location method in the embodiment of the present disclosure. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, the information location method of the above-mentioned application is realized. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computing device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0045] The transmission device is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computing device. In one example, the transmission device includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
[0046] The display may be, for example, a touch screen liquid crystal display (LCD) that may enable a user to interact with a user interface of the computing device.
[0047] It should be noted that, in some optional embodiments, the above Figure 1 The computing device shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware elements and software elements. Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computing devices described above.
[0048] According to a first aspect of this embodiment, an information positioning method is provided. Figure 2 A schematic diagram showing the process of the method is shown in FIG. Figure 2 As shown, the method includes:
[0049] S202: Obtain the document to be predicted;
[0050] S204: performing chapter analysis on the document to be predicted to obtain a first single text chapter tree corresponding to the document to be predicted; the first single text chapter tree includes at least one node to be predicted, each node to be predicted is used to store chapter information corresponding to the chapter to be predicted, the parent node of the node to be predicted is used to store chapter information of the previous chapter of the chapter to be predicted corresponding to the node to be predicted, and the child node of the node to be predicted is used to store chapter information of the next chapter of the chapter corresponding to the node to be predicted;
[0051] S206: Obtain a pre-trained aggregation tree; and
[0052] S208: Use a preset clustering algorithm to merge the first single text chapter tree with the aggregation tree to assign label information of the aggregation tree to the first single text chapter tree, and obtain label information of each node to be predicted in the first single text chapter tree, where the label information is used to locate the chapter position of the chapter to be predicted.
[0053] The document to be predicted includes at least one first-level chapter, and the label information in the aggregation tree matches at least one first-level chapter in the document to be predicted.
[0054] Specifically, the clustered tree is obtained by fusing the second single text chapter tree corresponding to the unlabeled document and the third single text chapter tree corresponding to the labeled document using a preset clustering algorithm. The preset clustering algorithm is used to cluster nodes with the same node features to obtain clustered nodes; at least one clustered node in the clustered tree has corresponding label information.
[0055] In this embodiment, the document is converted into a corresponding single text chapter tree (including a first single text chapter tree, a second single text chapter tree and a third single text chapter tree) by: using a document parsing tool to parse the document to obtain a single text chapter tree. The document parsing tool includes but is not limited to: a PDF chapter extraction tool or a word chapter extraction tool, etc. This embodiment does not limit the implementation method of the document parsing tool.
[0056] refer to Figure 3 As shown, the second single text chapter tree corresponding to the unlabeled document is used to pre-train the aggregation tree, and the third single text chapter tree corresponding to the labeled document is used to train the aggregation tree. In other words, the generation and application of the aggregation tree in this embodiment includes three stages: pre-training 31, training 32, and prediction 33. After the pre-training 31 and training 32 stages, the trained aggregation tree can be obtained.
[0057] Optionally, the unlabeled documents do not need to be labeled in advance. In this embodiment, the unlabeled documents are the complete set of documents of the same type that can be collected. In order to enable the aggregation tree to cover as many different chapter structures and expressions as possible, the larger the document size of the unlabeled documents, the better.
[0058] In this embodiment, each unlabeled document will be parsed into a chapter tree structure, that is, each unlabeled document will be converted into a corresponding second single text chapter tree.
[0059] Optionally, the annotated document needs to be annotated in advance. In this embodiment, annotating the document means annotating the corresponding tag information in each chapter in the document.
[0060] Illustratively, the tag information may be based on the semantic annotation of the chapter, or based on the preset classification annotation. This embodiment does not limit the annotation method of the tag information.
[0061] Optionally, the last level child node in the single text chapter tree and the aggregate tree has label information; or, any level node in the single text chapter tree and the aggregate tree has label information, in which case the label information is set according to the level of the node, and the label information corresponding to the upper level node includes the label information corresponding to the lower level node. For example, if the label information of a certain node is personnel statistics information, the label information corresponding to the lower level node of the node includes female statistics information and male statistics information.
[0062] In this embodiment, the second number of annotated documents is less than the first number of unannotated documents. In other words, in this embodiment, an aggregation tree can be constructed by annotating a small number of sample documents, and the annotated documents and unannotated documents can be merged. The aggregation tree can achieve accurate chapter positioning through node traversal and chapter identity determination. At the same time, since the prediction is based on tree traversal, the calculation efficiency is relatively high.
[0063] Optionally, obtaining a pre-trained aggregation tree includes: converting a first number of unlabeled documents into a second single-text chapter tree; fusing the second single-text chapter tree using a preset clustering algorithm to obtain a pre-trained aggregation tree; converting a second number of labeled documents into a third single-text chapter tree; and fusing the third single-text chapter tree into the pre-trained aggregation tree using a preset clustering algorithm to assign label information of the third single-text chapter tree to the pre-trained aggregation tree to obtain a trained aggregation tree.
[0064] Among them, the nodes in the third single text chapter tree include tag information.
[0065] Optionally, the node features include: hierarchical structure features and expression features. The hierarchical structure features are used to indicate the position of the node in the tree to which it belongs. In this way, when merging, nodes of the same hierarchical structure in different trees can be merged, so as to ensure that the structure of the chapter information in the different nodes after merging is the same. The expression feature is used to indicate the expression of the chapter information. In this way, when merging, nodes of the same expression in different trees can be merged, so as to ensure that the expression of the chapter information in the different nodes after merging is the same.
[0066] In one example, the expression features include text features; accordingly, the preset clustering algorithm includes a Word Mover's Distance (WMD) algorithm to calculate a first distance of text features of chapter information in different nodes. When the first distance is less than a first threshold, the text features of chapter information in different nodes are the same.
[0067] WMD algorithm: It is a metric algorithm developed based on word vectors to measure document similarity. WMD algorithm is a method to calculate the distance between sentences. The smaller the calculated distance, the higher the similarity.
[0068] Among them, the calculation algorithm of the word vector can be Word2Vec, or other algorithms for extracting word vectors. In this embodiment, in order to improve the accuracy of extracting expressions, in another example, the expression features include semantic features; accordingly, the preset clustering algorithm includes a word embedding model and a WMD algorithm, so as to use the word embedding model to extract the semantic features of chapter information in different nodes, and use the WMD algorithm to calculate the second distance of the semantic features of different nodes. When the second distance is less than the second threshold, the semantic features of the chapter information in different nodes are the same.
[0069] In this example, the word embedding model is trained using the full amount of data collected in advance as pre-training data. Compared with the traditional word vector generation algorithm, the word embedding model can generate dense word vector representations to avoid the vector sparsity problem during training; at the same time, word embedding can better learn the semantic information of words and the relationship between words, and can be better used for semantic generalization.
[0070] At the same time, compared with the edit distance or the longest common subsequence (LCS) and Jaccard distance (Jaccard distance), the preset clustering algorithm also uses semantic features, so it has stronger generalization ability and higher accuracy.
[0071] The first threshold and the second threshold may be the same or different, and this embodiment does not limit the values of the first threshold and the second threshold.
[0072] For example: Reference Figure 4 The pre-training process shown. First, each unlabeled document is converted into a second single text chapter tree 41, and each second single text chapter tree 41 represents an unlabeled document. Each node in the second single text chapter tree stores the chapter information of the corresponding chapter. The parent node represents the chapter information of the previous chapter in the chapter information; the child node represents the chapter information of the next chapter in the chapter information. The second single text chapter trees are fused using a preset clustering algorithm to obtain a pre-trained aggregation tree 42. The nodes in the pre-trained aggregation tree 42 store nodes with the same hierarchical structure features and the same expression features. For example, the child node "first-level chapter A" in the pre-trained aggregation tree 42 includes the chapter information of "first-level chapter A: a1" and "first-level chapter A: a2" of the second single text chapter tree 41.
[0073] According to the above process, the pre-training stage traverses multiple second single text chapter tree nodes. During the traversal process, different nodes with the same node features are aggregated according to the preset clustering algorithm to form node clusters. The chapter information in the same node cluster is at the same level, which can be used to generate label information of aggregated nodes in the aggregate tree. The richer the number of pre-trained texts, the richer the information contained in the generated aggregate tree and the more complete the structure.
[0074] Afterwards, refer to Figure 5The training process shown. Convert the annotated document into a third single text chapter tree 51, and the third chapter tree node includes the label of the last level node. Traverse the pre-training aggregation tree 52 generated in the pre-training stage and the third single text chapter tree 51 with label information, and merge the third single text chapter tree 51 into the pre-training aggregation tree 52 by calculating the identity of the chapters between the nodes. The merged nodes in the pre-training aggregation tree 52 also carry corresponding label information. By merging multiple third single text chapter trees 51 with label information into the pre-training aggregation tree 52, the obtained aggregation tree 53 will contain rich label information, thereby enabling accurate chapter positioning.
[0075] Finally, reference Figure 6 The prediction process shown. First, the document to be predicted is parsed into a first chapter tree structure 61. According to the construction process of the aggregation tree, the first chapter tree structure 61 is merged into the node of the aggregation tree 62. The fusion process is the process of labeling the first chapter tree 61. After the fusion is completed, according to the label information 63 of the aggregation node in the aggregation tree 62, the chapter position of the document to be predicted can be accurately located, providing sufficient preliminary preparation for the subsequent information extraction work.
[0076] Optionally, after step 208, the method further includes: obtaining target label information; determining a target node whose label information matches the target label information from the nodes to be predicted in the first single text chapter tree; and extracting chapter information stored in the target node in the document to be predicted.
[0077] Text information localization is a key link in information extraction technology and a critical step in information extraction based on annotation learning. On the one hand, information localization can improve extraction efficiency by narrowing the scope of information extraction, which is especially important for long texts; on the other hand, by applying macro context in information localization, the accuracy of the final result can be improved. For example, in the extraction of named entity classes, a large amount of information such as names and time can be extracted from the full text. If information localization is not performed, it is easy to extract wrong results.
[0078] In this embodiment, after locating the designated chapter, further information extraction and analysis can be performed on the specific part. Since the search scope is limited, the accuracy of information extraction can be greatly improved.
[0079] Thus, according to the first aspect of this embodiment, by obtaining a document to be predicted; performing chapter analysis on the document to be predicted, obtaining a first single text chapter tree corresponding to the document to be predicted; obtaining a pre-trained aggregation tree, at least one aggregation node in the aggregation tree has corresponding label information; and using a preset clustering algorithm to fuse the first single text chapter tree with the aggregation tree, so as to assign the label information of the aggregation tree to the first single text chapter tree, obtain the label information of each node to be predicted in the first single text chapter tree, and the label information is used to locate the chapter position of the chapter to be predicted; it can solve the problem that a large number of document annotation operations are required when locating information in the prior art, and it is difficult to obtain large-scale annotation data; because the hierarchical relationship between document chapters can be represented in the form of parent-child nodes in the aggregation tree, the preset clustering algorithm can determine the identity of the nodes, so the first single text chapter tree is fused to the aggregation tree to achieve accurate chapter positioning. At the same time, because the prediction is based on tree traversal, the operation efficiency is high.
[0080] In addition, by annotating a small number of documents and using the annotated documents and unannotated data to build an aggregation tree, the number of documents that need to be annotated can be reduced, document annotation costs and resources can be saved, and information location efficiency can be improved.
[0081] In addition, by setting the preset clustering algorithm including the word embedding model and the WMD algorithm, the word embedding model can generate dense word vector representations compared to the traditional word vector generation algorithm, avoiding the vector sparsity problem during training; at the same time, word embedding can better learn the semantic information of words and the relationship between words, and can be better used for semantic generalization. At the same time, compared with the edit distance or the longest common subsequence (LCS) and Jaccard distance (Jaccard distance), the preset clustering algorithm also uses semantic features, so it has stronger generalization ability and higher accuracy.
[0082] In addition, by locating the designated chapter and further extracting and analyzing the specific part, the scope of information search can be limited and the accuracy of information extraction can be improved.
[0083] In addition, reference Figure 1 As shown, according to the second aspect of this embodiment, a storage medium is provided, wherein the storage medium includes a stored program, wherein when the program is run, a processor executes any one of the above methods.
[0084] Thus, according to this embodiment, by obtaining a document to be predicted; performing chapter analysis on the document to be predicted, obtaining a first single text chapter tree corresponding to the document to be predicted; obtaining a pre-trained aggregation tree, at least one aggregation node in the aggregation tree has corresponding label information; and using a preset clustering algorithm to fuse the first single text chapter tree with the aggregation tree, so as to assign the label information of the aggregation tree to the first single text chapter tree, obtain the label information of each node to be predicted in the first single text chapter tree, and the label information is used to locate the chapter position of the chapter to be predicted; it can solve the problem that a large number of document annotation operations are required when locating information in the prior art, and it is difficult to obtain large-scale annotation data; because the hierarchical relationship between document chapters can be represented in the form of parent-child nodes in the aggregation tree, the preset clustering algorithm can determine the identity of the nodes, so the first single text chapter tree is fused to the aggregation tree to achieve accurate chapter positioning. At the same time, because the prediction is based on tree traversal, the operation efficiency is high.
[0085] In addition, by annotating a small number of documents and using the annotated documents and unannotated data to build an aggregation tree, the number of documents that need to be annotated can be reduced, document annotation costs and resources can be saved, and information location efficiency can be improved.
[0086] In addition, by setting the preset clustering algorithm including the word embedding model and the WMD algorithm, the word embedding model can generate dense word vector representations compared to the traditional word vector generation algorithm, avoiding the vector sparsity problem during training; at the same time, word embedding can better learn the semantic information of words and the relationship between words, and can be better used for semantic generalization. At the same time, compared with the edit distance or the longest common subsequence (LCS) and Jaccard distance (Jaccard distance), the preset clustering algorithm also uses semantic features, so it has stronger generalization ability and higher accuracy.
[0087] In addition, by locating the designated chapter and further extracting and analyzing the specific part, the scope of information search can be limited and the accuracy of information extraction can be improved.
[0088] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0089] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0090] Example 2
[0091] Figure 7 The information locating device 700 according to the first aspect of this embodiment is shown, and the device 700 corresponds to the method according to the first aspect of embodiment 1. Figure 7 As shown, the device 700 includes:
[0092] The document acquisition module 710 is used to acquire the document to be predicted;
[0093] The chapter analysis module 720 is used to perform chapter analysis on the document to be predicted to obtain a first single text chapter tree corresponding to the document to be predicted; the first single text chapter tree includes at least one node to be predicted, each node to be predicted is used to store chapter information corresponding to the chapter to be predicted, the parent node of the node to be predicted is used to store chapter information of the previous chapter of the chapter to be predicted corresponding to the node to be predicted, and the child node of the node to be predicted is used to store chapter information of the next chapter of the chapter corresponding to the node to be predicted;
[0094] The aggregation tree acquisition module 730 is used to acquire a pre-trained aggregation tree; the aggregation tree is obtained by fusing the second single text chapter tree corresponding to the unlabeled document and the third single text chapter tree corresponding to the labeled document using a preset clustering algorithm; the preset clustering algorithm is used to cluster nodes with the same node features to obtain aggregation nodes; at least one aggregation node in the aggregation tree has corresponding label information; and
[0095] The tree fusion module 740 is used to use the preset clustering algorithm to fuse the first single-text chapter tree with the aggregation tree, so as to assign the label information of the aggregation tree to the first single-text chapter tree, and obtain the label information of each node to be predicted in the first single-text chapter tree, and the label information is used to locate the chapter position of the chapter to be predicted.
[0096] Optionally, the aggregation tree acquisition module 730 is used to:
[0097] Converting the first number of unlabeled documents into the second single text chapter tree;
[0098] Using a preset clustering algorithm to fuse the second single text chapter trees to obtain a pre-trained clustered tree;
[0099] Converting a second number of annotated documents into the third single text chapter tree, the nodes in the third single text chapter tree including the tag information, the second number being smaller than the first number; and
[0100] The third single text chapter tree is merged into the pre-trained aggregation tree using a preset clustering algorithm, so as to assign label information of the third single text chapter tree to the pre-trained aggregation tree, thereby obtaining the trained aggregation tree.
[0101] Optionally, the node features include: hierarchical structure features and expression features.
[0102] Optionally, the expression features include text features; accordingly, the preset clustering algorithm includes a word shift distance WMD algorithm to calculate a first distance of text features of chapter information in different nodes. When the first distance is less than a first threshold, the text features of chapter information in different nodes are the same.
[0103] Optionally, the expression features include semantic features; accordingly, the preset clustering algorithm includes a word embedding model and a WMD algorithm, so as to use the word embedding model to extract the semantic features of chapter information in different nodes, and use the WMD algorithm to calculate the second distance of the semantic features of different nodes. When the second distance is less than a second threshold, the semantic features of the chapter information in different nodes are the same.
[0104] Optionally, after the first single text chapter tree and the aggregation tree are merged using the preset clustering algorithm, the device further includes:
[0105] The label acquisition module is used to obtain target label information;
[0106] a node locating module, configured to determine, from the nodes to be predicted in the first single text chapter tree, a target node whose label information matches the target label information; and
[0107] The information extraction module is used to extract the chapter information stored in the target node in the document to be predicted.
[0108] Thus, according to this embodiment, by obtaining a document to be predicted; performing chapter analysis on the document to be predicted, obtaining a first single text chapter tree corresponding to the document to be predicted; obtaining a pre-trained aggregation tree, at least one aggregation node in the aggregation tree has corresponding label information; and using a preset clustering algorithm to fuse the first single text chapter tree with the aggregation tree, so as to assign the label information of the aggregation tree to the first single text chapter tree, obtain the label information of each node to be predicted in the first single text chapter tree, and the label information is used to locate the chapter position of the chapter to be predicted; it can solve the problem that a large number of document annotation operations are required when locating information in the prior art, and it is difficult to obtain large-scale annotation data; because the hierarchical relationship between document chapters can be represented in the form of parent-child nodes in the aggregation tree, the preset clustering algorithm can determine the identity of the nodes, so the first single text chapter tree is fused to the aggregation tree to achieve accurate chapter positioning. At the same time, because the prediction is based on tree traversal, the operation efficiency is high.
[0109] In addition, by annotating a small number of documents and using the annotated documents and unannotated data to build an aggregation tree, the number of documents that need to be annotated can be reduced, document annotation costs and resources can be saved, and information location efficiency can be improved.
[0110] In addition, by setting the preset clustering algorithm including the word embedding model and the WMD algorithm, the word embedding model can generate dense word vector representations compared to the traditional word vector generation algorithm, avoiding the vector sparsity problem during training; at the same time, word embedding can better learn the semantic information of words and the relationship between words, and can be better used for semantic generalization. At the same time, compared with the edit distance or the longest common subsequence (LCS) and Jaccard distance (Jaccard distance), the preset clustering algorithm also uses semantic features, so it has stronger generalization ability and higher accuracy.
[0111] In addition, by locating the designated chapter and further extracting and analyzing the specific part, the scope of information search can be limited and the accuracy of information extraction can be improved.
[0112] Example 3
[0113] Figure 8 The information locating device 800 according to the first aspect of this embodiment is shown, and the device 800 corresponds to the method according to the first aspect of embodiment 1. Figure 8 As shown, the device 800 includes: a processor 810; and a memory 820, connected to the processor 810, and configured to provide the processor 810 with instructions for processing the following processing steps:
[0114] Get the document to be predicted;
[0115] Performing chapter analysis on the document to be predicted to obtain a first single text chapter tree corresponding to the document to be predicted; the first single text chapter tree includes at least one node to be predicted, each node to be predicted is used to store chapter information corresponding to the chapter to be predicted, the parent node of the node to be predicted is used to store chapter information of the previous chapter of the chapter to be predicted corresponding to the node to be predicted, and the child node of the node to be predicted is used to store chapter information of the next chapter of the chapter corresponding to the node to be predicted;
[0116] Obtaining a pre-trained aggregation tree; the aggregation tree is obtained by fusing a second single text chapter tree corresponding to an unlabeled document and a third single text chapter tree corresponding to an labeled document using a preset clustering algorithm; the preset clustering algorithm is used to cluster nodes having the same node features to obtain aggregation nodes; at least one aggregation node in the aggregation tree has corresponding label information; and
[0117] The first single-text chapter tree is merged with the aggregation tree using the preset clustering algorithm to assign label information of the aggregation tree to the first single-text chapter tree, thereby obtaining label information of each node to be predicted in the first single-text chapter tree, and the label information is used to locate the chapter position of the chapter to be predicted.
[0118] Optionally, obtaining a pre-trained aggregation tree includes:
[0119] Converting the first number of unlabeled documents into the second single text chapter tree;
[0120] Using a preset clustering algorithm to fuse the second single text chapter trees to obtain a pre-trained clustered tree;
[0121] Converting a second number of annotated documents into the third single text chapter tree, the nodes in the third single text chapter tree including the tag information, the second number being smaller than the first number; and
[0122] The third single text chapter tree is merged into the pre-trained aggregation tree using a preset clustering algorithm, so as to assign label information of the third single text chapter tree to the pre-trained aggregation tree, thereby obtaining the trained aggregation tree.
[0123] Optionally, the node features include: hierarchical structure features and expression features.
[0124] Optionally, the expression features include text features; accordingly, the preset clustering algorithm includes a word shift distance WMD algorithm to calculate a first distance of text features of chapter information in different nodes. When the first distance is less than a first threshold, the text features of chapter information in different nodes are the same.
[0125] Optionally, the expression features include semantic features; accordingly, the preset clustering algorithm includes a word embedding model and a WMD algorithm, so as to use the word embedding model to extract the semantic features of chapter information in different nodes, and use the WMD algorithm to calculate the second distance of the semantic features of different nodes. When the second distance is less than a second threshold, the semantic features of the chapter information in different nodes are the same.
[0126] Optionally, after the first single text chapter tree and the aggregation tree are merged by using the preset clustering algorithm, the method further includes:
[0127] Get target label information;
[0128] Determining, from the nodes to be predicted in the first single text chapter tree, a target node whose label information matches the target label information; and
[0129] Information extraction is performed on the chapter information stored in the target node in the document to be predicted.
[0130] Thus, according to this embodiment, by obtaining a document to be predicted; performing chapter analysis on the document to be predicted, obtaining a first single text chapter tree corresponding to the document to be predicted; obtaining a pre-trained aggregation tree, at least one aggregation node in the aggregation tree has corresponding label information; and using a preset clustering algorithm to fuse the first single text chapter tree with the aggregation tree, so as to assign the label information of the aggregation tree to the first single text chapter tree, obtain the label information of each node to be predicted in the first single text chapter tree, and the label information is used to locate the chapter position of the chapter to be predicted; it can solve the problem that a large number of document annotation operations are required when locating information in the prior art, and it is difficult to obtain large-scale annotation data; because the hierarchical relationship between document chapters can be represented in the form of parent-child nodes in the aggregation tree, the preset clustering algorithm can determine the identity of the nodes, so the first single text chapter tree is fused to the aggregation tree to achieve accurate chapter positioning. At the same time, because the prediction is based on tree traversal, the operation efficiency is high.
[0131] In addition, by annotating a small number of documents and using the annotated documents and unannotated data to build an aggregation tree, the number of documents that need to be annotated can be reduced, document annotation costs and resources can be saved, and information location efficiency can be improved.
[0132] In addition, by setting the preset clustering algorithm including the word embedding model and the WMD algorithm, the word embedding model can generate dense word vector representations compared to the traditional word vector generation algorithm, avoiding the vector sparsity problem during training; at the same time, word embedding can better learn the semantic information of words and the relationship between words, and can be better used for semantic generalization. At the same time, compared with the edit distance or the longest common subsequence (LCS) and Jaccard distance (Jaccard distance), the preset clustering algorithm also uses semantic features, so it has stronger generalization ability and higher accuracy.
[0133] In addition, by locating the designated chapter and further extracting and analyzing the specific part, the scope of information search can be limited and the accuracy of information extraction can be improved.
[0134] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0135] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0136] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0137] The units described as separate components may or may not be physically separated, and the components shown 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 the solution of this embodiment.
[0138] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0139] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0140] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. An information positioning method, characterized in that: include: Get the document to be predicted; Performing chapter analysis on the document to be predicted to obtain a first single text chapter tree corresponding to the document to be predicted; The first single text chapter tree includes at least one node to be predicted, each node to be predicted is used to store chapter information corresponding to the chapter to be predicted, the parent node of the node to be predicted is used to store chapter information of the previous chapter of the chapter to be predicted corresponding to the node to be predicted, and the child node of the node to be predicted is used to store chapter information of the next chapter of the chapter corresponding to the node to be predicted; Obtain a pre-trained aggregation tree; the aggregation tree is obtained by fusing the second single text chapter tree corresponding to the unlabeled document and the third single text chapter tree corresponding to the labeled document using a preset clustering algorithm; the preset clustering algorithm is used to cluster nodes with the same node features to obtain aggregation nodes; at least one aggregation node in the aggregation tree has corresponding label information; as well as The first single-text chapter tree is merged with the aggregation tree using the preset clustering algorithm to assign label information of the aggregation tree to the first single-text chapter tree, thereby obtaining label information of each node to be predicted in the first single-text chapter tree, and the label information is used to locate the chapter position of the chapter to be predicted.
2. The method according to claim 1, characterized in that The obtaining of the pre-trained aggregation tree comprises: Converting the first number of unlabeled documents into the second single text chapter tree; Using a preset clustering algorithm to fuse the second single text chapter trees to obtain a pre-trained clustered tree; Converting a second number of annotated documents into the third single text chapter tree, the nodes in the third single text chapter tree including the tag information, the second number being smaller than the first number; and The third single text chapter tree is merged into the pre-trained aggregation tree using a preset clustering algorithm, so as to assign label information of the third single text chapter tree to the pre-trained aggregation tree, thereby obtaining the trained aggregation tree.
3. The method according to claim 1, characterized in that The node features include: hierarchical structure features and expression features.
4. The method according to claim 3, characterized in that The expression features include text features; accordingly, the preset clustering algorithm includes a word shift distance WMD algorithm to calculate a first distance of text features of chapter information in different nodes. When the first distance is less than a first threshold, the text features of chapter information in different nodes are the same.
5. The method according to claim 3, characterized in that: The expression features include semantic features; accordingly, the preset clustering algorithm includes a word embedding model and a WMD algorithm, so as to use the word embedding model to extract the semantic features of chapter information in different nodes, and use the WMD algorithm to calculate the second distance of the semantic features of different nodes. When the second distance is less than a second threshold, the semantic features of the chapter information in different nodes are the same.
6. The method according to claim 1, characterized in that After the first single text chapter tree and the aggregation tree are merged by using the preset clustering algorithm, the method further includes: Get target label information; Determining, from the nodes to be predicted in the first single text chapter tree, a target node whose label information matches the target label information; and Information extraction is performed on the chapter information stored in the target node in the document to be predicted.
7. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is run, the processor executes the method according to any one of claims 1 to 6.
8. An information positioning device, characterized in that: include: A document acquisition module is used to acquire the document to be predicted; A chapter analysis module, used for performing chapter analysis on the document to be predicted to obtain a first single text chapter tree corresponding to the document to be predicted; The first single text chapter tree includes at least one node to be predicted, each node to be predicted is used to store chapter information corresponding to the chapter to be predicted, the parent node of the node to be predicted is used to store chapter information of the previous chapter of the chapter to be predicted corresponding to the node to be predicted, and the child node of the node to be predicted is used to store chapter information of the next chapter of the chapter corresponding to the node to be predicted; An aggregation tree acquisition module is used to acquire a pre-trained aggregation tree; the aggregation tree is obtained by fusing the second single text chapter tree corresponding to the unlabeled document and the third single text chapter tree corresponding to the labeled document using a preset clustering algorithm; the preset clustering algorithm is used to cluster nodes with the same node features to obtain aggregation nodes; at least one aggregation node in the aggregation tree has corresponding label information; as well as A tree fusion module is used to use the preset clustering algorithm to fuse the first single-text chapter tree with the aggregation tree, so as to assign the label information of the aggregation tree to the first single-text chapter tree, and obtain the label information of each node to be predicted in the first single-text chapter tree, and the label information is used to locate the chapter position of the chapter to be predicted.
9. The device according to claim 8, characterized in that The aggregation tree acquisition module is used to: Converting the first number of unlabeled documents into the second single text chapter tree; Using a preset clustering algorithm to fuse the second single text chapter trees to obtain a pre-trained clustered tree; Converting a second number of annotated documents into the third single text chapter tree, the nodes in the third single text chapter tree including the tag information, the second number being smaller than the first number; as well as The third single text chapter tree is merged into the pre-trained aggregation tree using a preset clustering algorithm, so as to assign label information of the third single text chapter tree to the pre-trained aggregation tree, thereby obtaining the trained aggregation tree.
10. An information positioning device, characterized in that: include: processor; as well as A memory, connected to the processor, configured to provide the processor with instructions for processing the following processing steps: Get the document to be predicted; Performing chapter analysis on the document to be predicted to obtain a first single text chapter tree corresponding to the document to be predicted; The first single text chapter tree includes at least one node to be predicted, each node to be predicted is used to store chapter information corresponding to the chapter to be predicted, the parent node of the node to be predicted is used to store chapter information of the previous chapter of the chapter to be predicted corresponding to the node to be predicted, and the child node of the node to be predicted is used to store chapter information of the next chapter of the chapter corresponding to the node to be predicted; Obtain a pre-trained aggregation tree; the aggregation tree is obtained by fusing the second single text chapter tree corresponding to the unlabeled document and the third single text chapter tree corresponding to the labeled document using a preset clustering algorithm; the preset clustering algorithm is used to cluster nodes with the same node features to obtain aggregation nodes; at least one aggregation node in the aggregation tree has corresponding label information; as well as The first single-text chapter tree is merged with the aggregation tree using the preset clustering algorithm to assign label information of the aggregation tree to the first single-text chapter tree, thereby obtaining label information of each node to be predicted in the first single-text chapter tree, and the label information is used to locate the chapter position of the chapter to be predicted.
Citation Information
Patent Citations
Document analysis method and device, computer equipment and storage medium
CN110377884A
Text classification method and device, equipment and storage medium
CN111460791A
Structured document processing system, structured document processing method, and structured document processing program
JP2009295122A
Method and System for Document Classification
US20100185568A1
