CN111651989B - Named entity recognition method and device, storage medium and electronic device - Google Patents

Named entity recognition method and device, storage medium and electronic device Download PDF

Info

Publication number
CN111651989B
CN111651989B CN202010286857.XA CN202010286857A CN111651989B CN 111651989 B CN111651989 B CN 111651989B CN 202010286857 A CN202010286857 A CN 202010286857A CN 111651989 B CN111651989 B CN 111651989B
Authority
CN
China
Prior art keywords
task
recognition
target
identification
training
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.)
Active
Application number
CN202010286857.XA
Other languages
Chinese (zh)
Other versions
CN111651989A (en
Inventor
伯仲璞
王道广
孙靖文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Minglue Artificial Intelligence Group Co Ltd
Original Assignee
Shanghai Minglue Artificial Intelligence Group 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 Shanghai Minglue Artificial Intelligence Group Co Ltd filed Critical Shanghai Minglue Artificial Intelligence Group Co Ltd
Priority to CN202010286857.XA priority Critical patent/CN111651989B/en
Publication of CN111651989A publication Critical patent/CN111651989A/en
Application granted granted Critical
Publication of CN111651989B publication Critical patent/CN111651989B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a named entity identification method and device, a storage medium and an electronic device. Wherein the method comprises the following steps: acquiring a target text to be identified, and determining attribute information of a first identification task in the target text; constructing an attribute identification task by taking the attribute information as a target, and determining the attribute identification task as a second identification task under the condition that the attribute identification task is a target class task; the method comprises the steps of inputting a first recognition task and a second recognition task into a target neural network model, and outputting a named entity of a target text, wherein the target neural network model is obtained through training of training samples and marking information of the training samples, the purpose of introducing the second recognition task, determining the named identification of the entity according to the first recognition task and the second recognition task is achieved, and further the technical problem that in the prior art, the cost for identifying the named entity is high is solved.

Description

Named entity recognition method and device, storage medium and electronic device
Technical Field
The present invention relates to the field of named entity recognition, and in particular, to a named entity recognition method and apparatus, a storage medium, and an electronic apparatus.
Background
Named entity recognition tasks are classical tasks and popular topics in the field of natural language processing, and have received extensive attention from academia and industry for the last decades of rapid development of natural language processing technologies.
The current named entity recognition NER technology faces simple tasks such as company name recognition, person name recognition, diming recognition and the like, and on the premise of proper data quantity, indexes such as accuracy, recall rate and the like can reach higher level, and the indexes of industrial application are reached.
For complex named entity recognition, the prior art generally adopts the approach that the NER model is not changed, but rather convergence of the sample space can be achieved by increasing the training data set continuously. On one hand, more data marking cost is required to be paid for increasing the training data set, and meanwhile, the time is required for marking the data, which can lead to task progress; on the other hand, simply increasing training data often cannot effectively solve the problem, and the increase of the data cannot bring fundamental improvement to the capacity of the model.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a named entity identification method and device, a storage medium and an electronic device, which at least solve the technical problem of high cost for accurately realizing named entity identification in the prior art.
According to an aspect of an embodiment of the present invention, there is provided a named entity recognition method, including: acquiring a target text to be identified, and determining attribute information of a first identification task in the target text; constructing an attribute identification task by taking the attribute information as a target, and determining the attribute identification task as a second identification task under the condition that the attribute identification task is a target class task; and inputting the first recognition task and the second recognition task into a target neural network model, and outputting a named entity of the target text, wherein the target neural network model is obtained through training a training sample and marking information of the training sample.
According to another aspect of the embodiment of the present invention, there is also provided a named entity recognition apparatus, including: the device comprises an acquisition unit, a recognition unit and a recognition unit, wherein the acquisition unit is used for acquiring a target text to be recognized and determining attribute information of a first recognition task in the target text; the determining unit is used for constructing an attribute identification task by taking the attribute information as a target, and determining the attribute identification task as a second identification task under the condition that the attribute identification task is a target class task; the output unit is used for inputting the first recognition task and the second recognition task into a target neural network model and outputting the named entity of the target text, wherein the target neural network model is obtained through training of training samples and labeling information of the training samples.
According to a further aspect of embodiments of the present invention, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the named entity recognition method described above when run.
According to still another aspect of the embodiments of the present invention, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the named entity recognition method described above through the computer program.
In the embodiment of the invention, the target text to be identified is obtained, and the attribute information of a first identification task in the target text is determined; constructing an attribute identification task by taking the attribute information as a target, and determining the attribute identification task as a second identification task under the condition that the attribute identification task is a target class task; the first recognition task and the second recognition task are input into the target neural network model, and the named entity of the target text is output, wherein the target neural network model is obtained through training of training samples and marking information of the training samples, the purpose of introducing the second recognition task and determining named identification of the entity according to the first recognition task and the second recognition task is achieved, and therefore the technical problem that in the prior art, the training samples are added for accurately realizing named entity identification, and further the cost is high for accurately realizing named entity identification in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
FIG. 1 is a schematic illustration of an application environment for an alternative named entity recognition method according to an embodiment of the invention;
FIG. 2 is a flow chart of an alternative named entity recognition method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of an alternative multi-tasking serial named entity identification network architecture according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative named entity recognition device according to an embodiment of the invention;
fig. 5 is a schematic diagram of an alternative electronic device according to an example of the invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For a better understanding of the embodiments provided herein, some of the terms are now described as follows:
named entity: entities in the text that have a specific meaning or are highly descriptive, such as person names, place names, organization names, date and time, proper nouns, etc.
Named entity identification: named entity recognition (NamedEntity Recongition) is a classical task in natural language processing, with the task objective of automatically recognizing named entities in text through an algorithm.
Complex named entity recognition: named entities identify a subset of tasks, particularly NER tasks that can be accomplished not only by the nature of the entity itself, but also by considering contextual semantic information. Such as extracting event subjects in news text.
According to an aspect of the embodiment of the present invention, a named entity recognition method is provided, optionally, as an optional implementation manner, the named entity recognition method may be applied, but not limited to, in a hardware environment as shown in fig. 1, and may include, but not limited to, the terminal device 102, the network 110, and the server 112.
The terminal device 102 may include, but is not limited to: a human-machine interaction screen 104, a processor 106 and a memory 108. The man-machine interaction screen 104 is used for acquiring man-machine interaction instructions through a man-machine interaction interface and is also used for target texts; the processor 106 is configured to complete the recognition of the named entity in response to the man-machine interaction instruction. The memory 108 is used for storing information such as the target text and attributes of the named entity recognition task. The server here may include, but is not limited to: the processing engine 116 is used for calling target texts to be identified in the database 114 and determining attribute information of a first identification task in the target texts; constructing an attribute identification task by taking the attribute information as a target, and determining the attribute identification task as a second identification task under the condition that the attribute identification task is a target class task; the first recognition task and the second recognition task are input into the target neural network model, and the named entity of the target text is output, wherein the target neural network model is obtained through training of training samples and marking information of the training samples, the purpose of introducing the second recognition task and determining named identification of the entity according to the first recognition task and the second recognition task is achieved, and therefore the technical problem that in the prior art, the training samples are added for accurately realizing named entity identification, and further the cost is high for accurately realizing named entity identification in the prior art is solved.
The specific process comprises the following steps: the target text is obtained and sent to the server 112 via the network 110 as in steps S102-S110. Determining, at the server 112, attribute information of the first recognition task in the target text; constructing an attribute identification task by taking the attribute information as a target, and determining the attribute identification task as a second identification task under the condition that the attribute identification task is a target class task; and inputting the first recognition task and the second recognition task into a target neural network model, and outputting a named entity of the target text, wherein the target neural network model is obtained through training a training sample and labeling information of the training sample. And then returns the result of the above determination to the terminal device 102.
Then, as shown in steps S102-S110, the terminal device 102 obtains a target text to be identified, and determines attribute information of a first identification task in the target text; constructing an attribute identification task by taking the attribute information as a target, and determining the attribute identification task as a second identification task under the condition that the attribute identification task is a target class task; the first recognition task and the second recognition task are input into the target neural network model, and the named entity of the target text is output, wherein the target neural network model is obtained through training of training samples and marking information of the training samples, the purpose of introducing the second recognition task and determining named identification of the entity according to the first recognition task and the second recognition task is achieved, and therefore the technical problem that in the prior art, the training samples are added for accurately realizing named entity identification, and further the cost is high for accurately realizing named entity identification in the prior art is solved.
Alternatively, in this embodiment, the named entity recognition method may be, but is not limited to, applied to the server 112, so as to assist the application client in performing named entity recognition processing on the published target file. The application client may be, but not limited to, a terminal device 102, where the terminal device 102 may be, but not limited to, a terminal device supporting running of the application client, such as a mobile phone, a tablet computer, a notebook computer, a PC, etc. The server 112 and the terminal device 102 may implement data interaction through, but are not limited to, a network, which may include, but is not limited to, a wireless network or a wired network. Wherein the wireless network comprises: bluetooth, WIFI, and other networks that enable wireless communications. The wired network may include, but is not limited to: wide area network, metropolitan area network, local area network. The above is merely an example, and is not limited in any way in the present embodiment.
Optionally, as an optional implementation manner, as shown in fig. 2, the named entity identifying method includes:
step S202, obtaining a target text to be recognized, and determining attribute information of a first recognition task in the target text.
In step S204, an attribute identification task is constructed with the attribute information as a target, and if the attribute identification task is a target class task, the attribute identification task is determined as a second identification task.
Step S206, inputting the first recognition task and the second recognition task into a target neural network model, and outputting a named entity of the target text, wherein the target neural network model is obtained through training of training samples and labeling information of the training samples.
Alternatively, the solution in this embodiment may include, but is not limited to, application in: and identifying the name and the place name in the news text. The target text may include, but is not limited to, a picture text including a place name and a person name, and identification of various complicated person names and named entities of the place name.
Taking the event body extraction task of the news text as an example, the event body extraction of the news text refers to extracting an event body of an event reported in the news text, and the event body may be a person or an organization.
The second recognition task is a named entity recognition task with lower extraction difficulty, and the extraction target completely comprises the first recognition task. The second recognition task is simple, a good extraction result can be obtained easily, meanwhile, the second recognition task result can provide useful information for the first recognition task, and when the network structure can effectively utilize the second recognition task information, the accuracy of the first recognition task can be effectively improved.
The labeling process for determining the second recognition task is as follows:
step one, confirming an extraction target of a current task (an original task, namely a first identification task);
step two, extracting target attributes of the current task;
step three, judging whether the task difficulty is lower by taking the target attribute as an extraction target;
step four, determining a second labeling task;
as shown in table 1, taking the news text event body extraction second recognition task as an example, the following is:
TABLE 1
Optionally, in this embodiment, determining, according to the attribute information, that the first recognition task belongs to the target class recognition task may include:
obtaining a mapping relation table of the first recognition task, wherein the mapping relation table records the difficulty degree of the first recognition task, and the attribute information comprises the difficulty degree;
and determining the difficulty level of the first recognition task according to the matching of the attribute information and the mapping table, wherein the target class recognition task represents the difficulty level of the first recognition task.
Under the condition that the record identification task in the mapping table comprises three grades of simple, medium and difficult, according to matching of attribute information and the mapping table, determining that the first identification task belongs to the simple identification task;
and determining a second identification task according to the first identification task, wherein the second identification task represents a subtask of the first identification task.
Optionally, in this embodiment, inputting the first recognition task and the second recognition task into the target neural network model, and outputting the named entity of the target text may include:
acquiring training texts in a training sample set, and labeling named entities for each training text in the training set;
acquiring marking information of a first recognition task and marking information of a second recognition task in a training text;
training a neural network model for the first recognition task and the second recognition task, and training the neural network model by adopting an error back propagation mode;
and determining the target neural network model when the parameters of the neural network model converge to a predetermined threshold.
The error back propagation method comprises the following steps:
adjusting parameters of the neural network model according to the prediction error of the first recognition task and the prediction error of the second recognition task;
and determining the neural network as a target neural network model under the condition that the neural network model parameters are converged to a preset threshold value.
According to the embodiment provided by the application, the target text to be identified is obtained, and the attribute information of the first identification task in the target text is determined; constructing an attribute identification task by taking the attribute information as a target, and determining the attribute identification task as a second identification task under the condition that the attribute identification task is a target class task; the first recognition task and the second recognition task are input into the target neural network model, and the named entity of the target text is output, wherein the target neural network model is obtained through training of training samples and marking information of the training samples, the purpose of introducing the second recognition task and determining named identification of the entity according to the first recognition task and the second recognition task is achieved, and therefore the technical problem that in the prior art, the training samples are added for accurately realizing named entity identification, and further the cost is high for accurately realizing named entity identification in the prior art is solved.
As an optional embodiment, the application also provides a named entity recognition method based on multitasking learning.
The method in this embodiment has the following core ideas: firstly, the original task is generalized, an auxiliary recognition task with lower difficulty is introduced, then the auxiliary task and the original task are completed simultaneously under a serial multi-task neural network model, and finally the complex named entity recognition is realized. In addition, the serial multitasking network structure provided by the method can effectively increase information transmission among subtasks so as to improve the final effect of the model.
The method comprises the following steps of: 1, constructing auxiliary tasks (corresponding to second recognition tasks) according to the original tasks (first recognition tasks). 2, constructing a model, namely providing a serial multitask learning deep network structure for processing complex named entity recognition tasks. And 3, network training.
Step 1, constructing an auxiliary task (corresponding to a second recognition task) according to an original task (a first recognition task);
taking the event body extraction task of the news text as an example to illustrate the definition of the auxiliary task, the news text event body extraction refers to extracting an event body of an event reported in the news text, and the event body may be a person or an organization.
The auxiliary task is a named entity identification task with lower extraction difficulty and the extraction target completely comprises the original task. The auxiliary task is simple, a good extraction result can be obtained easily, meanwhile, the auxiliary task result can provide useful information for the original task, and when the network structure can effectively utilize the auxiliary task information, the accuracy of the original task can be effectively improved.
Step 2, constructing a neural network model;
in this embodiment, a serial named entity recognition network based on multi-task learning is provided, and the network structure is shown in fig. 3, and the multi-task serial named entity recognition network structure is schematically shown.
The whole network is a multi-task learning network architecture, and a text embedding layer and a multi-head attention layer are shared by a plurality of tasks. The auxiliary task and the original task are used as sub-learning tasks to participate in model training together. It should be noted that, fig. 3 only shows a network structure when there is one auxiliary task, and when there are a plurality of auxiliary tasks, each auxiliary task has an auxiliary task network (such as a sub-network on the left side of fig. 3).
The text embedding layer may use various embedding methods such as word2vector, BERT, etc. The text embedding layer functions to learn a vector representation of each character in the text, which may have different representation capabilities depending on the embedding method, e.g. BERT may consider the context when modeling the character vector, word2vec only considering the character itself. The multi-head attention layer is used for providing full-text attention at a plurality of different angles, and the multi-head attention layer is connected with the full-connection layer of each subtask, so that each subtask can select a part suitable for the task from a plurality of kinds of attention (as shown in a process (b) in fig. 3).
It should be noted that the text embedding does not specify a specific embedding method, and there are multiple alternatives, such as word2vector, bert, etc.
The CRF layer output results of each subtask have two effects. First, is used for producing the output of this task; secondly, the output vector is spliced with the result of the full connection layer of the main task and then enters the CRF layer of the main task to generate the output result of the main task (as shown in the processes (c) and (d) in fig. 3). The method ensures that the main task network can consider the judging result of each subtask when the NER is made, and solves the problem of information communication between the main task and the subtasks.
In the network structure proposed in this embodiment, a dropout layer may be added after the network is shared, or a dropout layer may be added in each subtask network structure. The dropout network structure can effectively prevent over fitting in the network training process, and the network root structure is not changed when dropout is added.
And 3, training a model.
And during model training, model parameters are optimized by using an error counter-propagation mode, and the auxiliary task and the main task respectively generate prediction errors during training and perform parameter optimization by using the errors. The information transmission process from each subtask to the main task (process (a) in fig. 3) only participates in the model phase-competing parameter transmission, and does not participate in error back propagation during model training. Each auxiliary task only considers the current task tag when optimizing the parameters, and does not have to consider the main task. This makes the model as a whole more convergent.
Through the embodiment provided by the application, the method has the following beneficial effects:
1. the network structure can effectively improve the accuracy and recall rate of the model when processing the complex named entity recognition task. By defining auxiliary tasks and applying the network structure provided by the invention, common sense knowledge (such as a news event main body is necessarily a person or organization) can be effectively introduced into a named entity recognition model, so that the accuracy and recall rate of the model are effectively improved.
2. The network structure is easier to fit and train. The serial multi-task network structure is added on the basis of the multi-task learning network structure frame, and compared with other multi-task network structures, the serial network structure is easier to converge during training, so that training is simpler.
3. The network structure of the invention has fewer network parameters, and by introducing a multi-task learning framework and by means of the characteristic of multi-task learning sharing part of the network structure, the network structure of the invention contemplates that the solution of multiple models in multiple series has fewer network parameters, so that the network structure of the invention operates faster in practical use.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
According to another aspect of the embodiment of the invention, a named entity recognition device for implementing the named entity recognition method is also provided. As shown in fig. 4, the named entity recognition device includes: an acquisition unit 41, a determination unit 43, and an output unit 45.
An obtaining unit 41, configured to obtain a target text to be identified, and determine attribute information of a first identification task in the target text.
The determining unit 43 is configured to construct an attribute identifying task with the attribute information as a target, and determine the attribute identifying task as a second identifying task when the attribute identifying task is a target class task.
The output unit 45 is configured to input the first recognition task and the second recognition task into a target neural network model, and output a named entity of the target text, where the target neural network model is obtained by training a training sample and labeling information of the training sample.
Alternatively, in the present embodiment, the determining unit 43 may include:
the first acquisition module is used for acquiring a mapping relation table of the first identification task, wherein the mapping relation table records the difficulty degree of the first identification task identification, and the attribute information comprises the difficulty degree;
and the first determining module is used for determining the difficulty level of the first recognition task according to the matching of the attribute information and the mapping table, wherein the target class recognition task represents the difficulty level of the first recognition task.
Optionally, the apparatus further includes:
the second determining module is used for determining that the first recognition task belongs to the simple recognition task according to matching of the attribute information and the mapping table when the recording recognition task in the mapping table comprises three grades of simple, medium and difficult;
and the third determining module is used for determining a second identification task according to the first identification task, wherein the second identification task represents a subtask of the first identification task.
The output unit 45 may include:
the second acquisition module is used for acquiring training texts in the training sample set and labeling named entities for each training text in the training set;
the third acquisition module is used for acquiring the labeling information of the first recognition task and the labeling information of the second recognition task in the training text;
the adjustment module is used for training the neural network model for the first recognition task and the second recognition task and training the neural network model by adopting an error back propagation mode;
and the fourth determining module is used for determining the target neural network model when the parameters of the neural network model are converged to the preset threshold value.
The error back propagation method comprises the following steps: adjusting parameters of the neural network model according to the prediction error of the first recognition task and the prediction error of the second recognition task; and determining the neural network as a target neural network model under the condition that the neural network model parameters are converged to a preset threshold value.
By the embodiment provided by the application, the obtaining unit 41 obtains the target text to be identified, and determines the attribute information of the first identification task in the target text; the determination unit 43 determines a second recognition task from among the first recognition tasks in the case where the first recognition task is determined to belong to the target class recognition task based on the attribute information; the output unit 45 inputs the first recognition task and the second recognition task into a target neural network model, and outputs a named entity of the target text, wherein the target neural network model is obtained through training of training samples and labeling information of the training samples. The aim of introducing a second recognition task and determining the naming recognition of the entity according to the first recognition task and the second recognition task is achieved, so that the problem that in the prior art, a training sample is added for accurately realizing the naming entity recognition is avoided, and the technical problem that in order to accurately realize the naming entity recognition, the cost is high in the prior art is solved.
According to a further aspect of the embodiments of the present invention, there is also provided an electronic device for implementing the above named entity recognition method, as shown in fig. 5, the electronic device comprising a memory 502 and a processor 504, the memory 502 having stored therein a computer program, the processor 504 being arranged to perform the steps of any of the method embodiments described above by means of the computer program.
Alternatively, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of the computer network.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, acquiring a target text to be identified, and determining attribute information of a first identification task in the target text;
s2, constructing an attribute identification task by taking the attribute information as a target, and determining the attribute identification task as a second identification task under the condition that the attribute identification task is a target class task;
s3, inputting the first recognition task and the second recognition task into a target neural network model, and outputting a named entity of the target text, wherein the target neural network model is obtained through training of training samples and labeling information of the training samples.
Alternatively, it will be understood by those skilled in the art that the structure shown in fig. 5 is only schematic, and the electronic device may also be a terminal device such as a smart phone (e.g. an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a mobile internet device (Mobile Internet Devices, MID), a PAD, etc. Fig. 5 is not limited to the structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
The memory 502 may be used to store software programs and modules, such as program instructions/modules corresponding to the named entity recognition method and apparatus in the embodiment of the present invention, and the processor 504 executes the software programs and modules stored in the memory 502 to perform various functional applications and data processing, that is, implement the named entity recognition method described above. Memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 502 may further include memory located remotely from processor 504, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 502 may be used to store, but is not limited to, information such as target text, named entities, and the like. As an example, as shown in fig. 5, the memory 502 may include, but is not limited to, the acquiring unit 41, the determining unit 43, and the output unit 45 in the named entity recognition device. In addition, other module units in the named entity recognition device may be included, but are not limited to, and are not described in detail in this example.
Optionally, the transmission device 506 is configured to receive or transmit data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 506 includes a network adapter (Network Interface Controller, NIC) that may be connected to other network devices and routers via a network cable to communicate with the internet or a local area network. In one example, the transmission device 506 is a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.
In addition, the electronic device further includes: a display 508, configured to display the target text to be identified; and a connection bus 510 for connecting the respective module parts in the above-described electronic device.
According to a further aspect of embodiments of the present invention, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring a target text to be identified, and determining attribute information of a first identification task in the target text;
s2, constructing an attribute identification task by taking the attribute information as a target, and determining the attribute identification task as a second identification task under the condition that the attribute identification task is a target class task;
s3, inputting the first recognition task and the second recognition task into a target neural network model, and outputting a named entity of the target text, wherein the target neural network model is obtained through training of training samples and labeling information of the training samples.
Alternatively, in this embodiment, it will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by a program for instructing a terminal device to execute the steps, where the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the method described in the embodiments of the present invention.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (7)

1. A named entity recognition method, comprising:
acquiring a target text to be identified, and determining attribute information of a first identification task in the target text;
constructing an attribute identification task by taking the attribute information as a target, and determining the attribute identification task as a second identification task under the condition that the attribute identification task is a target class task;
inputting the first recognition task and the second recognition task into a target neural network model, and outputting a named entity of the target text, wherein the target neural network model is obtained through training a training sample and marking information of the training sample;
wherein, when the attribute identifying task is a target task, determining the attribute identifying task as a second identifying task includes:
obtaining a mapping relation table of the first recognition task, wherein the mapping relation table records the difficulty degree of the first recognition task, and the attribute information comprises the difficulty degree;
determining the difficulty level of the first recognition task according to the matching of the attribute information and the mapping table, wherein the target class recognition task represents the difficulty level of the first recognition task;
the step of inputting the first recognition task and the second recognition task into a target neural network model and outputting the named entity of the target text includes:
acquiring training texts in a training sample set, and labeling named entities for each training text in the training set;
acquiring marking information of a first recognition task and marking information of a second recognition task in a training text;
training the neural network model of the first recognition task and the second recognition task, and training the neural network model by adopting an error back propagation mode;
and determining the target neural network model when the parameters of the neural network model converge to a predetermined threshold.
2. The method according to claim 1, characterized in that it comprises:
under the condition that the record identification task in the mapping table comprises three grades of simple, medium and difficult, according to the matching of the attribute information and the mapping table, determining that the first identification task belongs to a simple identification task;
and determining the attribute identification task as a second identification task, wherein the second identification task represents a subtask of the first identification task.
3. The method of claim 1, wherein the error counter-propagating means comprises:
adjusting parameters of the neural network model according to the prediction error of the first recognition task and the prediction error of the second recognition task;
and determining the neural network as the target neural network model under the condition that the neural network model parameters are converged to a preset threshold value.
4. A named entity recognition device, comprising:
the device comprises an acquisition unit, a recognition unit and a recognition unit, wherein the acquisition unit is used for acquiring a target text to be recognized and determining attribute information of a first recognition task in the target text;
the determining unit is used for constructing an attribute identification task by taking the attribute information as a target, and determining the attribute identification task as a second identification task under the condition that the attribute identification task is a target class identification task;
the output unit is used for inputting the first recognition task and the second recognition task into a target neural network model and outputting a named entity of the target text, wherein the target neural network model is obtained through training of training samples and labeling information of the training samples;
the determination unit includes:
the first acquisition module is used for acquiring a mapping relation table of the first identification task, wherein the mapping relation table records the difficulty degree identified by the first identification task, and the attribute information comprises the difficulty degree;
the first determining module is used for determining the difficulty level of the first identification task according to the matching of the attribute information and the mapping table, wherein the target class identification task represents the difficulty level of the first identification task;
the output unit includes:
the second acquisition module is used for acquiring training texts in a training sample set and labeling named entities for each training text in the training set;
the third acquisition module is used for acquiring the labeling information of the first recognition task and the labeling information of the second recognition task in the training text;
the adjustment module is used for training the neural network model of the first recognition task and the second recognition task and training the neural network model in an error counter-propagation mode;
and the fourth determining module is used for determining the target neural network model when the parameters of the neural network model are converged to a preset threshold value.
5. The apparatus according to claim 4, comprising:
the second determining module is used for determining that the first recognition task belongs to a simple recognition task according to the matching of the attribute information and the mapping table when the recording recognition task in the mapping table comprises three grades of simple, medium and difficult;
and a third determining module, configured to determine the second identifying task according to the first identifying task, where the second identifying task represents a subtask of the first identifying task.
6. A computer readable storage medium comprising a stored program, wherein the program when run performs the method of any one of the preceding claims 1 to 3.
7. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 3 by means of the computer program.
CN202010286857.XA 2020-04-13 2020-04-13 Named entity recognition method and device, storage medium and electronic device Active CN111651989B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010286857.XA CN111651989B (en) 2020-04-13 2020-04-13 Named entity recognition method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010286857.XA CN111651989B (en) 2020-04-13 2020-04-13 Named entity recognition method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN111651989A CN111651989A (en) 2020-09-11
CN111651989B true CN111651989B (en) 2024-04-02

Family

ID=72346462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010286857.XA Active CN111651989B (en) 2020-04-13 2020-04-13 Named entity recognition method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN111651989B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112270193A (en) * 2020-11-02 2021-01-26 重庆邮电大学 Chinese named entity identification method based on BERT-FLAT
CN112818701B (en) * 2021-02-01 2023-07-04 上海明略人工智能(集团)有限公司 Method, device and equipment for determining dialogue entity recognition model

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9058317B1 (en) * 2012-11-01 2015-06-16 Digital Reasoning Systems, Inc. System and method for machine learning management
CN107766787A (en) * 2016-08-16 2018-03-06 深圳云天励飞技术有限公司 Face character recognition methods, device, terminal and storage medium
CN108536679A (en) * 2018-04-13 2018-09-14 腾讯科技(成都)有限公司 Name entity recognition method, device, equipment and computer readable storage medium
CN109062901A (en) * 2018-08-14 2018-12-21 第四范式(北京)技术有限公司 Neural network training method and device and name entity recognition method and device
WO2019008394A1 (en) * 2017-07-07 2019-01-10 Cscout Ltd Digital information capture and retrieval
CN109190120A (en) * 2018-08-31 2019-01-11 第四范式(北京)技术有限公司 Neural network training method and device and name entity recognition method and device
CN110287480A (en) * 2019-05-27 2019-09-27 广州多益网络股份有限公司 A kind of name entity recognition method, device, storage medium and terminal device
CN110851566A (en) * 2019-11-04 2020-02-28 沈阳雅译网络技术有限公司 Improved differentiable network structure searching method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9058317B1 (en) * 2012-11-01 2015-06-16 Digital Reasoning Systems, Inc. System and method for machine learning management
CN107766787A (en) * 2016-08-16 2018-03-06 深圳云天励飞技术有限公司 Face character recognition methods, device, terminal and storage medium
WO2019008394A1 (en) * 2017-07-07 2019-01-10 Cscout Ltd Digital information capture and retrieval
CN108536679A (en) * 2018-04-13 2018-09-14 腾讯科技(成都)有限公司 Name entity recognition method, device, equipment and computer readable storage medium
CN109062901A (en) * 2018-08-14 2018-12-21 第四范式(北京)技术有限公司 Neural network training method and device and name entity recognition method and device
CN109190120A (en) * 2018-08-31 2019-01-11 第四范式(北京)技术有限公司 Neural network training method and device and name entity recognition method and device
CN110287480A (en) * 2019-05-27 2019-09-27 广州多益网络股份有限公司 A kind of name entity recognition method, device, storage medium and terminal device
CN110851566A (en) * 2019-11-04 2020-02-28 沈阳雅译网络技术有限公司 Improved differentiable network structure searching method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王蕾 ; 谢云 ; 周俊生 ; 顾彦慧 ; 曲维光 ; .基于神经网络的片段级中文命名实体识别.中文信息学报.2018,(03),全文. *
郜成胜 ; 张君福 ; 李伟平 ; 赵文 ; 张世琨 ; .一种基于混合神经网络的命名实体识别与共指消解联合模型.电子学报.2020,(第03期),全文. *

Also Published As

Publication number Publication date
CN111651989A (en) 2020-09-11

Similar Documents

Publication Publication Date Title
KR102342604B1 (en) Method and apparatus for generating neural network
CN109033068A (en) It is used to read the method, apparatus understood and electronic equipment based on attention mechanism
CN107766940A (en) Method and apparatus for generation model
CN109684047A (en) Event-handling method, device, equipment and computer storage medium
CN108121800A (en) Information generating method and device based on artificial intelligence
CN111666416B (en) Method and device for generating semantic matching model
CN111651989B (en) Named entity recognition method and device, storage medium and electronic device
CN111813910A (en) Method, system, terminal device and computer storage medium for updating customer service problem
CN111738010A (en) Method and apparatus for generating semantic matching model
CN110245310B (en) Object behavior analysis method, device and storage medium
Malode Benchmarking public large language model
CN110222144A (en) Method for extracting content of text, device, electronic equipment and storage medium
CN111931503B (en) Information extraction method and device, equipment and computer readable storage medium
US20210357682A1 (en) Artificial intelligence driven image retrieval
CN111353290B (en) Method and system for automatically responding to user inquiry
US11188548B2 (en) Profile data store automation via bots
CN116757254B (en) Task processing method, electronic device and storage medium
CN111526054B (en) Method and device for acquiring network
CN111414609B (en) Object verification method and device
CN115510203B (en) Method, device, equipment, storage medium and program product for determining answers to questions
CN117909562A (en) Content recommendation method, device, equipment and medium based on content recommendation model
CN114936561A (en) Voice text processing method and device, storage medium and processor
CN116910201A (en) Dialogue data generation method and related equipment thereof
CN117194629A (en) Identification method and related device for preset category images
CN117852603A (en) Task information acquisition method and related equipment

Legal Events

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