CN114860878A - Entity chain finger method, device, electronic device and storage medium - Google Patents

Entity chain finger method, device, electronic device and storage medium Download PDF

Info

Publication number
CN114860878A
CN114860878A CN202210494352.1A CN202210494352A CN114860878A CN 114860878 A CN114860878 A CN 114860878A CN 202210494352 A CN202210494352 A CN 202210494352A CN 114860878 A CN114860878 A CN 114860878A
Authority
CN
China
Prior art keywords
entity
chain
finger
chain finger
entity chain
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
CN202210494352.1A
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.)
Beijing Minglue Zhaohui Technology Co Ltd
Original Assignee
Beijing Minglue Zhaohui Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Minglue Zhaohui Technology Co Ltd filed Critical Beijing Minglue Zhaohui Technology Co Ltd
Priority to CN202210494352.1A priority Critical patent/CN114860878A/en
Publication of CN114860878A publication Critical patent/CN114860878A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Databases & Information Systems (AREA)
  • Machine Translation (AREA)

Abstract

The application relates to a method, a device, an electronic device and a storage medium for entity chain finger, wherein the method comprises the following steps: acquiring a first text, and determining a first entity to be chain-pointed in the first text; recalling a plurality of first entity chain fingers corresponding to the first entity from a preset entity library; inputting entity information corresponding to each first entity into a well-trained entity chain finger prediction model to obtain a second entity chain finger corresponding to the first entity, wherein the entity chain finger prediction model is trained based on a fully-connected neural network and is trained to obtain an entity chain finger of an entity corresponding to the entity information according to the input entity information; according to the method and the device for searching the entity chain fingers, the entity chain finger result is determined according to the similarity between the second entity chain finger and the plurality of first entity chain fingers, and through the method and the device for searching the entity chain finger result, the problem that the entity chain finger effect is poor when the information or entities in the context are less in the related technology is solved, and the beneficial effects of reducing the searching space and improving the entity chain finger accuracy are achieved.

Description

Entity chain finger method, device, electronic device and storage medium
Technical Field
The present application relates to the field of natural language processing technologies, and in particular, to a method and an apparatus for entity chaining and an electronic apparatus and a storage medium.
Background
Entity Linking, also called entity Linking, is a new task of natural language processing, which is used to refer to the name links appearing in the article to the entities of the specified generation, i.e. to refer to the corresponding items of the object in the Knowledge Base (Knowledge Base).
In the entity chain indicating methods in the related art, the entity chain indicating method based on the word face and text Similarity calculates the Similarity between entities through indexes such as Edit Distance (Edit Distance), Dice coefficient (Dice coeffi-cient), Jaccard Similarity (Jaccard Similarity) and Cosine Similarity (Cosine Similarity), relative entropy or KL Divergence (Kullback-Leibler Divergence) and probability Model Similarity (Probalistic Model Similarity), but the entity chain indicating method based on the word face and text Similarity only does chain indicating based on the word face meaning; the entity chain indicating method based on the entity correlation degree is to compare the correlation degree of the entity and the candidate entity in the context, but the entity chain indicating method based on the entity correlation degree has poor effect when the information or the entity in the context is less.
Aiming at the problem that in the related art, when the information or entities in the context are less, the entity chain has poor effect, and no effective solution exists.
Disclosure of Invention
The application provides a method, a device, an electronic device and a storage medium for entity chain finger, which at least solve the problem of poor effect of entity chain finger when less information or entities exist in the context in the related art.
In a first aspect, the present application provides an entity chain finger method, including: acquiring a first text, and determining a first entity to be chain-pointed in the first text; recalling a first entity chain instruction set corresponding to the first entity from a preset entity library; inputting entity information corresponding to each first entity into a well-trained entity chain finger prediction model to obtain a second entity chain finger corresponding to the first entity, wherein the entity chain finger prediction model is trained based on a fully-connected neural network and is trained to obtain an entity chain finger of an entity corresponding to the entity information according to the input entity information; and determining the entity chain finger result according to the similarity between the second entity chain finger and each first entity chain finger in the first entity chain finger set.
In a second aspect, the present application provides an entity chain finger device, comprising:
the acquisition module is used for acquiring a first text and determining a first entity to be chained in the first text;
the recall module is used for recalling a first entity chain instruction set corresponding to the first entity from a preset entity library;
the processing module is used for inputting entity information corresponding to each first entity into a trained entity chain finger prediction model to obtain a second entity chain finger corresponding to the first entity, wherein the entity chain finger prediction model is trained on the basis of a fully-connected neural network and is trained to obtain an entity chain finger of an entity corresponding to the entity information according to the input entity information;
a determining module, configured to determine the entity chain finger result according to a similarity between the second entity chain finger and each first entity chain finger in the first entity chain finger set.
In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor configured to implement the steps of the method according to any of the embodiments of the first aspect when executing the program stored in the memory.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the entity chain finger method according to any one of the embodiments of the first aspect.
The method and the device can be applied to the field of natural language processing for entity identification and entity chain indication. According to the entity chain finger method, the entity chain finger device, the electronic device and the storage medium, the first text is obtained, and the first entity to be chain finger in the first text is determined; recalling a plurality of first entity chain fingers corresponding to the first entity from a preset entity library; inputting entity information corresponding to each first entity into a well-trained entity chain finger prediction model to obtain a second entity chain finger corresponding to the first entity, wherein the entity chain finger prediction model is trained based on a fully-connected neural network and is trained to obtain an entity chain finger of an entity corresponding to the entity information according to the input entity information; according to the similarity between the second entity chain finger and the plurality of first entity chain fingers, the entity chain finger result is determined, the problem that the entity chain finger effect is poor when the information or entities in the context are less in the related technology is solved, and the beneficial effects of reducing the search space and improving the entity chain finger accuracy are achieved.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of an entity chain instruction method according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a physical chain finger device according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Before describing the embodiments of the present application, the following description will be made of the related art means used by the entity chain instruction method of the embodiments of the present application and the problems in the related art.
In the related technology, the entity chain indicating method comprises an entity chain indicating method based on the similarity of a word and a text and an entity chain indicating method based on the correlation of the entity, wherein the corresponding method of the entity chain indicating based on the similarity of the word and the text is simple and has strong interpretability, but the corpus and the entity are not deeply mined, and only the chain indicating is removed based on the meaning of the word, so that the effect on complex knowledge entity chain indicating is not good; in the entity chain indicating method based on entity relevance, the probability that the candidate entity with high relevance to the context entity is the target entity is high, and the entity chain indicating effect can be better under the condition that enough entities exist in the context, but the entity chain indicating effect is not good when the number of the entities in the context is small.
The various techniques described herein may be used for tasks such as entity recognition and chain pointing in natural language understanding and natural language processing.
Fig. 1 is a schematic flowchart of an entity chain instruction method according to an embodiment of the present disclosure. As shown in fig. 1, an embodiment of the present application provides an entity chain finger method, which includes the following steps:
step S101, a first text is obtained, and a first entity to be chained in the first text is determined.
In this embodiment, the first text is a sentence or corpus that needs to indicate the corresponding related information of the entity in the knowledge base (e.g. the category of the entity, other attribute information of the entity, such as alias, brief description), for example: he has gone to city B, in which statement "B" is the entity that needs to indicate the corresponding relevant information in the knowledge base, i.e. the first entity; meanwhile, the first text is a text only marked with an entity, and the marked entity chain is required to be used for guiding corresponding related information in the knowledge base.
In this embodiment, the entity information related to the entity in the text content corresponding to the first text may be, for example: entity name, thereby determining the first entity.
Step S102, recalling a first entity chain instruction set corresponding to the first entity from a preset entity library.
In this embodiment, the preset entity library is a standard entity library, the standard entity library includes a standard entity (entity name), an entity type, and other attributes and attribute values (e.g., alias) of the entity, the entity type, the other attributes and attribute values of the entity form knowledge information of the standard entity, and the knowledge information is used as an entity chain finger of the entity.
In this embodiment, the first entity chain finger set recalled from the preset entity library is a standard entity in the standard entity library, and since the entity chain finger result corresponding to the standard entity is characterized by the corresponding knowledge information, the recall of the first entity chain finger set is correspondingly completed by recalling the corresponding standard entity set in the standard entity library; in this embodiment, when the standard entity corresponding to the first entity chain is recalled, if the name or alias of the entity in the standard entity library includes the entity name of the first entity in the first text, the entity is determined to be the entity to be recalled.
In this embodiment, the entity chain indication result of the first text is determined according to the data of the recalled corresponding standard entities, when there are a plurality of recalled corresponding standard entities, the entity chain indication is identified based on the standard entity corresponding to each first entity, when there is one recalled corresponding standard entity, the recalled standard entity corresponds to the entity chain indication result of the first text, and when there is no recalled standard entity, the first text is indicated as a blank entity.
Step S103, inputting entity information corresponding to each first entity into a trained entity chain finger prediction model to obtain a second entity chain finger corresponding to the first entity, wherein the entity chain finger prediction model is trained based on a fully-connected neural network and is trained to obtain an entity chain finger of an entity corresponding to the entity information according to the input entity information.
In this embodiment, an entity chain finger prediction model trained by a fully connected neural network (FC for short) is used to predict an entity chain finger, that is, an entity chain finger result corresponding to a first entity is predicted by an entity name corresponding to the first entity, and then, based on the predicted entity chain finger result, the entity chain finger corresponding to an entity in a standard entity library is screened, so as to determine the entity chain finger of the first entity; in the embodiment, a standard entity recalled from a standard entity library is used for neural network training, wherein FC is a most basic neural network structure, and each node except an input layer in the FC neural network is connected with all nodes in the previous layer.
Step S104, determining an entity chain finger result according to the similarity between the second entity chain finger and each first entity chain finger in the first entity chain finger set.
In this embodiment, the final purpose of the entity chain finger is to take the chain finger out of the standard entity in the standard entity library, so that the predicted entity chain finger result is used as a screening condition of the target entity chain finger in the entity chain finger result (candidate entity chain finger result) recalled from the standard entity library, that is, the target entity chain finger is determined based on the similarity between the second entity chain finger and the first entity chain finger, and the first entity chain finger with high similarity is selected as the entity chain finger result, so that the accuracy of the entity chain finger is improved.
Through the steps from S101 to S104, acquiring a first text and determining a first entity to be linked in the first text; recalling a plurality of first entity chain fingers corresponding to the first entity from a preset entity library; inputting entity information corresponding to each first entity into a well-trained entity chain finger prediction model to obtain a second entity chain finger corresponding to the first entity, wherein the entity chain finger prediction model is trained based on a fully-connected neural network and is trained to obtain an entity chain finger of an entity corresponding to the entity information according to the input entity information; according to the similarity between the second entity chain finger and the plurality of first entity chain fingers, the entity chain finger result is determined, the problem that the entity chain finger effect is poor when the information or entities in the context are less in the related technology is solved, and the beneficial effects of reducing the search space and improving the entity chain finger accuracy are achieved.
It should be noted that, in this embodiment, when performing entity chain pointing on an entity, the entity chain pointing is performed on the next entity after one entity completes the entity chain pointing; of course, in entity recall, then all entities of the text can be recalled to the standard entity, and the corresponding entity chain assignments.
In some embodiments, the determining the entity link result in step S104 according to the similarity between the second entity chain finger and each first entity chain finger in the first entity chain finger set may be implemented by:
and step 21, calculating the similarity between the word vector corresponding to each first entity chain finger and the word vector corresponding to the second entity chain finger.
In this embodiment, the similarity based on the word vector is used to determine the corresponding target entity chain finger, that is, the corresponding first entity chain finger is selected according to the second entity chain finger.
In some optional embodiments, the word vector corresponding to the first entity chain finger includes an average word vector corresponding to all words of the first entity chain finger, and the word vector corresponding to the second entity chain finger includes an average word vector corresponding to all words of the second entity chain finger, where the word vector of the entity chain finger is generated by processing the corresponding entity chain finger through the bidirectional attention neural network model Bert.
In this embodiment, a Bidirectional attention neural network model (Bert) is adopted to process a first entity chain finger and a second entity chain finger, and word vectors corresponding to the first entity chain finger and the second entity chain finger are respectively generated, wherein the Bert model is a language representation model, and the Bert model aims to obtain semantic representation of a text containing rich semantic information of the text by using large-scale unmarked corpus training, and then the semantic representation of the text is finely adjusted in a specific natural language understanding NLP task and is finally applied to the NLP task; it should be understood that the Bert language model is a well-known semantic vector processing model, and the method or method corresponding to generating the corresponding word vector should be considered to be clear by processing the corresponding entity chain using the Bert language model.
In this embodiment, when word vectors corresponding to the first entity chain finger and the second entity chain finger are obtained respectively, the similarity of the corresponding word vectors may be calculated by using a known similarity calculation method, for example: euclidean distance, cosine similarity.
And step 22, selecting a third entity chain finger in the first entity chain finger set, and determining that the entity chain finger result comprises the third entity chain finger, wherein the third entity chain finger is the first entity chain finger with the maximum similarity with the word vector of the second entity chain finger.
In this embodiment, all the first entity chain fingers in the first entity chain finger set are sorted in the descending order of similarity of the word vectors with the second entity chain fingers (corresponding to sorting the recalled standard entities), and the first entity chain finger with the highest similarity is selected as the third entity chain finger and is used as the corresponding entity chain finger of the first entity, that is, the result of the entity chain finger of the first text includes the third entity chain finger.
Calculating the similarity between the word vector corresponding to each first entity chain finger and the word vector corresponding to the second entity chain finger through the steps; and selecting a third entity chain finger in the first entity chain finger set, determining that the entity chain finger result comprises the third entity chain finger, wherein the third entity chain finger is the first entity chain finger with the maximum word vector similarity with the second entity chain finger, and adopting the sequencing based on the word vector similarity as a strategy for selecting the chain finger to confirm the entity chain finger result and improve the accuracy of the entity chain finger.
In some embodiments, the recalling, from the preset entity library, the first entity chain instruction set corresponding to the first entity in step S102 may be implemented by:
step 31, obtaining a first entity parameter table corresponding to a preset entity library, wherein the first entity parameter table includes entity information, an entity chain finger, and correspondence information between the entity information and the entity chain finger.
In this embodiment, the first entity parameter table refers to a standard entity stored in the form of a parameter table, that is, a representation of a standard entity library, and by looking up a table, the entity name, the entity category, other attribute information, knowledge information, and the like of the corresponding standard entity can be queried.
And step 32, inquiring an entity chain finger corresponding to the entity information of the first entity in the first entity parameter table, wherein the first entity chain finger set comprises the entity chain finger corresponding to the entity information of the first entity.
In this embodiment, the entity information of the first entity is description information of the first entity, for example: the entity name, when querying the entity chain finger corresponding to the entity information of the first entity, traverses the first entity parameter table according to the corresponding entity information, and when the entity information corresponding to the first entity corresponds to or is associated with the entity (entity name), the name of the entity category, and the attribute value of the other attribute in the first entity parameter table, the corresponding entity is the entity to be recalled, for example: when the entity name a corresponding to the entity information of the first entity is matched with the name a' of the alias in the other attributes of the standard entity S in the first entity parameter table, the standard entity S is an entity to be recalled, and the entity chain finger corresponding to the standard entity S is a first entity chain finger.
Acquiring a first entity parameter table corresponding to a preset entity library in the steps, wherein the first entity parameter table comprises entity information, entity chain fingers and corresponding relation information between the entity information and the entity chain fingers; and querying an entity chain finger corresponding to the entity information of the first entity in the first entity parameter table, wherein the first entity chain finger set comprises the entity chain finger corresponding to the entity information of the first entity, so that the entity in the first text is recalled, candidate entity chain fingers of the entity chain fingers are obtained, and the efficiency of the entity recall and the entity chain fingers is improved by adopting a table look-up mode.
In some embodiments, the determining of the first entity to be indicated in the first text in step S101 is implemented by implementing the following steps: and detecting a first entity name in the first text, and determining a first entity to be chained according to the detected first entity name.
In the embodiment, the entity detection is completed by reading the entity name of the representation entity; in some alternative embodiments, the first entity may be determined by extracting words from the text content of the text and verifying the first entity name based on the extracted words.
In some embodiments, after recalling the first entity chain instruction set corresponding to the first entity from the preset entity library in step S102, the following steps are further performed:
and step 41, determining the number of the first entity chain fingers in the recalled first entity chain finger set.
In this embodiment, whether the corresponding standard entity can be recalled, that is, the entity chain finger corresponding to the recall, is related to the first entity in the first text, and specifically, is determined according to whether the first entity can be matched with the corresponding standard entity in a preset entity library (standard entity library), and whether the corresponding standard entity can be recalled, which also affects the result of the corresponding entity chain finger.
In the embodiment, the entity chain finger result is quickly confirmed by determining or counting the number of the recalled first entity chain fingers.
And 42, when the first entity chain finger set is determined to comprise a single first entity chain finger, determining that the entity chain finger result corresponding to the first text comprises the first entity chain finger.
In this embodiment, when only one first entity chain finger is recalled, that is, only one standard entity is recalled, the result of the corresponding entity chain finger is necessarily the standard entity and the entity chain finger corresponding to the standard entity.
And 43, when the first entity chain indication set is determined to be an empty set, determining that the entity chain indication result corresponding to the first text comprises that the first text is an empty entity.
In this embodiment, when the first entity chain finger is not recalled, that is, when a standard entity is not recalled, the corresponding entity chain finger result is empty, and the first text corresponds to an empty entity.
In this embodiment, when a plurality of standard entities are recalled, the selection step of the corresponding standard entity or entity chain is executed downwards, that is, the steps from step S103 to step S104 are continuously executed.
Through the steps, the result of the entity chain finger is quickly determined according to the recalled entity, the processing of invalid entity chain fingers is reduced, and the efficiency of the entity chain finger is further improved.
In some of these embodiments, the following steps are also performed: the entity chain refers to the training of a prediction model by the following steps:
and 51, acquiring text data corresponding to a second entity with entity chain fingers from a preset entity library, converting the text data according to a preset format, and inputting the converted text data into a Bert model to obtain a semantic vector corresponding to the text data.
In this embodiment, the data used for training is text data composed of all information of standard entities from a standard entity library; in this embodiment, before inputting data into the initial fully-connected neural network model, the corresponding text data is processed by using the Bert model, so that the text data needs to be converted according to the data format of the Bert model.
In this embodiment, the format converting the text data includes: adding a CLS mark in front of the text, wherein the CLS represents the classification of the corresponding entity; adding a start mark and an end mark for marking the entity position in the text before and after the entity name in the text, adding a sep mark for representing the entity chain finger at the tail of the text, and simultaneously adding knowledge information of a certain standard entity in a recalled standard entity set behind the sep mark, namely adding information for correspondingly describing the corresponding entity chain finger; in some optional embodiments, the knowledge information of a certain standard entity in the recalled standard entity set is added by first adding the name of the standard entity after the sep identifier, and then adding a character string composed of attributes and attribute values of the standard entity in the knowledge base after the name of the standard entity, where the form is "attribute 1: attribute value 1, attribute 2: and the attribute values 2, ", after the conversion according to the preset data format is completed, the corresponding semantic vector is obtained by processing through a Bert model.
Step 52, in the semantic vector, a first vector corresponding to the word for the second entity classification and a second vector corresponding to the entity chain of the second entity are obtained.
In this embodiment, in the semantic vector, the output vectors corresponding to the cls identifier, the start identifier, and the end identifier are obtained and spliced to form a first vector, and the output vectors corresponding to the sep identifier, the start identifier, and the end identifier are obtained and spliced to form a second vector.
And 53, inputting the first vector and the second vector into the initial fully-connected neural network respectively, and training the initial fully-connected neural network to correspondingly obtain a class judgment loss function and an entity chain finger loss function.
In this embodiment, the category of the corresponding entity in the corresponding text data is predicted by inputting the first vector into the fully-connected layer of the fully-connected neural network, so as to obtain a category judgment loss; and predicting a chain finger result of the entity in the text data and the entity from the knowledge base in the input data by inputting the second vector into a full-connection layer of the full-connection neural network to obtain the entity chain finger loss.
And step 54, judging a loss function and an entity chain finger loss function based on the category to generate a combined loss function, and retraining the initial fully-connected neural network by taking the combined loss function as a target loss function until fitting to obtain an entity chain finger prediction model.
In this embodiment, the loss of the entity chain finger prediction model is rapidly reduced by a combined loss function composed of the category judgment loss function and the entity chain finger loss function, and by designing the multi-task model of the category judgment and the entity chain finger, the mining of the category information of the chained entity is enhanced, the search space is reduced, and the accuracy of the entity chain finger is improved.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here.
The present embodiment further provides an entity chain finger device, which is used to implement the foregoing embodiments and preferred embodiments, and the description of the entity chain finger device is omitted for brevity. As used hereinafter, the terms "module," "unit," "subunit," and the like may implement a combination of software and/or hardware for a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 2 is a block diagram of a physical chain finger device according to an embodiment of the present application, and as shown in fig. 2, the physical chain finger device includes:
the obtaining module 21 is configured to obtain a first text and determine a first entity to be linked in the first text;
a recall module 22, coupled to the obtaining module 21, configured to recall the first entity chain instruction set corresponding to the first entity from the preset entity library;
a processing module 23, coupled to the recall module 22, configured to input entity information corresponding to each first entity into a trained entity chain finger prediction model to obtain a second entity chain finger corresponding to the first entity, where the entity chain finger prediction model is trained based on a fully-connected neural network and is trained to obtain an entity chain finger of an entity corresponding to the entity information according to the input entity information;
and the determining module 24 is coupled to the processing module 23, and configured to determine an entity chain finger result according to the similarity between the second entity chain finger and each first entity chain finger in the first entity chain finger set.
By the device, the first text is obtained, and the first entity to be linked in the first text is determined; recalling a plurality of first entity chain fingers corresponding to the first entity from a preset entity library; inputting entity information corresponding to each first entity into a well-trained entity chain finger prediction model to obtain a second entity chain finger corresponding to the first entity, wherein the entity chain finger prediction model is trained based on a fully-connected neural network and is trained to obtain an entity chain finger of an entity corresponding to the entity information according to the input entity information; according to the similarity between the second entity chain finger and the plurality of first entity chain fingers, the entity chain finger result is determined, the problem that the entity chain finger effect is poor when the information or entities in the context are less in the related technology is solved, and the beneficial effects of reducing the search space and improving the entity chain finger accuracy are achieved.
In some of these embodiments, the determining module 24 further comprises:
the first calculation unit is used for calculating the similarity between the word vector corresponding to each first entity chain finger and the word vector corresponding to the second entity chain finger;
and the first determining unit is coupled with the first calculating unit and used for selecting a third entity chain finger in the first entity chain finger set, and the determined entity chain finger result comprises the third entity chain finger, wherein the third entity chain finger is the first entity chain finger with the maximum similarity with the word vector of the second entity chain finger.
In some embodiments, the word vector corresponding to the first entity chain finger includes an average word vector corresponding to all words of the first entity chain finger, and the word vector corresponding to the second entity chain finger includes an average word vector corresponding to all words of the second entity chain finger, wherein the word vector of the entity chain finger is generated by processing the corresponding entity chain finger through the bidirectional attention neural network model Bert.
In some of these embodiments, the recall module 22 further includes:
the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a first entity parameter table corresponding to a preset entity library, and the first entity parameter table comprises entity information, entity chain fingers and corresponding relation information between the entity information and the entity chain fingers;
the first query unit is coupled to the first obtaining unit and configured to query an entity chain finger corresponding to the entity information of the first entity in the first entity parameter table, where the first entity chain finger set includes the entity chain finger corresponding to the entity information of the first entity.
In some embodiments, the obtaining unit 21 is further configured to detect a first entity name in the first text, and determine the first entity to be linked according to the detected first entity name.
In some embodiments, the entity chain finger means is further configured to determine the number of first entity chain fingers in the recalled first entity chain finger set after recalling the first entity chain finger set corresponding to the first entity from a preset entity library; when the first entity chain finger set is determined to comprise a single first entity chain finger, determining that an entity chain finger result corresponding to the first text comprises the first entity chain finger; when the first entity chain finger set is determined to be an empty set, determining that the entity chain finger result corresponding to the first text comprises that the first text is an empty entity.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 3, an embodiment of the present application provides an electronic device including a processor 31, a communication interface 32, a memory 33, and a communication bus 34, where the processor 31, the communication interface 32, and the memory 33 are communicated with each other through the communication bus 34,
a memory 33 for storing a computer program;
the processor 31, when executing the program stored in the memory 33, implements the method steps of fig. 1.
The processing in the server implements the method steps in fig. 1, and the technical effect brought by the method is consistent with the technical effect of the embodiment for executing the entity chain instruction method in fig. 1, and is not described herein again.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 3, but this does not mean only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components.
The present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the entity chain finger method provided in any one of the foregoing method embodiments.
In yet another embodiment provided herein, there is also provided a computer program product containing instructions that, when executed on a computer, cause the computer to perform the method of any of the above embodiments.
It is noted that, in this document, relational terms such as "first" and "second," and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. An entity chain finger method, comprising:
acquiring a first text, and determining a first entity to be chain-pointed in the first text;
recalling a first entity chain instruction set corresponding to the first entity from a preset entity library;
inputting entity information corresponding to each first entity into a well-trained entity chain finger prediction model to obtain a second entity chain finger corresponding to the first entity, wherein the entity chain finger prediction model is trained based on a fully-connected neural network and is trained to obtain an entity chain finger of an entity corresponding to the entity information according to the input entity information;
and determining the entity chain finger result according to the similarity between the second entity chain finger and each first entity chain finger in the first entity chain finger set.
2. The method of claim 1, wherein determining the entity linking result according to the similarity between the second entity chain finger and each first entity chain finger in the first entity chain finger set comprises:
calculating the similarity between the word vector corresponding to each first entity chain finger and the word vector corresponding to the second entity chain finger;
and selecting a third entity chain finger in the first entity chain finger set, and determining that the entity chain finger result comprises the third entity chain finger, wherein the third entity chain finger is the first entity chain finger with the maximum similarity with the word vector of the second entity chain finger.
3. The method of claim 2, wherein the word vector corresponding to the first entity chain finger comprises an average word vector corresponding to all words of the first entity chain finger, and the word vector corresponding to the second entity chain finger comprises an average word vector corresponding to all words of the second entity chain finger, wherein the word vectors of the entity chain fingers are generated by processing the corresponding entity chain fingers through a bidirectional attention neural network model Bert.
4. The method of claim 1, wherein recalling a first entity chain index corresponding to the first entity from a preset entity library comprises:
acquiring a first entity parameter table corresponding to the preset entity library, wherein the first entity parameter table comprises entity information, entity chain fingers and corresponding relation information between the entity information and the entity chain fingers;
and querying an entity chain finger corresponding to the entity information of the first entity in the first entity parameter table, wherein the first entity chain finger set comprises the entity chain finger corresponding to the entity information of the first entity.
5. The method of claim 1, wherein determining the first entity to be chained in the first text comprises: and detecting a first entity name in the first text, and determining a first entity to be chained according to the detected first entity name.
6. The method of claim 1, wherein after recalling a first entity chain indication corresponding to the first entity from a preset entity library, the method further comprises:
determining a number of the first entity chain fingers in the first set of entity chain fingers recalled;
when the first entity chain finger set is determined to comprise a single first entity chain finger, determining that an entity chain finger result corresponding to the first text comprises the first entity chain finger;
when the first entity chain instruction set is determined to be an empty set, determining that the entity chain instruction result corresponding to the first text comprises that the first text is an empty entity.
7. The method of claim 1, wherein the training process of the entity chain refers to a predictive model comprises:
acquiring text data corresponding to a second entity with entity chain fingers from the preset entity library, converting the text data according to a preset format, and inputting the converted text data into a Bert model to obtain a semantic vector corresponding to the text data;
in the semantic vector, acquiring a first vector corresponding to a word for the second entity classification and a second vector corresponding to an entity chain index of the second entity;
inputting the first vector and the second vector into an initial fully-connected neural network respectively, and training the initial fully-connected neural network to correspondingly obtain a class judgment loss function and an entity chain finger loss function;
and based on the category judgment loss function and the entity chain finger loss function, generating a combined loss function, and retraining the initial fully-connected neural network by taking the combined loss function as a target loss function until fitting to obtain the entity chain finger prediction model.
8. A physical chain finger device, comprising:
the acquisition module is used for acquiring a first text and determining a first entity to be chained in the first text;
the recall module is used for recalling a first entity chain instruction set corresponding to the first entity from a preset entity library;
the processing module is used for inputting entity information corresponding to each first entity into a trained entity chain finger prediction model to obtain a second entity chain finger corresponding to the first entity, wherein the entity chain finger prediction model is trained on the basis of a fully-connected neural network and is trained to obtain an entity chain finger of an entity corresponding to the entity information according to the input entity information;
a determining module, configured to determine the entity chain finger result according to a similarity between the second entity chain finger and each first entity chain finger in the first entity chain finger set.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the steps of the method of any one of claims 1 to 7 when executing a program stored in a memory.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202210494352.1A 2022-05-07 2022-05-07 Entity chain finger method, device, electronic device and storage medium Pending CN114860878A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210494352.1A CN114860878A (en) 2022-05-07 2022-05-07 Entity chain finger method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210494352.1A CN114860878A (en) 2022-05-07 2022-05-07 Entity chain finger method, device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN114860878A true CN114860878A (en) 2022-08-05

Family

ID=82636219

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210494352.1A Pending CN114860878A (en) 2022-05-07 2022-05-07 Entity chain finger method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN114860878A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116150406A (en) * 2023-04-23 2023-05-23 湖南星汉数智科技有限公司 Context sparse entity linking method, device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116150406A (en) * 2023-04-23 2023-05-23 湖南星汉数智科技有限公司 Context sparse entity linking method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109918673B (en) Semantic arbitration method and device, electronic equipment and computer-readable storage medium
CN109033068B (en) Method and device for reading and understanding based on attention mechanism and electronic equipment
CN107480143B (en) Method and system for segmenting conversation topics based on context correlation
CN111639171A (en) Knowledge graph question-answering method and device
CN111190997A (en) Question-answering system implementation method using neural network and machine learning sequencing algorithm
CN104636465A (en) Webpage abstract generating methods and displaying methods and corresponding devices
CN111159363A (en) Knowledge base-based question answer determination method and device
CN110909160A (en) Regular expression generation method, server and computer readable storage medium
CN111444326A (en) Text data processing method, device, equipment and storage medium
CN110134777B (en) Question duplication eliminating method and device, electronic equipment and computer readable storage medium
CN113255320A (en) Entity relation extraction method and device based on syntax tree and graph attention machine mechanism
CN113051380B (en) Information generation method, device, electronic equipment and storage medium
CN112270188A (en) Questioning type analysis path recommendation method, system and storage medium
CN111460783B (en) Data processing method and device, computer equipment and storage medium
CN113986950A (en) SQL statement processing method, device, equipment and storage medium
CN114860878A (en) Entity chain finger method, device, electronic device and storage medium
CN107341152B (en) Parameter input method and device
CN112527985A (en) Unknown problem processing method, device, equipment and medium
CN111581377A (en) Text classification method and device, storage medium and computer equipment
CN115587163A (en) Text classification method and device, electronic equipment and storage medium
CN113177406B (en) Text processing method, text processing device, electronic equipment and computer readable medium
CN115994531A (en) Multi-dimensional text comprehensive identification method
CN115221284A (en) Text similarity calculation method and device, electronic equipment and storage medium
CN115017987A (en) Language model fine-tuning method, text classification method, device and equipment
CN114281942A (en) Question and answer processing method, related equipment and readable storage medium

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