CN112926326B - Named entity recognition method, named entity recognition device, named entity recognition computer equipment and named entity recognition storage medium - Google Patents
Named entity recognition method, named entity recognition device, named entity recognition computer equipment and named entity recognition storage medium Download PDFInfo
- Publication number
- CN112926326B CN112926326B CN202110191377.XA CN202110191377A CN112926326B CN 112926326 B CN112926326 B CN 112926326B CN 202110191377 A CN202110191377 A CN 202110191377A CN 112926326 B CN112926326 B CN 112926326B
- Authority
- CN
- China
- Prior art keywords
- template
- intervention
- sentence
- entity recognition
- statement
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 212
- 230000008569 process Effects 0.000 claims abstract description 166
- 238000004590 computer program Methods 0.000 claims description 38
- 238000012545 processing Methods 0.000 description 34
- 238000010586 diagram Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 5
- 230000003993 interaction Effects 0.000 description 4
- 238000003058 natural language processing Methods 0.000 description 4
- 230000008520 organization Effects 0.000 description 4
- 238000013473 artificial intelligence Methods 0.000 description 3
- 230000003068 static effect Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 241001155433 Centrarchus macropterus Species 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000004393 prognosis Methods 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/289—Phrasal analysis, e.g. finite state techniques or chunking
- G06F40/295—Named entity recognition
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Machine Translation (AREA)
Abstract
The application relates to a named entity recognition method, a named entity recognition device, computer equipment and a storage medium. The method comprises the following steps: acquiring sentences to be identified, and determining a business process corresponding to the sentences; inquiring at least one recall template preset corresponding to the business process; matching the sentence with at least one recall template, and determining a sentence to be interfered, which is successfully matched with the at least one recall template in the sentence, according to a matching result; and performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business flow, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result. By adopting the method, the accuracy of named entity identification can be improved.
Description
Technical Field
The present disclosure relates to the field of artificial intelligence technologies, and in particular, to a named entity recognition method, apparatus, computer device, and storage medium.
Background
With the development of artificial intelligence (Artificial Intelligence, AI) technology, natural language processing (Natural Language Processing, NLP) technology has been widely used in speech recognition, speech translation, understanding complete sentences, understanding synonyms of matching words, and generating grammatically correct complete sentences and paragraphs. As a basic task of natural language processing, named entity recognition (Named Entities Recognition, NER) aims at recognizing entities with specific meaning such as person names, place names, organization names and the like in corpora, such as recognizing named entities such as person names, place names, organization names, time, date and the like from sentences.
At present, when the ambiguous sentences are identified, for example, named entity identification is carried out on Nanjing, the traditional named entity identification method can identify Nanjing or Beijing, and the named entity identification accuracy is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a named entity recognition method, apparatus, computer device, and storage medium that can improve the accuracy of named entity recognition.
A named entity recognition method, the method comprising:
acquiring sentences to be identified, and determining a business process corresponding to the sentences;
inquiring at least one recall template preset corresponding to the business process;
matching the sentence with at least one recall template, and determining a sentence to be interfered, which is successfully matched with the at least one recall template in the sentence, according to a matching result;
and performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business flow, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result.
In one embodiment, the sentence is matched with at least one recall template, and the sentence to be interfered which is successfully matched with the at least one recall template in the sentence is determined according to the matching result, which comprises the following steps: determining recall feature fields in at least one recall template; performing character matching on the recall feature field in the sentence, and determining a target recall template with successful matching when the obtained character matching result is successful matching; and determining the statement to be interfered from the statement based on the target recall template.
In one embodiment, determining a statement to be interfered with from the statements based on the target recall template comprises: determining a slot to be interfered in a target recall template; dividing sentences according to the recall feature field and the slots to be intervened to obtain sentence dividing results; and determining a field corresponding to the slot to be interfered in the sentence dividing result as the sentence to be interfered.
In one embodiment, performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business flow, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result, wherein the method comprises the following steps: inquiring a forward intervention template corresponding to the business process; carrying out forward matching on the forward intervention template and each field of the sentence to be intervened to obtain a forward matching result; and when the forward matching result is successful, determining a field which is successfully matched with the forward intervention template in the sentence to be interfered as a named entity recognition result of the sentence.
In one embodiment, performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business flow, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result, wherein the method comprises the following steps: inquiring a negative intervention template preset corresponding to the business process; carrying out negative matching on the negative intervention template and each field of the statement to be intervened to obtain a negative matching result; and when the negative matching result is successful, determining that the named entity recognition result of the sentence does not comprise a field which is successfully matched with the negative intervention template in the sentence to be interfered.
In one embodiment, performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business flow, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result, wherein the method comprises the following steps: inquiring a positive intervention template and a negative intervention template which correspond to the business process and are preset; matching the negative intervention template and the positive intervention template with each field of the sentence to be intervened respectively to obtain a negative matching result and a positive matching result; when the negative matching result and the positive matching result are both successful in matching, and the field which is successfully matched with the negative intervention template in the sentence to be interfered and the field which is successfully matched with the positive intervention template in the sentence to be interfered are the same fields, determining that the named entity identification result of the sentence does not comprise the same fields.
In one embodiment, the method further comprises: determining word slots to be filled corresponding to the business process; filling the named entity recognition result into the word slots to be filled to obtain service word slots corresponding to the service flow; and executing the business process based on the business word slot when the business word slot meets the process execution condition.
A named entity recognition device, the device comprising:
The sentence acquisition module is used for acquiring sentences to be identified and determining business processes corresponding to the sentences;
the recall template query module is used for querying at least one recall template preset corresponding to the business process;
the statement to be interfered determining module is used for matching the statement with at least one recall template and determining the statement to be interfered which is successfully matched with the recall template in the statement according to the matching result;
the recognition intervention module is used for performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business flow, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result.
In one embodiment, the statement to be intervened determining module comprises a feature field determining module, a character matching module and a target recall template module; wherein: the feature field determining module is used for determining recall feature fields in at least one recall template; the character matching module is used for carrying out character matching on the recall characteristic field in the sentence, and determining a target recall template which is successfully matched when the obtained character matching result is successful; and the target recall template module is used for determining the statement to be interfered from the statement based on the target recall template.
In one embodiment, the target recall template module comprises a slot position determining module to be interfered, a sentence dividing module and a dividing result processing module; wherein: the to-be-interfered slot position determining module is used for determining to-be-interfered slot positions in the target recall template; the sentence dividing module is used for dividing sentences according to the recall feature field and the slots to be intervened to obtain sentence dividing results; the division result processing module is used for determining a field corresponding to the slot to be interfered in the sentence division result as the sentence to be interfered.
In one embodiment, the recognition intervention module comprises a forward template query module, a forward matching module, and a forward intervention module; wherein: the forward template inquiry module is used for inquiring a preset forward intervention template corresponding to the business process; the forward matching module is used for carrying out forward matching on the forward intervention template and each field of the statement to be intervened to obtain a forward matching result; and the forward intervention module is used for determining a field successfully matched with the forward intervention template in the sentence to be interfered as a named entity recognition result of the sentence when the forward matching result is successful.
In one embodiment, the identifying intervention module comprises a negative template query module, a negative matching module and a negative intervention module; wherein: the negative template query module is used for querying a negative intervention template preset corresponding to the business process; the negative matching module is used for carrying out negative matching on the negative intervention template and each field of the statement to be intervened to obtain a negative matching result; and the negative intervention module is used for determining that the named entity identification result of the sentence does not comprise a field which is successfully matched with the negative intervention template in the sentence to be interfered when the negative matching result is successful.
In one embodiment, the identifying intervention module includes an intervention module query module, an intervention template matching module, and an intervention processing module; wherein: the intervention module inquiry module is used for inquiring a positive intervention template and a negative intervention template which are preset corresponding to the business process; the intervention template matching module is used for respectively matching the negative intervention template and the positive intervention template with each field of the sentence to be intervened to obtain a negative matching result and a positive matching result; and the intervention processing module is used for determining that the named entity recognition result of the sentence does not comprise the same field when the negative matching result and the positive matching result are both successful in matching and the field successfully matched with the negative intervention template in the sentence to be intervened and the field successfully matched with the positive intervention template in the sentence to be intervened are the same field.
In one embodiment, the device further comprises a word slot determining module, a word slot filling module and a service processing module; wherein: the word slot determining module is used for determining word slots to be filled corresponding to the business flow; the word slot filling module is used for filling the named entity identification result into the word slot to be filled to obtain a business word slot corresponding to the business flow; and the business processing module is used for executing the business process based on the business word slot when the business word slot meets the process execution condition.
A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
acquiring sentences to be identified, and determining a business process corresponding to the sentences;
inquiring at least one recall template preset corresponding to the business process;
matching the sentence with at least one recall template, and determining a sentence to be interfered, which is successfully matched with the at least one recall template in the sentence, according to a matching result;
and performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business flow, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result.
In one embodiment, the processor when executing the computer program further performs the steps of: determining recall feature fields in at least one recall template; performing character matching on the recall feature field in the sentence, and determining a target recall template with successful matching when the obtained character matching result is successful matching; and determining the statement to be interfered from the statement based on the target recall template.
In one embodiment, the processor when executing the computer program further performs the steps of: determining a slot to be interfered in a target recall template; dividing sentences according to the recall feature field and the slots to be intervened to obtain sentence dividing results; and determining a field corresponding to the slot to be interfered in the sentence dividing result as the sentence to be interfered.
In one embodiment, the processor when executing the computer program further performs the steps of: inquiring a forward intervention template corresponding to the business process; carrying out forward matching on the forward intervention template and each field of the sentence to be intervened to obtain a forward matching result; and when the forward matching result is successful, determining a field which is successfully matched with the forward intervention template in the sentence to be interfered as a named entity recognition result of the sentence.
In one embodiment, the processor when executing the computer program further performs the steps of: inquiring a negative intervention template preset corresponding to the business process; carrying out negative matching on the negative intervention template and each field of the statement to be intervened to obtain a negative matching result; and when the negative matching result is successful, determining that the named entity recognition result of the sentence does not comprise a field which is successfully matched with the negative intervention template in the sentence to be interfered.
In one embodiment, the processor when executing the computer program further performs the steps of: inquiring a positive intervention template and a negative intervention template which correspond to the business process and are preset; matching the negative intervention template and the positive intervention template with each field of the sentence to be intervened respectively to obtain a negative matching result and a positive matching result; when the negative matching result and the positive matching result are both successful in matching, and the field which is successfully matched with the negative intervention template in the sentence to be interfered and the field which is successfully matched with the positive intervention template in the sentence to be interfered are the same fields, determining that the named entity identification result of the sentence does not comprise the same fields.
In one embodiment, the processor when executing the computer program further performs the steps of: determining word slots to be filled corresponding to the business process; filling the named entity recognition result into the word slots to be filled to obtain service word slots corresponding to the service flow; and executing the business process based on the business word slot when the business word slot meets the process execution condition.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring sentences to be identified, and determining a business process corresponding to the sentences;
inquiring at least one recall template preset corresponding to the business process;
matching the sentence with at least one recall template, and determining a sentence to be interfered, which is successfully matched with the at least one recall template in the sentence, according to a matching result;
and performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business flow, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining recall feature fields in at least one recall template; performing character matching on the recall feature field in the sentence, and determining a target recall template with successful matching when the obtained character matching result is successful matching; and determining the statement to be interfered from the statement based on the target recall template.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining a slot to be interfered in a target recall template; dividing sentences according to the recall feature field and the slots to be intervened to obtain sentence dividing results; and determining a field corresponding to the slot to be interfered in the sentence dividing result as the sentence to be interfered.
In one embodiment, the computer program when executed by the processor further performs the steps of: inquiring a forward intervention template corresponding to the business process; carrying out forward matching on the forward intervention template and each field of the sentence to be intervened to obtain a forward matching result; and when the forward matching result is successful, determining a field which is successfully matched with the forward intervention template in the sentence to be interfered as a named entity recognition result of the sentence.
In one embodiment, the computer program when executed by the processor further performs the steps of: inquiring a negative intervention template preset corresponding to the business process; carrying out negative matching on the negative intervention template and each field of the statement to be intervened to obtain a negative matching result; and when the negative matching result is successful, determining that the named entity recognition result of the sentence does not comprise a field which is successfully matched with the negative intervention template in the sentence to be interfered.
In one embodiment, the computer program when executed by the processor further performs the steps of: inquiring a positive intervention template and a negative intervention template which correspond to the business process and are preset; matching the negative intervention template and the positive intervention template with each field of the sentence to be intervened respectively to obtain a negative matching result and a positive matching result; when the negative matching result and the positive matching result are both successful in matching, and the field which is successfully matched with the negative intervention template in the sentence to be interfered and the field which is successfully matched with the positive intervention template in the sentence to be interfered are the same fields, determining that the named entity identification result of the sentence does not comprise the same fields.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining word slots to be filled corresponding to the business process; filling the named entity recognition result into the word slots to be filled to obtain service word slots corresponding to the service flow; and executing the business process based on the business word slot when the business word slot meets the process execution condition.
The named entity recognition method, the named entity recognition device, the named entity recognition computer equipment and the named entity recognition storage medium are used for determining the statement to be interfered, which is successfully matched with the at least one recall template in the statement, through at least one recall template preset by the business process corresponding to the statement to be recognized, carrying out entity recognition intervention on the statement to be interfered through the intervention template preset by the business process, and obtaining the named entity recognition result of the statement according to the entity recognition intervention result. In the processing process of named entity recognition, a to-be-interfered statement in the statement to be recognized is determined through a recall template which corresponds to the business process, entity recognition interference is carried out on the statement to be interfered through an interference template which corresponds to the business process, and named entity recognition is carried out on the statement according to the recall template and the interference template which correspond to different business process configurations, so that the pertinence of named entity recognition in different business processes is improved, and the accuracy of named entity recognition processing on the statement to be recognized in different business processes is improved.
Drawings
FIG. 1 is a diagram of an application environment for a named entity recognition method in one embodiment;
FIG. 2 is a flow diagram of a named entity recognition method in one embodiment;
FIG. 3 is a flow diagram of determining a statement to be intervened in one embodiment;
FIG. 4 is a flow diagram of entity identification intervention in one embodiment;
FIG. 5 is a block diagram of a named entity recognition device in one embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The named entity identification method provided by the application can be applied to an application environment shown in figure 1. Wherein the terminal 102 communicates with the server 104 via a network. The user inputs voice data or text data triggering the business process processing at the terminal 102, for example, the user triggers the business process of booking an air ticket through the input voice data or text data at the terminal 102, the terminal 102 obtains a sentence to be identified input by the user and sends the sentence to be identified to the server 104, the server 104 matches with the sentence to be identified through at least one recall template preset by the business process corresponding to the sentence to be identified, determines a sentence to be intervened which is successfully matched with the at least one recall template in the sentence, performs entity recognition intervention on the sentence to be intervened through an intervention template preset corresponding to the business process, and obtains a named entity recognition result of the sentence according to the entity recognition intervention result, the server 104 can feed back the named entity recognition result to the terminal 102, and the server 104 can execute a corresponding business process based on the named entity recognition result, for example, booking the air ticket for the user and feed back the booking result to the terminal 102. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 104 may be implemented by a stand-alone server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, a named entity recognition method is provided, and the method is applied to the server in fig. 1 for illustration, and includes the following steps:
step 202, acquiring sentences to be identified, and determining the business flow corresponding to the sentences.
The sentence is a corpus which needs to be identified by a named entity, for example, the sentence can be a text sentence, and the sentence is composed of a plurality of characters. For example, for the sentence "I am think of sitting on an airplane to Beijing to play for several days. The sentence can also be a voice text obtained based on a voice recognition technology, for example, the terminal can collect voice data of a user through a microphone, and the text sentence is obtained after natural language understanding processing is carried out on the collected voice data based on the voice recognition technology. Named entity refers to an entity with specific meaning in a sentence, such as a person name, a place name, an organization, a date, a time, a percentage, or money, etc., and named entity identification is that the named entity needs to be identified from the sentence, such as a person name, a place name, an organization name, a proper noun, a time, a date, etc. from the sentence to be identified. The business process may be a corresponding process of a business executed by the sentence, for example, when the user performs taxi booking processing by the sentence, the business process is a taxi booking process. Generally, different business scenarios correspond to different business processes, and different sentences are involved in the interaction of the different business processes. For example, in a business process of booking an air ticket, the related sentence interactions include departure place, arrival place, departure time and the like; in the business process of booking hotels, the related sentence interaction comprises the time of check-in, the time of departure, the name of the hotel and the like.
Specifically, when triggering to perform named entity recognition processing, for example, when receiving a statement related to a business process sent by a user through a terminal, the method obtains the statement to be recognized, and determines the business process corresponding to the statement. When the method is applied specifically, the intention recognition can be carried out on the sentences to be recognized, such as through a word list exhaustion method, a rule template analysis method, a deep learning intention recognition model and the like, the intention recognition is carried out on the sentences to be recognized, and the business flow corresponding to the sentences is determined according to the intention recognition result. In the specific implementation, if the sentence to be identified is not a sentence triggering the service flow, that is, the sentence to be identified is an interactive sentence after triggering the service flow, for example, when the sentence to be identified is a description about the departure time of the user in the man-machine interaction process after triggering the service flow of booking the airline ticket, the service flow corresponding to the sentence to be identified can be determined according to the context of the sentence to be identified.
Step 204, at least one recall template preset corresponding to the business process is queried.
The recall template is used for judging whether fields needing entity recognition intervention exist in the sentence, for example, whether ambiguous fields exist in the sentence can be judged, so that intervention is needed to be performed on named entity recognition processing of the sentence, and an accurate entity recognition result is obtained. For example, the recall template may be "×abc", where "×" is a wild card, and is used to refer to one or several characters, where "a", "B" and "C" are three characters, where the recall template indicates that when "ABC" exists in a sentence, an intervention is required to identify an entity in the "ABC" field in the sentence, for example, a dry prognosis may be identified as "a", "B", "C", "AB" or "BC", and specific identification results are configured according to actual needs. The recall templates are correspondingly preset according to the business processes, namely, different business processes can be provided with different recall templates, so that whether entity identification intervention is needed or not can be accurately judged through different recall templates on the same sentence according to different business processes, and an accurate named entity identification result can be obtained.
Specifically, a sentence to be identified is obtained, after a business flow corresponding to the sentence is determined, the server queries at least one recall template preset corresponding to the business flow. When the method is specifically applied, a corresponding recall template library can be pre-built for different business processes, and at least one recall template associated with the business process is stored in the recall template library. After determining the business flow corresponding to the sentence, the server can query the recall template library corresponding to the business flow, so as to query at least one recall template preset corresponding to the business flow from the recall template library.
And step 206, matching the sentences with at least one recall template, and determining the sentences to be interfered, which are successfully matched with the at least one recall template in the sentences, according to the matching result.
The to-be-interfered statement is a field which needs entity identification and interference processing in the to-be-identified statement, and the to-be-interfered statement is successfully matched with the recall template, namely the to-be-interfered statement in the statement hits the recall template, and the entity identification and interference processing is needed for the to-be-interfered statement.
Specifically, after the server queries at least one recall template preset corresponding to the business process, the sentence is matched with the obtained recall template, so that whether the sentence hits the recall template is judged, if yes, entity identification intervention processing is needed, and otherwise, the entity identification intervention processing is not needed. After the server obtains the matching result, determining the sentence to be interfered which is successfully matched with at least one recall template in the sentence according to the matching result, and if the field which is successfully matched with the recall template in the sentence can be determined as the sentence to be interfered.
And step 208, performing entity recognition intervention on the statement to be intervened through an intervention template preset corresponding to the business flow, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result.
The intervention template is used for performing entity recognition intervention on the sentence so as to obtain a named entity recognition result of the sentence. The intervention templates are correspondingly preset according to the business processes, namely different business processes can be provided with different intervention templates, so that different entity recognition interventions can be carried out on the same sentence through different intervention templates according to different business processes, and accurate named entity recognition results can be obtained. The intervention templates may include templates of different intervention types, such as may include a positive intervention template and a negative intervention template. For example, the forward intervention template may be "×ab", that is, when a field of "AB" exists in the sentence, the matching with the forward intervention template is successful, that is, the sentence hits the forward intervention template, and the named entity recognition result in the sentence may be recognized to include "AB". The negative intervention template may be "+bc", when the field of "+bc" exists in the sentence, the matching with the negative intervention template is successful, that is, the sentence hits the negative intervention template, and the named entity recognition result in the sentence may be recognized to not include "BC", that is, the "BC" field in the sentence is not recognized, but other fields are recognized, for example "+abc" in the sentence, and when the negative intervention template of "+bc" is hit, the named entity recognition result may include "ABC", "AB", but not "BC".
Specifically, after determining an intervention statement to be subjected to entity recognition intervention in the statement, the server queries an intervention template preset corresponding to the business flow, and performs entity recognition intervention on the statement to be subjected to the intervention by the intervention template obtained through the query, if fields corresponding to the intervention template in the statement are determined to be matched, or fields corresponding to the intervention template in the statement are not determined to be matched, so that a named entity recognition result of the statement is obtained according to the entity recognition intervention result.
In one specific application, the recall template corresponding to the business process includes "×123" expressed in a regular expression, and the intervention template includes "×12" and "×23". The recall template user determines whether entity recognition intervention is required to be performed on the sentence, if the recall template is hit in the sentence, that is, the recall template is successfully matched with 123, entity recognition intervention is required to be performed on 123 fields in the sentence, so as to determine a corresponding named entity recognition result in the business flow. "12" is a forward intervention template, i.e., when the forward intervention template is hit, a field of "12" is identified from the sentence; "23" is a negative intervention template, and "23" in the sentence is not recognized when the negative intervention template is hit. When different business processes are involved in different business scenes, the specific named entity recognition of the sentences can be realized by configuring different recall templates and intervention templates, so that an accurate named entity recognition result is obtained. For example, when "12" needs to be identified for the sentence "123" in the scene a, the recall template may be configured to be "×123", and the forward intervention template is configured to be "×12"; if "23" needs to be identified for the sentence "123" in the B scene, the recall template may be configured to be "×123", and the forward intervention template is "×23"; if "12" is not identified for the sentence "123" in the C scenario, the recall template may be configured as "×123" and the negative intervention template as "×12".
In another application, for the sentence "Nanjing", if "Nanjing" needs to be identified under the business process corresponding to the scene A, the recall template may be configured as "Nanjing", and the forward intervention template as "Nanjing", so that "Nanjing" may be accurately identified according to the sentence "Nanjing" and "Nanjing"; if 'Beijing' needs to be identified under the business process corresponding to the scene B, the recall template can be configured as 'Nanju', the forward intervention template is configured as 'Beijing', and 'Beijing' can be accurately identified according to the statement 'Nanju'; if "Nanjing" is not identified under the business process corresponding to scene C, the recall template may be configured as "Nanjing" and the negative intervention template as "Nanjing" and may be identified as other fields according to the statement "Nanjing" without identifying "Nanjing". For the same sentence, in different business processes, the recall template and the intervention template which are correspondingly configured according to the business processes can improve the pertinence of the named entity recognition, so that the accuracy of the named entity recognition processing for the sentences to be recognized of different business processes is improved.
In the named entity recognition method, at least one recall template preset by a business process corresponding to the sentence to be recognized is matched with the sentence to be recognized, the sentence to be interfered which is successfully matched with the at least one recall template in the sentence is determined, entity recognition intervention is carried out on the sentence to be interfered through an intervention template preset by the business process, and a named entity recognition result of the sentence is obtained according to the entity recognition intervention result. In the processing process of named entity recognition, a to-be-interfered statement in the statement to be recognized is determined through a recall template which corresponds to the business process, entity recognition interference is carried out on the statement to be interfered through an interference template which corresponds to the business process, and named entity recognition is carried out on the statement according to the recall template and the interference template which correspond to different business process configurations, so that the pertinence of named entity recognition in different business processes is improved, and the accuracy of named entity recognition processing on the statement to be recognized in different business processes is improved.
In one embodiment, as shown in fig. 3, the step of determining the statement to be interfered, that is, matching the statement with at least one recall template, and determining the statement to be interfered successfully matched with the at least one recall template in the statement according to the matching result includes:
step 302, a recall feature field in at least one recall template is determined.
The recall feature field is a feature field for determining whether the sentence hits the recall template, and if yes, the recall feature field may be "123"; as another example, when the recall template is "/to |flier| to", "to" may be the recall feature field, where "|" means "or". Each recall template is provided with a corresponding recall feature field, and whether the sentence hits the recall template can be determined by matching with the recall feature field.
Specifically, after the server obtains at least one recall template corresponding to the business process, the server determines recall feature fields in the recall template. In a specific application, each recall template can be parsed according to a preset recall template format, and recall feature fields in the recall templates are determined.
And 304, carrying out character matching on the recall feature field in the sentence, and determining a target recall template with successful matching when the obtained character matching result is successful matching.
After determining the recall feature field in the recall template, carrying out character matching on the recall feature field in the sentence, specifically carrying out character matching on the recall feature field and each field in the sentence in sequence by the server, and determining a target recall template successfully matched with the sentence when the obtained character matching result is successful, wherein the target recall template is the recall template successfully matched with the sentence.
In specific implementation, the recall feature field in the recall template may be one, for example "×a", or may be plural, for example "×ab"; the recall feature field may be continuous, such as ". ABC", or discontinuous, such as ". A. B. CED". The format of the recall feature field in the recall template may be preconfigured according to the actual needs of the business process. When the recall feature fields are matched with characters in the sentences, the recall feature fields can be matched with the fields of the sentences one by one, and when the number of the recall feature fields is a plurality of the recall feature fields, only if all the fields are successfully matched according to the corresponding sequence, the corresponding recall template can be determined to be successfully matched with the sentences. For example, for recall templates "/a"/B "/CED"/its recall feature fields include "a"/B "and" CDE "in order, wherein" a "and" B "may have other characters therebetween, while" C "," D "and" E "are continuous, with no other characters included therebetween; for statement 1, the fields of statement 1 are in one-to-one correspondence with recall feature fields of the recall template, and the matching is successful; and for the statement 2 "/a"/CED "/B" and "CDE" characters are also included, but the character sequence is different from the sequence of the recall feature field in the recall template, sentence 2 is not matched with the recall template, and the matching result is a matching failure.
When the number of the recall templates is a plurality of, the recall feature fields in all the recall templates can be respectively subjected to character matching in the sentences, the target recall templates successfully matched with the sentences are determined according to the character matching result, and when the number of the target recall templates is a plurality of, all the target recall templates are effective, namely entity identification intervention processing can be performed according to the triggering of all the hit recall templates.
Step 306, determining the statement to be interfered from the statement based on the target recall template.
After the target recall template is obtained, the server determines the statement to be interfered from the statement based on the target recall template. In specific implementation, the server may determine, from the statements, the statement to be interfered, which needs to be subjected to entity recognition and intervention processing, according to a preset format of the target recall template.
In this embodiment, the server performs character matching on the recall feature field obtained in the recall template in the sentence, determines the target recall template according to the character matching result, and determines the sentence to be interfered from the sentence according to the target recall template, so that the target recall template hit by the sentence can be determined based on the character matching, so that entity recognition intervention can be performed on the sentence to be interfered in the sentence, and accuracy of named entity recognition is improved.
In one embodiment, determining a statement to be intervened from among the statements based on the target recall template includes: determining a slot to be interfered in a target recall template; dividing sentences according to the recall feature field and the slots to be intervened to obtain sentence dividing results; and determining a field corresponding to the slot to be interfered in the sentence dividing result as the sentence to be interfered.
The slot to be interfered is a field needing entity identification interference processing in the recall template, for example, for the recall template ". ABC { [ w:1-4] }", the recall feature field is "ABC", and the slot to be interfered is 1-4 characters after "ABC", namely, when the sentence is matched with the recall feature field of "ABC", namely, when the sentence hits the recall template, 1-4 characters after "ABC" in the sentence are the slot to be interfered, namely, entity identification interference processing is needed for 1-4 characters after "ABC".
Specifically, after determining the target recall template, the server further determines a slot to be intervened in the target recall template, the slot to be intervened is preconfigured when the recall template is set, and the slot to be intervened and the recall feature field can include non-overlapping fields, such as "xabc { [ w:1-4] }" for the recall template; the slots to be tampered with and recall feature fields may also include overlapping fields, i.e., a portion of the fields are both the recall feature fields and the slots to be tampered with, such as "AB { [ w:1-2] C }" for recall templates, the recall feature fields include "AB" and "C", and the slots to be tampered with include 1-2 characters located between "AB" and "C", and "C".
After determining the slot to be intervened in the target recall template, the server divides the sentence according to the recall feature field and the slot to be intervened, for example, the server divides each field of the sentence according to the sequence and format of the recall feature field and the slot to be intervened, and a sentence division result is obtained. And the server determines a field corresponding to the slot to be interfered in the sentence dividing result as the sentence to be interfered. The fields in the statement to be interfered correspond to the slots to be interfered, and the fields in the statement to be interfered can comprise recall feature fields or not.
In one specific application, the configuration of the fields in the configuration of the recall template includes an AND, OR, and context. Wherein, the AND can be directly connected without setting specific symbols, such as AB; "or" is identified by brackets and is linked by "|", such as "(a|b|c)", indicating "a" or "B" or "C"; the context may be determined from the context of the fields. For example, { [ w:1-4] } represents any text of length 1 to 4, and the slot to be interfered with to be recognized is present above or below, so that the character of the longest length is recognized. For the situation only, if the recall template is set to be "(A|B) C { [ w:1-4] }, specifically to be" (to go|to) { [ w:2-4] }, and the recall template is set to be "to go" or "to fly" or "to" in the previous step, the 2-4 characters matched to the back are identified as slots to be interfered, namely, 2-4 fields located after "to go" or "to fly" or "to" in the sentence are determined as sentences to be interfered in the sentence. In addition, the recall template can also be set to only include the context or simultaneously include the context, and is flexibly configured according to actual needs.
In a specific implementation, the named entity recognition method is applied to a multi-round dialogue scene, and word slot filling can be performed on the multi-round dialogue scene according to the named entity recognition result for the sentence. In the man-machine conversation, after the user intention is primarily defined, necessary information is acquired to finally obtain a defined user instruction, and the multi-round conversation corresponds to a process of one thing. Word slots are information required to complete a preliminary user intent to an explicit user instruction in a multi-round dialog process, one word slot corresponding to one type of information required to be obtained in the processing of one thing. At this time, the recall template may be set to an "AB { [ slot ] C }" format, so that "[ slot ] +c" together forms a new word slot, where { [ slot ] } represents a system word slot, a custom word slot, a result of regular recognition, and no context may be outside { }. For example, the surname name listed in the word slot is customized, the recall template is 'I'm is { [ slot ] mr }, when the fact that the text is 'I'm is'm appears in the sentence, and the word slot is hit at the same time' slot ] ', and' mr is 'after' slot ', the recall template is hit, and' mr 'is taken as the word slot to recall, namely' mr 'slot' is determined as the sentence to be interfered. For another example, "[ w: min-max ]", means that the number of characters from min to max can be determined as the slot to be interfered, the jump word is realized, but two groups of [ w: min-max ] are not allowed to appear continuously in the recall template; for another example, "{ A [ w:1-4] }", "{ A [ slot ] }", A and [ slot ] can be combined into a word slot, namely, the word slot is used as a slot position to be intervened.
In this embodiment, the server divides the sentence according to the to-be-interfered slot and the recall feature field in the target recall template, and determines the field corresponding to the to-be-interfered slot in the sentence division result as the to-be-interfered sentence, so that the to-be-interfered sentence is extracted from the sentence according to the recall template preset corresponding to the business process, and entity recognition intervention is performed on the to-be-interfered sentence, so as to obtain an accurate named entity recognition result.
In one embodiment, as shown in fig. 4, the processing of entity recognition intervention, that is, performing entity recognition intervention on a statement to be interfered through an intervention template preset corresponding to a business process, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result includes:
step 402, inquiring a preset forward intervention template corresponding to the business process.
The intervention templates comprise forward intervention templates, and when the forward intervention templates hit, corresponding fields are identified, namely when sentences are matched with the forward intervention templates, the fields matched with the forward intervention templates in the sentences are determined to be named entity identification results. For example, the forward intervention template may be "×ab", that is, when a field of "AB" exists in the sentence, the matching with the forward intervention template is successful, that is, the sentence hits the forward intervention template, and the named entity recognition result in the sentence may be recognized to include "AB". The forward intervention templates are configured in advance according to actual needs corresponding to the business processes.
Specifically, when the entity identification intervention is performed, the server queries a forward intervention template preset corresponding to the business flow. In a specific application, the server can query an intervention template library corresponding to the business process and obtain a forward intervention template corresponding to the business process from the intervention template library.
And step 404, performing forward matching on the forward intervention template and each field of the statement to be intervened to obtain a forward matching result.
After the forward intervention template is obtained, the server carries out forward matching on the forward intervention template and each field of the sentence to be interfered, and specifically, the server can carry out character matching on the forward intervention template and each field of the sentence to be interfered, so that a forward matching result is obtained.
And step 406, when the forward matching result is successful, determining the field which is successfully matched with the forward intervention template in the sentence to be interfered as a named entity recognition result of the sentence.
When the forward matching result is successful, namely, when fields consistent with the forward intervention template exist in the fields of the statement to be intervened, the fields successfully matched with the forward intervention template in the statement to be intervened are determined to be the named entity recognition result of the statement, and therefore the named entity in the statement is recognized according to the forward intervention template.
In the embodiment, the server carries out forward matching on the preset forward intervention template corresponding to the business process and each field of the sentence to be interfered, and determines the field successfully matched with the forward intervention template in the sentence to be interfered as the named entity identification result of the sentence, so that the named entity associated with the business process in the sentence is identified by utilizing the forward intervention template, the problem that the named entity identification cannot be accurately carried out when ambiguity exists in the sentence can be avoided, and the accuracy of the named entity identification is improved.
In one embodiment, performing entity recognition intervention on a sentence to be interfered through an intervention template preset corresponding to a business process, and obtaining a named entity recognition result of the sentence according to the entity recognition intervention result, wherein the method comprises the following steps: inquiring a negative intervention template preset corresponding to the business process; carrying out negative matching on the negative intervention template and each field of the statement to be intervened to obtain a negative matching result; and when the negative matching result is successful, determining that the named entity recognition result of the sentence does not comprise a field which is successfully matched with the negative intervention template in the sentence to be interfered.
The intervention templates comprise negative intervention templates, when the negative intervention templates hit, corresponding fields are not identified, namely when the sentences are matched with the negative intervention templates, the fields matched with the negative intervention templates in the sentences are determined not to be named entity identification results, and therefore the identification results are eliminated through the negative intervention templates. For example, when the field of "×bc" exists in the sentence, the matching with the negative intervention template is successful, that is, the sentence hits the negative intervention template, it may be identified that the named entity identification result in the sentence does not include "BC", that is, the field of "BC" in the sentence is not identified, but other fields are identified, for example, when the field of "×abc" in the sentence is identified, and when the negative intervention template of "×bc" is hit, the named entity identification result may include "ABC", "AB", but does not include "BC".
Specifically, the server queries a negative intervention template preset corresponding to the business process, and in specific application, the server may query an intervention template library preset corresponding to the business process, and obtain a negative intervention template preset corresponding to the business process from the intervention template library. After the negative intervention template is obtained, the server carries out negative matching on the negative intervention template and each field of the statement to be intervened, and specifically, the server can carry out character matching on the negative intervention template and each field of the statement to be intervened, so that a negative matching result is obtained. When the negative matching result is successful, namely, when fields consistent with the negative intervention template exist in the fields of the statement to be intervened, determining that the named entity identification result of the statement does not include the fields successfully matched with the negative intervention template in the statement to be intervened, and sequencing entity identification modes of the fields successfully matched with the negative intervention template in the statement to be intervened, so that the corresponding named entity identification result is not identified.
In this embodiment, a server performs negative matching on a negative intervention template preset corresponding to a business process and each field of a sentence to be interfered, and determines a field successfully matched with the negative intervention template in the sentence to be interfered as a named entity recognition result of the sentence, so that named entities associated with the business process in the sentence are eliminated by using the negative intervention template, the problem that named entity recognition cannot be accurately performed when ambiguity exists in the sentence can be avoided, and the accuracy of named entity recognition is improved.
In a specific implementation, the named entity recognition method is applied to a multi-round dialogue scene, and word slot filling can be performed on the multi-round dialogue scene according to the named entity recognition result for the sentence. At the moment, after the recall template determines the sentence to be interfered, if and only if the sentence to be interfered hits the forward intervention template, filling word slots into fields matched with the forward intervention template; and when the to-be-interfered statement hits the negative interference template, excluding the field matched with the negative interference template, and not taking the field as the field filled in the word slot.
Specifically, the configuration of fields in the configuration of the intervention template includes AND, OR, context, and other word slot keys. Wherein, the AND can be directly connected without setting specific symbols, such as AB; "or" is identified by brackets and is linked by "|", such as "(a|b|c)", indicating "a" or "B" or "C"; the context may be determined from the context of the field; other word slot keys may be [ D ]. For example, for a forward intervention template "(A|B) C { [ slot ] }", { [ slot ] } represents the result of system word slot, custom word slot, canonical recognition, template extraction. Specifically, for example, { [ start_city ] }, when the forward intervention template is "go" or "fly" or "go" above, and when the forward intervention template is matched with a later recognized urban word slot, the forward intervention template is hit, and the [ start_city ] in { } is interfered, namely the [ start_city ] is recognized to fill the word slot. And the intervention template is "A [ D ] { [ slot ] }, other word slot names are allowed to appear in the text to represent one type of word slot, specifically, the text is" from [ start_city ] to { [ end_city ] }, when "{ }" is preceded by "from" +word slot of start_city type + "to", and meanwhile, a word slot for identifying end_city type is hit after the "{ }", the intervention template is hit, and the word slot for end_city is interfered, namely, the end_city is identified to be filled with the word slot or not filled with the word slot. Furthermore, the intervention templates can be set to only include the context or simultaneously include the context, and are flexibly configured according to actual needs. The intervention template can also realize word skipping through the 'w: min-max', which means that the entity recognition intervention processing can be carried out on the characters from min to max, but two groups of 'w: min-max' are not allowed to continuously appear in the intervention template; in addition, "{ A [ w:1-4] }", "{ A [ slot ] }", A and [ slot ] can be combined into a word slot, i.e. word slot filling is performed or not performed.
In specific implementation, the specific configuration formats and rules of the positive intervention template and the negative intervention template may be the same, but the corresponding configuration results are different, so that the corresponding field is identified when the positive intervention template is hit, and the corresponding field is not identified when the negative intervention template is hit.
In one embodiment, performing entity recognition intervention on a sentence to be interfered through an intervention template preset corresponding to a business process, and obtaining a named entity recognition result of the sentence according to the entity recognition intervention result, wherein the method comprises the following steps: inquiring a positive intervention template and a negative intervention template which correspond to the business process and are preset; matching the negative intervention template and the positive intervention template with each field of the sentence to be intervened respectively to obtain a negative matching result and a positive matching result; when the negative matching result and the positive matching result are both successful in matching, and the field which is successfully matched with the negative intervention template in the sentence to be interfered and the field which is successfully matched with the positive intervention template in the sentence to be interfered are the same fields, determining that the named entity identification result of the sentence does not comprise the same fields.
The intervention templates comprise a positive intervention template and a negative intervention template at the same time, match is carried out in the sentence to be interfered through the positive intervention template and the negative intervention template respectively, and a named entity recognition result corresponding to the sentence is determined according to the matching result.
Specifically, the server queries a positive intervention template and a negative intervention template which are preset corresponding to the business process, and matches the negative intervention template and the positive intervention template with each field of the sentence to be interfered respectively, specifically, character matching can be performed, and a negative matching result and a positive matching result are obtained. When the negative matching result and the positive matching result are both successful in matching, which indicates that the statement hits the negative intervention template and the positive intervention template at the same time, the server determines whether a field which is successfully matched with the negative intervention template in the statement to be interfered and a field which is successfully matched with the positive intervention template in the statement to be interfered are the same fields, namely whether the statement hits the negative intervention template and the positive intervention template at the same time are the same fields, if yes, the named entity identification result of the statement is determined to not comprise the same fields. When the same field of the sentence hits the positive intervention template and the negative intervention template at the same time, the negative intervention template has higher priority than the positive intervention template, and the named entity identification result of the sentence is determined to not comprise the same field, so that the same field is eliminated.
In the embodiment, when the sentence hits the positive intervention template and the negative intervention template at the same time, the named entity recognition result of the sentence is determined to not comprise the same field, and the same field is eliminated, so that the same field is eliminated, the conflict between the positive intervention template and the negative intervention template can be avoided, and the accuracy of the named entity recognition result is ensured.
In one embodiment, the named entity recognition method further comprises: determining word slots to be filled corresponding to the business process; filling the named entity recognition result into the word slots to be filled to obtain service word slots corresponding to the service flow; and executing the business process based on the business word slot when the business word slot meets the process execution condition.
The word slot to be filled can include departure location, departure time and arrival location in the business process of booking the air ticket, wherein the word slot to be filled converts user intention into information required to be completed by an explicit business process instruction. The business word groove is information obtained after filling the word groove to be filled according to the named entity recognition result. The process execution condition is used for triggering the execution of the business process, for example, in the business process of booking the air ticket, when the three word slots such as the departure place, the departure time and the arrival place are filled and completed and are not in conflict, if the departure place and the arrival place are different, the business process of booking the air ticket can be executed at the moment, the process execution condition is met, the execution of the business process is triggered, and the air ticket booking processing is carried out.
Specifically, after the recognition result of the named entity of the sentence is obtained, the server determines word slots to be filled corresponding to the business process, different business processes correspond to different word slots to be filled, and after filling the word slots to be filled corresponding to the business process, execution of the business process can be triggered when the process execution condition is met. And the server specifically fills the named entity recognition result into the word slots to be filled to obtain business word slots corresponding to the business processes, determines whether the process execution conditions corresponding to the business processes are met according to the business word slots, if so, triggers the execution of the business processes, and executes the business processes based on the business word slots. When the method is applied specifically, different business processes correspond to different word slots to be filled, different process execution conditions are provided, and the method is preconfigured according to actual needs.
In this embodiment, the word slots to be filled corresponding to the business processes are filled according to the recognition results of the named entities of the sentences, so that the corresponding business processes are executed, and the word slots can be filled through the recognized accurate recognition results of the named entities, so that the accuracy of executing the business processes can be ensured.
It should be understood that, although the steps in the flowcharts of fig. 2-4 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-4 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 5, there is provided a named entity recognition apparatus 500, comprising: statement acquisition module 502, recall template query module 504, statement to be intervened determination module 506, and identify intervention module 508, wherein:
The sentence acquisition module 502 is configured to acquire a sentence to be identified, and determine a business process corresponding to the sentence;
a recall template query module 504, configured to query at least one recall template preset corresponding to the business process;
the to-be-interfered statement determining module 506 is configured to match the statement with at least one recall template, and determine, according to the matching result, a to-be-interfered statement that is successfully matched with the at least one recall template in the statement;
the recognition intervention module 508 is configured to perform entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business flow, and obtain a named entity recognition result of the statement according to the entity recognition intervention result.
In one embodiment, the statement to be intervened determination module 506 includes a feature field determination module, a character matching module, and a target recall template module; wherein: the feature field determining module is used for determining recall feature fields in at least one recall template; the character matching module is used for carrying out character matching on the recall characteristic field in the sentence, and determining a target recall template which is successfully matched when the obtained character matching result is successful; and the target recall template module is used for determining the statement to be interfered from the statement based on the target recall template.
In one embodiment, the target recall template module comprises a slot position determination module to be intervened, a sentence dividing module and a dividing result processing module; wherein: the to-be-interfered slot position determining module is used for determining to-be-interfered slot positions in the target recall template; the sentence dividing module is used for dividing sentences according to the recall feature field and the slots to be intervened to obtain sentence dividing results; the division result processing module is used for determining a field corresponding to the slot to be interfered in the sentence division result as the sentence to be interfered.
In one embodiment, the recognition intervention module 508 includes a forward template query module, a forward matching module, and a forward intervention module; wherein: the forward template inquiry module is used for inquiring a preset forward intervention template corresponding to the business process; the forward matching module is used for carrying out forward matching on the forward intervention template and each field of the statement to be intervened to obtain a forward matching result; and the forward intervention module is used for determining a field successfully matched with the forward intervention template in the sentence to be interfered as a named entity recognition result of the sentence when the forward matching result is successful.
In one embodiment, the recognition intervention module 508 includes a negative template query module, a negative matching module, and a negative intervention module; wherein: the negative template query module is used for querying a negative intervention template preset corresponding to the business process; the negative matching module is used for carrying out negative matching on the negative intervention template and each field of the statement to be intervened to obtain a negative matching result; and the negative intervention module is used for determining that the named entity identification result of the sentence does not comprise a field which is successfully matched with the negative intervention template in the sentence to be interfered when the negative matching result is successful.
In one embodiment, the identify intervention module 508 includes an intervention module query module, an intervention template matching module, and an intervention processing module; wherein: the intervention module inquiry module is used for inquiring a positive intervention template and a negative intervention template which are preset corresponding to the business process; the intervention template matching module is used for respectively matching the negative intervention template and the positive intervention template with each field of the sentence to be intervened to obtain a negative matching result and a positive matching result; and the intervention processing module is used for determining that the named entity recognition result of the sentence does not comprise the same field when the negative matching result and the positive matching result are both successful in matching and the field successfully matched with the negative intervention template in the sentence to be intervened and the field successfully matched with the positive intervention template in the sentence to be intervened are the same field.
In one embodiment, the system further comprises a word slot determining module, a word slot filling module and a service processing module; wherein: the word slot determining module is used for determining word slots to be filled corresponding to the business flow; the word slot filling module is used for filling the named entity identification result into the word slot to be filled to obtain a business word slot corresponding to the business flow; and the business processing module is used for executing the business process based on the business word slot when the business word slot meets the process execution condition.
For specific limitations of the named entity recognition device, reference may be made to the above limitation of the named entity recognition method, and no further description is given here. The above named entity recognition means may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, and a network interface 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 includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a named entity recognition method.
It will be appreciated by those skilled in the art that the structure shown in fig. 6 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
acquiring sentences to be identified, and determining a business process corresponding to the sentences;
inquiring at least one recall template preset corresponding to the business process;
matching the sentence with at least one recall template, and determining a sentence to be interfered, which is successfully matched with the at least one recall template in the sentence, according to a matching result;
and performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business flow, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result.
In one embodiment, the processor when executing the computer program further performs the steps of: determining recall feature fields in at least one recall template; performing character matching on the recall feature field in the sentence, and determining a target recall template with successful matching when the obtained character matching result is successful matching; and determining the statement to be interfered from the statement based on the target recall template.
In one embodiment, the processor when executing the computer program further performs the steps of: determining a slot to be interfered in a target recall template; dividing sentences according to the recall feature field and the slots to be intervened to obtain sentence dividing results; and determining a field corresponding to the slot to be interfered in the sentence dividing result as the sentence to be interfered.
In one embodiment, the processor when executing the computer program further performs the steps of: inquiring a forward intervention template corresponding to the business process; carrying out forward matching on the forward intervention template and each field of the sentence to be intervened to obtain a forward matching result; and when the forward matching result is successful, determining a field which is successfully matched with the forward intervention template in the sentence to be interfered as a named entity recognition result of the sentence.
In one embodiment, the processor when executing the computer program further performs the steps of: inquiring a negative intervention template preset corresponding to the business process; carrying out negative matching on the negative intervention template and each field of the statement to be intervened to obtain a negative matching result; and when the negative matching result is successful, determining that the named entity recognition result of the sentence does not comprise a field which is successfully matched with the negative intervention template in the sentence to be interfered.
In one embodiment, the processor when executing the computer program further performs the steps of: inquiring a positive intervention template and a negative intervention template which correspond to the business process and are preset; matching the negative intervention template and the positive intervention template with each field of the sentence to be intervened respectively to obtain a negative matching result and a positive matching result; when the negative matching result and the positive matching result are both successful in matching, and the field which is successfully matched with the negative intervention template in the sentence to be interfered and the field which is successfully matched with the positive intervention template in the sentence to be interfered are the same fields, determining that the named entity identification result of the sentence does not comprise the same fields.
In one embodiment, the processor when executing the computer program further performs the steps of: determining word slots to be filled corresponding to the business process; filling the named entity recognition result into the word slots to be filled to obtain service word slots corresponding to the service flow; and executing the business process based on the business word slot when the business word slot meets the process execution condition.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
Acquiring sentences to be identified, and determining a business process corresponding to the sentences;
inquiring at least one recall template preset corresponding to the business process;
matching the sentence with at least one recall template, and determining a sentence to be interfered, which is successfully matched with the at least one recall template in the sentence, according to a matching result;
and performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business flow, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining recall feature fields in at least one recall template; performing character matching on the recall feature field in the sentence, and determining a target recall template with successful matching when the obtained character matching result is successful matching; and determining the statement to be interfered from the statement based on the target recall template.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining a slot to be interfered in a target recall template; dividing sentences according to the recall feature field and the slots to be intervened to obtain sentence dividing results; and determining a field corresponding to the slot to be interfered in the sentence dividing result as the sentence to be interfered.
In one embodiment, the computer program when executed by the processor further performs the steps of: inquiring a forward intervention template corresponding to the business process; carrying out forward matching on the forward intervention template and each field of the sentence to be intervened to obtain a forward matching result; and when the forward matching result is successful, determining a field which is successfully matched with the forward intervention template in the sentence to be interfered as a named entity recognition result of the sentence.
In one embodiment, the computer program when executed by the processor further performs the steps of: inquiring a negative intervention template preset corresponding to the business process; carrying out negative matching on the negative intervention template and each field of the statement to be intervened to obtain a negative matching result; and when the negative matching result is successful, determining that the named entity recognition result of the sentence does not comprise a field which is successfully matched with the negative intervention template in the sentence to be interfered.
In one embodiment, the computer program when executed by the processor further performs the steps of: inquiring a positive intervention template and a negative intervention template which correspond to the business process and are preset; matching the negative intervention template and the positive intervention template with each field of the sentence to be intervened respectively to obtain a negative matching result and a positive matching result; when the negative matching result and the positive matching result are both successful in matching, and the field which is successfully matched with the negative intervention template in the sentence to be interfered and the field which is successfully matched with the positive intervention template in the sentence to be interfered are the same fields, determining that the named entity identification result of the sentence does not comprise the same fields.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining word slots to be filled corresponding to the business process; filling the named entity recognition result into the word slots to be filled to obtain service word slots corresponding to the service flow; and executing the business process based on the business word slot when the business word slot meets the process execution condition.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.
Claims (10)
1. A named entity recognition method, the method comprising:
acquiring sentences to be identified, and determining a business flow corresponding to the sentences;
inquiring at least one recall template preset corresponding to the business process;
matching the sentence with the at least one recall template, and determining a sentence to be interfered, which is successfully matched with the at least one recall template in the sentence, according to a matching result;
And performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business flow, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result.
2. The method of claim 1, wherein the matching the statement with the at least one recall template, and determining, based on the matching result, a statement to be intervened in the statement that successfully matches the at least one recall template, comprises:
determining recall feature fields in the at least one recall template;
performing character matching on the recall feature field in the sentence, and determining a target recall template with successful matching when the obtained character matching result is successful matching;
and determining a statement to be interfered from the statements based on the target recall template.
3. The method of claim 2, wherein the determining a statement to be interfered with from the statements based on the target recall template comprises:
determining a slot to be interfered in the target recall template;
performing sentence division on the sentences according to the recall feature field and the slots to be intervened to obtain sentence division results;
And determining a field corresponding to the slot to be interfered in the sentence dividing result as a sentence to be interfered.
4. The method according to claim 1, wherein the performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business process, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result, includes:
inquiring a forward intervention template preset corresponding to the business process;
carrying out forward matching on the forward intervention template and each field of the statement to be intervened to obtain a forward matching result;
and when the forward matching result is successful, determining a field which is successfully matched with the forward intervention template in the statement to be interfered as a named entity recognition result of the statement.
5. The method according to claim 1, wherein the performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business process, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result, includes:
inquiring a negative intervention template preset corresponding to the business process;
Carrying out negative matching on the negative intervention template and each field of the statement to be intervened to obtain a negative matching result;
and when the negative matching result is successful, determining that the named entity recognition result of the sentence does not include a field which is successfully matched with the negative intervention template in the sentence to be interfered.
6. The method according to claim 1, wherein the performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business process, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result, includes:
inquiring a positive intervention template and a negative intervention template which are preset corresponding to the business process;
matching the negative intervention template and the positive intervention template with each field of the statement to be intervened respectively to obtain a negative matching result and a positive matching result;
and when the negative matching result and the positive matching result are both successful in matching, and the field which is successfully matched with the negative intervention template in the sentence to be interfered and the field which is successfully matched with the positive intervention template in the sentence to be interfered are the same field, determining that the same field is not included in the named entity identification result of the sentence.
7. The method according to any one of claims 1 to 6, further comprising:
determining word slots to be filled corresponding to the business flow;
filling the named entity recognition result into the word slots to be filled to obtain service word slots corresponding to the service flow;
and executing the business process based on the business word slot when the business word slot meets the process execution condition.
8. A named entity recognition device, the device comprising:
the sentence acquisition module is used for acquiring sentences to be identified and determining business processes corresponding to the sentences;
the recall template query module is used for querying at least one recall template preset corresponding to the business process;
the statement to be interfered determining module is used for matching the statement with the at least one recall template and determining a statement to be interfered which is successfully matched with the at least one recall template in the statement according to a matching result;
and the recognition intervention module is used for performing entity recognition intervention on the statement to be interfered through an intervention template preset corresponding to the business process, and obtaining a named entity recognition result of the statement according to the entity recognition intervention result.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110191377.XA CN112926326B (en) | 2021-02-20 | 2021-02-20 | Named entity recognition method, named entity recognition device, named entity recognition computer equipment and named entity recognition storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110191377.XA CN112926326B (en) | 2021-02-20 | 2021-02-20 | Named entity recognition method, named entity recognition device, named entity recognition computer equipment and named entity recognition storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112926326A CN112926326A (en) | 2021-06-08 |
CN112926326B true CN112926326B (en) | 2024-01-19 |
Family
ID=76169925
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110191377.XA Active CN112926326B (en) | 2021-02-20 | 2021-02-20 | Named entity recognition method, named entity recognition device, named entity recognition computer equipment and named entity recognition storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112926326B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109918680A (en) * | 2019-03-28 | 2019-06-21 | 腾讯科技(上海)有限公司 | Entity recognition method, device and computer equipment |
CN110688467A (en) * | 2019-08-23 | 2020-01-14 | 北京百度网讯科技有限公司 | Named entity recognition method and device, computer equipment and storage medium |
WO2020139865A1 (en) * | 2018-12-24 | 2020-07-02 | Conversica, Inc. | Systems and methods for improved automated conversations |
CN111898382A (en) * | 2020-06-30 | 2020-11-06 | 北京搜狗科技发展有限公司 | Named entity recognition method and device for named entity recognition |
-
2021
- 2021-02-20 CN CN202110191377.XA patent/CN112926326B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020139865A1 (en) * | 2018-12-24 | 2020-07-02 | Conversica, Inc. | Systems and methods for improved automated conversations |
CN109918680A (en) * | 2019-03-28 | 2019-06-21 | 腾讯科技(上海)有限公司 | Entity recognition method, device and computer equipment |
CN110688467A (en) * | 2019-08-23 | 2020-01-14 | 北京百度网讯科技有限公司 | Named entity recognition method and device, computer equipment and storage medium |
CN111898382A (en) * | 2020-06-30 | 2020-11-06 | 北京搜狗科技发展有限公司 | Named entity recognition method and device for named entity recognition |
Also Published As
Publication number | Publication date |
---|---|
CN112926326A (en) | 2021-06-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109002510B (en) | Dialogue processing method, device, equipment and medium | |
US10102191B2 (en) | Propagation of changes in master content to variant content | |
CN109508458B (en) | Legal entity identification method and device | |
US9779728B2 (en) | Systems and methods for adding punctuations by detecting silences in a voice using plurality of aggregate weights which obey a linear relationship | |
CN107221328B (en) | Method and device for positioning modification source, computer equipment and readable medium | |
CN112800769B (en) | Named entity recognition method, named entity recognition device, named entity recognition computer equipment and named entity recognition storage medium | |
WO2014187096A1 (en) | Method and system for adding punctuation to voice files | |
CN110797012B (en) | Information extraction method, equipment and storage medium | |
CN112784029B (en) | Business processing method and device based on natural language processing and computer equipment | |
CN111898363B (en) | Compression method, device, computer equipment and storage medium for long and difficult text sentence | |
CN110717021A (en) | Input text and related device for obtaining artificial intelligence interview | |
CN110825840B (en) | Word bank expansion method, device, equipment and storage medium | |
WO2020233381A1 (en) | Speech recognition-based service request method and apparatus, and computer device | |
US8577924B2 (en) | Determining base attributes for terms | |
CN112926326B (en) | Named entity recognition method, named entity recognition device, named entity recognition computer equipment and named entity recognition storage medium | |
CN112597748B (en) | Corpus generation method, corpus generation device, corpus generation equipment and computer-readable storage medium | |
CN113722436A (en) | Text information extraction method and device, computer equipment and storage medium | |
CN110852082B (en) | Synonym determination method and device | |
CN115438158A (en) | Intelligent dialogue method, device, equipment and storage medium | |
CN113434631A (en) | Emotion analysis method and device based on event, computer equipment and storage medium | |
CN111859042A (en) | Retrieval method and device and electronic equipment | |
CN110489740A (en) | Semantic analytic method and Related product | |
CN115023695B (en) | Updating training examples for artificial intelligence | |
CN115687136A (en) | Script program processing method, system, computer equipment and medium | |
CN115270775A (en) | Text similarity calculation method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |