A data parsing method and device based on deep learning and a medium
By using deep learning technology, standard words and candidate words are obtained from text data. Using semantic models and prediction matrices, entity representations are directly unified into standard words, solving the problem of large workload in converting semi-structured and unstructured data into structured data, and achieving efficient data conversion and relation extraction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 中电通商数字技术(上海)有限公司
- Filing Date
- 2022-06-23
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies involve a huge workload and are time-consuming when converting semi-structured and unstructured data into structured data, especially since entity representations vary across different domains, making it difficult to efficiently extract entities and relationships.
By employing a deep learning-based approach, standard words and candidate words are obtained from text data. A semantic model is used to transform candidate words into related words, and a prediction matrix is constructed to extract entity relationships. Entity descriptions are then directly unified into standard words, reducing the need for label settings.
It enables the rapid and accurate conversion of semi-structured and unstructured data into structured data without increasing the workload of labeling, simplifying the extraction process of entities and relationships.
Smart Images

Figure CN115186659B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of deep learning, and in particular to a data parsing method, apparatus, and medium based on deep learning. Background Technology
[0002] In today's society, with the rapid development of information technology, data has become a vital asset. However, many problems exist in the use of data, among which text data parsing is the most complex and crucial. Text data includes structured, semi-structured, and unstructured data. Semi-structured and unstructured data need to be converted into machine-understandable structured data to better extract and utilize the textual information. The key to this conversion lies in extracting entities and the relationships between them from semi-structured and unstructured data. Generally, supervised learning is used to extract entities and their relationships to obtain structured data. In practice, the entities in the semi-structured and unstructured data must first be extracted. Then, the relationships between entities are determined. Finally, standard terms are used to describe the entities and their relationships in the text data (generally, each domain has a standard vocabulary containing terms used to describe entities and their relationships) to obtain structured data. Entities extracted from semi-structured and unstructured data typically have multiple representations, and the relationships between entities are also complex and varied, making it difficult to extract these entities and the relationships between them. Current solutions involve pre-labeling the different representations of entities to map them to their corresponding representations.
[0003] However, in general, the amount of text data that needs to be processed is massive, which leads to a huge workload when adding tags; and there are a large number of entities in different domains, so adding tags to all the descriptions of these entities also takes a lot of time.
[0004] Therefore, how to reduce the workload of converting semi-structured and unstructured data into structured data is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this application is to provide a data parsing method, apparatus, and medium based on deep learning, so as to reduce the workload of converting semi-structured and unstructured data into structured data.
[0006] To address the aforementioned technical problems, this application provides a data parsing method based on deep learning, comprising:
[0007] Obtain standard words and candidate words from text data of semi-structured data and / or unstructured data, wherein the candidate words are other words in the text data that are different from the standard words;
[0008] The standard word and the candidate word are input into the semantic model to obtain related words among the candidate words that represent the same entity as the standard word;
[0009] Convert the relevant words in the text data into the corresponding standard words;
[0010] Extract the relationships between the entities from the text data.
[0011] Preferably, the step of extracting the relationships between the entities in the text data includes:
[0012] The text data is input into a prediction matrix to extract the relationships between the entities; wherein the prediction matrix is trained based on the semantic and positional features of the entities in the historical text data.
[0013] Preferably, constructing the prediction matrix includes:
[0014] Obtain the relation table of the domain where the text data is located;
[0015] For each relationship in the relationship table, a corresponding prediction matrix is constructed.
[0016] Preferably, obtaining the standard words in the text data includes:
[0017] The standard vocabulary is obtained by matching the standard vocabulary with the text data using a text matching algorithm.
[0018] Preferably, obtaining the candidate words from the text data includes:
[0019] The text data is segmented using a word segmentation algorithm;
[0020] The keyword filtering algorithm selects words with weights higher than a weight threshold as candidate words.
[0021] Preferably, the step of inputting the standard word and the candidate words into the semantic model to obtain related words among the candidate words that describe the same entity as the standard word includes:
[0022] Input the standard words to train the semantic model;
[0023] The candidate words are input into the trained semantic model for similarity calculation;
[0024] Candidate words whose similarity to the standard word is higher than a similarity threshold are selected as the related words corresponding to the standard word.
[0025] Preferably, the text matching algorithm includes the AC automaton and / or the KMP algorithm;
[0026] The word segmentation algorithm includes the jieba algorithm;
[0027] The keyword filtering algorithm includes the TF-IDF algorithm;
[0028] The semantic model includes word2vec and / or BERT.
[0029] To address the aforementioned technical problems, this application also provides a data parsing device based on deep learning, comprising:
[0030] The acquisition module is used to acquire standard words and candidate words in text data, wherein the candidate words are other words in the text data that are different from the standard words;
[0031] An input module is used to input the standard word and the candidate word into a semantic model to obtain related words among the candidate words that represent the same entity as the standard word;
[0032] The conversion module is used to convert the related words into the corresponding standard words;
[0033] An extraction module is used to extract the relationships between the entities in the text data.
[0034] To address the aforementioned technical problems, this application also provides a data parsing device based on deep learning, comprising: a memory for storing computer programs;
[0035] A processor is used to implement the steps of the deep learning-based data parsing method described above when executing computer programs.
[0036] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned deep learning-based data parsing method.
[0037] The deep learning-based data parsing method provided in this application first obtains standard words and candidate words from the text data. Candidate words are other words in the text data that differ from the standard words. Among these, some candidate words describe the same entity as the standard words; these candidate words are called related words corresponding to the standard words. The standard words and candidate words are input into a semantic model, which then obtains related words that describe the same entity as the standard words. Next, the related words in the text data are converted into corresponding standard words. Each entity in the text data is described using standard words. Finally, the relationships between the entities are extracted from the text data. The method provided in this application does not require labeling various descriptions of entities; it directly converts all descriptions into standard words, reducing workload and ultimately obtaining the entities and the relationships between them, thus obtaining structured data.
[0038] This application also provides a data parsing device and a computer-readable storage medium based on deep learning, which correspond to the above-described method and therefore have the same beneficial effects as the above-described method. Attached Figure Description
[0039] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 A flowchart illustrating a deep learning-based data parsing method provided in this application embodiment;
[0041] Figure 2 A schematic diagram illustrating a deep learning-based data parsing method in the medical field provided in this application embodiment;
[0042] Figure 3 A structural diagram of a deep learning-based data parsing device provided in an embodiment of this application;
[0043] Figure 4 This is a structural diagram of a deep learning-based data parsing device provided in another embodiment of this application. Detailed Implementation
[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0045] The core of this application is to provide a data parsing method, apparatus, and medium based on deep learning, so as to reduce the workload of converting semi-structured and unstructured data into structured data.
[0046] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0047] A large amount of semi-structured and unstructured data exists across various fields. The purpose of this application is to transform this data into structured data that machines can understand, thereby realizing its value. Generally, the methods provided in this application can be applied to fields such as medicine. For example, in a piece of medical-related text data, body parts and detection methods appear; these are entities, and the correspondence between the body part and the detection method for that part constitutes the entity relationship. However, in some semi-structured and unstructured data, the descriptions of different body parts are not the same. For example, some patients may describe abdominal pain as "stomach pain" during examinations; "abdomen" is generally the standard term, while "stomach" is a related term. The relationships between entities are also diverse. For instance, "abdomen" and a detection method for the abdomen have an "examination" relationship, while "abdomen" and the stomach within the abdomen have a "belonging" relationship. In practical applications, the descriptions of entities and entity relationships vary. Currently, before extracting each entity, these related terms are labeled to clarify each description of the entity. However, this approach is labor-intensive and prone to missing some less frequently used related terms. To address the aforementioned problems, embodiments of this application provide a data parsing method based on deep learning. Figure 1 A flowchart illustrating a deep learning-based data parsing method provided in this application embodiment; as shown Figure 1 As shown, the method includes the following steps:
[0048] S10: Obtain standard words and candidate words from text data of semi-structured and / or unstructured data, wherein candidate words are other words in the text data that are different from standard words.
[0049] Generally, text data preprocessing is required first to filter out meaningless words and punctuation. Then, standard words are obtained from the text data corresponding to semi-structured and / or unstructured data. For text data in the medical field, a standard vocabulary list for the medical field is obtained, added to the word segmentation dictionary, and used as matching words in the vocabulary list to quickly match the standard words in the text data to determine all standard words contained within the text data. If no standard words are found in the text data, the amount of text data can be increased. Here, a text matching algorithm can be used to match the standard vocabulary list with the text data to obtain the standard words. The type of text matching algorithm is not limited; it can be an Aho-Corasick automaton or the KMP algorithm.
[0050] After obtaining the standard words in the text data, it is necessary to obtain the related words of the standard words in the text data. Standard words and related words are words that describe the same entity. However, this application does not add corresponding tags to the related words. Therefore, it is impossible to confirm which words are related words. We can only first obtain candidate words in the text data, and then find the related words corresponding to the standard words from these candidate words. Here, it is not limited to which specific words the candidate words include. Candidate words are other words in the text data that are different from the standard words, but some words without practical meaning can be directly filtered out. Here, each sample in the text data can be segmented by a word segmentation algorithm, and a keyword filtering algorithm can be used to select high-weight words as candidate words. The word segmentation algorithm used in the embodiments of this application includes, but is not limited to, the jieba algorithm, and the keyword filtering algorithm includes, but is not limited to, the TF-IDF algorithm.
[0051] S11: Input the standard word and candidate words into the semantic model to obtain the related words among the candidate words that represent the same entity as the standard word.
[0052] In this step, the semantic model is pre-built. First, the standard words obtained from the text data mentioned above are used to train the semantic model. The trained semantic model can then compare the similarity between words at the semantic level. Next, each candidate word is input into the semantic model, which calculates the similarity between the candidate words and the standard words. Alternatively, the model can start by selecting the candidate words with the highest similarity, choosing the top k as related words for the standard word. Or, a similarity threshold can be set, and candidate words with similarity higher than the threshold can be used as related words for the standard word. Then, a related word index table containing related words can be built for each standard word. Here, word2vec can be used as the semantic model to implement related word comparison; other semantic models such as BERT can also be used to construct the related word index table.
[0053] S12: Convert related words in the text data into corresponding standard words.
[0054] The standard words and related words can be matched in the related word index table. Then, the related words are converted into standard words, and other irrelevant words are removed. At this point, the text data only includes standard words, meaning that each entity in the text data is described using standard words.
[0055] S13: Extract the relationships between entities from text data.
[0056] Finally, extracting the relationships between entities from the text data completes the transformation of semi-structured and unstructured text data into structured data. The method for extracting these relationships is not limited here; examples will be provided in the embodiments below.
[0057] Taking text data in the medical field as an example, Figure 2 A schematic diagram illustrating a deep learning-based data parsing method in the medical field provided in this application embodiment; as shown Figure 2 As shown, standard words and candidate words are obtained from the input text data. Then, related words are converted into standard words. Finally, relation extraction can be achieved based on the semantic and positional features of the entities. The semantic features are the meanings of the standard words, and the positional features are the positions of the standard words in the text data. The final extraction result represents the inspection relationship between each part and the inspection method for each part.
[0058] The deep learning-based data parsing method provided in this application first obtains standard words and candidate words from the text data. Candidate words are other words in the text data that differ from the standard words. Among these, some candidate words describe the same entity as the standard words; these candidate words are called related words corresponding to the standard words. The standard words and candidate words are input into a semantic model, which then obtains related words that describe the same entity as the standard words. Next, the related words in the text data are converted into corresponding standard words. Each entity in the text data is described using standard words. Finally, the relationships between the entities are extracted from the text data. The method provided in this application does not require labeling various descriptions of entities; it directly converts all descriptions into standard words, reducing workload and ultimately obtaining the entities and the relationships between them, thus obtaining structured data.
[0059] The above embodiments do not explain how to extract the relationships between entities from text data. This application provides a solution, including: inputting text data into a prediction matrix to extract the relationships between entities; wherein the prediction matrix is trained based on the semantic and positional features of each entity in historical text data. Constructing the prediction matrix includes: obtaining a relationship table of the domain in which the text data resides; and constructing a corresponding prediction matrix for each relationship in the relationship table.
[0060] This application embodiment constructs a multi-head relation extraction model, which uses a prediction matrix to extract the relations between entities. Assume there are n entities to be extracted. Within a domain, there exists a relation table containing the possible relations between entities in that domain. Therefore, the relation table of the domain containing the text data can be obtained first. Assume there are r types of relations between entities. This application embodiment constructs a prediction matrix for each type of relation, and then predicts the relations between entities using their semantic and positional features. Let r... k As the kth relation in the relation set It is an n×n matrix that represents the relationships between all entities, as shown in formulas (1), (2) and (3).
[0061] h i =[w i :pos i (1)
[0062] h j =[w j :pos j (2)
[0063]
[0064] Where w i It is the semantic feature vector of entity i, pos i This is a positional encoding, where hi is the positional feature vector of entity i after concatenation, entity j is the same as entity i, W is a parameter matrix, and σ is the sigmoid function. A total of r n×n matrices are obtained through prediction, from which the relationship between each entity can be determined. The semantic and positional features used in the embodiments of this application are all embodiments of this application. If the specific feature form is changed, but the same or similar relationship prediction method is used as in this application, it is within the protection scope of this application. It is worth noting that the solution provided in the embodiments of this application first constructs a prediction matrix for each possible relationship, and then inputs the text data into each prediction matrix to determine the relationship between each entity. The following describes the construction of a prediction matrix for checking relationships, and the results obtained by inputting text data into the prediction matrix are shown in Table 1.
[0065] Table 1. Check Relationship Correspondence Table
[0066]
[0067]
[0068] In the table, a value of 0 indicates that there is no examination relationship between the two, while a value of 1 indicates that there is an examination relationship. It is evident that there is an examination relationship between pulmonary artery and arterial imaging, and between pulmonary nodules and plain CT scans.
[0069] In step S10, obtaining standard words and candidate words from the text data specifically involves matching the standard word list with the text data using a text matching algorithm to obtain standard words; segmenting the text data using a word segmentation algorithm; and filtering words with weights higher than a weight threshold using a keyword filtering algorithm as candidate words. The solution provided in this application embodiment can quickly and accurately obtain standard words and candidate words from text data.
[0070] The above embodiments do not limit how to obtain related words. This application provides a scheme to input standard words and candidate words into a semantic model to obtain related words among the candidate words that describe the same entity as the standard words. This includes: inputting standard words to train the semantic model; inputting candidate words into the trained semantic model to perform similarity calculation; and selecting candidate words whose similarity to the standard words is higher than a similarity threshold as related words corresponding to the standard words. This application provides a scheme for selecting related words from among the candidate words that describe the same entity as the standard words. By using standard words to train the semantic model, related words of these standard words can be quickly found. The semantic model provided in this application is trained using a large amount of historical data before inputting standard words, and then trained again with standard words input. Finally, the semantic model can find related words among the candidate words that describe the same entity as the standard words.
[0071] In the above embodiments, the data parsing method based on deep learning has been described in detail. This application also provides embodiments corresponding to the data parsing device based on deep learning. It should be noted that this application describes the embodiments of the device from two perspectives: one is based on functional modules, and the other is based on hardware.
[0072] From the perspective of functional modules, this embodiment provides a data parsing device based on deep learning. Figure 3 A structural diagram of the deep learning-based data parsing device provided in the embodiments of this application is shown below. Figure 3 As shown, the device includes:
[0073] The acquisition module 10 is used to acquire standard words and candidate words in text data, wherein candidate words are other words in the text data that are different from standard words;
[0074] Input module 11 is used to input standard words and candidate words into the semantic model to obtain related words among the candidate words that represent the same entity as the standard words;
[0075] Conversion module 12 is used to convert related words into corresponding standard words;
[0076] Extraction module 13 is used to extract the relationships between entities in text data.
[0077] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.
[0078] The deep learning-based data parsing device provided in this embodiment corresponds to the above method, and therefore has the same beneficial effects as the above method.
[0079] From a hardware perspective, this embodiment provides another data parsing device based on deep learning. Figure 4 A structural diagram of a deep learning-based data parsing apparatus provided in another embodiment of this application is shown below. Figure 4 As shown, the deep learning-based data parsing device includes: a memory 20 for storing computer programs;
[0080] The processor 21 is used to implement the steps of the deep learning-based data parsing method mentioned in the above embodiments when executing a computer program.
[0081] The deep learning-based data parsing device provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.
[0082] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0083] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the deep learning-based data parsing method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the deep learning-based data parsing method.
[0084] In some embodiments, the deep learning-based data parsing device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
[0085] Those skilled in the art will understand that the structure shown in the figure does not constitute a limitation on a deep learning-based data parsing device and may include more or fewer components than shown.
[0086] The data parsing apparatus based on deep learning provided in this application includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: a data parsing method based on deep learning.
[0087] The deep learning-based data parsing device provided in this embodiment corresponds to the above method, and therefore has the same beneficial effects as the above method.
[0088] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.
[0089] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, 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. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0090] The computer-readable storage medium provided in this embodiment corresponds to the method described above, and therefore has the same beneficial effects as the method described above.
[0091] The foregoing has provided a detailed description of the deep learning-based data parsing method, apparatus, and medium provided in this application. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
[0092] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the aforementioned element.
Claims
1. A data parsing method based on deep learning, characterized in that, include: A text matching algorithm is used to match a standard vocabulary with semi-structured and / or unstructured text data to obtain standard words in the text data. The text data is segmented using a word segmentation algorithm, and words with weights higher than a weight threshold are selected as candidate words using a keyword filtering algorithm. The candidate words are other words in the text data that are different from the standard words. The standard word is input to train the semantic model. The candidate word is input into the trained semantic model to perform similarity calculation. The candidate word whose similarity with the standard word is higher than the similarity threshold is selected as the related word that expresses the same entity as the standard word among the candidate words. Convert the relevant words in the text data into the corresponding standard words; Extract the relationships between the entities from the text data.
2. The data parsing method based on deep learning according to claim 1, characterized in that, The extraction of the relationships between the entities in the text data includes: The text data is input into a prediction matrix to extract the relationships between the entities; wherein the prediction matrix is trained based on the semantic and positional features of the entities in the historical text data.
3. The data parsing method based on deep learning according to claim 2, characterized in that, Constructing the prediction matrix includes: Obtain the relation table of the domain where the text data is located; For each relationship in the relationship table, a corresponding prediction matrix is constructed.
4. The data parsing method based on deep learning according to claim 1, characterized in that, The text matching algorithm includes the AC automaton and / or the KMP algorithm; The word segmentation algorithm includes the jieba algorithm; The keyword filtering algorithm includes the TF-IDF algorithm; The semantic model includes word2vec and / or BERT.
5. A data parsing device based on deep learning, characterized in that, include: The acquisition module is used to match a standard vocabulary with semi-structured and / or unstructured text data using a text matching algorithm to obtain standard words in the text data; to segment the text data using a word segmentation algorithm; and to select words with weights higher than a weight threshold as candidate words using a keyword filtering algorithm, wherein the candidate words are other words in the text data that are different from the standard words; The input module is used to input the standard word to train the semantic model, input the candidate word into the trained semantic model to perform similarity calculation, and take the candidate word whose similarity with the standard word is higher than the similarity threshold as the related word that expresses the same entity as the standard word among the candidate words; The conversion module is used to convert the related words into the corresponding standard words; An extraction module is used to extract the relationships between the entities in the text data.
6. A data parsing device based on deep learning, characterized in that, Includes memory used to store computer programs; A processor, configured to implement the steps of the deep learning-based data parsing method as described in any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the deep learning-based data parsing method as described in any one of claims 1 to 4.