CN111881266A - Response method and device - Google Patents

Response method and device Download PDF

Info

Publication number
CN111881266A
CN111881266A CN201910656586.XA CN201910656586A CN111881266A CN 111881266 A CN111881266 A CN 111881266A CN 201910656586 A CN201910656586 A CN 201910656586A CN 111881266 A CN111881266 A CN 111881266A
Authority
CN
China
Prior art keywords
matching
pattern
target
metadata
result
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.)
Granted
Application number
CN201910656586.XA
Other languages
Chinese (zh)
Other versions
CN111881266B (en
Inventor
韩卫强
李云彬
彭作聪
权圣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mashang Xiaofei Finance Co Ltd
Original Assignee
Mashang Xiaofei Finance Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mashang Xiaofei Finance Co Ltd filed Critical Mashang Xiaofei Finance Co Ltd
Priority to CN201910656586.XA priority Critical patent/CN111881266B/en
Publication of CN111881266A publication Critical patent/CN111881266A/en
Application granted granted Critical
Publication of CN111881266B publication Critical patent/CN111881266B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a response method and a device, wherein the method comprises the following steps: acquiring target problem information input by a user; performing pattern matching on the target problem information to obtain a target matching result; performing natural language understanding processing on the target problem information through a natural language understanding NLU model obtained by pre-training to obtain a natural language understanding result; and determining target reply information according to the target matching result and the natural language understanding result. By the response method provided by the invention, the accuracy of problem response in the response process can be improved.

Description

Response method and device
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a response method and apparatus.
Background
With the continuous development of internet technology, an automatic answering system, for example, an automatic answering robot (also referred to as BOT), which integrates a plurality of Artificial Intelligence (AI) technologies, is gradually applied in various fields.
Currently, an automatic response system generally includes a Natural Language Understanding (NLU) module, which can be used to perform processes such as intention recognition, entity recognition, FAQ (frequently asked Questions) semantic matching, emotion recognition and the like on question information input by a user. However, the existing natural language understanding module usually performs recognition of intentions, entities and the like based on a model obtained by training a machine learning algorithm, and due to technical bottlenecks and the like, recognition errors often occur in the recognition process based on the model obtained by training, so that the answer returned to the user is incorrect.
Therefore, the problem that the problem reply accuracy is low in the automatic response process exists in the prior art.
Disclosure of Invention
The embodiment of the invention provides a response method and a response device, which aim to solve the problem of low problem response accuracy in an automatic response process.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a response method. The method comprises the following steps:
acquiring target problem information input by a user;
performing pattern matching on the target problem information to obtain a target matching result;
performing natural language understanding processing on the target problem information through a natural language understanding NLU model obtained by pre-training to obtain a natural language understanding result;
and determining target reply information according to the target matching result and the natural language understanding result.
In a second aspect, an embodiment of the present invention further provides a response apparatus. The answering device comprises:
the acquisition module is used for acquiring target problem information input by a user;
the matching module is used for carrying out pattern matching on the target problem information to obtain a target matching result;
the natural language understanding module is used for carrying out natural language understanding processing on the target problem information through a natural language understanding NLU model obtained through pre-training to obtain a natural language understanding result;
and the first determining module is used for determining target reply information according to the target matching result and the natural language understanding result.
In a third aspect, an embodiment of the present invention further provides a responding apparatus, including a processor, a memory, and a computer program stored on the memory and operable on the processor, where the computer program, when executed by the processor, implements the steps of the responding method described above.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps of the above-mentioned answering method.
In the embodiment of the invention, target problem information input by a user is acquired; performing pattern matching on the target problem information to obtain a target matching result; performing natural language understanding processing on the target problem information through a natural language understanding NLU model obtained by pre-training to obtain a natural language understanding result; and determining target reply information according to the target matching result and the natural language understanding result. By combining pattern matching and an NLU (non line of sight) model to analyze and recognize target question information input by a user and combining a target matching result and a natural language understanding result to jointly determine reply information, the accuracy of question reply can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a flowchart of a response method provided by an embodiment of the present invention;
fig. 2 is a schematic diagram of a system architecture to which the response method provided by the embodiment of the present invention is applicable;
FIG. 3 is a block diagram of a transponder device provided in an embodiment of the present invention;
fig. 4 is a structural diagram of a response unit according to still another embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a response method. Referring to fig. 1, fig. 1 is a flowchart of a response method provided by an embodiment of the present invention, as shown in fig. 1, including the following steps:
step 101, obtaining target problem information input by a user.
In this embodiment, the target question information may be any question information input by the user.
In practical application, the user can input the question information in the form of text or speech. Optionally, if the question information input by the user is question information in a voice form, the question information in the voice form may be subjected to voice recognition first, so as to be converted into target question information in a text form.
Optionally, the target question information may also be information obtained by preprocessing question information input by a user, for example, the target question information may be information obtained by filtering question information input by the user.
And 102, performing pattern matching on the target problem information to obtain a target matching result.
For example, a problem template set may be preset, and pattern matching may be performed on the target problem information and the problem templates in the problem template set to obtain a problem template matched with the target problem information, so that at least one of intention type information, entity information, reply information, and the like corresponding to the target problem information may be obtained based on the matched problem template; or a matching mode may be preset, and pattern matching may be performed on the target question information according to the matching mode to identify at least one of intention type information, entity information, reply information, and the like corresponding to the target question information.
It should be noted that, when the pattern matching is performed on the target problem information, the pattern matching may be successful, that is, at least one of the intention type information, the entity information, the reply information, and the like is obtained by matching, and the pattern matching may also be failed. Optionally, in the case that the pattern matching is successful, the target matching result may include at least one item of matched intention type information, entity information, reply information, and the like; in the case where the pattern matching fails, the above target matching result may include information indicating that the matching failed.
And 103, performing natural language understanding processing on the target problem information through an NLU model obtained through pre-training to obtain a natural language understanding result.
In this embodiment, the NLU model may be any model obtained by training based on a machine learning algorithm, and may be used to perform processing such as intention recognition, entity recognition, FAQ semantic matching, emotion recognition, and the like on question information input by a user. The natural language understanding result may include at least one of intention type information, entity information, emotion type information, reply information, and the like.
It should be noted that step 102 and step 103 may be executed in parallel or may be executed in series. In the case of serial execution, step 102 may be executed first, and then step 103 may be executed; step 103 may be performed first, and then step 102 may be performed.
Alternatively, the step 103 may be performed in the case where the pattern matching fails in the step 102.
And step 104, determining target reply information according to the target matching result and the natural language understanding result.
In this step, target reply information may be determined according to the target matching result and the natural language understanding result to reply to the user. For example, the target reply information may be determined according to the target matching result in a case where the target matching result includes at least one of the matched intention type information, entity information, reply information, and the like, or may be determined according to the natural language understanding result otherwise; the target matching result and the natural language understanding result may be integrated to jointly determine the target reply information, for example, if the target matching result includes the intention type information and the natural language understanding result includes the entity information, the intention type information in the target matching result and the entity information in the natural language understanding result may be integrated to jointly determine the target reply information.
In practical application, some problem information of NLU model analysis errors can be collected, and a problem template set or a pattern matching rule and the like for pattern matching are set based on the problem information, so that the problem information can be matched more accurately based on the problem template set or the pattern matching rule and the like; problem information which is based on problem template set or pattern matching rules and the like and fails in matching can be processed through the NLU model, and therefore accuracy of problem reply in an automatic response process can be improved.
According to the response method provided by the embodiment of the invention, the target problem information input by a user is obtained; performing pattern matching on the target problem information to obtain a target matching result; performing natural language understanding processing on the target problem information through a natural language understanding NLU model obtained by pre-training to obtain a natural language understanding result; and determining target reply information according to the target matching result and the natural language understanding result. The target problem information input by the user is analyzed and recognized by combining the pattern matching and the NLU model, and the reply information is determined by combining the target matching result and the natural language understanding result, so that the accuracy of the reply information can be improved.
Optionally, the step 103, that is, determining the target reply information according to the target matching result and the natural language understanding result, may include:
under the condition that the pattern matching is successful, determining the target reply information according to the target matching result;
and under the condition that the pattern matching fails, determining the target reply information according to the natural language understanding result.
In this embodiment, the priority of the matching result obtained based on the pattern matching may be higher than the natural language understanding result obtained based on the NLU model, and in the case that the pattern matching is successful, that is, in the case that the target matching result includes at least one of the matched intention type information, the entity information, the reply information, and the like, the target reply information may be determined based on the target matching result, otherwise, the target reply information may be determined according to the natural language understanding result. Since the accuracy of the matching result based on the pattern matching is generally high, the reply information is preferentially determined based on the pattern matching result, and the accuracy of the problem reply in the response process can be improved.
Optionally, the step 102, that is, performing pattern matching on the target problem information to obtain a target matching result, may include:
acquiring target pattern metadata corresponding to the target problem information, wherein the target pattern metadata comprises a matching pattern, and the matching pattern comprises a regular matching pattern or a code analysis pattern;
and performing pattern matching on the target problem information according to the matching pattern to obtain a target matching result.
In this embodiment, the target schema metadata may be any schema metadata corresponding to the target problem information. The target schema metadata may include one or more schema metadata. Each pattern metadata may include a matching pattern, where the matching pattern may include a canonical matching pattern or a code resolution pattern.
The regular matching pattern may be understood as matching the problem information according to a set regular matching rule, and the code analysis pattern may be understood as matching the problem information according to a set analysis code.
Alternatively, the mode metadata may be set for each specific question, respectively. For example, one or more schema metadata may be set for each question to ensure that the question can be accurately matched during the schema matching process.
In this embodiment, for the above target pattern metadata corresponding to the target question information, that is, the above target pattern metadata, may be obtained based on a keyword in the target question information. For example, each of the pattern metadata may be associated with at least one keyword, so that the pattern metadata matching the keyword of the target question information may be determined as the pattern metadata corresponding to the target question information based on the keyword in the target question information and the keyword associated with each of the pattern metadata.
Optionally, the mode metadata corresponding to the target problem information may also be acquired based on user identification information (i.e., a user ID) carried by the target problem information. For example, each of the above-mentioned pattern metadata may include a user ID, so that the same pattern metadata as the user ID carried by the target question information may be determined based on the user ID carried by the target question information and the user ID in each of the pattern metadata, and may be used as the pattern metadata corresponding to the target question information.
Optionally, the set mode metadata may be stored in a knowledge base management System (KMS), and after the target question information is obtained, the mode metadata corresponding to the target question information may be obtained from the KMS.
According to the embodiment of the invention, the target problem information is subjected to pattern matching according to the regular matching pattern or the code analysis pattern, so that the accuracy of matching partial problems can be improved, and the accuracy of problem reply in the response process can be further improved.
Optionally, the target pattern metadata may further include a matching result type, where the matching result type includes a reply information class, an intention classification information class, or an entity information class;
and the type of the target matching result is the type of the matching result.
In this embodiment, the matching result type of each pattern metadata is used to indicate a type of a matching result obtained after performing pattern matching using the matching pattern of the pattern metadata.
For example, if the type of the matching result of the pattern metadata a is the reply information type, after the problem information is matched according to the matching pattern of the pattern metadata a, if the matching is successful, the pattern matching result is the reply information; if the matching result type of the pattern metadata B is the intention type information type, matching the problem information according to the matching pattern of the pattern metadata B, and if the matching is successful, taking the pattern matching result as the intention type information; and if the matching result type of the pattern metadata C is the entity information type, matching the problem information according to the matching pattern of the pattern metadata C, and if the matching is successful, taking the pattern matching result as the entity information.
In this embodiment, the target pattern metadata further includes a matching result type, so that not only can the type of the pattern matching result be flexibly and accurately controlled, but also an object needing to use the target matching result can know the type of the target pattern metadata.
Optionally, the performing pattern matching on the target problem information according to the matching pattern to obtain the target matching result may include:
acquiring an ith mode metadata of the N mode metadata under the condition that the target mode metadata comprises N mode metadata;
if the matching result type of the ith pattern metadata is a first type and the matching result of the first type is not matched, performing pattern matching on the target problem information according to the matching pattern of the ith pattern metadata to obtain a matching result corresponding to the ith pattern metadata, adding 1 to the value of i, and returning to execute the step of obtaining the ith pattern metadata in the N pattern metadata until the value of i is greater than N;
if the matching result type of the ith pattern metadata is a first type and the matching result of the first type is matched, adding 1 to the value of i, and returning to execute the step of acquiring the ith pattern metadata in the N pattern metadata until the value of i is greater than N;
if the matching result type of the ith pattern metadata is the entity information type, performing pattern matching on the target problem information according to the matching pattern of the ith pattern metadata to obtain a matching result corresponding to the ith pattern metadata, adding 1 to the value of i, and returning to execute the step of obtaining the ith pattern metadata in the N pattern metadata until the value of i is greater than N;
wherein N is an integer greater than 1, i is a positive integer with an initial value of 1, the first type includes the reply information class or the intention classification information class, and the target matching result includes matching results corresponding to the N pattern metadata.
In this embodiment, in the case where the target schema metadata includes N schema metadata, the N schema metadata may be traversed. For any pattern metadata in the N pattern metadata, if the matching result type of the pattern metadata is a reply information type or an intention classification information type and the reply information or the intention classification information is not matched, performing pattern matching on the target question information according to the matching pattern of the pattern metadata, if the pattern matching is successful, obtaining the reply information or the intention classification information, and continuously judging the next pattern metadata; if the matching result type of the pattern metadata is a reply information type or an intention classification information type and the reply information or the intention classification information is matched, the next pattern metadata can be directly judged; and if the matching result type of the mode metadata is the entity information type, performing mode matching on the target problem information according to the matching mode of the mode metadata, and if the mode matching is successful, obtaining the entity information and continuously judging the next mode metadata.
It should be noted that the target matching result may include a matching result corresponding to each successfully matched schema metadata.
The following examples are given to illustrate embodiments of the present invention:
for example, the mode matching result is recorded as ret _ value, which is in a form of a list, and the flag indicating whether the intention classification information or the reply information is matched is flag, where the value of flag may be True if the intention classification information or the reply information is matched, False if the intention classification information or the reply information is not matched, and True if the initialization flag is initialized.
Step a1, obtaining a schema metadata list Pattern corresponding to the user Id from the KMS.
Step a2, traversing Patterns.
Step a3, for PatterniIs the pattern, if patterniAct _ type ≠ 2 and flag ═ Ture, increments i by 1, and returns to execute step a 2; otherwise according to patterniAnd if the matching is successful, adding the matching result into ret _ value, adding i into 1, and returning to execute the step a 2.
In this step, the Pattern described aboveiEpsilon to Pattern represents PatterniBelonging to patterrns. The Pattern described aboveiAct _ type denotes PatterniThe type of the matching result of (1), the patterniAct _ type ≠ 2 denotes that the matching result type is not the entity information type.
Specifically, if the matching pattern type is a regular matching pattern, that is, a patterniPattern _ type is 0, then the problem information may be matched based on a regular matching pattern; if the matching pattern type is a code analysis pattern, that is, patterniPattern _ type ═ 1, then the problem information can be matched based on the code resolution pattern.
And step a4, returning a matching result ret _ value after traversing is completed.
In the embodiment of the invention, under the condition that the target mode metadata comprises N mode metadata, all the mode metadata with the matching result type of the entity information class in the N mode metadata are used for carrying out mode matching on the problem information, so that the entity information as much as possible can be obtained, the determination of the reply information is facilitated, and only one mode metadata with the matching result type of the intention type information class or the reply information class in the N mode metadata is used for carrying out mode matching on the problem information, so that the adverse effect of a plurality of different intention type information or reply information on the determination of the reply information can be avoided, and the mode matching efficiency can be improved.
Optionally, the target pattern metadata further includes a priority of the matching result;
the performing pattern matching on the target problem information according to the matching pattern to obtain the target matching result may include:
performing pattern matching on the target problem information according to a matching pattern of each pattern metadata in the M pattern metadata respectively under the condition that the target pattern metadata comprises M pattern metadata to obtain S matching results, wherein M is an integer larger than 1, and S is a positive integer smaller than or equal to M;
if the S matching results comprise at least two first matching results, selecting a matching result from the at least two first matching results according to the priority of each first matching result in the at least two first matching results;
wherein the first matching result is a matching result of the reply information class or the intention classification information class, and the target pattern matching result includes the selected matching result and a matching result other than the first matching result in the S matching results.
In this embodiment, each schema metadata may further include a priority of the matching result. In this way, when a plurality of different intention classification information or reply information is obtained by a problem matching, one intention classification information or reply information can be selected from the plurality of different intention classification information or reply information according to the priority of each matching result. For example, for question Q, matching results in intention classification information a1 and second intention classification information a2, and if the priority of intention classification information a1 is higher than that of second intention classification information a2, intention classification information a1 may be selected and added to the target pattern matching result.
Optionally, if the priorities of the plurality of different intention classification information or reply information are the same, one of the plurality of different intention classification information or reply information may be randomly selected.
It should be noted that the S matching results may include matching results corresponding to the schema metadata with successful schema matching in the M schema metadata.
In the embodiment of the invention, under the condition that the number of the matching results of the reply information classes or the intention classification information classes is multiple, the priority of the matching result is utilized to select a matching result from the matching results of the reply information classes or the intention classification information classes, so that the method is simple and convenient to realize, the accuracy of the selected matching result can be improved, and the accuracy of question answering in the answering process can be further improved.
Optionally, before obtaining the schema metadata corresponding to the target issue information, the method may further include:
collecting problem information of the NLU model analysis error;
schema metadata is determined from the collected issue information.
In this embodiment, when the problem information can be analyzed by using the NLU model in the response process, if the problem information is analyzed incorrectly, the problem information can be recorded, and the mode metadata can be set for the recorded problem information, so that the problem information can be accurately matched based on the mode metadata, and the accuracy of problem response in the response process is improved.
The following describes embodiments of the present invention with reference to examples:
referring to fig. 2, fig. 2 is a schematic diagram of a system architecture to which the response method provided by the embodiment of the present invention is applicable, and as shown in fig. 2, the system architecture includes a preprocessing module, an NLU module, a pattern matching module, a DM (dialog management) module, an NLG (Natural Language generation) module, a reply module, and a KMS.
The preprocessing module is used for preprocessing the problem information input by the user, such as filtering processing, word segmentation processing and the like.
The NLU module may include an NLU model, and is configured to perform natural language understanding processing on the preprocessed question information, for example, performing intention recognition, entity recognition, FAQ semantic matching, emotion recognition, and the like on the question information.
The Pattern matching module (also called Pattern matching module) is used for performing Pattern matching on the preprocessed problem, and can return a matching result to the NLU module. It should be noted that the pattern matching module may also directly return the matching result to the DM module.
The DM module may determine the behavior of the problem information according to the historical session state and the information (i.e., the NLU result, the pattern matching result, etc.) transmitted by the NLU module.
The NLG module can acquire the question answers from the KMS according to the behaviors, and generate response information of the questions according to the question answers and return the response information to the user.
Specifically, the Pattern matching module may include a Pattern metadata (i.e., Pattern metadata) retrieval module, a Pattern main module, a regular matching module, and a code parsing and executing module.
The Pattern metadata retrieval module can acquire Pattern metadata from the KMS.
The Pattern main module can be used for Pattern matching main body logic control, and Pattern matching is carried out through a regular matching module or a code analysis and execution module according to the Pattern type in the Pattern metadata.
The Regular matching module may support a complete set of PCRE (Perl Compatible Regular Expressions) Expressions, and may be used to match problems through a Regular matching mode, and may be used to process some simple problems.
The code parsing and executing module is internally provided with a code interpreter and a runtime environment, supports python language subset parsing and execution and is used for matching problems through a code parsing mode. In practical application, if some problems cannot be handled by the regular matching module, the code analysis and execution module can be configured to handle the problems.
Alternatively, the definition of Pattern metadata can be as shown in table 1:
TABLE 1
Figure BDA0002137042350000111
It should be noted that the Pattern described above can be used to define a regular matching rule (such as a regular expression) for implementing a regular matching Pattern competition Pattern matching or a code block for implementing a code parsing Pattern for Pattern matching. The action _ type field may be used to indicate the type of the matching result.
The embodiment of the invention uses the pattern matching module, can quickly and conveniently repair response errors caused by various algorithm models, and well meets the requirement of timely feedback of a user on error conditions (namely bad-case).
Referring to fig. 3, fig. 3 is a structural diagram of a response device provided in an embodiment of the present invention. As shown in fig. 3, the transponder apparatus 300 includes:
an obtaining module 301, configured to obtain target question information input by a user;
a matching module 302, configured to perform pattern matching on the target problem information to obtain a target matching result;
a natural language understanding module 303, configured to perform natural language understanding processing on the target problem information through a natural language understanding NLU model obtained through pre-training, to obtain a natural language understanding result;
a first determining module 304, configured to determine the target reply information according to the target matching result and the natural language understanding result.
Optionally, the matching module includes:
an obtaining unit, configured to obtain target pattern metadata corresponding to the target problem information, where the target pattern metadata includes a matching pattern, and the matching pattern includes a regular matching pattern or a code parsing pattern;
and the matching unit is used for carrying out pattern matching on the target problem information according to the matching pattern to obtain a target matching result.
Optionally, the target pattern metadata further includes a matching result type, where the matching result type includes a reply information class, an intention classification information class, or an entity information class;
and the type of the target matching result is the type of the matching result.
Optionally, the matching unit is specifically configured to:
acquiring an ith mode metadata of the N mode metadata under the condition that the target mode metadata comprises N mode metadata;
if the matching result type of the ith pattern metadata is a first type and the matching result of the first type is not matched, performing pattern matching on the target problem information according to the matching pattern of the ith pattern metadata to obtain a matching result corresponding to the ith pattern metadata, adding 1 to the value of i, and returning to execute the step of obtaining the ith pattern metadata in the N pattern metadata until the value of i is greater than N;
if the matching result type of the ith pattern metadata is a first type and the matching result of the first type is matched, adding 1 to the value of i, and returning to execute the step of acquiring the ith pattern metadata in the N pattern metadata until the value of i is greater than N;
if the matching result type of the ith pattern metadata is the entity information type, performing pattern matching on the target problem information according to the matching pattern of the ith pattern metadata to obtain a matching result corresponding to the ith pattern metadata, adding 1 to the value of i, and returning to execute the step of obtaining the ith pattern metadata in the N pattern metadata until the value of i is greater than N;
wherein N is an integer greater than 1, i is a positive integer with an initial value of 1, the first type includes the reply information class or the intention classification information class, and the target matching result includes matching results corresponding to the N pattern metadata.
Optionally, the target pattern metadata further includes a priority of the matching result;
the matching unit is specifically configured to:
performing pattern matching on the target problem information according to a matching pattern of each pattern metadata in the M pattern metadata respectively under the condition that the target pattern metadata comprises M pattern metadata to obtain S matching results, wherein M is an integer larger than 1, and S is a positive integer smaller than or equal to M;
if the S matching results comprise at least two first matching results, selecting a matching result from the at least two first matching results according to the priority of each first matching result in the at least two first matching results;
wherein the first matching result is a matching result of the reply information class or the intention classification information class, and the target pattern matching result includes the selected matching result and a matching result other than the first matching result in the S matching results.
Optionally, the apparatus further comprises:
a collecting module, configured to collect problem information of an NLU model analysis error before obtaining the pattern metadata corresponding to the target problem information;
a second determination module to determine schema metadata based on the collected issue information.
Optionally, the first determining module is specifically configured to:
under the condition that the pattern matching is successful, determining the target reply information according to the target matching result;
and under the condition that the pattern matching fails, determining the target reply information according to the natural language understanding result. The responding apparatus 300 provided in the embodiment of the present invention can implement each process in the foregoing method embodiments, and is not described here again to avoid repetition.
The response device 300 of the embodiment of the present invention includes an obtaining module 301, configured to obtain target problem information input by a user; a matching module 302, configured to perform pattern matching on the target problem information to obtain a target matching result; a natural language understanding module 303, configured to perform natural language understanding processing on the target problem information through a natural language understanding NLU model obtained through pre-training, to obtain a natural language understanding result; a first determining module 304, configured to determine the target reply information according to the target matching result and the natural language understanding result. The target problem information input by the user is analyzed and recognized by combining the pattern matching and the NLU model, and the reply information is determined by combining the target matching result and the natural language understanding result, so that the accuracy of the reply information can be improved.
Referring to fig. 4, fig. 4 is a structural diagram of a response unit according to still another embodiment of the present invention, and as shown in fig. 4, a response unit 400 includes: a processor 401, a memory 402 and a computer program stored on the memory 402 and operable on the processor, the various components in the data transmission device 400 being coupled together by a bus interface 403, the computer program, when executed by the processor 401, performing the steps of:
acquiring target problem information input by a user;
performing pattern matching on the target problem information to obtain a target matching result;
performing natural language understanding processing on the target problem information through a natural language understanding NLU model obtained by pre-training to obtain a natural language understanding result;
and determining target reply information according to the target matching result and the natural language understanding result.
Optionally, the computer program when executed by the processor 401 is further configured to:
acquiring target pattern metadata corresponding to the target problem information, wherein the target pattern metadata comprises a matching pattern, and the matching pattern comprises a regular matching pattern or a code analysis pattern;
and performing pattern matching on the target problem information according to the matching pattern to obtain a target matching result.
Optionally, the target pattern metadata further includes a matching result type, where the matching result type includes a reply information class, an intention classification information class, or an entity information class;
and the type of the target matching result is the type of the matching result.
Optionally, the computer program when executed by the processor 401 is further configured to:
acquiring an ith mode metadata of the N mode metadata under the condition that the target mode metadata comprises N mode metadata;
if the matching result type of the ith pattern metadata is a first type and the matching result of the first type is not matched, performing pattern matching on the target problem information according to the matching pattern of the ith pattern metadata to obtain a matching result corresponding to the ith pattern metadata, adding 1 to the value of i, and returning to execute the step of obtaining the ith pattern metadata in the N pattern metadata until the value of i is greater than N;
if the matching result type of the ith pattern metadata is a first type and the matching result of the first type is matched, adding 1 to the value of i, and returning to execute the step of acquiring the ith pattern metadata in the N pattern metadata until the value of i is greater than N;
if the matching result type of the ith pattern metadata is the entity information type, performing pattern matching on the target problem information according to the matching pattern of the ith pattern metadata to obtain a matching result corresponding to the ith pattern metadata, adding 1 to the value of i, and returning to execute the step of obtaining the ith pattern metadata in the N pattern metadata until the value of i is greater than N;
wherein N is an integer greater than 1, i is a positive integer with an initial value of 1, the first type includes the reply information class or the intention classification information class, and the target matching result includes matching results corresponding to the N pattern metadata.
Optionally, the target pattern metadata further includes a priority of the matching result;
the computer program, when executed by the processor 401, is further adapted to:
performing pattern matching on the target problem information according to a matching pattern of each pattern metadata in the M pattern metadata respectively under the condition that the target pattern metadata comprises M pattern metadata to obtain S matching results, wherein M is an integer larger than 1, and S is a positive integer smaller than or equal to M;
if the S matching results comprise at least two first matching results, selecting a matching result from the at least two first matching results according to the priority of each first matching result in the at least two first matching results;
wherein the first matching result is a matching result of the reply information class or the intention classification information class, and the target pattern matching result includes the selected matching result and a matching result other than the first matching result in the S matching results.
Optionally, the computer program when executed by the processor 401 is further configured to: before mode metadata corresponding to the target problem information is obtained, problem information of the NLU model analysis error is collected;
schema metadata is determined from the collected issue information.
Optionally, the computer program when executed by the processor 401 is further configured to:
under the condition that the pattern matching is successful, determining the target reply information according to the target matching result;
and under the condition that the pattern matching fails, determining the target reply information according to the natural language understanding result.
An embodiment of the present invention further provides a response apparatus, which includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements each process of the response method embodiment, and can achieve the same technical effect, and details are not repeated here to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above-mentioned response method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A method of responding, comprising:
acquiring target problem information input by a user;
performing pattern matching on the target problem information to obtain a target matching result;
performing natural language understanding processing on the target problem information through a natural language understanding NLU model obtained by pre-training to obtain a natural language understanding result;
and determining target reply information according to the target matching result and the natural language understanding result.
2. The method of claim 1, wherein the performing pattern matching on the target problem information to obtain a target matching result comprises:
acquiring target pattern metadata corresponding to the target problem information, wherein the target pattern metadata comprises a matching pattern, and the matching pattern comprises a regular matching pattern or a code analysis pattern;
and performing pattern matching on the target problem information according to the matching pattern to obtain a target matching result.
3. The method of claim 2, wherein the target schema metadata further comprises a match result type, the match result type comprising a reply information class, an intent classification information class, or an entity information class;
and the type of the target matching result is the type of the matching result.
4. The method according to claim 3, wherein the performing pattern matching on the target question information according to the matching pattern to obtain the target matching result comprises:
acquiring an ith mode metadata of the N mode metadata under the condition that the target mode metadata comprises N mode metadata;
if the matching result type of the ith pattern metadata is a first type and the matching result of the first type is not matched, performing pattern matching on the target problem information according to the matching pattern of the ith pattern metadata to obtain a matching result corresponding to the ith pattern metadata, adding 1 to the value of i, and returning to execute the step of obtaining the ith pattern metadata in the N pattern metadata until the value of i is greater than N;
if the matching result type of the ith pattern metadata is a first type and the matching result of the first type is matched, adding 1 to the value of i, and returning to execute the step of acquiring the ith pattern metadata in the N pattern metadata until the value of i is greater than N;
if the matching result type of the ith pattern metadata is the entity information type, performing pattern matching on the target problem information according to the matching pattern of the ith pattern metadata to obtain a matching result corresponding to the ith pattern metadata, adding 1 to the value of i, and returning to execute the step of obtaining the ith pattern metadata in the N pattern metadata until the value of i is greater than N;
wherein N is an integer greater than 1, i is a positive integer with an initial value of 1, the first type includes the reply information class or the intention classification information class, and the target matching result includes matching results corresponding to the N pattern metadata.
5. The method of claim 3, wherein the target pattern metadata further comprises a priority of the matching result;
the performing pattern matching on the target problem information according to the matching pattern to obtain the target matching result includes:
performing pattern matching on the target problem information according to a matching pattern of each pattern metadata in the M pattern metadata respectively under the condition that the target pattern metadata comprises M pattern metadata to obtain S matching results, wherein M is an integer larger than 1, and S is a positive integer smaller than or equal to M;
if the S matching results comprise at least two first matching results, selecting a matching result from the at least two first matching results according to the priority of each first matching result in the at least two first matching results;
wherein the first matching result is a matching result of the reply information class or the intention classification information class, and the target pattern matching result includes the selected matching result and a matching result other than the first matching result in the S matching results.
6. The method of claim 2, wherein prior to obtaining schema metadata corresponding to the target issue information, the method further comprises:
collecting problem information of the NLU model analysis error;
schema metadata is determined from the collected issue information.
7. The method according to any one of claims 1 to 6, wherein the determining target reply information according to the target matching result and the natural language understanding result comprises:
under the condition that the pattern matching is successful, determining the target reply information according to the target matching result;
and under the condition that the pattern matching fails, determining the target reply information according to the natural language understanding result.
8. A transponder apparatus, comprising:
the acquisition module is used for acquiring target problem information input by a user;
the matching module is used for carrying out pattern matching on the target problem information to obtain a target matching result;
the natural language understanding module is used for carrying out natural language understanding processing on the target problem information through a natural language understanding NLU model obtained through pre-training to obtain a natural language understanding result;
and the first determining module is used for determining target reply information according to the target matching result and the natural language understanding result.
9. A answering device, comprising a processor, a memory and a computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the answering method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the answering method according to any one of claims 1 to 7.
CN201910656586.XA 2019-07-19 2019-07-19 Response method and device Active CN111881266B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910656586.XA CN111881266B (en) 2019-07-19 2019-07-19 Response method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910656586.XA CN111881266B (en) 2019-07-19 2019-07-19 Response method and device

Publications (2)

Publication Number Publication Date
CN111881266A true CN111881266A (en) 2020-11-03
CN111881266B CN111881266B (en) 2024-06-07

Family

ID=73153950

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910656586.XA Active CN111881266B (en) 2019-07-19 2019-07-19 Response method and device

Country Status (1)

Country Link
CN (1) CN111881266B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116009827A (en) * 2023-03-28 2023-04-25 杭州实在智能科技有限公司 Intelligent generation and recommendation method and system for RPA (remote procedure association) flow and guiding course

Citations (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005275939A (en) * 2004-03-25 2005-10-06 Onepass:Kk Question-type knowledge acquiring system
CN101076061A (en) * 2007-03-30 2007-11-21 腾讯科技(深圳)有限公司 Robot server and automatic chatting method
CN104216913A (en) * 2013-06-04 2014-12-17 Sap欧洲公司 Problem answering frame
CN104598445A (en) * 2013-11-01 2015-05-06 腾讯科技(深圳)有限公司 Automatic question-answering system and method
US20170004008A1 (en) * 2014-01-28 2017-01-05 Hewlett-Packard Development Company, L.P. Task management based on semantic analysis
US20170124064A1 (en) * 2014-05-22 2017-05-04 Huawei Technologies Co., Ltd. Reply information recommendation method and apparatus
CN107301213A (en) * 2017-06-09 2017-10-27 腾讯科技(深圳)有限公司 Intelligent answer method and device
CN107766511A (en) * 2017-10-23 2018-03-06 深圳市前海众兴电子商务有限公司 Intelligent answer method, terminal and storage medium
CN108021369A (en) * 2017-12-21 2018-05-11 马上消费金融股份有限公司 A kind of data integration processing method and relevant apparatus
WO2018149326A1 (en) * 2017-02-16 2018-08-23 阿里巴巴集团控股有限公司 Natural language question answering method and apparatus, and server
CN108664599A (en) * 2018-05-09 2018-10-16 腾讯科技(深圳)有限公司 Intelligent answer method, apparatus, intelligent answer server and storage medium
CN108829757A (en) * 2018-05-28 2018-11-16 广州麦优网络科技有限公司 A kind of intelligent Service method, server and the storage medium of chat robots
CN108845804A (en) * 2017-12-23 2018-11-20 北京邮电大学 A kind of design method of the NC code interpreter based on CYCLE circulation
CN108897867A (en) * 2018-06-29 2018-11-27 北京百度网讯科技有限公司 For the data processing method of knowledge question, device, server and medium
CN108920497A (en) * 2018-05-23 2018-11-30 北京奇艺世纪科技有限公司 A kind of man-machine interaction method and device
CN109033305A (en) * 2018-07-16 2018-12-18 深圳前海微众银行股份有限公司 Question answering method, equipment and computer readable storage medium
CN109190114A (en) * 2018-08-13 2019-01-11 北京百度网讯科技有限公司 Method and apparatus for generating return information
CN109241258A (en) * 2018-08-23 2019-01-18 江苏索迩软件技术有限公司 A kind of deep learning intelligent Answer System using tax field
CN109493166A (en) * 2018-10-23 2019-03-19 深圳智能思创科技有限公司 A kind of construction method for e-commerce shopping guide's scene Task conversational system
US20190163691A1 (en) * 2017-11-30 2019-05-30 CrowdCare Corporation Intent Based Dynamic Generation of Personalized Content from Dynamic Sources
CN109885672A (en) * 2019-03-04 2019-06-14 中国科学院软件研究所 A kind of question and answer mode intelligent retrieval system and method towards online education
CN109885810A (en) * 2019-01-17 2019-06-14 平安城市建设科技(深圳)有限公司 Nan-machine interrogation's method, apparatus, equipment and storage medium based on semanteme parsing

Patent Citations (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005275939A (en) * 2004-03-25 2005-10-06 Onepass:Kk Question-type knowledge acquiring system
CN101076061A (en) * 2007-03-30 2007-11-21 腾讯科技(深圳)有限公司 Robot server and automatic chatting method
CN104216913A (en) * 2013-06-04 2014-12-17 Sap欧洲公司 Problem answering frame
CN104598445A (en) * 2013-11-01 2015-05-06 腾讯科技(深圳)有限公司 Automatic question-answering system and method
US20160247068A1 (en) * 2013-11-01 2016-08-25 Tencent Technology (Shenzhen) Company Limited System and method for automatic question answering
US20170004008A1 (en) * 2014-01-28 2017-01-05 Hewlett-Packard Development Company, L.P. Task management based on semantic analysis
US20170124064A1 (en) * 2014-05-22 2017-05-04 Huawei Technologies Co., Ltd. Reply information recommendation method and apparatus
WO2018149326A1 (en) * 2017-02-16 2018-08-23 阿里巴巴集团控股有限公司 Natural language question answering method and apparatus, and server
CN108446286A (en) * 2017-02-16 2018-08-24 阿里巴巴集团控股有限公司 A kind of generation method, device and the server of the answer of natural language question sentence
CN107301213A (en) * 2017-06-09 2017-10-27 腾讯科技(深圳)有限公司 Intelligent answer method and device
CN107766511A (en) * 2017-10-23 2018-03-06 深圳市前海众兴电子商务有限公司 Intelligent answer method, terminal and storage medium
US20190163691A1 (en) * 2017-11-30 2019-05-30 CrowdCare Corporation Intent Based Dynamic Generation of Personalized Content from Dynamic Sources
CN108021369A (en) * 2017-12-21 2018-05-11 马上消费金融股份有限公司 A kind of data integration processing method and relevant apparatus
CN108845804A (en) * 2017-12-23 2018-11-20 北京邮电大学 A kind of design method of the NC code interpreter based on CYCLE circulation
CN108664599A (en) * 2018-05-09 2018-10-16 腾讯科技(深圳)有限公司 Intelligent answer method, apparatus, intelligent answer server and storage medium
CN108920497A (en) * 2018-05-23 2018-11-30 北京奇艺世纪科技有限公司 A kind of man-machine interaction method and device
CN108829757A (en) * 2018-05-28 2018-11-16 广州麦优网络科技有限公司 A kind of intelligent Service method, server and the storage medium of chat robots
CN108897867A (en) * 2018-06-29 2018-11-27 北京百度网讯科技有限公司 For the data processing method of knowledge question, device, server and medium
CN109033305A (en) * 2018-07-16 2018-12-18 深圳前海微众银行股份有限公司 Question answering method, equipment and computer readable storage medium
CN109190114A (en) * 2018-08-13 2019-01-11 北京百度网讯科技有限公司 Method and apparatus for generating return information
CN109241258A (en) * 2018-08-23 2019-01-18 江苏索迩软件技术有限公司 A kind of deep learning intelligent Answer System using tax field
CN109493166A (en) * 2018-10-23 2019-03-19 深圳智能思创科技有限公司 A kind of construction method for e-commerce shopping guide's scene Task conversational system
CN109885810A (en) * 2019-01-17 2019-06-14 平安城市建设科技(深圳)有限公司 Nan-machine interrogation's method, apparatus, equipment and storage medium based on semanteme parsing
CN109885672A (en) * 2019-03-04 2019-06-14 中国科学院软件研究所 A kind of question and answer mode intelligent retrieval system and method towards online education

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116009827A (en) * 2023-03-28 2023-04-25 杭州实在智能科技有限公司 Intelligent generation and recommendation method and system for RPA (remote procedure association) flow and guiding course

Also Published As

Publication number Publication date
CN111881266B (en) 2024-06-07

Similar Documents

Publication Publication Date Title
CN110727779A (en) Question-answering method and system based on multi-model fusion
CN110890088B (en) Voice information feedback method and device, computer equipment and storage medium
CN114970560A (en) Dialog intention recognition method and device, storage medium and intelligent device
CN111368096A (en) Knowledge graph-based information analysis method, device, equipment and storage medium
CN114647713A (en) Knowledge graph question-answering method, device and storage medium based on virtual confrontation
CN109753561B (en) Automatic reply generation method and device
CN111738017A (en) Intention identification method, device, equipment and storage medium
CN111190973A (en) Method, device, equipment and storage medium for classifying statement forms
CN111488950B (en) Classification model information output method and device
CN111414732A (en) Text style conversion method and device, electronic equipment and storage medium
CN115345177A (en) Intention recognition model training method and dialogue method and device
CN111881266B (en) Response method and device
CN111639160A (en) Domain identification method, interaction method, electronic device and storage medium
CN116680385A (en) Dialogue question-answering method and device based on artificial intelligence, computer equipment and medium
CN110413750A (en) The method and apparatus for recalling standard question sentence according to user's question sentence
CN112989040B (en) Dialogue text labeling method and device, electronic equipment and storage medium
CN111666770B (en) Semantic matching method and device
CN115019788A (en) Voice interaction method, system, terminal equipment and storage medium
CN113963235A (en) Cross-category image recognition model reusing method and system
CN113628077A (en) Method for generating non-repeated examination questions, terminal and readable storage medium
CN114942980B (en) Method and device for determining text matching
CN110765246B (en) Question and answer method and device based on intelligent robot, storage medium and intelligent device
CN113850235B (en) Text processing method, device, equipment and medium
CN114239941A (en) Report robot multi-round conversation strategy prediction method and system
CN113568929A (en) Data storage method, data query method, data storage device, data query device and electronic equipment

Legal Events

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