CN112765984A - Named entity recognition method and device, computer equipment and storage medium - Google Patents

Named entity recognition method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112765984A
CN112765984A CN202011639064.8A CN202011639064A CN112765984A CN 112765984 A CN112765984 A CN 112765984A CN 202011639064 A CN202011639064 A CN 202011639064A CN 112765984 A CN112765984 A CN 112765984A
Authority
CN
China
Prior art keywords
recognized
entity
named entity
text
category
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
CN202011639064.8A
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.)
Ping An Asset Management Co Ltd
Original Assignee
Ping An Asset Management 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 Ping An Asset Management Co Ltd filed Critical Ping An Asset Management Co Ltd
Priority to CN202011639064.8A priority Critical patent/CN112765984A/en
Publication of CN112765984A publication Critical patent/CN112765984A/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
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • G06F40/295Named entity recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Character Discrimination (AREA)

Abstract

The application relates to a natural language processing technology and provides a named entity identification method, a named entity identification device, computer equipment and a storage medium. The method comprises the following steps: acquiring a named entity identification request, wherein the named entity identification request carries an initial text to be identified; setting a category label for the initial text to be recognized according to the preset entity category to obtain a target text to be recognized corresponding to the preset entity category; sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain a classification prediction result corresponding to each single character in the target text to be recognized; collecting the classified prediction results to obtain target classified prediction results corresponding to the target text to be recognized; and determining a named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold. By adopting the method, the multi-class named entity identification can be realized, and the problem that the coincident named entities cannot be identified is solved.

Description

Named entity recognition method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a named entity identification method, apparatus, computer device, and storage medium.
Background
With the development of computer technology, named entity recognition, also called "proper name recognition", has appeared, and is meant to identify entities with specific meaning in text, mainly including names of people, places, organizations, proper nouns, etc., and usually includes two parts of entity boundary identification and entity category identification.
In the conventional technology, a named entity recognition mode is often adopted, wherein a sentence text is input, BMES (begin, mean, end, single, beginning, middle, end, single character) tags or BIO tags are constructed, a model is trained for fitting, multiple classifications are made word by word during prediction through the trained model, and a named entity recognition result is determined.
However, in the traditional method, because multiple classifications are directly made word by word during prediction, only one classification result is output for each single word in the sentence text, and the problem that the coincident named entities cannot be identified exists.
Disclosure of Invention
In view of the above, it is necessary to provide a named entity identifying method, an apparatus, a computer device and a storage medium capable of identifying a coincident named entity in order to solve the above technical problems.
A named entity identification method, the method comprising:
acquiring a named entity identification request, wherein the named entity identification request carries an initial text to be identified;
setting a category label for the initial text to be recognized according to the preset entity category to obtain a target text to be recognized corresponding to the preset entity category;
sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain a classification prediction result corresponding to each single character in the target text to be recognized;
collecting the classified prediction results to obtain target classified prediction results corresponding to the target text to be recognized;
and determining a named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold.
In one embodiment, the step of setting a category label for the initial text to be recognized according to the preset entity category to obtain a target text to be recognized corresponding to the preset entity category includes:
determining a category label corresponding to each preset entity category according to the preset entity categories;
and writing the category label into the initial text to be recognized to obtain a target text to be recognized corresponding to the preset entity category.
In one embodiment, before sequentially inputting a target text to be recognized into a trained named entity recognition model and obtaining a classification prediction result corresponding to each single character in the target text to be recognized, the method further includes:
acquiring training samples, wherein each sample in the training samples is a sample which carries an entity boundary label and comprises a category label;
inputting each sample in the training samples into an initial named entity recognition model to obtain a prediction recognition result corresponding to each sample;
and comparing the predicted recognition result with the entity boundary labels carried by the samples to obtain the trained named entity recognition model.
In one embodiment, inputting each sample in the training samples into the initial named entity recognition model, and obtaining the predicted recognition result corresponding to each sample includes:
inputting each sample in the training samples into an initial named entity recognition model, wherein the initial named entity recognition model comprises a coding layer, a feature extraction layer and a classification layer;
coding each single character in each sample through a coding layer to obtain a character code corresponding to each single character in each sample;
extracting features according to the character codes through a feature extraction layer to obtain feature vectors corresponding to the samples;
and carrying out classification prediction through a classification layer according to the characteristic vectors to obtain a prediction recognition result corresponding to each sample.
In one embodiment, the step of comparing the predicted recognition result with the entity boundary labels carried by the samples to obtain the trained named entity recognition model includes:
determining entity boundary labels to be compared corresponding to the individual characters in each sample according to the entity boundary labels carried by each sample;
comparing the entity boundary label to be compared with the boundary label prediction result of each single character in the prediction recognition result to obtain a model loss function;
and according to the model loss function, carrying out parameter adjustment on the initial named entity recognition model to obtain a trained named entity recognition model.
In one embodiment, sequentially inputting the target text to be recognized into the trained named entity recognition model, and obtaining the classification prediction result corresponding to each single character in the target text to be recognized comprises:
sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain the prediction probability of each single character in the target text to be recognized belonging to each entity boundary label;
and sequencing the prediction probabilities to obtain a classification prediction result corresponding to each single character in the target text to be recognized.
In one embodiment, determining the named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold comprises:
determining an alternative recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold, wherein the alternative recognition result comprises an alternative entity category and alternative entity boundary labels of each single character in the initial text to be recognized corresponding to the alternative entity category;
according to the alternative entity boundary labels and the preset effective labels, performing label effectiveness screening on alternative identification results to obtain target identification results comprising the preset effective labels;
and determining a named entity recognition result corresponding to the initial text to be recognized according to the target recognition result.
A named entity recognition apparatus, the apparatus comprising:
the system comprises a receiving module, a processing module and a sending module, wherein the receiving module is used for acquiring a named entity identification request which carries an initial text to be identified;
the label setting module is used for setting a category label for the initial text to be recognized according to the preset entity category to obtain a target text to be recognized corresponding to the preset entity category;
the prediction module is used for sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain a classification prediction result corresponding to each single character in the target text to be recognized;
the collecting module is used for collecting the classified prediction results to obtain target classified prediction results corresponding to the target text to be recognized;
and the processing module is used for determining the named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a named entity identification request, wherein the named entity identification request carries an initial text to be identified;
setting a category label for the initial text to be recognized according to the preset entity category to obtain a target text to be recognized corresponding to the preset entity category;
sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain a classification prediction result corresponding to each single character in the target text to be recognized;
collecting the classified prediction results to obtain target classified prediction results corresponding to the target text to be recognized;
and determining a named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold.
A computer storage medium having a computer program stored thereon, the computer program when executed by a processor implementing the steps of:
acquiring a named entity identification request, wherein the named entity identification request carries an initial text to be identified;
setting a category label for the initial text to be recognized according to the preset entity category to obtain a target text to be recognized corresponding to the preset entity category;
sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain a classification prediction result corresponding to each single character in the target text to be recognized;
collecting the classified prediction results to obtain target classified prediction results corresponding to the target text to be recognized;
and determining a named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold.
The named entity recognition method, the device, the computer equipment and the storage medium can obtain the target text to be recognized corresponding to the preset entity category by setting the category label for the initial text to be recognized according to the preset entity category after obtaining the named entity recognition request of the initial text to be recognized, can obtain the classification prediction result corresponding to each single character in the target text to be recognized by sequentially inputting the target text to be recognized into the trained named entity recognition model, thereby obtaining the target classification prediction result corresponding to the target text to be recognized by collecting the classification prediction results, determining the named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and the preset classification probability threshold, and obtaining the target text to be recognized corresponding to the preset entity category by setting the category label in the initial text to be recognized in the whole process, and then, named entity recognition is carried out on the target text to be recognized, so that multi-class named entity recognition can be realized, and the problem that coincident named entities cannot be recognized is solved.
Drawings
FIG. 1 is a flow diagram of a named entity recognition method in one embodiment;
FIG. 2 is a diagram of a named entity identification methodology in one embodiment;
FIG. 3 is a schematic diagram of a named entity identification method in another embodiment;
FIG. 4 is a block diagram of the structure of a named entity recognition device in one embodiment;
FIG. 5 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In an embodiment, as shown in fig. 1, a named entity identification method is provided, and this embodiment is illustrated by applying the method to a terminal, and it is to be understood that the method may also be applied to a server, and may also be applied to a system including a terminal and a server, and is implemented by interaction between the terminal and the server. In this embodiment, the method includes the steps of:
step 102, acquiring a named entity identification request, wherein the named entity identification request carries an initial text to be identified.
The named entities include names of people, organizations, places, and other entities identified by names, and the more extensive entities include numbers, dates, currencies, addresses, and the like. The initial text to be recognized refers to the data to be recognized, which needs to recognize the entity type and the entity boundary label. For example, the initial text to be recognized may specifically be a building name, a place, and the like to be recognized. For example, the initial text to be recognized may be the bridge of Changjiang river, Nanjing, the finance center of Lujiazui, etc.
Specifically, when the named entity identification needs to be performed, a user may input a named entity identification request carrying an initial text to be identified to a terminal, and the terminal may receive the named entity identification request carrying the initial text to be identified.
And 104, setting a category label for the initial text to be recognized according to the preset entity category to obtain a target text to be recognized corresponding to the preset entity category.
The preset entity category refers to a preset entity category, and the entity category refers to a category to which the entity belongs, for example, the entity category may specifically refer to a city, a bridge, a region name, and the like, and the preset entity category may be set by itself as needed. The category labels are used for representing preset entity categories, and the category labels of different preset entity categories are different. For example, the category label may be a chinese expression or an english expression corresponding to a preset entity category. For example, for an entity category city, the category tag may be city, and for an entity category bridge, the category tag may be bridge. The target text to be recognized refers to the initial text to be recognized added with the category label.
Specifically, the terminal determines a corresponding category tag according to a preset entity category, and then writes the category tag corresponding to the preset entity category into the initial text to be recognized, so as to obtain a target text to be recognized corresponding to the preset entity category. For example, the target text to be recognized may be in the form of: [ Category tag ] + initial text to be recognized.
And 106, sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain a classification prediction result corresponding to each single character in the target text to be recognized.
The classification prediction result refers to entity boundary labels corresponding to the individual characters in the target text to be recognized and the probability of the individual characters belonging to the entity boundary labels, the entity boundary labels are used for representing the corresponding positions of the individual characters in the target text to be recognized in the entity category, the commonly used entity boundary labels comprise BMES labels or BIO labels, and the BIO labels can label each element as 'B-X', 'I-X' or 'O'. Wherein "B-X" indicates that the fragment in which the element is located belongs to X type and the element is at the beginning of the fragment, "I-X" indicates that the fragment in which the element is located belongs to X type and the element is in the middle position of the fragment, and "O" indicates that the fragment does not belong to any type. For example, the BIO label is performed on the bridge in the Yangtze river of Nanjing, the corresponding BIO label can be obtained as the BIO ooo in the entity category of the city, and the corresponding BIO label can be obtained as the OOOBIII in the entity category of the bridge.
Specifically, after the text to be recognized is obtained, the terminal inputs the text to be recognized into the trained named entity recognition model in sequence, obtains the probability that each individual character in the text to be recognized belongs to each entity boundary label through the trained named entity recognition model, sorts the probability that each individual character belongs to each entity boundary label, determines the entity boundary label corresponding to each individual character, and obtains the classification prediction result corresponding to each individual character in the text to be recognized. It should be noted that, sequentially inputting the target text to be recognized into the trained named entity recognition model means that the target text to be recognized corresponding to one of the entity classes in the preset entity classes is input each time, and the corresponding classification prediction result corresponding to each single character in the target text to be recognized is obtained until the target text to be recognized corresponding to the entity classes in all the preset entity classes is predicted.
And 108, collecting the classified prediction results to obtain target classified prediction results corresponding to the target text to be recognized.
Specifically, the terminal may obtain a target classification prediction result corresponding to the target text to be recognized by aggregating probabilities that each individual character in the target text to be recognized belongs to the entity boundary label in the classification prediction result, that is, the target classification prediction result is a sum of the probabilities that each individual character belongs to the entity boundary label.
And step 110, determining a named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold.
The preset classification probability threshold is used for evaluating whether the target classification prediction result meets the classification probability requirement, and the evaluation can be understood as that the target classification prediction result is considered to meet the classification probability requirement only when the target classification prediction result is greater than the preset classification probability threshold, and the target classification prediction result can be used as a named entity recognition result corresponding to the initial text to be recognized. The preset classification probability threshold may be set as needed, for example, the preset classification probability threshold may be specifically 0.8, 0.85, and the like. The named entity recognition result corresponding to the initial text to be recognized refers to a classification prediction result which is screened from the target classification prediction result and meets preset requirements, and the preset requirements can be embodied through a preset classification probability threshold.
Specifically, the terminal calculates a classification threshold to be compared corresponding to the target classification prediction result according to the number of the single characters in the target text to be recognized corresponding to the target classification prediction result and a preset classification probability threshold, compares the classification threshold to be compared with the target classification prediction result, and determines a named entity recognition result corresponding to the initial text to be recognized. The method for calculating the classification threshold to be compared corresponding to the target classification prediction result according to the number of the single words and the preset classification probability threshold may be to use the product of the number of the single words and the preset classification probability threshold as the classification threshold to be compared.
For example, when the number of the single words in the target text to be recognized corresponding to the target classification prediction result is X and the preset classification probability threshold is 0.8, the classification threshold to be compared is 0.8X, and the named entity recognition result corresponding to the initial text to be recognized can be determined by 0.8X and the target classification prediction result Y. And when Y is larger than 0.8X, taking the target classification prediction result corresponding to Y as a named entity recognition result corresponding to the initial text to be recognized. When Y is less than 0.8X, the target classification prediction result corresponding to Y is not used as a named entity recognition result corresponding to the initial text to be recognized. It should be noted here that since Y is the target classification prediction result, which is actually the result obtained by collecting the classification prediction results of the individual words, Y is necessarily smaller than X, and the maximum Y may be X.
The named entity recognition method can obtain a target text to be recognized corresponding to the preset entity category by setting category labels for the initial text to be recognized according to the preset entity category after acquiring a named entity recognition request of the initial text to be recognized, can obtain classification prediction results corresponding to individual characters in the target text to be recognized by sequentially inputting the target text to be recognized into a trained named entity recognition model, so that target classification prediction results corresponding to the target text to be recognized can be obtained by collecting the classification prediction results, and the named entity recognition result corresponding to the initial text to be recognized is determined according to the target classification prediction results and a preset classification probability threshold, and the whole process includes the steps of setting category labels to encode category characteristics into the initial text to be recognized to obtain the target text to be recognized corresponding to the preset entity category, and then, named entity recognition is carried out on the target text to be recognized, so that multi-class named entity recognition can be realized, and the problem that coincident named entities cannot be recognized is solved.
In one embodiment, the step of setting a category label for the initial text to be recognized according to the preset entity category to obtain a target text to be recognized corresponding to the preset entity category includes:
determining a category label corresponding to each preset entity category according to the preset entity categories;
and writing the category label into the initial text to be recognized to obtain a target text to be recognized corresponding to the preset entity category.
Specifically, the terminal queries preset entity category tag information according to a preset entity category, so as to determine a category tag corresponding to each preset entity category, where a corresponding relationship between each entity category and the category tag is preset in the preset entity category tag information, for example, the corresponding relationship may be in a form of city, bridge, or the like. After the category label is obtained, the terminal writes the category label into the initial text to be recognized, and obtains a target text to be recognized corresponding to the preset entity category. For example, when the preset entity category is a city, the corresponding category tag is city by querying the preset entity category tag information, and the form of the target text to be recognized may be: [ city ] + the original text to be recognized.
In this embodiment, the corresponding category label is determined according to the preset entity category, and the category label is set for the initial text to be recognized, so that the target text to be recognized corresponding to the preset entity category can be obtained.
In one embodiment, before sequentially inputting a target text to be recognized into a trained named entity recognition model and obtaining a classification prediction result corresponding to each single character in the target text to be recognized, the method further includes:
acquiring training samples, wherein each sample in the training samples is a sample which carries an entity boundary label and comprises a category label;
inputting each sample in the training samples into an initial named entity recognition model to obtain a prediction recognition result corresponding to each sample;
and comparing the predicted recognition result with the entity boundary labels carried by the samples to obtain the trained named entity recognition model.
The entity boundary labels carried by the sample are used for representing the corresponding positions of the single characters in the sample in the preset entity categories corresponding to the category labels. For example, when the sample is a bridge in the Yangtze river of Nanjing, the corresponding entity boundary label carried in the city is BIIOOOO, and the corresponding entity boundary label carried in the bridge is OOOBIII. The sample not only carries the entity boundary label, but also comprises a category label, namely when the named entity recognition model is trained, the category label is coded into the sample to be used as characteristic data to participate in the training, so that the cyclic prediction can be realized according to the category number when the trained named entity recognition model is used for prediction, and a prediction result corresponding to each preset entity category, namely a target classification prediction result corresponding to a target text to be recognized is obtained. It should be noted that, when constructing a training sample, for a named entity, multiple samples may be constructed according to the category tag and correspond to the named entity, for example, for the named entity of the changjiang river bridge in south beijing, according to the category tag city, a sample [ city ] + the changjiang river bridge in south beijing may be constructed, and according to the category tag bridge, a sample [ bridge ] + the changjiang river bridge in south beijing may be constructed.
Specifically, when training a named entity recognition model, a terminal firstly obtains training samples from a preset database, inputs each sample in the training samples into an initial named entity recognition model, codes, extracts features and classifies each sample in the training samples through the initial named entity recognition model to obtain a prediction recognition result corresponding to each sample, compares the prediction recognition result with an entity boundary label carried by each sample to obtain a model loss function, and utilizes the model loss function to perform parameter adjustment on the initial named entity recognition model to obtain the trained named entity recognition model.
In this embodiment, training of the named entity recognition model can be achieved by obtaining training samples, inputting each sample in the training samples into the initial named entity recognition model, obtaining a predicted recognition result corresponding to each sample, and comparing the predicted recognition result with the entity boundary labels carried by each sample to obtain the trained named entity recognition model.
In one embodiment, inputting each sample in the training samples into the initial named entity recognition model, and obtaining the predicted recognition result corresponding to each sample includes:
inputting each sample in the training samples into an initial named entity recognition model, wherein the initial named entity recognition model comprises a coding layer, a feature extraction layer and a classification layer;
coding each single character in each sample through a coding layer to obtain a character code corresponding to each single character in each sample;
extracting features according to the character codes through a feature extraction layer to obtain feature vectors corresponding to the samples;
and carrying out classification prediction through a classification layer according to the characteristic vectors to obtain a prediction recognition result corresponding to each sample.
Specifically, the initial named entity recognition model includes a coding layer, a feature extraction layer, and a classification layer, after each sample in a training sample is input into the initial named entity recognition model, each individual character in each sample may be coded by using the coding layer in a manner of querying a preset character table to obtain a character code corresponding to each individual character in each sample, and a character code corresponding to each individual character is preset in the preset character table. After the word codes are obtained, feature extraction can be carried out through the feature extraction layer according to the word codes to obtain feature vectors corresponding to the samples, and after the feature vectors are obtained, classified prediction can be carried out through the classification layer according to the feature vectors to obtain prediction recognition results corresponding to the samples. For example, as shown in fig. 2, the initial named entity recognition model may be a model based on a bert (Bidirectional Encoder retrieval from Transformers) model, in which a plurality of transfomer blocks are used as a feature extraction layer, and a Head layer is used as a classification layer to implement classification prediction.
In this embodiment, each sample in the training samples is input into the initial named entity recognition model, each single character in each sample is coded by the coding layer to obtain a character code, the feature extraction layer is used to extract features according to the character code to obtain a feature vector, and the classification layer is used to perform classification prediction according to the feature vector to obtain a prediction recognition result, so that the prediction of the sample can be realized.
In one embodiment, the step of comparing the predicted recognition result with the entity boundary labels carried by the samples to obtain the trained named entity recognition model includes:
determining entity boundary labels to be compared corresponding to the individual characters in each sample according to the entity boundary labels carried by each sample;
comparing the entity boundary label to be compared with the boundary label prediction result of each single character in the prediction recognition result to obtain a model loss function;
and according to the model loss function, carrying out parameter adjustment on the initial named entity recognition model to obtain a trained named entity recognition model.
Specifically, the terminal may determine the entity boundary label to be compared corresponding to each individual character in each sample according to the entity boundary label carried by each sample, and may obtain the model loss function by comparing the entity boundary label to be compared with the boundary label prediction result of each individual character in the corresponding prediction recognition result. After the model loss function is obtained, the terminal adjusts parameters of the initial named entity recognition model through back propagation by using the model loss function until the model loss function meets the preset requirement, and the trained named entity recognition model is obtained. Here, the preset requirement that the model loss function needs to meet may be less than a preset threshold or the model loss function, and the present embodiment is not limited in detail here. It should be noted here that although a class label is introduced as feature data in a sample, the loss at this position is not calculated when calculating the model loss function. The label carried by the device can be set to be X, and the corresponding output prediction result is also X, namely no loss exists.
In this embodiment, a model loss function is obtained by comparing the entity boundary labels to be compared with the boundary label prediction results of the individual characters in the prediction recognition results, and a trained named entity recognition model is obtained by performing parameter adjustment on the initial named entity recognition model according to the model loss function, so that training of the named entity recognition model can be realized.
In one embodiment, sequentially inputting the target text to be recognized into the trained named entity recognition model, and obtaining the classification prediction result corresponding to each single character in the target text to be recognized comprises:
sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain the prediction probability of each single character in the target text to be recognized belonging to each entity boundary label;
and sequencing the prediction probabilities to obtain a classification prediction result corresponding to each single character in the target text to be recognized.
Specifically, the text to be recognized is sequentially input into the trained named entity recognition model, so that the prediction probabilities of the individual characters in the text to be recognized belonging to the entity boundary labels can be obtained, the prediction probabilities are sorted, and the entity boundary label corresponding to the prediction probability with the highest probability can be selected as the classification prediction result corresponding to the individual characters. For example, when the target text to be recognized is [ city ] + Nanjing City Changjiang river bridge, if the prediction probability attributed to the label B is 0.8, the prediction probability attributed to the label I is 0.15, and the prediction probability attributed to the label O is 0.05 for the south word, the entity boundary label B corresponding to the prediction probability with the highest probability can be selected as the classification prediction result corresponding to the south word by sorting the prediction probabilities.
In the embodiment, the text to be recognized is sequentially input into the trained named entity recognition model to obtain the prediction probability that each single character in the text to be recognized belongs to each entity boundary label, the prediction probabilities are sequenced to obtain the classification prediction result corresponding to each single character in the text to be recognized, and the classification prediction result can be obtained.
In one embodiment, determining the named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold comprises:
determining an alternative recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold, wherein the alternative recognition result comprises an alternative entity category and alternative entity boundary labels of each single character in the initial text to be recognized corresponding to the alternative entity category;
according to the alternative entity boundary labels and the preset effective labels, performing label effectiveness screening on alternative identification results to obtain target identification results comprising the preset effective labels;
and determining a named entity recognition result corresponding to the initial text to be recognized according to the target recognition result.
The alternative recognition result is a recognition result which is screened according to a preset classification probability threshold and meets the requirement of the classification probability. The preset valid tag is a tag with actual meaning in the entity boundary tags, for example, for a BIO tag, a tag B indicates that an element is at the beginning of the segment, and a tag I indicates that the element is at the middle position of the segment, which are both tags with actual meaning, while a tag O indicates that the tag is not of any type, which is a tag without actual meaning.
Specifically, after the candidate recognition result corresponding to the initial text to be recognized is determined according to the target classification prediction result and the preset classification probability threshold, the terminal needs to further perform label validity screening on the candidate recognition result according to the candidate entity boundary label and the preset valid label to obtain the target recognition result including the preset valid label, and the named entity recognition result corresponding to the initial text to be recognized can be determined according to the target recognition result.
For example, when the number of the preset entity classes is 20, and named entity recognition is performed, for an initial text to be recognized, the terminal will first construct a target text to be recognized corresponding to the 20 preset entity classes, then input the 20 target texts to be recognized into a trained named entity recognition model in sequence, obtain a target classification prediction result corresponding to each target text to be recognized, then compare each target classification prediction result with a preset classification probability threshold, and select an alternative recognition result meeting the classification probability requirement from the candidate recognition results, among these alternative recognition results that meet the classification probability requirement, there may be some invalid recognition results, where an invalid recognition result means that for a certain entity class, although the corresponding target classification threshold result can meet the classification probability requirement, all the entity boundary labels in the target classification prediction result corresponding to the entity class are labels without practical significance. Therefore, the terminal needs to further perform label validity screening on the candidate recognition result according to the candidate entity boundary label and the preset valid label to obtain a target recognition result including the preset valid label, and according to the target recognition result, the named entity recognition result corresponding to the initial text to be recognized can be determined.
In this embodiment, the candidate recognition result is subjected to tag validity screening according to the candidate entity boundary tag and the preset valid tag in the candidate recognition result to obtain a target recognition result including the preset valid tag, and the named entity recognition result corresponding to the initial text to be recognized is determined according to the target recognition result, so that the recognition result can be screened to obtain a named entity recognition result with practical significance.
As shown in fig. 3, the named entity recognition method of the present application is described by an embodiment, when named entity recognition needs to be performed on an initial text to be recognized, which is a continental mouth finance center, a user inputs a named entity recognition request carrying "continental mouth finance center" to a terminal, after receiving the named entity recognition request carrying "continental mouth finance center", the terminal sets a category tag for the "continental mouth finance center" according to a preset entity category [ region ], obtains a target text to be recognized "[ region ] continental mouth finance center" corresponding to the preset entity category [ region ], inputs the target text to be recognized into a trained named entity recognition model, encodes each single word in the "[ region ] continental mouth finance center" through an encoding layer, obtains a word encoding corresponding to each single word as "22, 1002, 2332, 5656, 7456, 6321, 8976, 321 ″ extracting the character codes by the feature extraction layer to obtain corresponding feature vectors, performing classification prediction by the classification layer according to the feature vectors to obtain classification prediction results corresponding to the individual characters in the target text to be recognized, collecting the classification prediction results to obtain target classification prediction results corresponding to the target text to be recognized, determining the named entity recognition results (i.e. X, B, I, O in the figure) corresponding to the initial text to be recognized according to the target classification prediction results and a preset classification probability threshold, and feeding back the named entity recognition results. It should be noted here that the word code "22, 1002, 2332, 5656, 7456, 6321, 8976, 321" is merely an example, and the actual word code is a multidimensional vector, where X is an output corresponding to the category label "region", for example, for a named entity recognition model based on the bert model, the word code may be specifically 768-dimensional vector. The feature extraction layer and the classification layer correspond to the bert layer in fig. 3, and the bert layer cannot directly process character strings, so that a target text to be recognized needs to be converted into word codes for processing, the output of the corresponding bert is actually also digital codes (i.e., X, 2, 1, 1, 0, 0, 0, 0 in fig. 3), and after the digital codes are obtained, the terminal determines entity boundary labels corresponding to the digital codes according to the corresponding relationship between preset digital codes and the entity boundary labels, so as to obtain the entity boundary labels corresponding to the individual words in the target text to be recognized. In this embodiment, the correspondence between the preset number code and the entity boundary tag means that 2 corresponds to B, 1 corresponds to I, and 0 corresponds to O.
It should be understood that, although the steps in the flowcharts related to the above embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in each flowchart related to the above embodiments may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
In one embodiment, as shown in fig. 4, there is provided a named entity recognition apparatus comprising: a receiving module 402, a label setting module 404, a predicting module 406, an aggregating module 408, and a processing module 410, wherein:
a receiving module 402, configured to obtain a named entity identification request, where the named entity identification request carries an initial text to be identified;
a tag setting module 404, configured to set a category tag for the initial text to be recognized according to a preset entity category, so as to obtain a target text to be recognized corresponding to the preset entity category;
the prediction module 406 is configured to sequentially input the target text to be recognized into the trained named entity recognition model, so as to obtain a classification prediction result corresponding to each individual character in the target text to be recognized;
the collecting module 408 is configured to collect the classified prediction results to obtain target classified prediction results corresponding to the target text to be recognized;
and the processing module 410 is configured to determine a named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold.
The named entity recognition device can obtain a target text to be recognized corresponding to the preset entity category by setting category labels for the initial text to be recognized according to the preset entity category after acquiring a named entity recognition request of the initial text to be recognized, can obtain classification prediction results corresponding to individual characters in the target text to be recognized by sequentially inputting the target text to be recognized into a trained named entity recognition model, so that target classification prediction results corresponding to the target text to be recognized can be obtained by collecting the classification prediction results, and the named entity recognition result corresponding to the initial text to be recognized is determined according to the target classification prediction results and a preset classification probability threshold, and the whole process includes the steps of setting category labels to encode category characteristics into the initial text to be recognized to obtain the target text to be recognized corresponding to the preset entity category, and then, named entity recognition is carried out on the target text to be recognized, so that multi-class named entity recognition can be realized, and the problem that coincident named entities cannot be recognized is solved.
In one embodiment, the tag setting module is further configured to determine, according to the preset entity category, a category tag corresponding to each preset entity category, and write the category tag into the initial text to be recognized, so as to obtain a target text to be recognized corresponding to the preset entity category.
In one embodiment, the named entity recognition device further includes a training module, where the training module is configured to obtain training samples, where each sample in the training samples is a sample that carries an entity boundary label and includes a category label, input each sample in the training samples into the initial named entity recognition model, obtain a predicted recognition result corresponding to each sample, and compare the predicted recognition result with the entity boundary label carried by each sample, to obtain a trained named entity recognition model.
In one embodiment, the training module is further configured to input each sample in the training samples into an initial named entity recognition model, where the initial named entity recognition model includes a coding layer, a feature extraction layer, and a classification layer, encode each individual character in each sample through the coding layer to obtain a character code corresponding to each individual character in each sample, perform feature extraction according to the character code through the feature extraction layer to obtain a feature vector corresponding to each sample, and perform classification prediction according to the feature vector through the classification layer to obtain a prediction recognition result corresponding to each sample.
In one embodiment, the training module is further configured to determine, according to the entity boundary labels carried by the samples, entity boundary labels to be compared corresponding to the individual characters in the samples, compare the entity boundary labels to be compared with the boundary label prediction results of the individual characters in the prediction recognition results to obtain a model loss function, and perform parameter adjustment on the initial named entity recognition model according to the model loss function to obtain a trained named entity recognition model.
In one embodiment, the prediction module is further configured to sequentially input the target text to be recognized into the trained named entity recognition model, obtain prediction probabilities that the individual characters in the target text to be recognized belong to the entity boundary labels, and rank the prediction probabilities to obtain classification prediction results corresponding to the individual characters in the target text to be recognized.
In an embodiment, the processing module is further configured to determine, according to the target classification prediction result and a preset classification probability threshold, an alternative recognition result corresponding to the initial text to be recognized, where the alternative recognition result includes an alternative entity category and alternative entity boundary tags of each individual word in the initial text to be recognized corresponding to the alternative entity category, perform tag validity screening on the alternative recognition result according to the alternative entity boundary tags and the preset valid tags to obtain a target recognition result including the preset valid tags, and determine, according to the target recognition result, a named entity recognition result corresponding to the initial text to be recognized.
For the specific definition of the named entity recognition apparatus, reference may be made to the above definition of the named entity recognition method, which is not described herein again. The various modules in the named entity recognition apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 5. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a named entity recognition method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:
acquiring a named entity identification request, wherein the named entity identification request carries an initial text to be identified;
setting a category label for the initial text to be recognized according to the preset entity category to obtain a target text to be recognized corresponding to the preset entity category;
sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain a classification prediction result corresponding to each single character in the target text to be recognized;
collecting the classified prediction results to obtain target classified prediction results corresponding to the target text to be recognized;
and determining a named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and determining a category label corresponding to each preset entity category according to the preset entity category, and writing the category label into the initial text to be recognized to obtain a target text to be recognized corresponding to the preset entity category.
In one embodiment, the processor, when executing the computer program, further performs the steps of: the method comprises the steps of obtaining training samples, wherein each sample in the training samples is a sample which carries an entity boundary label and comprises a category label, inputting each sample in the training samples into an initial named entity recognition model to obtain a predicted recognition result corresponding to each sample, and comparing the predicted recognition result with the entity boundary labels carried by each sample to obtain a trained named entity recognition model.
In one embodiment, the processor, when executing the computer program, further performs the steps of: inputting each sample in the training samples into an initial named entity recognition model, wherein the initial named entity recognition model comprises a coding layer, a feature extraction layer and a classification layer, coding each single character in each sample through the coding layer to obtain a character code corresponding to each single character in each sample, extracting features according to the character code through the feature extraction layer to obtain a feature vector corresponding to each sample, and performing classification prediction according to the feature vector through the classification layer to obtain a prediction recognition result corresponding to each sample.
In one embodiment, the processor, when executing the computer program, further performs the steps of: determining entity boundary labels to be compared corresponding to the single characters in the samples according to the entity boundary labels carried by the samples, comparing the entity boundary labels to be compared with the boundary label prediction results of the single characters in the prediction recognition results to obtain a model loss function, and performing parameter adjustment on the initial named entity recognition model according to the model loss function to obtain a trained named entity recognition model.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and sequentially inputting the text to be recognized into the trained named entity recognition model to obtain the prediction probability of each single character in the text to be recognized belonging to each entity boundary label, and sequencing the prediction probabilities to obtain the classification prediction result corresponding to each single character in the text to be recognized.
In one embodiment, the processor, when executing the computer program, further performs the steps of: determining an alternative recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold, wherein the alternative recognition result comprises an alternative entity category and alternative entity boundary labels of each single character in the initial text to be recognized corresponding to the alternative entity category, performing label effectiveness screening on the alternative recognition result according to the alternative entity boundary labels and preset effective labels to obtain a target recognition result comprising the preset effective labels, and determining a named entity recognition result corresponding to the initial text to be recognized according to the target recognition result.
In one embodiment, a computer storage medium is provided, having a computer program stored thereon, the computer program, when executed by a processor, implementing the steps of:
acquiring a named entity identification request, wherein the named entity identification request carries an initial text to be identified;
setting a category label for the initial text to be recognized according to the preset entity category to obtain a target text to be recognized corresponding to the preset entity category;
sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain a classification prediction result corresponding to each single character in the target text to be recognized;
collecting the classified prediction results to obtain target classified prediction results corresponding to the target text to be recognized;
and determining a named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold.
In one embodiment, the computer program when executed by the processor further performs the steps of: and determining a category label corresponding to each preset entity category according to the preset entity category, and writing the category label into the initial text to be recognized to obtain a target text to be recognized corresponding to the preset entity category.
In one embodiment, the computer program when executed by the processor further performs the steps of: the method comprises the steps of obtaining training samples, wherein each sample in the training samples is a sample which carries an entity boundary label and comprises a category label, inputting each sample in the training samples into an initial named entity recognition model to obtain a predicted recognition result corresponding to each sample, and comparing the predicted recognition result with the entity boundary labels carried by each sample to obtain a trained named entity recognition model.
In one embodiment, the computer program when executed by the processor further performs the steps of: inputting each sample in the training samples into an initial named entity recognition model, wherein the initial named entity recognition model comprises a coding layer, a feature extraction layer and a classification layer, coding each single character in each sample through the coding layer to obtain a character code corresponding to each single character in each sample, extracting features according to the character code through the feature extraction layer to obtain a feature vector corresponding to each sample, and performing classification prediction according to the feature vector through the classification layer to obtain a prediction recognition result corresponding to each sample.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining entity boundary labels to be compared corresponding to the single characters in the samples according to the entity boundary labels carried by the samples, comparing the entity boundary labels to be compared with the boundary label prediction results of the single characters in the prediction recognition results to obtain a model loss function, and performing parameter adjustment on the initial named entity recognition model according to the model loss function to obtain a trained named entity recognition model.
In one embodiment, the computer program when executed by the processor further performs the steps of: and sequentially inputting the text to be recognized into the trained named entity recognition model to obtain the prediction probability of each single character in the text to be recognized belonging to each entity boundary label, and sequencing the prediction probabilities to obtain the classification prediction result corresponding to each single character in the text to be recognized.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining an alternative recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold, wherein the alternative recognition result comprises an alternative entity category and alternative entity boundary labels of each single character in the initial text to be recognized corresponding to the alternative entity category, performing label effectiveness screening on the alternative recognition result according to the alternative entity boundary labels and preset effective labels to obtain a target recognition result comprising the preset effective labels, and determining a named entity recognition result corresponding to the initial text to be recognized according to the target recognition result.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A named entity identification method, the method comprising:
acquiring a named entity identification request, wherein the named entity identification request carries an initial text to be identified;
setting a category label for the initial text to be recognized according to a preset entity category to obtain a target text to be recognized corresponding to the preset entity category;
sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain a classification prediction result corresponding to each single character in the target text to be recognized;
collecting the classification prediction results to obtain target classification prediction results corresponding to the target text to be recognized;
and determining a named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold.
2. The method according to claim 1, wherein the setting of the category label for the initial text to be recognized according to the preset entity category to obtain the target text to be recognized corresponding to the preset entity category comprises:
determining a category label corresponding to each preset entity category according to the preset entity categories;
and writing the category label into the initial text to be recognized to obtain a target text to be recognized corresponding to the preset entity category.
3. The method according to claim 1, wherein before the text to be recognized is sequentially input into the trained named entity recognition model and the classification prediction result corresponding to each individual character in the text to be recognized is obtained, the method further comprises:
acquiring training samples, wherein each sample in the training samples is a sample which carries an entity boundary label and comprises the category label;
inputting each sample in the training samples into an initial named entity recognition model to obtain a prediction recognition result corresponding to each sample;
and comparing the predicted recognition result with the entity boundary labels carried by the samples to obtain a trained named entity recognition model.
4. The method of claim 3, wherein the inputting each sample in the training samples into an initial named entity recognition model to obtain a predicted recognition result corresponding to each sample comprises:
inputting each sample in the training samples into an initial named entity recognition model, wherein the initial named entity recognition model comprises a coding layer, a feature extraction layer and a classification layer;
coding each single character in each sample through the coding layer to obtain a character code corresponding to each single character in each sample;
extracting features according to the character codes through the feature extraction layer to obtain feature vectors corresponding to the samples;
and performing classified prediction according to the feature vectors through the classification layer to obtain a prediction recognition result corresponding to each sample.
5. The method of claim 3, wherein the comparing the predicted recognition result with the entity boundary labels carried by the samples to obtain the trained named entity recognition model comprises:
determining entity boundary labels to be compared corresponding to the individual characters in each sample according to the entity boundary labels carried by each sample;
comparing the entity boundary label to be compared with the boundary label prediction result of each single character in the prediction recognition result to obtain a model loss function;
and adjusting parameters of the initial named entity recognition model according to the model loss function to obtain a trained named entity recognition model.
6. The method of claim 1, wherein the step of sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain the classification prediction result corresponding to each single character in the target text to be recognized comprises the steps of:
sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain the prediction probability of each single character in the target text to be recognized belonging to each entity boundary label;
and sequencing the prediction probabilities to obtain classification prediction results corresponding to the single characters in the target text to be recognized.
7. The method according to claim 1, wherein the determining the named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold comprises:
determining an alternative recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold, wherein the alternative recognition result comprises an alternative entity category and alternative entity boundary labels of each single character in the initial text to be recognized corresponding to the alternative entity category;
according to the alternative entity boundary label and a preset effective label, performing label effectiveness screening on the alternative identification result to obtain a target identification result comprising the preset effective label;
and determining a named entity recognition result corresponding to the initial text to be recognized according to the target recognition result.
8. An apparatus for named entity recognition, the apparatus comprising:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for acquiring a named entity identification request which carries an initial text to be identified;
the label setting module is used for setting a category label for the initial text to be recognized according to a preset entity category to obtain a target text to be recognized corresponding to the preset entity category;
the prediction module is used for sequentially inputting the target text to be recognized into the trained named entity recognition model to obtain a classification prediction result corresponding to each single character in the target text to be recognized;
the collecting module is used for collecting the classification prediction results to obtain target classification prediction results corresponding to the target text to be recognized;
and the processing module is used for determining a named entity recognition result corresponding to the initial text to be recognized according to the target classification prediction result and a preset classification probability threshold.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer storage medium on which a computer program is stored, characterized in that the computer program, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202011639064.8A 2020-12-31 2020-12-31 Named entity recognition method and device, computer equipment and storage medium Pending CN112765984A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011639064.8A CN112765984A (en) 2020-12-31 2020-12-31 Named entity recognition method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011639064.8A CN112765984A (en) 2020-12-31 2020-12-31 Named entity recognition method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112765984A true CN112765984A (en) 2021-05-07

Family

ID=75698312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011639064.8A Pending CN112765984A (en) 2020-12-31 2020-12-31 Named entity recognition method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112765984A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468322A (en) * 2021-05-31 2021-10-01 北京达佳互联信息技术有限公司 Method, device, equipment and medium for training and extracting keyword recognition model
CN113516129A (en) * 2021-07-15 2021-10-19 广州云从鼎望科技有限公司 Business card recognition method and device, computer readable storage medium and control device
CN113761925A (en) * 2021-07-23 2021-12-07 中国科学院自动化研究所 Named entity identification method, device and equipment based on noise perception mechanism
CN113836927A (en) * 2021-09-27 2021-12-24 平安科技(深圳)有限公司 Training method, device and equipment for named entity recognition model and storage medium
CN114997171A (en) * 2022-06-17 2022-09-02 平安科技(深圳)有限公司 Entity identification method, device, equipment and storage medium
CN115277063A (en) * 2022-06-13 2022-11-01 深圳铸泰科技有限公司 Terminal identification device under IPV4 and IPV6 hybrid network environment
CN116757216A (en) * 2023-08-15 2023-09-15 之江实验室 Small sample entity identification method and device based on cluster description and computer equipment
CN117251650A (en) * 2023-11-20 2023-12-19 之江实验室 Geographic hotspot center identification method, device, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109992782A (en) * 2019-04-02 2019-07-09 深圳市华云中盛科技有限公司 Legal documents name entity recognition method, device and computer equipment
CN110222330A (en) * 2019-04-26 2019-09-10 平安科技(深圳)有限公司 Method for recognizing semantics and device, storage medium, computer equipment
CN111126068A (en) * 2019-12-25 2020-05-08 中电云脑(天津)科技有限公司 Chinese named entity recognition method and device and electronic equipment
CN111401064A (en) * 2019-01-02 2020-07-10 中国移动通信有限公司研究院 Named entity identification method and device and terminal equipment
CN111738004A (en) * 2020-06-16 2020-10-02 中国科学院计算技术研究所 Training method of named entity recognition model and named entity recognition method
CN111967264A (en) * 2020-08-26 2020-11-20 湖北亿咖通科技有限公司 Named entity identification method
CN112052684A (en) * 2020-09-07 2020-12-08 南方电网数字电网研究院有限公司 Named entity identification method, device, equipment and storage medium for power metering

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111401064A (en) * 2019-01-02 2020-07-10 中国移动通信有限公司研究院 Named entity identification method and device and terminal equipment
CN109992782A (en) * 2019-04-02 2019-07-09 深圳市华云中盛科技有限公司 Legal documents name entity recognition method, device and computer equipment
CN110222330A (en) * 2019-04-26 2019-09-10 平安科技(深圳)有限公司 Method for recognizing semantics and device, storage medium, computer equipment
CN111126068A (en) * 2019-12-25 2020-05-08 中电云脑(天津)科技有限公司 Chinese named entity recognition method and device and electronic equipment
CN111738004A (en) * 2020-06-16 2020-10-02 中国科学院计算技术研究所 Training method of named entity recognition model and named entity recognition method
CN111967264A (en) * 2020-08-26 2020-11-20 湖北亿咖通科技有限公司 Named entity identification method
CN112052684A (en) * 2020-09-07 2020-12-08 南方电网数字电网研究院有限公司 Named entity identification method, device, equipment and storage medium for power metering

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468322A (en) * 2021-05-31 2021-10-01 北京达佳互联信息技术有限公司 Method, device, equipment and medium for training and extracting keyword recognition model
CN113516129A (en) * 2021-07-15 2021-10-19 广州云从鼎望科技有限公司 Business card recognition method and device, computer readable storage medium and control device
CN113761925B (en) * 2021-07-23 2022-10-28 中国科学院自动化研究所 Named entity identification method, device and equipment based on noise perception mechanism
CN113761925A (en) * 2021-07-23 2021-12-07 中国科学院自动化研究所 Named entity identification method, device and equipment based on noise perception mechanism
CN113836927B (en) * 2021-09-27 2023-09-29 平安科技(深圳)有限公司 Named entity recognition model training method, device, equipment and storage medium
CN113836927A (en) * 2021-09-27 2021-12-24 平安科技(深圳)有限公司 Training method, device and equipment for named entity recognition model and storage medium
CN115277063A (en) * 2022-06-13 2022-11-01 深圳铸泰科技有限公司 Terminal identification device under IPV4 and IPV6 hybrid network environment
CN115277063B (en) * 2022-06-13 2023-07-25 深圳铸泰科技有限公司 Terminal identification device under IPV4 and IPV6 mixed network environment
CN114997171A (en) * 2022-06-17 2022-09-02 平安科技(深圳)有限公司 Entity identification method, device, equipment and storage medium
CN116757216A (en) * 2023-08-15 2023-09-15 之江实验室 Small sample entity identification method and device based on cluster description and computer equipment
CN116757216B (en) * 2023-08-15 2023-11-07 之江实验室 Small sample entity identification method and device based on cluster description and computer equipment
CN117251650A (en) * 2023-11-20 2023-12-19 之江实验室 Geographic hotspot center identification method, device, computer equipment and storage medium
CN117251650B (en) * 2023-11-20 2024-02-06 之江实验室 Geographic hotspot center identification method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112765984A (en) Named entity recognition method and device, computer equipment and storage medium
JP6955580B2 (en) Document summary automatic extraction method, equipment, computer equipment and storage media
CN110598206B (en) Text semantic recognition method and device, computer equipment and storage medium
CN111177326B (en) Key information extraction method and device based on fine labeling text and storage medium
CN111581229B (en) SQL statement generation method and device, computer equipment and storage medium
CN109753653B (en) Entity name recognition method, entity name recognition device, computer equipment and storage medium
CN110569500A (en) Text semantic recognition method and device, computer equipment and storage medium
CN110334179B (en) Question-answer processing method, device, computer equipment and storage medium
CN108491406B (en) Information classification method and device, computer equipment and storage medium
CN111444723A (en) Information extraction model training method and device, computer equipment and storage medium
CN111797629B (en) Method and device for processing medical text data, computer equipment and storage medium
CN110362798B (en) Method, apparatus, computer device and storage medium for judging information retrieval analysis
CN111859916B (en) Method, device, equipment and medium for extracting key words of ancient poems and generating poems
CN110888911A (en) Sample data processing method and device, computer equipment and storage medium
CN112766319A (en) Dialogue intention recognition model training method and device, computer equipment and medium
CN113887229A (en) Address information identification method and device, computer equipment and storage medium
CN112699923A (en) Document classification prediction method and device, computer equipment and storage medium
CN112395500A (en) Content data recommendation method and device, computer equipment and storage medium
CN110472049A (en) Disorder in screening file classification method, computer equipment and readable storage medium storing program for executing
CN116070632A (en) Informal text entity tag identification method and device
CN113704436A (en) User portrait label mining method and device based on session scene
CN109063155B (en) Language model parameter determination method and device and computer equipment
CN112464660B (en) Text classification model construction method and text data processing method
CN112732884A (en) Target answer sentence generation method and device, computer equipment and storage medium
CN111754352A (en) Method, device, equipment and storage medium for judging correctness of viewpoint statement

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