CN115238680A - Error correction method, medium, device and computing equipment for entity recognition result - Google Patents

Error correction method, medium, device and computing equipment for entity recognition result Download PDF

Info

Publication number
CN115238680A
CN115238680A CN202210848661.4A CN202210848661A CN115238680A CN 115238680 A CN115238680 A CN 115238680A CN 202210848661 A CN202210848661 A CN 202210848661A CN 115238680 A CN115238680 A CN 115238680A
Authority
CN
China
Prior art keywords
entity
text
entry
training
recognized
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.)
Pending
Application number
CN202210848661.4A
Other languages
Chinese (zh)
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202210848661.4A priority Critical patent/CN115238680A/en
Publication of CN115238680A publication Critical patent/CN115238680A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • 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/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Character Discrimination (AREA)

Abstract

The embodiment of the disclosure provides an entity identification result error correction method, medium, device and computing equipment. The method comprises the following steps: acquiring an entity prediction result corresponding to a text to be recognized; determining entity entries corresponding to the texts to be recognized in a corresponding knowledge base, wherein the knowledge base also comprises entity entry blurb corresponding to the entity entries; and determining error correction operation on the entity prediction result based on the entity prediction result, the text to be recognized, the entity entries and the entity entry introduction. The entries and entry blurb in the knowledge base are combined with the text to be recognized, so that the accuracy of the entity prediction result is evaluated together, and error correction is performed when the entity prediction result is inaccurate, so that the accuracy and reliability of the entity recognition result of the text to be recognized can be improved remarkably.

Description

Error correction method, medium, device and computing equipment for entity recognition result
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to an error correction method, medium, apparatus, and computing device for entity identification results.
Background
This section is intended to provide a background or context to the embodiments of the disclosure recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
In the fields of man-machine conversation, language translation, and the like, it is important to accurately and unmistakably recognize each type of corresponding text entity contained in given text information. By quickly finding out the corresponding entity under the context in the given text, the corresponding function of the entity can be conveniently called, and the method and the device are widely applied to scenes such as medicine, automobiles, e-commerce and the like.
In the related art, a method for identifying text entities generally includes converting text into feature vectors, and analyzing the feature vectors to identify entities and corresponding types in the text. However, when the text length is short, the corresponding feature vectors are few, and the accuracy of the obtained data features is insufficient, so that the accuracy of the obtained recognition result is poor.
Disclosure of Invention
The present disclosure provides an error correction method, medium, apparatus, and computing device for entity identification result to solve the problem of poor accuracy of entity identification result in the related art.
In a first aspect of the disclosed embodiments, there is provided a method for correcting an entity identification result, including:
acquiring an entity prediction result corresponding to a text to be recognized;
determining entity entries corresponding to the texts to be recognized in a corresponding knowledge base, wherein the knowledge base also comprises entity entry blurb corresponding to the entity entries;
and determining error correction operation for the entity prediction result based on the entity prediction result, the text to be recognized, the entity entries and the entity entry brief introduction.
In a second aspect of the disclosed embodiments, there is provided a method for training a solid prediction model, including:
determining corresponding entries and entry brief introduction of training texts in a knowledge base, wherein the training texts are labeled with character category labels;
inputting the training text and the corresponding vocabulary entry and vocabulary entry introduction of the training text in the knowledge base into an entity prediction model for training, outputting a first training entity, a first training entity category and a first training confidence score contained in the training text,
the character category labels include:
the first character and entity category label of the entity;
a non-initial character and an entity category label of the entity;
a non-entity tag.
In a third aspect of the disclosed embodiments, there is provided an entity recognition model training method, including:
determining corresponding entries and entry blurbs of training texts in a knowledge base, wherein the training texts are marked with character type labels;
inputting the training texts and training texts of the corresponding entries and entry blurbs of the training texts in the knowledge base into an entity recognition model for training, outputting a second training entity, a second training entity category and a second training confidence score contained in the training texts,
the character category label includes:
the first character and entity category label of the entity;
a non-initial character and an entity category label of the entity;
a non-entity tag.
In a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium comprising:
the computer readable storage medium has stored therein computer executable instructions for implementing the error correction method of the entity identification result as in the first aspect of the present disclosure when executed by the processor; and/or, the computer executable instructions when executed by the processor are for implementing a method of entity prediction model training as in the second aspect of the present disclosure; and/or the computer executable instructions, when executed by the processor, are for implementing the entity recognition model training method as in the third aspect of the present disclosure.
In a fifth aspect of embodiments of the present disclosure, there is provided an error correction apparatus for an entity identification result, including:
the acquisition module is used for acquiring an entity prediction result corresponding to the text to be recognized;
the enhancement module is used for determining an entity entry corresponding to the text to be recognized in a corresponding knowledge base, and the knowledge base also comprises an entity entry brief introduction corresponding to the entity entry;
and the error correction module is used for determining error correction operation on the entity prediction result based on the entity prediction result, the text to be recognized, the entity entries and the entity entry introduction.
In a sixth aspect of the disclosed embodiments, there is provided an entity prediction model training apparatus, comprising:
the determining module is used for determining corresponding entries and entry blurb of the training texts in the knowledge base, and the training texts are labeled with character category labels;
a training module used for inputting the training text and the corresponding vocabulary entry and vocabulary entry brief introduction of the training text in the knowledge base into the entity prediction model for training, and outputting a first training entity, a first training entity category and a first training confidence score contained in the training text,
the character category label includes:
the first character of the entity and the entity category label;
a non-initial character and an entity category label of the entity;
a non-entity tag.
In a seventh aspect of the disclosed embodiments, there is provided an entity recognition model training apparatus, comprising:
determining corresponding entries and entry blurbs of training texts in a knowledge base, wherein the training texts are marked with character type labels;
inputting the training text and training texts with entries and entry blurbs corresponding to the training text in the knowledge base into the entity recognition model for training, outputting a second training entity, a second training entity category and a second training confidence score contained in the training text,
the character category label includes:
the first character of the entity and the entity category label;
a non-initial character and an entity category label of the entity;
a non-entity tag.
In an eighth aspect of embodiments of the present disclosure, there is provided a computing device comprising: at least one processor;
and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to cause the computing device to perform a method of error correction of entity identification results as in the first aspect of the disclosure; and/or to cause a computing device to perform a method of entity prediction model training as in the second aspect of the disclosure; and/or cause a computing device to perform a method of entity recognition model training as in the third aspect of the present disclosure.
According to the error correction method, medium, device and computing equipment for the entity recognition result, the entity prediction result corresponding to the text to be recognized is obtained; then determining entity entries corresponding to the texts to be recognized in a corresponding knowledge base; and finally, determining error correction operation on the entity prediction result based on the entity prediction result, the text to be recognized, the entity entries and the entity entry introduction. Therefore, different operations can be adopted according to different entity prediction results, when the entity prediction result is the existence entity, the vocabulary entry and the vocabulary entry brief introduction in the knowledge base are combined with the text to be recognized, the accuracy of the obtained entity and entity category is jointly evaluated, and when the entity prediction result is the absence entity, the vocabulary entry brief introduction and the text to be recognized are utilized to recognize whether the entity exists in the text to be recognized again, so that the accuracy and the reliability of the entity recognition result of the text to be recognized can be obviously improved.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present disclosure will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the present disclosure are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
fig. 1 schematically illustrates an application scenario diagram according to an embodiment of the present disclosure;
fig. 2 schematically shows a flow chart of an error correction method of an entity identification result according to another embodiment of the present disclosure;
fig. 3a schematically shows a flow chart of a method of error correction of entity identification results according to a further embodiment of the present disclosure;
FIG. 3b is a flow chart schematically illustrating an entity prediction result of a text to be recognized obtained by an entity prediction model in the embodiment shown in FIG. 3 a;
fig. 4 schematically shows a flowchart of an error correction method of an entity recognition result according to still another embodiment of the present disclosure;
FIG. 5 schematically illustrates a flow chart of a method of entity prediction model training in accordance with yet another embodiment of the present disclosure;
FIG. 6 schematically illustrates a flow chart of a method of entity prediction model training in accordance with yet another embodiment of the present disclosure;
FIG. 7 schematically illustrates a flow diagram of a method of entity recognition model training in accordance with yet another embodiment of the present disclosure;
FIG. 8 schematically illustrates a structural diagram of a computer-readable storage medium according to yet another embodiment of the present disclosure;
fig. 9 schematically shows a structural diagram of an error correction apparatus for entity recognition results according to still another embodiment of the present disclosure;
FIG. 10 schematically illustrates a structural diagram of an entity prediction model training apparatus according to yet another embodiment of the present disclosure;
FIG. 11 schematically illustrates a structural diagram of an entity recognition model training apparatus according to yet another embodiment of the present disclosure;
fig. 12 schematically shows a structural schematic of a computing device according to yet another embodiment of the present disclosure.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present disclosure will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are presented merely to enable those skilled in the art to better understand and to practice the disclosure, and are not intended to limit the scope of the disclosure in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to an embodiment of the disclosure, an error correction method, medium, device and computing device for entity recognition results are provided.
In this context, it is to be understood that the terminology which has been used is intended to be in the nature of words of description rather than of limitation. Furthermore, the number of any elements in the drawings is intended to be illustrative and not restrictive, and any nomenclature is used for distinction only and not for any restrictive meaning.
The following are descriptions of terms involved in this disclosure:
entity: the term "entity" refers to a specific person, thing, object or concept that can exist objectively and can be distinguished from each other, and is used in this disclosure to mean a word having an actual meaning.
Entity identification: the full name is Named after Entity Recognition, NER for short, and corresponding Chinese is Named Entity Recognition, namely an information extraction technology for acquiring entities from texts, character strings and the like.
The principles and spirit of the present disclosure are explained in detail below with reference to several representative embodiments thereof.
Summary of The Invention
The inventor finds that entity recognition tasks widely exist in the fields of man-machine conversation, translation and the like, or scenes of medicine, automobiles, e-commerce and the like, and it is very important to accurately recognize corresponding entities in various types of texts (including texts extracted from voice and images). The existing entity recognition method mainly converts a text to be recognized into a feature vector through a recognition model, and then determines an entity (and a category thereof) and a non-entity contained in the text to be recognized according to different data features corresponding to the feature vectors of the entity and the non-entity (which are learned by the recognition model through pre-training), when the text to be recognized is short (which results in a small number of feature vectors available for analysis), and the text to be recognized contains a plurality of entities to be recognized (at this time, the data features obtained based on the text to be recognized most likely only contain information of the entity itself, the feature vectors of the non-entity are small, and the data features of the non-entity are difficult to recognize, so that the entity to be recognized and the non-entity are difficult to distinguish, and the specific category of the entity to be recognized is difficult to determine), or in a scene with complex context and professional field (because the recognition model learns less data features of such context or field, the recognition accuracy of the entity is poor), when the data features are directly analyzed through the feature vectors, the reliability is poor, and the entity recognition method for accurately recognizing the entity in the scene is easy to appear, or the entity recognition method for judging whether the entity recognition result in the related technology is insufficient reliability.
According to the scheme, the entity prediction result corresponding to the text to be recognized is obtained firstly, then the entry and the entry brief introduction corresponding to the text to be recognized are found out in the knowledge base, and the error correction result of the entity prediction result is determined based on the entry, the text to be recognized, the entry brief introduction and the entity prediction result.
Having described the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.
Application scene overview
Referring to fig. 1, after a user inputs data (which may be text, voice or video) 110 including a text to be recognized into a terminal device 100, in an entity recognition process, the terminal device 100 performs entity recognition on the text to be recognized to obtain an entity prediction result 120 (including an entity and an entity category), and performs error correction processing on the entity prediction result 120 by combining a knowledge base 121 and an entity recognition model 122 to obtain a final output entity recognition result 130, thereby completing an entity recognition result error correction process.
It should be noted that, in the scenario shown in fig. 1, the terminal device, the data including the text to be recognized, the knowledge base, the entity recognition model, the entity prediction result, and the entity recognition result are illustrated by taking only one example, but the disclosure is not limited thereto, that is, the number of the terminal device, the data including the text to be recognized, the knowledge base, the entity recognition model, the entity prediction result, and the entity recognition result may be any number.
Exemplary method
An error correction method for an entity recognition result according to an exemplary embodiment of the present disclosure is described below with reference to fig. 2 to 5 in conjunction with an application scenario of fig. 1. It should be noted that the above application scenarios are merely illustrated for the convenience of understanding the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. Rather, embodiments of the present disclosure may be applied to any scenario where applicable.
Fig. 2 is a flowchart of an error correction method for entity identification results according to an embodiment of the present disclosure. The error correction method for the entity identification result is applied to terminal equipment or a server. As shown in fig. 2, the error correction method for entity identification result provided in this embodiment includes the following steps:
step S201, an entity prediction result corresponding to the text to be recognized is obtained.
Specifically, the text to be recognized may be text included in characters input by the user, may also be text extracted from pictures or videos (pictures), or may also be text extracted from audio or videos (sounds).
The entity prediction result is a recognition result of whether an entity exists in the text to be recognized, which entities exist and the entity category. The entity prediction result may be that no entity exists in the text to be recognized, or may be that one or more entities exist in the text to be recognized and include an entity category of each entity. If the text to be recognized is "three words i am", the entity prediction result may be: wherein, the existence entity is Zhang III, and the corresponding entity category is the name of a person. There may also be one or more entity categories of each entity in the text to be recognized, such as "apple in table" entity, and the entity categories may be "electronic device" or "food".
The entity prediction results may be obtained from an identification model, such as identification of the entity prediction model, or may be obtained from manual identification, and the entity prediction results obtained in different manners may be the same or different (when the entity prediction results are different, at least one entity prediction result is usually wrong). If the same text to be recognized is recognized in different modes and corresponding recognition results are obtained, the recognition results can be used as entity prediction results and substituted into the method for error correction.
The entity prediction may be correct or incorrect, such as not matching the entity or entity class actually contained in the text to be recognized. If the text to be recognized is "apple is really good, the entity prediction model may recognize the entity category of the entity" apple "as an electronic product, but actually the entity category should be food or fruit, i.e. the entity prediction result is wrong.
If the entity prediction result is obtained through an identification model (such as an entity prediction model), the model usually outputs a score of the entity identification result, and whether the entity prediction result is correct or not can be judged according to the score, if the score of the entity prediction result is 0.1 and the score threshold value requiring credibility of the entity prediction result is 0.6, the entity prediction result is likely to be wrong.
Step S202, determining entity entries corresponding to the texts to be recognized in the corresponding knowledge base.
The knowledge base also comprises entity entry introduction corresponding to the entity entries.
Specifically, the knowledge base may be a database provided by a network service provider, such as various encyclopedic databases or thesis databases; or may be a database established in an internal server, such as an internal description information database.
The knowledge base includes entries and entry blurbs corresponding to the entries, and may further include other different types of contents such as specific descriptions, application examples, and corresponding names in other languages, but in this embodiment, only the entries and the entry blurbs corresponding to the entries are needed.
In an exemplary embodiment of the present disclosure, the respective knowledge bases for matching are predetermined and generally remain unchanged during use (e.g., only an administrator modifies the configuration will the corresponding knowledge base for matching be changed).
There may be one or more corresponding knowledge bases, such as an encyclopedia database and an internal description information database.
In an exemplary embodiment of the disclosure, there are multiple corresponding knowledge bases, and the server or the processor determines the entity entry corresponding to the text to be recognized in each knowledge base respectively. If each knowledge base contains the corresponding entity entry, the entity entry corresponding to the text to be recognized can be determined based on the priority of the plurality of entity entries and/or the searching heat of the entity entries.
The different kinds of content in the knowledge base can be directly determined by the label of each kind of content. And determining the entity entries corresponding to the text to be recognized, comparing the information labeled as the entries with characters or vocabularies in the text to be recognized, and determining the entries with the same comparison results as the entity entries corresponding to the text to be recognized.
Or the text to be recognized can be split into a plurality of words by a word segmentation algorithm and other methods, and then the split words are respectively matched with the entries in the knowledge base to find the corresponding entity entries.
Illustratively, the text to be recognized is "where three pieces go", and the text can be split into three parts of "three pieces of" and "where" through a word segmentation algorithm, and then the three parts are respectively matched with the corresponding knowledge base to find out the corresponding entries.
In an exemplary embodiment of the present disclosure, the entries corresponding to the text to be recognized and the corresponding knowledge bases may be filtered based on the set rule, and the words considered as not entities in the knowledge bases are removed, such as: and filtering the entries based on the keywords in the entry introduction.
Illustratively, where the term "is introduced as being capable of being used as a query word and a negative word in the term introduction of the encyclopedic knowledge base without an actual meaning, the term which contains descriptions such as the query word and the negative word in the retrieved term introduction can be filtered as a non-entity term; for example, "do not go to restaurant," "do" and "do" are two keywords of "question word" and "negative word" respectively in the entry introduction, so that the two entries are removed, the corresponding entity entry of the text to be recognized, "do not go to restaurant" is only possible to be "go" or "restaurant," and then the entry with the number of words less than 2 is removed by the word number screening of the entry, that is, "go", the entity entry is only "restaurant", and the category is the place name.
In an exemplary embodiment of the present disclosure, if the first entry corresponding to the potential entity does not exist in the knowledge base, the potential entity is removed and no further processing is performed.
Step S203, determining error correction operation for the entity prediction result based on the entity prediction result, the text to be recognized, the entity entries and the entity entry introduction.
Specifically, the error correction operation may be different according to the entity prediction result.
If the entity prediction result includes an entity, an entity class and a score (i.e., the first potential entity class and the score for the confidence of the first potential entity and the first potential entity class), and the score is higher (higher than a set confidence score threshold), which indicates that the entity prediction result is more reliable, the error correction operation may be: the entity prediction is taken directly as the final result (i.e. no further error correction processing is required).
If the entity prediction result has a low score (lower than a set confidence score threshold value) indicating that the entity prediction result has a low confidence level, the error correction operation may be to substitute the text to be recognized, the entity entry and the entity entry introduction into an entity recognition model (another recognition model different from the model used for the entity prediction result), and re-determine the entity and the entity category (i.e., the second potential entity category) contained in the text to be recognized, and the corresponding score (i.e., the second confidence score).
And if the score output by the entity recognition model is higher than the set credibility score threshold, which indicates that the reliability of the output result of the entity recognition model is higher, the entity and the entity category output by the entity recognition model can be used as the final entity and the final entity category after error correction.
If the score output by the entity recognition model is lower than the set credibility score threshold, the reliability of the output result of the entity recognition model is low, and then it can be determined that no entity exists in the text to be recognized.
According to the error correction method for the entity recognition result, the entity prediction result corresponding to the text to be recognized is obtained; then determining entity entries corresponding to the texts to be recognized in a corresponding knowledge base; and finally, determining error correction operation on the entity prediction result based on the entity prediction result, the text to be recognized, the entity entries and the entity entry introduction. Therefore, different operations can be adopted according to different entity prediction results, when the entity prediction result is the existence entity, the vocabulary entry and the vocabulary entry brief introduction in the knowledge base are combined with the text to be recognized, the accuracy of the obtained entity and entity category is jointly evaluated, and when the entity prediction result is the absence entity, the vocabulary entry brief introduction and the text to be recognized are utilized to recognize whether the entity exists in the text to be recognized again, so that the accuracy and the reliability of the entity recognition result of the text to be recognized can be obviously improved.
Fig. 3a is a flowchart of an error correction method for entity identification results according to an embodiment of the present disclosure. As shown in fig. 3a, the error correction method for entity identification results provided in this embodiment includes the following steps:
and step S301, acquiring an entity prediction result in a manual prediction mode.
Wherein the entity prediction result includes a first potential entity, a first potential entity category corresponding to the first potential entity, and a first confidence score.
Specifically, the entity prediction result may be obtained through manual prediction, and when a training sample for training the entity recognition model is required to be made, the entity and the entity category included in the text to be recognized, that is, the first potential entity and the first potential entity category, may be determined manually according to the text to be recognized, and the first confidence score may be manually added according to whether the determined first potential entity and the determined first potential entity category are accurate or not.
The manually determined first potential entity and the first potential entity category in the text to be recognized may be correct or incorrect (at this time, the first confidence score may be set to be lower), so as to play a role in training the entity recognition model.
For example, when the text to be recognized "apple is really good as a training sample, the first potential entity may be determined as" apple ", the first potential entity category may be determined as" fruit ", where the first confidence score may be determined as 0.9 or 1, the first potential entity may also be determined as" apple ", and the first potential entity category may be determined as" electronic device ", where the first confidence score may be determined as 0.3 or 0.4 (or any value less than 0.5 to indicate that the determination result is unreliable), the first potential entity may also be determined not to exist in the text to be recognized, and the text to be recognized may also function as a training sample.
The above examples show that the efficiency of the potential entities in the text to be recognized determined by the manual prediction mode is low, and the potential entities are generally not used in the actual prediction occasions, and are mainly applied to the training of models.
Step S302, the text to be recognized is input into the corresponding entity prediction model, and an entity prediction result is obtained based on the output result of the entity prediction model.
Wherein the entity prediction result includes a first potential entity, a first potential entity category corresponding to the first potential entity, and a first confidence score.
Specifically, the entity prediction model is a pre-trained neural network model capable of executing an entity recognition task, a text to be recognized is input into the entity prediction model, each character in the text to be recognized is converted into a feature vector by the entity prediction model, then, by analyzing data features of each feature vector, a first potential entity category and a score of each character in the potential entity which are determined based on the text to be recognized are output, and the score is determined based on the data features corresponding to the feature vector of each character. A first confidence score may be calculated based on the score of each character.
In an exemplary embodiment of the present disclosure, the first confidence score may be an average of the scores of each character in the first potential entity.
In an exemplary embodiment of the disclosure, the entity prediction model includes a first encoder for identifying and encoding text to be identified and a first decoder for determining a first potential entity in the text to be identified, a first potential entity category of the corresponding first potential entity and a first confidence score based on an output result of the first encoder.
Specifically, a first encoder identifies and encodes a text to be identified to obtain a feature vector corresponding to each character of the text to be identified, a first decoder determines a first potential entity and a first potential entity category in the text to be identified based on data features of the feature vector, and calculates a score of each character in each text to be identified based on the feature vector.
In an exemplary embodiment of the present disclosure, the first encoder may be a BERT model or a blstm model, and the first decoder may be a CRF model or a SPAN model. These models are all neural network models that can be used in the related art for entity recognition tasks.
As shown in fig. 3b, it is a flowchart of obtaining an entity prediction result of a text to be recognized through an entity prediction model, and the specific steps of obtaining the entity prediction result include:
and S3021, inputting the text to be recognized into the entity prediction model, and taking the output result of the entity prediction model as a prediction entity and a prediction entity category corresponding to the prediction entity.
Specifically, if the first confidence score is high enough, which indicates that the accuracy of the entity prediction result is sufficient, the corresponding error correction operation only needs to take the entity prediction result as the final result, and subsequent steps are saved.
In order to ensure the accuracy of the entity prediction result, the text to be recognized is firstly input into the entity prediction model to obtain the entity and the entity category which are output by the entity prediction model for the first time, namely the predicted entity and the predicted entity category, and then the predicted entity and the predicted entity category are combined with the vocabulary entry and the vocabulary entry introduction in the knowledge base and then input into the entity prediction model again, and the entity category which are output by the entity prediction model for the second time are used as the first potential entity and the first potential entity category, so that the accuracy and the reliability of the output result are ensured to the maximum extent through twice recognition by the entity prediction model and combination of the vocabulary entry, the vocabulary entry introduction and the predicted entity in the knowledge base for the second time.
In an exemplary embodiment of the present disclosure, the text to be recognized input into the entity prediction model includes a label of each character, and if entities, entity types, and non-entities are all labeled, at this time, the encoder portion of the entity prediction model determines that a corresponding feature vector is obtained according to each character and the label corresponding to the character, and the decoder portion determines a corresponding score based on the feature vector.
However, when the entity prediction model outputs the predicted entity and the predicted entity category, the corresponding confidence score may not be calculated, and when the first potential entity and the first potential entity category are output, the calculation is performed.
Step S3022, determining a preliminary term and a preliminary term introduction corresponding to the predicted entity in the knowledge base.
Specifically, the process of outputting the predicted entity and the predicted entity category corresponding to the text to be recognized through the entity prediction model does not include a link of evaluating the accuracy of the predicted entity and the predicted entity category. Therefore, the accuracy of the predicted entity and the predicted entity category cannot be guaranteed, and therefore, the text to be recognized needs to be recognized for the second time by combining the entries and entry blurb in the knowledge base.
According to the predicted entity and the predicted entity category output by the entity prediction model, the entry with the same name as the predicted entity can be matched in the knowledge base, and the entry is used as a preparation entry corresponding to the predicted entity, and the entry introduction corresponding to the entry is used as a preparation entry introduction.
In an exemplary embodiment of the present disclosure, when there are a plurality of entries of the same name as the predicted entity, keyword matching may be performed based on the entry profile of the corresponding entry and the predicted entity category (if the predicted entity category is fruit, whether or not there is a keyword of "fruit" in the matching entry profile), and the entry corresponding to the entry profile matched by the keyword may be used as a preliminary entry, and the entry profile may be used as a preliminary entry profile.
In an exemplary embodiment of the present disclosure, the specific steps of determining the preliminary terms and the preliminary term profiles include:
step one (not shown), determining the entries in the knowledge base with the same name as the predicted entity as the preparation entries.
Wherein, the knowledge base stores the vocabulary entry, the vocabulary entry brief introduction and the vocabulary entry hot value in a triple mode.
Specifically, the knowledge base in this embodiment necessarily includes the term, the term introduction, and the term heat value, and these three parameters are stored in the form of a triple (or ternary array), for example, (term, term introduction, term heat value), where the term heat value is used to reflect the number of times the term is searched/viewed/used.
Therefore, when the first entry is determined, the triples in the knowledge base are directly read, the triples with the same name as the predicted entity are determined based on the matching between the entries and the predicted entity, the entries in the triples are used as the prepared entries, and the entry blurs in the triples are used as the prepared entry blurs.
And step two (not shown), in response to the non-uniqueness with the same-name entry of the predicted entity, uniquely determining a preparation entry based on the entry hot degree value of each corresponding same-name entry.
Specifically, if at least two entries with the same name as the predicted entity can be obtained based on the matching of the entries and the predicted entity (the triples corresponding to the entries are different, including entry introduction difference and entry hot value difference), one entry with the same name needs to be selected as a spare entry.
In a specific selection mode, the entries with the highest ranking determined entry hot value may be determined as the preparation entries based on the reverse ranking of the entry hot values.
In an exemplary embodiment of the present disclosure, the entry having the highest entry popularity value of the corresponding entries of the same name is uniquely determined as the preparation entry.
Specifically, the entry corresponding to the highest heat value among the entry heat values corresponding to the multiple entries of the same name may be directly obtained without sorting, and the entry may be determined as the preliminary entry.
In an exemplary embodiment of the present disclosure, the entry with the highest vocabulary entry popularity value in the plurality of vocabulary entry profiles including the first vocabulary entry category in the keyword (or the synonym of the keyword) may be determined as the first entry based on the matching of the keyword and the first vocabulary entry category in the vocabulary entry profiles and the reverse rank of the vocabulary entry popularity value.
Specifically, if the text to be recognized is ' Pu ' er tea ', the potential entity category corresponding to the potential entity ' Pu ' er tea ' is ' book ', the corresponding entry is Pu ' er tea, but if the word entries corresponding to the ' Pu ' er tea ' are arranged in reverse order according to the heat value of each entry, the key word corresponding to the highest heat degree is ' tea, and obviously does not correspond to the potential entity category, so that the entry with the highest heat degree in the entry introduction of the entry introduction (such as a popular science book published in 2004) containing the ' book ' (or synonyms: book and book) in the key words of the entry introduction is determined as a first entry, and the corresponding entry introduction is determined as a first entry introduction.
In an exemplary embodiment of the disclosure, the predicted entity and the predicted entity category are rejected if there are no preliminary entries in the knowledge base corresponding to the predicted entity and the predicted entity.
Specifically, if the preliminary entry corresponding to the predicted entity does not exist in the knowledge base, the enhanced text cannot be obtained based on the predicted entity, and at this time, the accuracy and reliability of the first potential entity and the first potential entity category output by the entity prediction model cannot be guaranteed, so that the predicted entity can be deleted. If a predicted entity in the text to be recognized, namely the 'flying Pacific', is 'flying Pacific', an alternative entry with the same name as the predicted entity cannot be found in the knowledge base, and therefore the predicted entity can be deleted. After deletion, new predicted entities are re-determined.
And S3023, splicing the predicted vocabulary entry, the text to be recognized and the brief introduction of the predicted vocabulary entry to obtain the enhanced text.
Specifically, the predicted vocabulary entry brief introduction and the text to be recognized are spliced, and the spliced text is used as an enhanced text to be brought into the entity prediction model for secondary prediction.
In an exemplary embodiment of the present disclosure, the portion of the text to be recognized in the enhanced text includes a label for each character (e.g., a character category label including that each character belongs to an entity/non-entity, belongs to a first character/non-first character of an entity, and an entity category), and the predicted vocabulary entry brief description do not include labels, whereby the entity prediction model will only determine the entities of the portion of the text to be recognized in the enhanced text, but will not determine the entities in the predicted vocabulary entry and the predicted vocabulary entry brief description, since the predicted vocabulary entry brief description may itself also include other entities to better describe the predicted vocabulary entry, but these entities may not be present in the text to be recognized, such as the entities for explaining the vocabulary entry, including "yunnan province" and "arbor" in the vocabulary entry brief description of the vocabulary entry, "but including only the entity" pu tea "corresponding to the text to be recognized, and not including the entities" yunnan province "and" arbor ".
And S3024, inputting the enhanced text into the entity prediction model, and taking the output result of the entity prediction model as an entity prediction result.
Wherein the entity prediction result includes a first potential entity, a first potential entity category corresponding to the first potential entity, and a first confidence score.
Specifically, when the enhanced text is input into the entity prediction model, an encoder of the entity prediction model identifies and encodes all contents in the enhanced text to obtain a feature vector corresponding to the enhanced text, a decoder of the entity prediction model determines an entity and an entity category, namely a first potential entity and a first potential entity category, corresponding to the text to be identified and including labels through the feature vector output by the encoder, determines a score of each character in the first potential entity, and accordingly obtains a first confidence score.
Because the first potential entity and the first potential entity category output by the entity prediction model are combined with the text to be recognized and the predicted vocabulary entry introduction obtained based on the predicted entity, compared with the prior art in which the recognition is only carried out by the text to be recognized, the available feature vectors are obviously increased (the number of the feature vectors corresponds to the number of characters input into the entity prediction model, and after the predicted vocabulary entry and the predicted vocabulary entry introduction are increased, the number of the characters input into the entity prediction model is increased, so that the number of the available feature vectors is increased), and the increased feature vectors are obtained based on the predicted entity and have higher relevance with the entity in the text to be recognized, so that the capability of accurately recognizing the corresponding first potential entity and the first potential entity category from the text to be recognized is obviously improved.
And step S303, matching the text to be recognized with a knowledge base, and determining the alternative entries and the alternative entry blurb obtained by matching.
Specifically, the text to be recognized is divided into a plurality of words (vocabulary), each word is matched with the knowledge base, the entry corresponding to each word is determined and used as the alternative entry, and entry brief introduction corresponding to the alternative entry is the alternative entry brief introduction.
And S304, filtering the alternative entries based on the number of the characters of the alternative entries.
Specifically, since the words obtained by direct splitting may include non-entity parts such as conjunctions and dummy words, these non-entity words and corresponding candidate entries need to be filtered, wherein the preliminary filtering may be performed by filtering the word number of the candidate entries. For example, candidate entries with a word number less than 2 are filtered out, because the number of common entities is at least two words in most cases.
Step S305, performing word segmentation processing on the text to be recognized based on the word segmentation algorithm, and filtering alternative entries different from entity results obtained by the word segmentation processing.
Specifically, word segmentation processing is performed on the text to be recognized through a word segmentation algorithm, so that entity words and non-entity words in the text to be recognized can be obtained generally, if the alternative vocabulary entry obtained based on splitting and matching does not contain an alternative vocabulary entry having the same name as the entity word obtained through word segmentation, the situation that the alternative vocabulary entry is not split properly needs to be split again is indicated, and the words after being split again are matched with the knowledge base until the obtained alternative vocabulary entry and the words obtained through word segmentation have the same name.
In an exemplary embodiment of the present disclosure, if the method for splitting the text to be recognized in step S303 is a word segmentation algorithm, this step may perform comparison through another word segmentation algorithm different from the word segmentation algorithm used in this step. If the forward maximum matching algorithm and the reverse maximum matching algorithm are respectively adopted for word segmentation.
This step and step S304 are optional steps parallel to each other, and those skilled in the art can select any step or two steps to be executed together according to the requirement, so as to achieve the effect of filtering the alternative terms.
And S306, taking the filtered alternative vocabulary entry as an entity vocabulary entry corresponding to the text to be recognized, and taking the alternative vocabulary entry brief introduction corresponding to the filtered alternative vocabulary entry as an entity vocabulary entry brief introduction.
Specifically, the candidate entries are filtered, and entries corresponding to non-entities in the candidate entries can be removed, so that the candidate entries are ensured to be entity entries corresponding to the text to be recognized.
Step S307, based on the entity prediction result, the text to be recognized, the entity entry and the entity entry brief introduction, the error correction operation for the entity prediction result is determined.
Specifically, the content of this step is the same as that of step S203 in the embodiment shown in fig. 2, and is not repeated here.
According to the error correction method for the entity recognition result, the entity prediction result corresponding to the text to be recognized is obtained in a mode of manual prediction or an entity prediction model; then, determining alternative entries corresponding to the text to be recognized in a corresponding knowledge base, and filtering the alternative entries to obtain entity entries and entity entry introduction corresponding to the text to be recognized; and finally, determining error correction operation on the entity prediction result based on the entity prediction result, the text to be recognized, the entity entries and the entity entry introduction. Therefore, the entity prediction result can be obtained in different modes, the accuracy of the obtained result is ensured when the entity prediction result is obtained through the entity prediction model, meanwhile, the candidate entries are determined by corresponding the text to be recognized with the knowledge base, and then the candidate entries are filtered, so that the entries determined through the text to be recognized are effectively ensured to be the corresponding entity entries, the accuracy and reliability of the entity prediction result and the entity entries and the entity entry brief introduction which are used as reference bases during error correction operation are improved, and the accuracy and reliability of the error correction result are improved.
Fig. 4 is a flowchart of an error correction method for entity identification results according to an embodiment of the present disclosure. As shown in fig. 4, the error correction method for entity identification result provided in this embodiment includes the following steps:
step S401, an entity prediction result corresponding to the text to be recognized is obtained.
Step S402, determining entity entries corresponding to the texts to be recognized in the corresponding knowledge bases.
Specifically, steps S401 to S402 are the same as steps S201 to S202 in the embodiment shown in fig. 2, and are not repeated herein.
Step S403, if the entity prediction result includes the first potential entity and the first potential entity type, and the first confidence score exceeds the score threshold, the first potential entity and the first potential entity type included in the entity prediction result are used as the final entity and the final entity type.
Specifically, the error correction operation on the entity prediction result is mainly determined according to two aspects, namely whether the entity prediction result comprises the first potential entity or not, and the first confidence score.
If the entity prediction result does not contain an entity or contains an entity, but the first confidence score is low and may represent that the recognition result of the entity prediction model is erroneous, at this time, the corresponding error correction operation needs to input the text to be recognized, the entity entry and the entity entry introduction into the entity recognition model, and determine again whether the entity exists in the text to be recognized.
If the entity prediction result contains an entity and the first confidence score is higher (higher than the score threshold), the entity prediction result is represented to have higher reliability and credibility, and at this time, the first potential entity and the first potential entity category of the entity prediction result can be directly used as the final entity and the final entity category without further error correction processing.
Step S404, if the entity prediction result is that the text to be recognized does not include an entity, or the entity prediction result includes a first potential entity and a first potential entity category, but the first confidence score does not exceed the threshold, inputting the entity entry, the text to be recognized, and the entity entry brief description into the entity recognition model, so as to obtain an entity recognition result of the entity recognition model for the text to be recognized.
The entity recognition result comprises a second potential entity corresponding to the entity entry, a second potential entity category corresponding to the second potential entity, and a second confidence score.
Specifically, the entity entry, the text to be recognized, and the entity entry introduction are input into the entity recognition model, that is, the reliability of the entity prediction result is insufficient, and the entity of the text to be recognized is determined again directly through the entity recognition model (referring to the embodiment shown in fig. 3, the entity prediction result may be a result obtained by performing two times of recognition on the entity prediction model, and then through the entity prediction model, it is difficult to obtain a result with higher accuracy and reliability, and therefore, the model to be recognized needs to be replaced).
The specific method for obtaining the entity identification result through the entity identification model may be as follows:
the text to be recognized, the entity entry and the entity entry brief introduction are spliced together in a fixed sequence (for example, the text to be recognized, the first entry brief introduction and the entity entry are fixed, and the main purpose is to determine whether the entity corresponding to the entity entry is correct) and then input into the entity recognition model.
In an exemplary embodiment of the disclosure, the entity recognition model includes a second encoder for recognizing and encoding based on the entity term, the text to be recognized, and the entity term profile, and a second decoder for determining a second potential entity, a second potential entity category, and a second confidence score in the text to be recognized based on output results of the second encoder.
Specifically, each character in the text to be recognized input into the entity recognition model includes a label (e.g., a character category label), and the entity entry introduction do not include a label (although no label is included, information of the entity entry and the entity entry introduction may be provided to the entity recognition model to assist in recognizing the entity in the text to be recognized, only the entity recognition model does not need to recognize the information), so that the entity recognition model may determine only a second potential entity and a second potential entity category corresponding to the part including the label, and calculate a corresponding second confidence score (the method for calculating the second confidence score may refer to the embodiment shown in fig. 2).
In an exemplary embodiment of the present disclosure, the entity entry and the entity entry introduction may also be labeled separately (in this case, the labeling is different from the labeling only used for the text to be recognized in terms of type and purpose, but is only used for distinguishing the text to be recognized from the entity entry and the entity entry introduction), so as to indicate that the target entity does not need to be determined for the content, and in this case, the entity recognition model only determines the corresponding second potential entity and the second potential entity category that do not include the labeled part.
In an exemplary embodiment of the present disclosure, the text to be recognized and the entity entry introduction may also respectively adopt different labels to distinguish (the label at this time is different from the label type only used for the text to be recognized and is different only for the purpose of distinguishing the text to be recognized and the entity entry introduction), and at this time, the entity recognition model only determines the second potential entity and the second potential entity category corresponding to the part of the content of the text to be recognized represented by the label.
Step S405, in response to the second confidence score being higher than the corresponding score threshold, determining the second potential entity as the final entity, and determining a second potential entity category of the corresponding second potential entity as the final entity category.
Specifically, if the second confidence score output by the entity recognition model is higher, the second potential entity and the second potential entity category output by the entity recognition model have higher reliability and accuracy, so the corresponding error correction operation is as follows: and directly outputting the second potential entity and the second potential entity category as an end entity and an end entity category.
Step S406, if the second confidence score does not exceed the score threshold, determining that no entity exists in the text to be recognized.
Specifically, if the second confidence score output by the entity recognition model and the first confidence score output by the entity prediction model are both low, which means that the entity existing in the text to be recognized cannot be found after multiple recognition by two different recognition models, the entity existing in the text to be recognized can be directly determined, instead of outputting the entity with the low confidence score and the entity type, because the recognition result of the entity is likely to be wrong.
According to the error correction method for the entity recognition result of the embodiment of the disclosure, after the entity prediction result corresponding to the text to be recognized is obtained, and the entity vocabulary entry introduction corresponding to the text to be recognized are determined, whether re-recognition is carried out through the entity recognition model, the entity vocabulary entry introduction and the text to be recognized is determined according to whether the entity prediction result contains the first potential entity and the first confidence score, and whether the second potential entity is used as a final entity is determined according to the second confidence score output by the entity recognition model, or whether the text to be recognized does not contain the entity is determined. Therefore, different error correction operations can be adopted according to the entity prediction result, the accuracy and the reliability of the final entity obtained after the error correction operation are ensured to the maximum extent, or the text to be recognized is directly determined not to contain the entity, so that the accuracy and the reliability of the recognition result are effectively ensured.
Fig. 5 is a flowchart of a method for training an entity prediction model according to an embodiment of the present disclosure. The entity prediction model training method is applied to the embodiments shown in fig. 2 to 4. As shown in fig. 5, the entity recognition model training method provided in this embodiment includes the following steps:
step S501, determining corresponding entries and entry blurb of the training text in the knowledge base.
Wherein, the training text is marked with a character type label.
Specifically, the training text used for training the entity prediction model is a text labeled with a character type label in advance.
The character category label is a label for respectively marking the category of each character in the training text, wherein the category comprises an entity/non-entity, a first character/non-first character of the entity and an entity category.
Illustratively, the training text is "chocolate good eating", wherein "chocolate" is an entity, the entity category is food, and "true good eating" is non-entity, and thus, the word "chocolate" may be added with the entity first character and the entity category is a character category label for food (e.g., B-food, wherein B represents the entity first character and-food represents the entity category is food), both "gram" and "strength" may be added with the entity non-first character and the entity category is a character category label for food (e.g., I-food, wherein I represents the entity non-first character), and then "true", "good", "eating" may be added with the non-entity label (e.g., O, for representing non-entity). Then there are: chocolate (I-food) chocolate (I) food true (O) good (O) eat (O).
The training text may select a text to which a character category label has been added, or select a text that does not include a character category label, and then manually add a character category label, or select a text to which an entity has been identified but a character category label has not been added, and then automatically add a character category label based on the identification result (the automatic addition of a character category label may be implemented based on an existing algorithm, and is not described herein any more since it is not a protection content of the present scheme).
After the training text is obtained, the corresponding entries and entry blurbs of the training text in the knowledge base need to be determined.
The specific steps of determining the corresponding entries and entry blurbs in the knowledge base through the training text may refer to the embodiments shown in fig. 2 and 3, and are not described herein again.
Step S502, inputting the training texts and the corresponding entries and entry blurbs of the training texts in the knowledge base into an entity prediction model for training, and outputting a first training entity, a first training entity category and a first training confidence score contained in the training texts.
Specifically, the entity prediction model may not only directly primarily identify the entity and the entity category included in the text to be identified, but also determine the entity and the entity category in the text to be identified as the entity prediction result by combining the input text to be identified, the vocabulary entry and the vocabulary entry introduction.
Because the text to be recognized in the training text input into the entity prediction model contains the character category labels, and the vocabulary entry introduction in the training text do not contain the character category labels, the encoder of the entity prediction model encodes all the contents input into the entity prediction model to obtain the feature vectors, but the decoder of the entity prediction model only calculates the evaluation scores of all the characters in the text to be recognized based on the text to be recognized containing the character category labels (the evaluation scores are determined based on all the feature vectors together), and then determines the entities in the text to be recognized according to the evaluation scores. And then, the evaluation scores of each character of the entity are averaged to obtain a first training confidence score corresponding to the first training entity. Thus, the entity prediction model is able to determine only the first training entity in the text to be recognized, and not the entities in the terms and term profiles.
According to the entity prediction model training method of the embodiment of the disclosure, the corresponding vocabulary entry and vocabulary entry brief introduction of the training text in the knowledge base are determined, then the training text and the corresponding vocabulary entry and vocabulary entry brief introduction of the training text in the knowledge base are input into the entity recognition model for training, and the first training entity contained in the training text and the first training entity class corresponding to the first training entity are output, so that the entity recognition model can recognize the first training entity and the first training entity class in the training text according to the training text, the vocabulary entry and the vocabulary entry brief introduction, and calculate the corresponding first training confidence score, thereby remarkably improving the accuracy of the entity prediction model recognition.
Fig. 6 is a flowchart of a method for training an entity prediction model according to an embodiment of the present disclosure. As shown in fig. 6, the entity prediction model training method provided in this embodiment includes the following steps:
step S601, determining the entries in the knowledge base with the same name as the entities in the training texts as corresponding entries.
Wherein, the knowledge base stores the vocabulary entry, the vocabulary entry brief introduction and the vocabulary entry hot degree value in a triple mode.
Step S602, in response to the fact that the entries with the same name as the entity in the training text are not unique, uniquely determining the corresponding entries and entry blurb of the corresponding entries based on the entry heat value of each corresponding entry with the same name.
The entry with the highest entry hot value corresponding to each entry with the same name is uniquely determined as the corresponding entry and the entry introduction of the corresponding entry.
Specifically, the determination manner of the entity in the training text may refer to the corresponding description in the embodiment of fig. 6; the method for determining the corresponding entries and entry blurbs of the entities in the training text through the knowledge base may refer to the corresponding contents in the embodiment shown in fig. 3, which are not repeated herein.
Step S603, inputting the training text and the corresponding vocabulary entry and vocabulary entry brief introduction of the training text in the knowledge base into an entity prediction model for training, and outputting a first training entity, a first training entity category and a first training confidence score contained in the training text.
Specifically, the training of the entity prediction model through the training text, the vocabulary entry and the vocabulary entry introduction may refer to the corresponding description in the embodiment shown in fig. 5, and will not be described herein again.
According to the entity prediction model training method of the embodiment of the disclosure, the corresponding entries and entry blurbs in the training text in the knowledge base are determined, and then the training text, the entries and the entry blurbs are input into the entity recognition model for training, so that the entity prediction model is trained after the training text is combined with the entries and the entry blurbs, and the accuracy and reliability of the entity prediction model for recognizing the entities in the text to be recognized based on the entries and the entry blurbs are effectively ensured.
Fig. 7 is a flowchart of an entity recognition model training method according to an embodiment of the present disclosure. The entity recognition model training method is applied to the embodiments shown in fig. 2 to 4. As shown in fig. 7, the entity recognition model training method provided in this embodiment includes the following steps:
step S701, determining corresponding entries and entry blurbs of the training texts in a knowledge base.
Wherein, the training text is marked with character category labels.
Step S702, inputting the training text and the corresponding vocabulary entry and vocabulary entry brief introduction of the training text in the knowledge base into the entity recognition model for training, and outputting a second training entity, a second training entity category and a second training confidence score contained in the training text.
Wherein the character category label includes: the first character and entity category label of the entity; a non-initial character and an entity category label of the entity; a non-entity tag.
Specifically, the training of the entity recognition model is the same as the training of the entity prediction model, and reference is made to the embodiments shown in fig. 5 and fig. 6, which is not repeated herein.
According to the entity recognition model training method, the training text is input into the entity recognition model for training, and a second training entity category and a second training confidence score of a second training entity contained in the training text are output. Therefore, the entity recognition model can be focused on the tasks of entity and entity type recognition, and the validity and reliability of the recognition result are ensured.
Exemplary Medium
Having described the method of the exemplary embodiment of the present disclosure, next, a storage medium of the exemplary embodiment of the present disclosure will be described with reference to fig. 8.
Referring to fig. 8, a storage medium 80 stores therein a program product for implementing the above method according to an embodiment of the present disclosure, which may employ a portable compact disc read only memory (CD-ROM) and includes computer-executable instructions for causing a computing device to perform the method for error correction of entity recognition results provided by the present disclosure. However, the program product of the present disclosure is not limited thereto.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A readable signal medium may include a propagated data signal with computer-executable instructions embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. The readable signal medium may also be any readable medium other than a readable storage medium.
Computer-executable instructions for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer executable instructions may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN).
Exemplary devices
After introducing the medium of the exemplary embodiment of the present disclosure, an error correction device of the entity identification result of the exemplary embodiment of the present disclosure is described below with reference to fig. 9, which is used to implement the error correction method of the entity identification result in any one of the method embodiments described above, and an entity identification model training device of the exemplary embodiment of the present disclosure is described below with reference to fig. 10, which is used to implement the entity identification model training method in any one of the method embodiments described above, and an entity prediction model training device of the exemplary embodiment of the present disclosure is described below with reference to fig. 11, which is used to implement the entity prediction model training method in any one of the method embodiments described above, and the implementation principle and technical effect thereof are similar to those of the embodiment of the corresponding method described above, and are not repeated herein.
The error correction apparatus 900 for entity identification results provided by the present disclosure includes:
an obtaining module 910, configured to obtain an entity prediction result corresponding to a text to be recognized;
an enhancement module 920, configured to determine an entity entry corresponding to the text to be recognized in a corresponding knowledge base, where the knowledge base further includes an entity entry introduction corresponding to the entity entry;
an error correction module 930 configured to determine an error correction operation for the entity prediction result based on the entity prediction result, the text to be recognized, the entity entry, and the entity entry introduction.
In an exemplary embodiment of the disclosure, the obtaining module 910 is specifically configured to: an entity prediction result is obtained through a manual prediction mode, and comprises a first potential entity, a first potential entity category corresponding to the first potential entity and a first confidence score.
In an exemplary embodiment of the disclosure, the obtaining module 910 is specifically configured to: the text to be recognized is input to a corresponding entity prediction model, and an entity prediction result is obtained based on an output result of the entity prediction model, wherein the entity prediction result comprises a first potential entity, a first potential entity category corresponding to the first potential entity, and a first confidence score.
In an exemplary embodiment of the disclosure, the entity prediction model includes a first encoder for identifying and encoding text to be identified and a first decoder for determining a first potential entity in the text to be identified, a first potential entity category of the corresponding first potential entity and a first confidence score based on an output result of the first encoder.
In an exemplary embodiment of the disclosure, the obtaining module 910 is specifically configured to: inputting a text to be recognized into an entity prediction model, and taking an output result of the entity prediction model as a prediction entity and a prediction entity category corresponding to the prediction entity; determining a preparation entry and a preparation entry brief introduction corresponding to the predicted entity in a knowledge base; splicing the prepared entry, the text to be identified and the prepared entry brief introduction to obtain an enhanced text; the method includes inputting the enhanced text into an entity prediction model, and using an output of the entity prediction model as an entity prediction result, the entity prediction result including a first potential entity, a first potential entity category corresponding to the first potential entity, and a first confidence score.
In an exemplary embodiment of the disclosure, the obtaining module 910 is specifically configured to: storing the vocabulary entry, vocabulary entry brief introduction corresponding to the vocabulary entry and vocabulary entry heat value in a triple mode in response to a knowledge base, and determining the vocabulary entry with the same name as the predicted entity in the knowledge base as a prepared vocabulary entry; in response to being non-unique to the predicted entity homonym, a preliminary entry is uniquely determined based on a respective entry heating value for each homonym.
In an exemplary embodiment of the disclosure, the obtaining module 910 is specifically configured to: and uniquely determining the entry with the highest entry heat value corresponding to each entry with the same name as a prepared entry.
In an exemplary embodiment of the disclosure, the obtaining module 910 is further configured to: and if the preparation entries corresponding to the predicted entity and the predicted entity do not exist in the knowledge base, removing the predicted entity and the predicted entity category.
In an exemplary embodiment of the disclosure, the enhancing module 920 is specifically configured to: matching the text to be recognized with a knowledge base, and determining alternative entries and alternative entry blurbs obtained by matching; filtering the alternative entries based on the number of the characters of the alternative entries; and taking the filtered alternative vocabulary entry as an entity vocabulary entry corresponding to the text to be recognized, and taking the alternative vocabulary entry brief introduction corresponding to the filtered alternative vocabulary entry as the entity vocabulary entry brief introduction.
In an exemplary embodiment of the disclosure, the enhancing module 920 is specifically configured to: matching the text to be recognized with a knowledge base, and determining alternative entries and alternative entry introduction obtained through matching; performing word segmentation processing on the text to be recognized based on a word segmentation algorithm, and filtering alternative entries with different entity results obtained by the word segmentation processing; and taking the filtered alternative entries as entity entries corresponding to the texts to be recognized, and taking alternative entry blurs corresponding to the filtered alternative entries as entity entry blurs.
In an exemplary embodiment of the disclosure, the error correction module 930 is specifically configured to: and if the entity prediction result comprises the first potential entity and the first potential entity type and the first confidence score exceeds a score threshold, taking the first potential entity and the first potential entity type contained in the entity prediction result as an end entity and an end entity type.
In an exemplary embodiment of the disclosure, the error correction module 930 is specifically configured to: if the entity prediction result is that the text to be recognized does not contain an entity, or the entity prediction result contains a first potential entity and a first potential entity category but the first confidence score does not exceed the threshold, inputting the entity entry, the text to be recognized and the entity entry introduction into an entity recognition model to obtain an entity recognition result of the entity recognition model for the text to be recognized, wherein the entity recognition result comprises a second potential entity corresponding to the entity entry, a second potential entity category corresponding to the second potential entity and a second confidence score; in response to the second confidence score being above the respective score threshold, determining the second potential entity as the final entity and determining a second potential entity category for the respective second potential entity as the final entity category.
In an exemplary embodiment of the disclosure, the error correction module 930 is further configured to: and inputting the entity entry, the text to be recognized and the entity entry brief introduction into the entity recognition model to obtain an entity recognition result of the entity recognition model for the text to be recognized, and determining that no entity exists in the text to be recognized if the second confidence score does not exceed the score threshold.
In an exemplary embodiment of the disclosure, the entity recognition model includes a second encoder for recognizing and encoding based on the entity entry, the text to be recognized, and the entity entry introduction, and a second decoder for determining a second potential entity, a second potential entity category, and a second confidence score in the text to be recognized based on an output of the second encoder.
In an exemplary embodiment of the disclosure, the obtaining module 910 is specifically configured to: the entity prediction model is obtained by training in the following way: determining corresponding entries and entry blurbs of training texts in a knowledge base, wherein the training texts are marked with character type labels; inputting a training text and entries and entry blubs of the training text corresponding to the entries and the entry blubs in a knowledge base into an entity prediction model for training, and outputting a first training entity, a first training entity category and a first training confidence score contained in the training text, wherein the character category label comprises: the first character of the entity and the entity category label; a non-initial character and an entity category label of the entity; a non-entity tag.
In an exemplary embodiment of the disclosure, the error correction module 930 is specifically configured to: the entity recognition model is obtained through training in the following mode: determining corresponding entries and entry blurbs of training texts in a knowledge base, wherein the training texts are marked with character type labels; inputting the training text and entries and entry blubs of the training text corresponding to the training text in a knowledge base into an entity recognition model for training, and outputting a second training entity, a second training entity category and a second training confidence score contained in the training text, wherein the character category label comprises: the first character and entity category label of the entity; a non-initial character and an entity category label of the entity; a non-entity tag.
The entity prediction model training device 1000 provided by the present disclosure includes:
a determining module 1010, configured to determine corresponding entries and entry blurbs of the training texts in the knowledge base, where the training texts are labeled with character category labels;
a training module 1020, configured to input the training text and the corresponding entries and entry blurbs of the training text in the knowledge base into the entity prediction model for training, output a first training entity, a first training entity category and a first training confidence score included in the training text,
the character category labels include:
the first character of the entity and the entity category label;
a non-initial character and an entity category label of the entity;
a non-entity tag.
In an exemplary embodiment of the disclosure, the determining module 1010 is specifically configured to: in response to the fact that the vocabulary entries, the vocabulary entry introduction and the vocabulary entry hot degree values are stored in the knowledge base in a triple mode, determining the vocabulary entries with the same names as the entities in the training texts in the knowledge base as corresponding vocabulary entries; and in response to the fact that the entries with the same names as the entities in the training text are not unique, uniquely determining the corresponding entries based on the entry hot degree values of the corresponding entries with the same names.
In an exemplary embodiment of the disclosure, the determining module 1010 is specifically configured to: and uniquely determining the entry with the highest entry heat value corresponding to each entry with the same name as the corresponding entry.
The entity recognition model training device 1100 provided by the present disclosure includes:
a determining module 1110, configured to determine corresponding entries and entry blurbs of training texts in a knowledge base, where the training texts are labeled with character category labels;
a training module 1120, configured to input the training text and training texts of the training texts corresponding to the entries and entry blurs in the knowledge base into the entity recognition model for training, output a second training entity, a second training entity category and a second training confidence score included in the training text,
the character category label includes:
the first character and entity category label of the entity;
a non-initial character and an entity category label of the entity;
a non-entity tag.
Exemplary computing device
Having described the methods, media, and apparatus of the exemplary embodiments of the present disclosure, a computing device of the exemplary embodiments of the present disclosure is next described with reference to fig. 12.
The computing device 1200 shown in fig. 12 is only one example and should not impose any limitations on the functionality or scope of use of embodiments of the disclosure.
As shown in fig. 8, computing device 1200 is represented in the form of a general purpose computing device. Components of computing device 1200 may include, but are not limited to: at least one processing unit 1201, at least one memory unit 1202, and a bus 1203 connecting the various system components including the processing unit 1201 and the memory unit 1202. Wherein computer-executable instructions are stored in the at least one memory unit 1202; the at least one processing unit 1201 includes a processor that executes the computer-executable instructions to implement the methods described above.
The bus 1203 includes a data bus, a control bus, and an address bus.
The storage unit 1202 may include readable media in the form of volatile memory, such as Random Access Memory (RAM) 12021 and/or cache memory 12022, and may further include readable media in the form of non-volatile memory, such as Read Only Memory (ROM) 12023.
The storage unit 1202 may also include a program having a set (at least one) of program modules 12024, such program modules 12024 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may comprise an implementation of a network environment.
The computing device 1200 may also communicate with one or more external devices 1204 (e.g., keyboard, pointing device, etc.). Such communication may occur via input/output (I/O) interfaces 1205. Moreover, computing device 1200 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) through network adapter 1206. As shown in FIG. 12, a network adapter 1206 communicates with the other modules of the computing device 1200 via a bus 1203. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computing device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
It should be noted that although in the above detailed description several units/modules or sub-units/modules of the error correction means of the entity recognition result are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module, in accordance with embodiments of the present disclosure. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Further, while the operations of the disclosed methods are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
While the spirit and principles of the present disclosure have been described with reference to several particular embodiments, it is to be understood that the present disclosure is not limited to the particular embodiments disclosed, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (10)

1. An error correction method for entity recognition results, comprising:
acquiring an entity prediction result corresponding to a text to be recognized;
determining an entity entry corresponding to the text to be recognized in a corresponding knowledge base, wherein the knowledge base also comprises an entity entry introduction corresponding to the entity entry;
and determining error correction operation for the entity prediction result based on the entity prediction result, the text to be recognized, the entity entry and the entity entry brief introduction.
2. The method for correcting the entity recognition result according to claim 1, wherein the obtaining the entity prediction result corresponding to the text to be recognized comprises:
the entity prediction result is obtained through a manual prediction mode, and comprises a first potential entity, a first potential entity category corresponding to the first potential entity, and a first confidence score.
3. The method for correcting the entity recognition result according to claim 1, wherein the obtaining the entity prediction result corresponding to the text to be recognized comprises:
the method comprises the steps of inputting texts to be recognized into corresponding entity prediction models, and obtaining entity prediction results based on output results of the entity prediction models, wherein the entity prediction results comprise a first potential entity, a first potential entity category corresponding to the first potential entity, and a first confidence score.
4. The method of claim 3, wherein the entity prediction model comprises a first encoder and a first decoder, the first encoder is configured to identify and encode the text to be identified, and the first decoder is configured to determine the first potential entity in the text to be identified, the first potential entity class and the first confidence score of the corresponding first potential entity based on the output of the first encoder.
5. The method for correcting the entity recognition result according to claim 3, wherein the inputting the text to be recognized into the corresponding entity prediction model, and obtaining the entity prediction result based on the output result of the entity prediction model comprises:
inputting a text to be recognized into the entity prediction model, and taking an output result of the entity prediction model as a prediction entity and a prediction entity category corresponding to the prediction entity;
determining a preliminary vocabulary entry and a preliminary vocabulary entry introduction corresponding to the predicted entity in the knowledge base;
splicing the prepared entry, the text to be recognized and the prepared entry brief introduction to obtain an enhanced text;
inputting the enhanced text into the entity prediction model, taking an output of the entity prediction model as the entity prediction result, the entity prediction result including a first potential entity, a first potential entity category corresponding to the first potential entity, and a first confidence score.
6. A method for training an entity prediction model is characterized by comprising the following steps:
determining corresponding entries and entry blurbs of training texts in a knowledge base, wherein the training texts are labeled with character type labels;
inputting the training texts and the corresponding entries and entry blubs of the training texts in a knowledge base into the entity prediction model for training, outputting a first training entity, a first training entity category and a first training confidence score contained in the training texts,
the character category label includes:
the first character of the entity and the entity category label;
a non-initial character and an entity category label of the entity;
a non-entity tag.
7. An entity recognition model training method is characterized by comprising the following steps:
determining corresponding entries and entry brief introduction of training texts in a knowledge base, wherein the training texts are labeled with character category labels;
inputting the training texts and training texts of entries and entry blubs corresponding to the training texts in a knowledge base into the entity recognition model for training, and outputting a second training entity, a second training entity category and a second training confidence score contained in the training texts,
the character category label includes:
the first character and entity category label of the entity;
a non-initial character and an entity category label of the entity;
a non-entity tag.
8. A computer-readable storage medium, comprising: the computer-readable storage medium has stored therein computer-executable instructions for implementing an error correction method of an entity identification result according to any one of claims 1 to 5 when executed by a processor; and/or, the computer executable instructions when executed by a processor are for implementing the entity prediction model training method of claim 6; and/or the computer executable instructions when executed by a processor are for implementing the entity recognition model training method of claim 7.
9. An error correction apparatus for entity recognition results, comprising the steps of:
the acquisition module is used for acquiring an entity prediction result corresponding to the text to be recognized;
the enhancement module is used for determining an entity entry corresponding to the text to be recognized in a corresponding knowledge base, and the knowledge base also comprises an entity entry brief introduction corresponding to the entity entry;
and the error correction module is used for determining error correction operation on the entity prediction result based on the entity prediction result, the text to be recognized, the entity entry and the entity entry brief introduction.
10. A computing device, comprising: at least one processor;
and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to cause the computing device to perform a method of error correction of entity identification results as claimed in any one of claims 1 to 5; and/or to cause a computing device to perform the entity prediction model training method of claim 6; and/or to cause a computing device to perform the entity recognition model training method of claim 7.
CN202210848661.4A 2022-07-19 2022-07-19 Error correction method, medium, device and computing equipment for entity recognition result Pending CN115238680A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210848661.4A CN115238680A (en) 2022-07-19 2022-07-19 Error correction method, medium, device and computing equipment for entity recognition result

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210848661.4A CN115238680A (en) 2022-07-19 2022-07-19 Error correction method, medium, device and computing equipment for entity recognition result

Publications (1)

Publication Number Publication Date
CN115238680A true CN115238680A (en) 2022-10-25

Family

ID=83673887

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210848661.4A Pending CN115238680A (en) 2022-07-19 2022-07-19 Error correction method, medium, device and computing equipment for entity recognition result

Country Status (1)

Country Link
CN (1) CN115238680A (en)

Similar Documents

Publication Publication Date Title
US10657325B2 (en) Method for parsing query based on artificial intelligence and computer device
US8606559B2 (en) Method and apparatus for detecting errors in machine translation using parallel corpus
CN111339283B (en) Method and device for providing customer service answers aiming at user questions
US11222053B2 (en) Searching multilingual documents based on document structure extraction
US9928269B2 (en) Apply corrections to an ingested corpus
CN109241319B (en) Picture retrieval method, device, server and storage medium
US11907671B2 (en) Role labeling method, electronic device and storage medium
WO2017161899A1 (en) Text processing method, device, and computing apparatus
US11699034B2 (en) Hybrid artificial intelligence system for semi-automatic patent infringement analysis
CN111597800B (en) Method, device, equipment and storage medium for obtaining synonyms
CN113626573B (en) Sales session objection and response extraction method and system
US20190243895A1 (en) Contextual Analogy Representation
KR101507637B1 (en) Device and method for supporting detection of mistranslation
CN113806482A (en) Cross-modal retrieval method and device for video text, storage medium and equipment
US8219905B2 (en) Automatically detecting keyboard layout in order to improve the quality of spelling suggestions
US10133736B2 (en) Contextual analogy resolution
US20180137099A1 (en) Multilingual Analogy Detection and Resolution
CN109408175B (en) Real-time interaction method and system in general high-performance deep learning calculation engine
US20050086214A1 (en) Computer system and method for multilingual associative searching
US20180137102A1 (en) Multilingual Idiomatic Phrase Translation
CN115150354B (en) Method and device for generating domain name, storage medium and electronic equipment
RU2693328C2 (en) Methods and systems for generating a replacement request for a user input request
CN115238680A (en) Error correction method, medium, device and computing equipment for entity recognition result
CN111626059B (en) Information processing method and device
CN114860870A (en) Text error correction method and device

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