CN114117055A - Method, device, equipment and readable medium for extracting text entity relationship - Google Patents

Method, device, equipment and readable medium for extracting text entity relationship Download PDF

Info

Publication number
CN114117055A
CN114117055A CN202210100635.3A CN202210100635A CN114117055A CN 114117055 A CN114117055 A CN 114117055A CN 202210100635 A CN202210100635 A CN 202210100635A CN 114117055 A CN114117055 A CN 114117055A
Authority
CN
China
Prior art keywords
text
target entity
entity
relationship
vector
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210100635.3A
Other languages
Chinese (zh)
Other versions
CN114117055B (en
Inventor
赵周剑
王永明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Taimei Medical Technology Co Ltd
Original Assignee
Zhejiang Taimei Medical Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Taimei Medical Technology Co Ltd filed Critical Zhejiang Taimei Medical Technology Co Ltd
Priority to CN202210100635.3A priority Critical patent/CN114117055B/en
Publication of CN114117055A publication Critical patent/CN114117055A/en
Application granted granted Critical
Publication of CN114117055B publication Critical patent/CN114117055B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/117Tagging; Marking up; Designating a block; Setting of attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • G06F40/295Named entity recognition
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H10/00ICT specially adapted for the handling or processing of patient-related medical or healthcare data
    • G16H10/60ICT specially adapted for the handling or processing of patient-related medical or healthcare data for patient-specific data, e.g. for electronic patient records

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Epidemiology (AREA)
  • Medical Informatics (AREA)
  • Primary Health Care (AREA)
  • Public Health (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the specification discloses a method, a device, equipment and a readable medium for extracting text entity relationships. The scheme may include: acquiring a target entity text in text data to be classified; acquiring a mark matched with a target entity text; extracting a hidden state feature vector of the identifier of the target entity text; splicing the hidden state characteristic vectors of the marks of any two target entity texts to obtain a relation vector of any two marks; forming the relation vectors into a vector matrix; and processing the vector matrix to obtain the entity relation of the target entity text. The method for extracting the text entity relationship provided by the embodiment of the specification can accelerate the extraction of the entity relationship by the neural network, and has the advantages of high identification precision and short time consumption.

Description

Method, device, equipment and readable medium for extracting text entity relationship
Technical Field
The present application relates to the field of medical text technologies, and in particular, to a method, an apparatus, a device, and a computer readable medium for extracting a text entity relationship.
Background
With the recent acceleration of information-oriented pace of hospitals, a large number of electronic medical records are accumulated in each hospital. Electronic case expressions are generally long, a plurality of entities appear in electronic cases, and when entity relationships are classified, the number of entity relationship pairs needing to be classified is increased.
In the prior art, the classification accuracy based on the pre-trained neural network is high, but the pre-trained neural network generally comprises a large amount of parameters, so that the entity relationships in the text are classified one by one, the inference speed is low, and the method is not suitable for multi-entity relationship extraction.
Therefore, a method for extracting entity relationships is urgently needed.
Disclosure of Invention
The embodiment of the specification provides a method, a device, equipment and a computer readable medium for extracting a text entity relationship, so as to solve the problem that the existing method for extracting the entity relationship consumes long time.
In order to solve the above technical problem, the embodiments of the present specification are implemented as follows:
an extraction method for a text entity relationship provided by an embodiment of the present specification includes:
acquiring a target entity text in text data to be classified;
acquiring an identifier matched with the target entity text;
extracting a hidden state feature vector of the identifier of the target entity text;
splicing hidden state feature vectors of the marks of any two target entity texts to obtain a relation vector of any two marks;
forming the relationship vectors into a vector matrix;
and processing the vector matrix to obtain the entity relationship of the target entity text.
Optionally, before the obtaining of the target entity text in the text data to be classified, the method further includes:
and performing word segmentation on the original text data by adopting named entity recognition to obtain the text data to be classified.
Optionally, after obtaining the identifier matched with the target entity text, the method further includes:
determining a referring word corresponding to the target entity text according to the type of the target entity text;
and replacing the target entity text with the reference word.
Optionally, after obtaining the identifier matched with the target entity text, the method further includes:
determining a referring word corresponding to the target entity text according to the type of the target entity text;
and adding the representative words to two sides of the target entity text.
Optionally, the splicing is performed on hidden state feature vectors of the identifiers of any two target entity texts to obtain relationship vectors of any two identifiers, and the method specifically includes:
and splicing the hidden state characteristic vectors of any two different identifiers to obtain the relation vector of any two identifiers.
Optionally, the method further includes:
acquiring a text entity relationship requirement of a user;
dividing the target entity text into a first target entity text and a second target entity text according to the requirement; the requirement comprises a relationship of the first target entity text and the second target entity text.
Optionally, the splicing any two different hidden state feature vectors of the identifiers to obtain a relationship vector of any two identifiers includes:
splicing the identified hidden state feature vector of the second target entity text after the identified hidden state feature vector of the first target entity text.
An apparatus for extracting a text entity relationship provided in an embodiment of the present specification includes:
the first acquisition module is used for acquiring a target entity text in the text data to be classified;
the second acquisition module is used for acquiring the identification matched with the target entity text;
the extraction module is used for extracting the hidden state characteristic vector of the identifier of the target entity text;
the splicing module is used for splicing the hidden state characteristic vectors of the identifiers of any two target entity texts to obtain the relation vector of any two identifiers;
a vector matrix forming module, configured to form the relationship vector into a vector matrix;
and the processing module is used for processing the vector matrix to obtain the entity relationship of the target entity text.
An extraction device for text entity relationships provided in an embodiment of the present specification includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a target entity text in text data to be classified;
acquiring an identifier matched with the target entity text;
extracting a hidden state feature vector of the identifier of the target entity text;
splicing hidden state feature vectors of the marks of any two target entity texts to obtain a relation vector of any two marks;
forming the relationship vectors into a vector matrix;
and processing the vector matrix to obtain the entity relationship of the target entity text.
The embodiment of the present specification provides a computer readable medium, on which computer readable instructions are stored, and the computer readable instructions can be executed by a processor to implement the method for extracting the text entity relationship.
One embodiment of the present description can achieve at least the following advantages:
extracting hidden state characteristic vectors of the marks of the target entity texts, splicing the hidden state characteristic vectors of the marks of any two target texts to obtain a relation vector corresponding to the target entity texts, obtaining a matrix based on the relation vector, and obtaining the entity relation of the target entity texts by processing the vector matrix. According to the text entity relation extraction method provided by the embodiment of the specification, the hidden state feature vector extraction is only performed once on the target entity text, so that the extraction time of the feature vectors is greatly reduced for many times, the relation of all target entity texts is identified once through the vector matrix, and the accuracy and the speed of entity relation extraction are improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
Fig. 1 is a schematic flowchart of an extraction method of a text entity relationship according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of another method for extracting textual entity relationships according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of text data to be classified according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of text data with a logo provided in an embodiment of the present specification;
fig. 5 is a schematic diagram of text data after a replacement operation according to an embodiment of the present specification;
fig. 6 is a schematic diagram of hidden state feature vectors extracted by using a neural network model according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an extracting apparatus corresponding to a text entity relationship in fig. 1 according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an extraction device corresponding to a text entity relationship in fig. 1 according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of one or more embodiments of the present disclosure more apparent, the technical solutions of one or more embodiments of the present disclosure will be described in detail and completely with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present specification, and not all embodiments. All other embodiments that can be derived by a person skilled in the art from the embodiments given herein without making any creative effort fall within the protection scope of one or more embodiments of the present disclosure.
It is to be understood that, although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited by these terms. These terms are only used to distinguish one type of information from another.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
In the prior art, the classification based on the pre-trained neural network has high precision, but because the pre-trained neural network generally comprises a large amount of parameters, the entity relationships in the text are classified one by one according to the combined semantics, the reasoning speed is low, and the method is not suitable for extracting the entity relationships when the text comprises a plurality of entity texts.
In order to solve the defects in the prior art, the scheme provides the following embodiments:
fig. 1 is a schematic flowchart of an extraction method of a text entity relationship provided in an embodiment of the present specification. From the viewpoint of the program, the execution subject of the flow may be a program installed in an application server or an application terminal.
As shown in fig. 1, the process may include the following steps:
step 102: and acquiring a target entity text in the text data to be classified.
It should be noted that the original text data targeted by the embodiments of the present specification may be an electronic case, which is a digitized medical record of a patient stored, managed, transmitted and reproduced by an electronic device (a computer, a health card, etc.), instead of a handwritten paper medical record. The contents of the electronic case comprise all information of the paper case history, which mainly comprises natural information of names, sexes and the like of patients, the popularity of admission, discharge, transfer and the like of the patients, various examination records accepted by the patients in hospitals, various treatment records made by doctors for the patients, nursing records for the patients and the like. The entity relationship extraction provided by the embodiment of the specification is especially the relationship extraction between two target entity texts.
The text data to be classified in the embodiment of the present specification may use named entity recognition to perform word segmentation on the original text data, so as to obtain the text data to be classified. The text data to be classified can contain a plurality of words and punctuations, and the text data to be classified contains target entity text data and non-target entity text. For example: the patient had hypertension for 30 years. In this text, "patient", "suffering from", "patient", "whom", "patient", "whom",. "both belong to non-target entity text, while" hypertension "and" 30 years "belong to target entity text.
It should be noted that the target entity text may be a text of interest to the user in the text data to be classified, and the entity text has a special meaning, for example: in the electronic case, the user cares about the disease, and words representing the disease can be used as target entity texts; in electronic cases the user may also be concerned about the relationship of disease to time, and words representing time may also be targeted entity text. The target entity text is determined according to the kind of text data.
In fact, the technical solution of the present application is applicable not only to the text data of the electronic case, but also to other text data, for example: internet text data, news text data, stock market text data, and the like.
Step 104: and acquiring the mark matched with the target entity text.
In practical application, the identifier may be matched according to the meaning actually expressed by the target entity text, for example: the texts representing diseases in the text data to be classified may be collectively identified as "DIS", and the texts representing TIMEs in the text data to be classified may be collectively identified as "TIME". For example, the text data to be classified is "the patient has hypertension for 30 years. "hypertension" may be collectively labeled as "DIS", and "30 years", collectively labeled as "TIME".
Step 106: extracting a hidden state feature vector of the identifier of the target entity text;
it should be noted that, in this step, hidden state feature vector extraction may be performed on the identifier of the target entity text by using the basic neural network model, for example:
Figure DEST_PATH_IMAGE001
Figure 88081DEST_PATH_IMAGE002
etc., each identified hidden state feature vector may represent:
Figure 576832DEST_PATH_IMAGE004
wherein,
Figure DEST_PATH_IMAGE005
is shown as
Figure 517106DEST_PATH_IMAGE006
And hidden state feature vector information of the identifier corresponding to the target entity text, wherein the dimensionality of the hidden state feature vector is the same as the number of neurons of a hidden layer in the neural network. Assuming that the number of hidden layer neurons is h, the dimension of each identified hidden state feature vector is h.
Step 108: splicing hidden state feature vectors of the marks of any two target entity texts to obtain a relation vector of any two marks;
in practical application, when the dimension of the hidden state feature vector is h, the dimension of the relationship vector is 2 h.
Step 110: and forming the relation vectors into a vector matrix.
And combining the relation vectors formed by any two hidden state characteristic vectors to obtain a vector matrix.
Step 112: and processing the vector matrix to obtain the entity relationship of the target entity text.
In practical application, a Multilayer Perceptron (MLP for short) may be adopted to classify vector matrices to obtain an entity relationship of a target entity text. The relationships between the target entity texts may be classified according to the existence of relationships, for example: "the patient had hypertension for 30 years and was admitted at month 3 this year. "in the text, after being classified by the multilayer perceptron, the output result is: hypertension is related to 30 years, and hypertension is unrelated to 3 months this year. Wherein, further entity text relation extraction can be carried out on the relation between the hypertension and the 30 years according to the starting time, the duration and the ending time.
It should be understood that in the method described in one or more embodiments of the present disclosure, the order of some steps may be adjusted according to actual needs, or some steps may be omitted.
In the method in fig. 1, hidden state feature vectors of the identifiers of the target entity texts are extracted, the hidden state feature vectors of the identifiers of any two target texts are spliced to obtain relationship vectors corresponding to the target entity texts, a matrix is obtained based on the relationship vectors, and the entity relationship of the target entity texts is obtained by processing the vector matrix. According to the text entity relation extraction method provided by the embodiment of the specification, the hidden state feature vector extraction is only performed once on the target entity text, so that the extraction time of the feature vectors is greatly reduced for many times, the relation of all target entity texts is identified once through the vector matrix, and the accuracy and the speed of entity relation extraction are improved.
Based on the method of fig. 1, the embodiments of the present specification also provide some specific implementations of the method, which are described below.
As an optional implementation manner, before obtaining the target entity text in the text data to be classified, the method further includes:
and performing word segmentation on the original text data by adopting named entity recognition to obtain the text data to be classified.
Named Entity Recognition (NER) refers to recognizing entities with specific meanings in texts, and mainly includes names of people, places, organizations, proper nouns, and the like.
The named entity recognition in the embodiment of the specification can be based on a rule and dictionary method to perform word segmentation on text data, and a rule template or a special dictionary is constructed according to the characteristics of a data set. The rules include keywords, position words, orientation words, center words, indicator words, statistical information, punctuation marks, and the like. The dictionary may be a dictionary composed of feature words and an external dictionary, which may be an existing common sense dictionary. After rules and dictionaries are formulated, the text is typically processed using matching to achieve named entity recognition. For example: and performing word segmentation on the text data by adopting a maximum matching algorithm. In practice, for electronic cases, the external dictionary may include names of diseases, categories of syndromes, and the like.
The named entity recognition in the embodiments of the present specification may also adopt a deep learning method to perform word segmentation on text data, for example: towards the LSTM-CNNs architecture, the architecture can automatically detect text features at the word and character level.
The original text data is subjected to word segmentation processing through the steps to obtain the text data to be classified after word segmentation, and basic data are provided for subsequent entity relation extraction.
As an optional implementation manner, after obtaining the identifier matching with the target entity text, the method further includes:
determining a referring word corresponding to the target entity text according to the type of the target entity text;
and replacing the target entity text with the reference word.
In practical application, the target entity text in the text data to be classified is
Figure DEST_PATH_IMAGE007
Then it will be right
Figure 708002DEST_PATH_IMAGE007
Performing replacement operation, namely performing text entities of target entities meeting conditions in the text
Figure 872267DEST_PATH_IMAGE007
Replacing the target entity text into corresponding reference words according to the type of the target entity text
Figure 910630DEST_PATH_IMAGE008
And extracting the position in the corresponding identification text
Figure DEST_PATH_IMAGE009
. The reference word can be part of speech of the text entity, and can also be other specified words. Replacing words in the text data to be classified with the representative words may be expressed as:
Figure DEST_PATH_IMAGE011
wherein,
Figure 326699DEST_PATH_IMAGE012
represents the text after the word is segmented,
Figure 766908DEST_PATH_IMAGE007
representing the text of the target entity in the text,
Figure 836495DEST_PATH_IMAGE008
a referring word representing the target entity text.
Through the steps, the complexity of the neural model for extracting the hidden state feature vectors of the marks corresponding to the target entity texts can be reduced. Taking a disease as an example of a text entity, thousands of words related to the disease exist, and when the recognition model recognizes a large number of words related to the disease, the difficulty of extracting text vectors of a target entity can be greatly improved. Because the influence of all the disease entity texts on the whole semantics is consistent, the diseases are represented by adopting the uniform reference words, and the positions of the entity texts in the text data are used for distinguishing different diseases, the difficulty of extracting the hidden state feature vectors of the entity texts by the model can be greatly reduced.
For example, "a patient has hypertension for 30 years and is admitted to the hospital 3 months this year. The original text data is subjected to word segmentation to obtain text data to be classified; the hypertension belongs to one of diseases, can be replaced by DIS, 30 years and 3 months this year belong to one of TIME attributes, and are replaced by TIME in a unified mode, and the text data after replacement is that the patient suffers from DIS TIME and is admitted with TIME.
As an optional implementation manner, after obtaining the identifier matching with the target entity text, the method further includes:
determining a referring word corresponding to the target entity text according to the type of the target entity text;
and adding the representative words to two sides of the target entity text.
In practical applications, the processing method of the text data to be classified is the same as the process of replacing the entity text by using the reference word, and details are not repeated here. In this embodiment, the same pronouns may be added to the left and right sides of the target entity text.
For example, "a patient has hypertension for 30 years and is admitted to the hospital 3 months this year. The original text data is subjected to word segmentation to obtain text data to be classified; the 'hypertension' belongs to diseases, can adopt 'DIS' to indicate words, '30 years' and '3 months in this year' to belong to TIME attributes, and adopt 'TIME' to indicate pronouns in a unified way, after the pronouns are added, the text data to be classified become 'the patient suffers from DIS hypertension DIS TIME30 years TIME, and the TIME is admitted in 3 months in this year'.
As an optional implementation manner, the splicing hidden state feature vectors of the identifiers of any two target entity texts to obtain a relationship vector of any two identifiers specifically includes:
and splicing the hidden state characteristic vectors of any two different identifiers to obtain the relation vector of any two identifiers.
In the target entity text, the target entity text may be classified according to the type of the target entity text. In practical application, classification can be performed according to the identification of the target entity text, and hidden state feature vectors corresponding to any two different identifications are spliced to obtain a relation vector.
Because different target entity texts with the same identifier do not generally have entity relationships, by adopting the technical scheme, the relationship extraction between different entity texts under the same identifier can be reduced, and the time consumption of the entity relationship extraction is reduced.
As an optional implementation, the method further comprises:
acquiring a text entity relationship requirement of a user;
dividing the target entity text into a first target entity text and a second target entity text according to the requirement; the requirement comprises a relationship of the first target entity text and the second target entity text.
By acquiring the requirements of the user on the text entity relationship, the relationship between two types of target entity texts which the user needs to know can be determined; and dividing the target entity text into a first target entity text and a second target entity text according to the requirements of the user, wherein the first target entity text is the entity text mainly concerned by the user, and the second target entity text is the entity text secondarily concerned by the user. For example: if the user wants to know the relationship between the disease and the time, the target entity text representing the disease is the first target entity text, and the target entity text representing the time is the second target entity text.
As an optional implementation manner, the splicing any two different hidden state feature vectors of the identifiers to obtain a relationship vector of any two identifiers includes:
splicing the identified hidden state feature vector of the second target entity text after the identified hidden state feature vector of the first target entity text.
Under the condition that user requirements are clear, when target entity texts are spliced, the hidden state feature vector corresponding to the identifier of the second target entity text is spliced behind the hidden state feature vector corresponding to the identifier of the first target entity text. The relation vector formed by the method and the vector matrix formed by the relation vector can quickly realize the extraction of the entity text relation meeting the user requirement.
As an optional implementation, the extracting the hidden state feature vector of the identifier of the target entity text includes:
and extracting the hidden state feature vector of the identification of the target entity text by adopting a neural network model.
As an optional implementation manner, the processing the vector matrix to obtain the entity relationship of the target entity text includes:
and classifying the vector matrix by adopting a multilayer perceptron to obtain the entity relationship of the target entity text.
As an optional implementation, the forming the relationship vector into a vector matrix includes:
and combining all the relation vectors in the text to be classified to obtain the vector matrix.
It should be noted that, the obtaining process of the relationship vector may include:
obtaining a hidden state feature vector of an identifier corresponding to a target entity text i
Figure 486788DEST_PATH_IMAGE005
Hidden state feature vector of identifier corresponding to target entity text j
Figure DEST_PATH_IMAGE013
Wherein
Figure DEST_PATH_IMAGE015
Figure 831182DEST_PATH_IMAGE016
h is the number of the neurons of the hidden layer of the neural network model;
will be provided with
Figure 735684DEST_PATH_IMAGE005
And
Figure 304068DEST_PATH_IMAGE013
splicing is carried out, i.e. the
Figure 989128DEST_PATH_IMAGE013
Head end of
Figure 793005DEST_PATH_IMAGE005
Connecting the tail ends of the two vectors to obtain a relation vector:
Figure DEST_PATH_IMAGE017
=
Figure 676647DEST_PATH_IMAGE018
(
Figure DEST_PATH_IMAGE019
)=
Figure 25720DEST_PATH_IMAGE020
the dimension of the spliced relation vector is 2 h.
Combining the relation vectors according to the sequence to obtain a vector matrix:
Figure DEST_PATH_IMAGE021
it should be understood that the hidden state feature vectors in the embodiments of the present specification do not take directions into consideration, that is, the above relationship vectors are combined in a certain order to form a vector matrix.
In order to facilitate understanding of the technical solutions provided in the embodiments of the present specification, another specific embodiment is provided to describe the technical solutions of the present application, which is specifically as follows:
for the convenience of explanation of the technical scheme of the present application, the patient is admitted to the hospital 3 months this year after suffering from hypertension for 30 years. And performing entity relation extraction as original text data.
Fig. 2 is a schematic flow chart of another method for extracting textual entity relationships according to an embodiment of the present disclosure. As shown in fig. 2, the method comprises the following steps:
step 202: original text data is acquired.
The original text data in this embodiment is: the patient had hypertension for 30 years and was admitted to the hospital 3 months this year.
Step 204: and performing word segmentation on the original text data to obtain text data to be classified.
Fig. 3 is a schematic diagram of text data to be classified according to an embodiment of the present disclosure. After word segmentation, the text data to be classified as shown in fig. 3 is obtained. And obtaining the target entity text for the data to be classified in the figure 3 according to the attribute of the entity text. Fig. 4 is a schematic diagram of text data with a logo provided in an embodiment of the present specification. As shown in fig. 4, the target entity text in this embodiment includes: hypertension, 30 years and 3 months this year.
Step 206: determining a referring word corresponding to the target entity text according to the type of the target entity text;
step 208: and replacing the target entity text with the reference word.
As shown in fig. 4, three entities, namely, hypertension, 30 years and 3 months this year, are respectively identified, and a target entity text with the identification is obtained. Different ground color patterns are used in fig. 4 to represent different types of target entity text. Since "30 years" and "this year 3 month" belong to entity texts of the time type, the same reference words are substituted for 30 years and this year 3 month, for example: TIME. "hypertension" is different from "30 years" in type, and is replaced by other pronouns. For example: DIS. Fig. 5 is a schematic diagram of text data after a replacement operation according to an embodiment of the present disclosure. After the replacement operation, the text data as shown in fig. 5 is obtained.
Step 210: and extracting the hidden state feature vector of the identification of the target entity text by adopting a neural network model.
Fig. 6 is a schematic diagram of hidden state feature vectors extracted by using a neural network model according to an embodiment of the present disclosure. As shown in fig. 6, the hidden state feature vector corresponding to the target entity text "hypertension" is a feature vector with a dotted filling pattern, and the hidden state feature vectors corresponding to the target entity text "30 years" and the target entity text "3 months this year" are feature vectors with a meshed filling pattern, and are located at different positions respectively.
Step 212: and splicing the hidden state characteristic vectors of the marks of any two target entity texts to obtain the relation vectors of any two marks.
Step 214: and forming the relation vectors into a vector matrix.
And splicing the DIS characteristic vector and the two TIME characteristic vectors respectively to obtain a vector matrix of the target entity text. Assuming that the dimension of the "DIS" vector is 1 × 512, the vector matrix after splicing is 2 × 1024.
Step 216: and classifying the vector matrix by adopting a multilayer perceptron to obtain the entity relationship of the target entity text.
And inputting the vector matrix into a multilayer perceptron to obtain the entity relationship of the target entity text. In this embodiment, the output result indicates that the entity relationship between "hypertension" and "30 years" is related, "hypertension" and "this year 3 month" are unrelated, and "30 years" and "this year 3 month" are unrelated; in practical applications, the disease may be further divided according to the specific relationship between the disease and time, for example: the physical relationship between "hypertension" and "30 years" is further described in terms of a start time, duration, and end time.
It should be noted that, if the target entity text is identified by adding the reference words on both sides of the entity text, the hidden state feature vectors of the identifiers corresponding to the target entity text may be extracted in two forms. Firstly, extracting a hidden state feature vector by using a reference word added on the left side of a target entity text as a hidden state feature vector of a mark corresponding to the target entity text. And secondly, respectively extracting the hidden state feature vectors of the added reference words on the left and right sides of the target entity text and the target entity text, and solving an average vector of the three extracted hidden state feature vectors as the hidden state feature vectors of the corresponding marks of the target entity text.
Based on the same idea, the embodiment of the present specification further provides a device corresponding to the above method. Fig. 7 is a schematic structural diagram of an extraction apparatus corresponding to the text entity relationship in fig. 1 according to an embodiment of the present disclosure. As shown in fig. 7, the apparatus may include:
a first obtaining module 701, configured to obtain a target entity text in text data to be classified;
a second obtaining module 703, configured to obtain an identifier matching the target entity text;
an extracting module 705, configured to extract a hidden state feature vector of the identifier of the target entity text;
the splicing module 707 is configured to splice hidden state feature vectors of identifiers of any two target entity texts to obtain a relationship vector of any two identifiers;
a vector matrix forming module 709, configured to form the relationship vector into a vector matrix;
and the processing module 711 is configured to process the vector matrix to obtain an entity relationship of the target entity text.
It will be appreciated that the modules described above refer to computer programs or program segments for performing a certain function or functions. In addition, the distinction between the above-described modules does not mean that the actual program code must also be separated.
Based on the same idea, the embodiment of the present specification further provides a device corresponding to the above method.
Fig. 8 is a schematic structural diagram of an extraction device corresponding to a text entity relationship in fig. 1 according to an embodiment of the present disclosure. As shown in fig. 8, the apparatus 800 may include:
at least one processor 810; and the number of the first and second groups,
a memory 830 communicatively coupled to the at least one processor; wherein,
the memory 830 stores instructions 820 executable by the at least one processor 810 to enable the at least one processor 810 to:
acquiring a target entity text in text data to be classified;
acquiring an identifier matched with the target entity text;
extracting a hidden state feature vector of the identifier of the target entity text;
splicing hidden state feature vectors of the marks of any two target entity texts to obtain a relation vector of any two marks;
forming the relationship vectors into a vector matrix;
and processing the vector matrix to obtain the entity relationship of the target entity text.
Based on the same idea, the embodiment of the present specification further provides a computer-readable medium corresponding to the above method. The computer readable medium has computer readable instructions stored thereon that are executable by a processor to implement the method of:
acquiring a target entity text in text data to be classified;
acquiring an identifier matched with the target entity text;
extracting a hidden state feature vector of the identifier of the target entity text;
splicing hidden state feature vectors of the marks of any two target entity texts to obtain a relation vector of any two marks;
forming the relationship vectors into a vector matrix;
and processing the vector matrix to obtain the entity relationship of the target entity text.
While particular embodiments of the present specification have been described above, in some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in this specification are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other.
The apparatus, the device, and the method provided in the embodiments of the present specification are corresponding, and therefore, the apparatus and the device also have beneficial technical effects similar to those of the corresponding method, and since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the corresponding apparatus and device are not described again here.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital character system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate a dedicated integrated circuit chip. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information which can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for extracting text entity relationship is characterized by comprising the following steps:
acquiring a target entity text in text data to be classified;
acquiring an identifier matched with the target entity text;
extracting a hidden state feature vector of the identifier of the target entity text;
splicing hidden state feature vectors of the marks of any two target entity texts to obtain a relation vector of any two marks;
forming the relationship vectors into a vector matrix;
and processing the vector matrix to obtain the entity relationship of the target entity text.
2. The method for extracting text entity relationship according to claim 1, wherein before the obtaining of the target entity text in the text data to be classified, the method further comprises:
and performing word segmentation on the original text data by adopting named entity recognition to obtain the text data to be classified.
3. The method for extracting textual entity relationships according to claim 1, wherein after obtaining the identifier matching the target entity text, the method further comprises:
determining a referring word corresponding to the target entity text according to the type of the target entity text;
and replacing the target entity text with the reference word.
4. The method for extracting textual entity relationships according to claim 1, wherein after obtaining the identifier matching the target entity text, the method further comprises:
determining a referring word corresponding to the target entity text according to the type of the target entity text;
and adding the representative words to two sides of the target entity text.
5. The method for extracting text entity relationship according to claim 1, wherein the splicing of hidden state feature vectors of the identifiers of any two target entity texts to obtain the relationship vector of any two identifiers specifically comprises:
and splicing the hidden state characteristic vectors of any two different identifiers to obtain the relation vector of any two identifiers.
6. The method for extracting textual entity relationships according to claim 1, further comprising:
acquiring a text entity relationship requirement of a user;
dividing the target entity text into a first target entity text and a second target entity text according to the requirement; the requirement comprises a relationship of the first target entity text and the second target entity text.
7. The method for extracting the text entity relationship according to claim 6, wherein the splicing the hidden state feature vectors of the identifiers of any two target entity texts to obtain the relationship vectors of any two identifiers comprises:
splicing the identified hidden state feature vector of the second target entity text after the identified hidden state feature vector of the first target entity text.
8. An apparatus for extracting text entity relationship, comprising:
the first acquisition module is used for acquiring a target entity text in the text data to be classified;
the second acquisition module is used for acquiring the identification matched with the target entity text;
the extraction module is used for extracting the hidden state characteristic vector of the identifier of the target entity text;
the splicing module is used for splicing the hidden state characteristic vectors of the identifiers of any two target entity texts to obtain the relation vector of any two identifiers;
a vector matrix forming module, configured to form the relationship vector into a vector matrix;
and the processing module is used for processing the vector matrix to obtain the entity relationship of the target entity text.
9. An extraction device of text entity relations, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a target entity text in text data to be classified;
acquiring an identifier matched with the target entity text;
extracting a hidden state feature vector of the identifier of the target entity text;
splicing hidden state feature vectors of the marks of any two target entity texts to obtain a relation vector of any two marks;
forming the relationship vectors into a vector matrix;
and processing the vector matrix to obtain the entity relationship of the target entity text.
10. A computer readable medium having computer readable instructions stored thereon, wherein the computer readable instructions are executable by a processor to implement the method for extracting textual entity relationships of any of claims 1 to 7.
CN202210100635.3A 2022-01-27 2022-01-27 Method, device, equipment and readable medium for extracting text entity relationship Active CN114117055B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210100635.3A CN114117055B (en) 2022-01-27 2022-01-27 Method, device, equipment and readable medium for extracting text entity relationship

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210100635.3A CN114117055B (en) 2022-01-27 2022-01-27 Method, device, equipment and readable medium for extracting text entity relationship

Publications (2)

Publication Number Publication Date
CN114117055A true CN114117055A (en) 2022-03-01
CN114117055B CN114117055B (en) 2023-03-24

Family

ID=80361707

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210100635.3A Active CN114117055B (en) 2022-01-27 2022-01-27 Method, device, equipment and readable medium for extracting text entity relationship

Country Status (1)

Country Link
CN (1) CN114117055B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114783559A (en) * 2022-06-23 2022-07-22 浙江太美医疗科技股份有限公司 Medical image report information extraction method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120078918A1 (en) * 2010-09-28 2012-03-29 Siemens Corporation Information Relation Generation
CN108959630A (en) * 2018-07-24 2018-12-07 电子科技大学 A kind of character attribute abstracting method towards English without structure text
CN109783618A (en) * 2018-12-11 2019-05-21 北京大学 Pharmaceutical entities Relation extraction method and system based on attention mechanism neural network
CN110704576A (en) * 2019-09-30 2020-01-17 北京邮电大学 Text-based entity relationship extraction method and device
CN111967242A (en) * 2020-08-17 2020-11-20 支付宝(杭州)信息技术有限公司 Text information extraction method, device and equipment
CN113672727A (en) * 2021-07-28 2021-11-19 重庆大学 Financial text entity relation extraction method and system
CN113806531A (en) * 2021-08-26 2021-12-17 西北大学 Drug relationship classification model construction method, drug relationship classification method and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120078918A1 (en) * 2010-09-28 2012-03-29 Siemens Corporation Information Relation Generation
CN108959630A (en) * 2018-07-24 2018-12-07 电子科技大学 A kind of character attribute abstracting method towards English without structure text
CN109783618A (en) * 2018-12-11 2019-05-21 北京大学 Pharmaceutical entities Relation extraction method and system based on attention mechanism neural network
CN110704576A (en) * 2019-09-30 2020-01-17 北京邮电大学 Text-based entity relationship extraction method and device
CN111967242A (en) * 2020-08-17 2020-11-20 支付宝(杭州)信息技术有限公司 Text information extraction method, device and equipment
CN113672727A (en) * 2021-07-28 2021-11-19 重庆大学 Financial text entity relation extraction method and system
CN113806531A (en) * 2021-08-26 2021-12-17 西北大学 Drug relationship classification model construction method, drug relationship classification method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
朱频频: "《智能客户服务技术与应用》", 31 January 2019, 中国铁道出版社 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114783559A (en) * 2022-06-23 2022-07-22 浙江太美医疗科技股份有限公司 Medical image report information extraction method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114117055B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
Cerda et al. Encoding high-cardinality string categorical variables
EP3926531B1 (en) Method and system for visio-linguistic understanding using contextual language model reasoners
CN111709243A (en) Knowledge extraction method and device based on deep learning
CN110442859B (en) Labeling corpus generation method, device, equipment and storage medium
Laubrock et al. Computational approaches to comics analysis
Li et al. Detection of bleeding events in electronic health record notes using convolutional neural network models enhanced with recurrent neural network autoencoders: deep learning approach
CN112151183A (en) Entity identification method of Chinese electronic medical record based on Lattice LSTM model
CN111832307A (en) Entity relationship extraction method and system based on knowledge enhancement
CN113221555A (en) Keyword identification method, device and equipment based on multitask model
CN112308113A (en) Target identification method, device and medium based on semi-supervision
CN111046660A (en) Method and device for recognizing text professional terms
CN111177375A (en) Electronic document classification method and device
Sultan et al. A hybrid egocentric video summarization method to improve the healthcare for Alzheimer patients
CN114117055B (en) Method, device, equipment and readable medium for extracting text entity relationship
CN113887206B (en) Model training and keyword extraction method and device
Soykan et al. A comprehensive gold standard and benchmark for comics text detection and recognition
Mishra et al. Multimodal machine learning for extraction of theorems and proofs in the scientific literature
CN117152770A (en) Handwriting input-oriented writing capability intelligent evaluation method and system
Fernández et al. Contextual word spotting in historical manuscripts using markov logic networks
Amjad et al. Comparison of Text Classificatio n Methods Using Deep Learning Neural Networks
Zhang et al. Medical assertion classification in Chinese EMRs using attention enhanced neural network
CN112579774B (en) Model training method, model training device and terminal equipment
CN115048927A (en) Method, device and equipment for identifying disease symptoms based on text classification
CN114548113A (en) Event-based reference resolution system, method, terminal and storage medium
KR20220096055A (en) Electronic device for word embedding and method of operating the same

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant