WO2017097061A1 - Smart response method and apparatus - Google Patents

Smart response method and apparatus Download PDF

Info

Publication number
WO2017097061A1
WO2017097061A1 PCT/CN2016/104071 CN2016104071W WO2017097061A1 WO 2017097061 A1 WO2017097061 A1 WO 2017097061A1 CN 2016104071 W CN2016104071 W CN 2016104071W WO 2017097061 A1 WO2017097061 A1 WO 2017097061A1
Authority
WO
WIPO (PCT)
Prior art keywords
question
information
type
answer
problem information
Prior art date
Application number
PCT/CN2016/104071
Other languages
French (fr)
Chinese (zh)
Inventor
韩丙卫
冯军
丁岩
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017097061A1 publication Critical patent/WO2017097061A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation

Definitions

  • the present invention relates to the field of communications, and in particular to an intelligent response method and apparatus.
  • the traditional customer service center is mainly based on the telephone call center.
  • the traditional customer service center can not meet the needs of customers.
  • Many large service companies are constantly expanding their more cost-effective customer service centers, reducing labor costs and enhancing user experience, such as smart online customer service and smartphone applications.
  • the core of intelligent customer service is intelligent question and answer.
  • the question and answer system can get short and accurate answers based on user input.
  • the intelligent question answering system has inflexible semantic support and inconvenient maintenance, and no effective solution has been proposed yet.
  • the embodiment of the invention provides an intelligent response method and device, so as to at least solve the problem that the intelligent question answering system in the related art is inflexible in semantic support and inconvenient to maintain.
  • an intelligent response method includes: receiving problem information input through a user terminal; searching a plurality of question and answer libraries for a question and answer library corresponding to the type of the problem information; The rule searches for an answer corresponding to the question information from a question answering library corresponding to the type of the question information; and returns an answer corresponding to the question information as a return result to the user terminal.
  • searching for the answer corresponding to the question information from the question and answer library corresponding to the type of the question information according to the preset rule includes: selecting the question and answer library corresponding to the type of the question information, according to the question information and The similarity of the question stored in the question and answer library corresponding to the type of the problem information, filtering the question in the question answering library corresponding to the type of the problem information; and the corresponding answer corresponding to the filtered question is corresponding to the problem information s answer.
  • the question information is stored according to the question information and the question and answer library corresponding to the type of the question information.
  • the similarity of the problem, the filtering of the problem in the question answering library corresponding to the type of the problem information includes: obtaining a target problem matching the problem information from the question answering library corresponding to the type of the problem information; obtaining the problem information and the The similarity of the target problem; filtering the target problem in the question and answer library corresponding to the type of the problem information that is less than the preset threshold, and obtaining the first filtering result; when only one target problem is included in the first filtering result, The answer corresponding to the one target question is the answer corresponding to the problem information; when the plurality of the target questions are included in the first filtering result, the target problem corresponding to the highest priority among the plurality of the target questions is taken The answer is the answer to the question information.
  • the method 1 is applied to at least one of the following scenarios: the problem information is the same as the target problem; the problem information includes the target problem; and the target problem includes the problem information.
  • the number of words included in the segmentation of the problem information is obtained by the following rules: segmenting the problem information to obtain a plurality of words; assigning each word according to the part of speech of each word Weighting; the number of each of the plurality of words and the weighted sum of each of the words as the number of words included after the word segmentation of the question; the following rules are used to obtain the word segmentation after the target problem is included
  • the weighted sum of words is the number of words included after the word segmentation of the target question.
  • searching, from a plurality of question and answer libraries, the question and answer library corresponding to the type of the problem information includes: determining whether the problem information is the first type of problem information; and the problem information is the first type of problem In the case of information, obtaining a first type of question and answer library corresponding to the first type of question information; and if the question information is not the first type of question information, determining whether the question information is the second type of question information;
  • the problem information is the second type of problem information
  • the second type of question answering library corresponding to the second type of question information is obtained; from the second type of question answering library, the problem information is reconfirmed according to the preset rule;
  • the reconfirmed question information is the third type of question information; in the case where the reconfirmed question information is the third type of question information, the third type of question answering library corresponding to the reconfirmed question information is obtained.
  • the first type of problem information includes: slang; the first type of question and answer library includes: a slang corpus; wherein the slang corpus stores a slang word and an answer corresponding to the slang word;
  • the second type of problem information includes: specific problem information; the second type of question and answer library includes: an equivalence sentence and a standard sentence library; wherein the equivalence sentence and the standard sentence library store the specific problem and correspond to the specific problem a standard sentence or an equivalent sentence;
  • the third type of problem information includes: general problem information; the third type of question and answer library includes: a general question and an answer corresponding to the ordinary question.
  • reconfirming the problem information according to the preset rule includes: querying, from the second type of question and answer library, all the questions corresponding to the problem information; After the rule is filtered to obtain all the second filtering results, if the second filtering result is unique, the filtering result is used as the re-confirmed problem information; in the case where the second filtering result does not exist Next, the problem information input through the user terminal is used as the problem information after the reconfirmation.
  • the method before returning the answer corresponding to the problem information to the user terminal as a return result, the method further includes: determining whether the answer corresponding to the problem information is the fourth type of problem information; wherein The fourth type of problem information includes: a guided question; if yes, triggering display of the prompt information, wherein the prompt information is used to prompt the user terminal to input the guide information corresponding to the fourth type of problem information; if not, directly The answer corresponding to the question information is returned to the user terminal as a return result.
  • an intelligent response apparatus including: a receiving module configured to receive problem information input through a user terminal; and a first searching module configured to search from a plurality of question and answer libraries a question answering library corresponding to the type of the problem information; the second searching module is configured to search for an answer corresponding to the question information from the question answering library corresponding to the type of the question information according to the preset rule; and returning the module, set to be The answer corresponding to the question information is returned to the user terminal as a return result.
  • the second searching module is further configured to: according to the problem information, the similarity between the problem information and the question stored in the question and answer library corresponding to the type of the problem information, from the question answering library corresponding to the type of the problem information. Filtering the question in the question and answer library corresponding to the type of the problem information; and using the filtered answer corresponding to the question as the answer corresponding to the question information.
  • the second searching module includes: a first acquiring unit, configured to acquire a target problem that matches the problem information from a question and answer library corresponding to the type of the problem information; and the second obtaining unit is configured to Obtaining a similarity between the problem information and the target problem; the filtering unit is configured to filter the target problem in the Q&A library corresponding to the type of the problem information that is less than a preset threshold, to obtain a first filtering result; In order to include only one of the target questions in the first filtering result, the answer corresponding to the one target question is used as an answer corresponding to the problem information; and when the plurality of the target questions are included in the first filtering result, The answer corresponding to the target question with the highest priority among the plurality of the target questions is taken as the answer corresponding to the question information.
  • the first searching module includes: a first determining unit, configured to determine whether the problem information is the first type of problem information; and a third obtaining unit, configured to: the problem information is the first type of problem In the case of information, a first type of question and answer library corresponding to the first type of question information is obtained; and the second determining unit is configured to determine whether the question information is the first if the question information is not the first type of question information.
  • the fourth obtaining unit is configured to obtain a second type of question and answer library corresponding to the second type of question information if the problem information is the second type of question information; and the confirming unit is set to be from the first In the second type of question answering library, the problem information is reconfirmed according to the preset rule; the third determining unit is configured to determine whether the reconfirmed question information is the third type of problem information; and the fifth obtaining unit is set to reconfirm the In the case where the problem information is the third type of problem information, a third type of question answering library corresponding to the reconfirmed problem information is obtained.
  • the confirmation unit includes: a query subunit, configured to query all the questions corresponding to the problem information from the second type of question and answer library; and the filtering subunit is set to follow the preset rule After filtering all the questions, the second filtering result is obtained; the confirmation subunit is set to use the filtering result as the problem information after the reconfirmation if the second filtering result is unique; and in the absence of the second filtering In the case of the result, the problem information input by the user terminal is used as the problem information after the reconfirmation.
  • the device further includes: a determining module, configured to determine whether the answer corresponding to the problem information is the fourth type of problem information; wherein the fourth type of problem information includes: a guided question; a display module, When the answer corresponding to the question information is the fourth type of question information, triggering the display of the prompt information, wherein the prompt information is used to prompt the user terminal to input the guide information corresponding to the fourth type of problem information;
  • the returning module is further configured to directly return the answer corresponding to the question information as a return result to the user terminal if the answer corresponding to the question information is not the fourth type of question information.
  • Embodiments of the present invention also provide a storage medium, which may be configured to store program code for performing the following steps: receiving problem information input through a user terminal; searching for the problem from a plurality of question and answer libraries A question answering library corresponding to the type of information; searching for an answer corresponding to the question information from a question and answer library corresponding to the type of the question information according to a preset rule; and returning the answer corresponding to the question information as a return result to the user terminal.
  • the problem information input through the user terminal is received; from the plurality of question and answer libraries, the question and answer library corresponding to the type of the problem information is searched; and the question and answer library corresponding to the type of the problem information is selected according to the preset rule. Find an answer corresponding to the question information; return the answer corresponding to the question information as a return result to the user terminal.
  • the question and answer library is divided into multiple question and answer libraries. According to the type of the question information input, the answers corresponding to the question information are searched from the question and answer library corresponding to the type of the question information in the plurality of question and answer libraries, and the intelligence in the related technology is solved.
  • the question and answer system has inflexible semantic support and inconvenient maintenance, which improves the flexibility of semantic support and facilitates the maintenance and update of the intelligent question answering system.
  • FIG. 1 is a flowchart 1 of an intelligent response method according to an embodiment of the present invention.
  • FIG. 2 is a second flowchart of an intelligent response method according to an embodiment of the present invention.
  • FIG. 3 is a third flowchart of an intelligent response method according to an embodiment of the present invention.
  • FIG. 4 is a flowchart 4 of an intelligent response method according to an embodiment of the present invention.
  • FIG. 5 is a flow chart of a smart question answering method in accordance with a preferred embodiment of the present invention.
  • FIG. 6 is a schematic flow chart of a query question and answer process according to a preferred embodiment of the present invention.
  • FIG. 7 is a structural block diagram 1 of an intelligent response device according to an embodiment of the present invention.
  • FIG. 8 is a structural block diagram 2 of an intelligent response apparatus according to an embodiment of the present invention.
  • FIG. 9 is a structural block diagram 3 of an intelligent response apparatus according to an embodiment of the present invention.
  • FIG. 10 is a structural block diagram 4 of an intelligent response apparatus according to an embodiment of the present invention.
  • FIG. 11 is a structural block diagram 5 of an intelligent response apparatus according to an embodiment of the present invention.
  • FIG. 12 is a block diagram showing the architecture of a smart question answering system in accordance with a preferred embodiment of the present invention.
  • FIG. 1 is a flowchart 1 of an intelligent response method according to an embodiment of the present invention. As shown in FIG. 1 , the process includes the following steps:
  • Step S102 receiving problem information input through the user terminal
  • Step S104 searching for a question and answer library corresponding to the type of the problem information from the plurality of question and answer libraries;
  • Step S106 searching for an answer corresponding to the problem information from a question and answer library corresponding to the type of the problem information according to a preset rule;
  • step S108 the answer corresponding to the question information is returned to the user terminal as a return result.
  • the question and answer library is divided into multiple, different questions.
  • the type of information corresponds to different question and answer libraries, that is, different question and answer libraries store different types of questions and answers.
  • the type of the question information is from the question and answer library corresponding to the type of the question information.
  • the intelligent question answering system is inflexible in semantic support and inconvenient to maintain.
  • the above problem information may include: “Hello”, “How is the weather” and the like, with certain characteristics such as using dialects to describe how to query the specific fee information, etc., “How to check the phone bill”
  • Ordinary problem information such as "how to send a text message”, a guided question such as "query call charge”
  • the types of the above question and answer library may include: a slang corpus, an equivalent sentence and a standard sentence library, and a general question and answer library;
  • the slang corpus stores a slang word and an answer corresponding to the slang word;
  • the equivalent sentence and the standard sentence library store the specific question and a standard sentence or an equivalent sentence corresponding to the specific question; Stores common questions and answers to the common questions.
  • Each type of question information corresponds to a type of question and answer library.
  • the step S104 may include: selecting, from the question and answer library corresponding to the type of the problem information, the similarity of the problem information and the question stored in the question and answer library corresponding to the type of the question information. Filtering the question in the question and answer library corresponding to the type of the problem information; and using the filtered answer corresponding to the question as the answer corresponding to the question information.
  • the method may be: obtaining a target problem that matches the problem information from a question and answer library corresponding to the type of the problem information; obtaining a similarity between the problem information and the target problem; filtering the type of the problem information In the corresponding question and answer library, the target problem with the similarity less than the preset threshold is obtained, and the first filtering result is obtained; when only one target problem is included in the first filtering result, the answer corresponding to the target problem is taken as the problem The answer corresponding to the information; when the plurality of the target questions are included in the first filtering result, the answer corresponding to the target question with the highest priority among the plurality of the target questions is taken as the answer corresponding to the problem information.
  • the above-mentioned target problem may be a problem related to the problem information
  • the related questions are found in the question and answer library corresponding to the type of the problem information, and the similarity between the problem information and the related problems is calculated.
  • the related problems whose similarity is less than a certain threshold are filtered out. If there is only one related problem after filtering, the answer corresponding to the related question is taken as the answer corresponding to the problem information; if it is filtered out, When multiple related questions are concerned, the answer corresponding to the question with the highest priority may be taken as the answer corresponding to the question information according to the priority of the related questions.
  • the priority may be the ranking score of the search engine of the related question, and the priority of the ranked high is high. That is to find the answer corresponding to the problem information through the combination of search and similarity filtering, and solve the problem that the search engine hits too many results in the related art, can not directly return to the user's answer, and overcomes the common similarity. Calculate the problem of weak semantic support.
  • the preset threshold may be preset, may be a fixed value, or may be adjusted in real time according to actual conditions, and the preset threshold may be set as empirical data.
  • the number of words; words2 is the number of words included after the word segmentation of the target question; Samewords is the number of words included in the word segmentation after the word segmentation is performed after segmentation of the target question; Num1 is the number of words in the Samewords that are segmented
  • the number of words included in the word segmentation of the problem information may be obtained by dividing the problem information into a plurality of words; each word of the word is used for each word.
  • the word assigns a weight; the number of each of the plurality of words and the weighted sum of the words are the number of words included after the word segmentation of the question information;
  • the target problem can be obtained by the following rules The number of words included after the word segmentation: segmentation of the target question, obtaining a plurality of words; assigning a weight to each word according to the part of speech of each word; the number of each word of the plurality of words And the weighted sum of each word as the number of words included after the word segmentation of the target question.
  • the weights of different part-of-speech allocations are different.
  • the weight of a noun can be 2
  • the weight of a verb can be 2
  • the weight of an adjective is 1, wherein a weight of 1 means that when calculating the total number of words included, The word is only calculated once. If the weight is 2, it means that when calculating the total number of words included, the word needs to be calculated twice.
  • mode 2 may be employed, but is not limited thereto.
  • FIG. 2 is a flowchart 2 of an intelligent response method according to an embodiment of the present invention.
  • the foregoing step S104 may include:
  • Step S104-1 determining whether the problem information is the first type of problem information
  • Step S104-2 if the problem information is the first type of problem information, acquiring a first type of question answering library corresponding to the first type of problem information;
  • Step S104-3 if the problem information is not the first type of problem information, determining whether the problem information is the second type of problem information;
  • Step S104-4 if the problem information is the second type of problem information, acquiring a second type of question answering library corresponding to the second type of problem information;
  • Step S104-5 from the second type of question and answer library, re-confirm the problem information according to the preset rule;
  • Step S104-6 determining whether the reconfirmed problem information is the third type of problem information
  • Step S104-7 in the case where the reconfirmed problem information is the third type of question information, acquire a third type of question answering library corresponding to the reconfirmed question information.
  • the first type of problem information may include: the above-mentioned slang language; the above-mentioned first type question and answer
  • the library includes: the above-mentioned slang corpus;
  • the second type of problem information may include: specific problem information;
  • the second type of question and answer library may include: an equivalent sentence and a standard sentence library;
  • the third type of problem information may include: general problem information
  • the third type of question and answer library mentioned above may include: a general question and answer library.
  • the above specific problem may be some personalized problem.
  • the corresponding answer is found by searching for the equivalent sentence or standard sentence corresponding to the equivalent sentence and the standard sentence database. .
  • FIG. 3 is a flowchart of a smart response method according to an embodiment of the present invention.
  • the foregoing step S212 may include:
  • Step S212-1 querying, from the second type of question and answer library, all the questions corresponding to the problem information
  • Step S212-2 after filtering all the questions according to the preset rule, obtaining a second filtering result
  • Step S212-3 in the case that the second filtering result is unique, the filtering result is used as the re-confirmed problem information; and in the case where the second filtering result does not exist, the problem information input through the user terminal is to be As the problem information after the reconfirmation.
  • the preset rule may be the similarity filtering mode described above, and the problem of low similarity is filtered out by setting the threshold value by calculating the similarity between the problem information and all the questions corresponding to the problem information. The remaining question may be the issue of reconfirmation.
  • FIG. 4 is a flowchart of a smart response method according to an embodiment of the present invention. As shown in FIG. 4, before the step S108, the method may further include:
  • Step S402 determining whether the answer corresponding to the problem information is the fourth type of problem information; wherein the fourth type of problem information includes: a guided question;
  • Step S404 if yes, triggering display of the prompt information, wherein the prompt information is used to prompt the user terminal to input the guide information corresponding to the fourth type of problem information;
  • Step S406 if not, directly returning the answer corresponding to the question information to the user terminal as a return result.
  • the above-mentioned guided question may be an extension of the ordinary question and answer.
  • the guided question cannot directly obtain the answer, and must obtain some necessary information through interactive guidance to obtain the final result.
  • the method further includes: determining whether the problem information includes a sensitive word, and if the sensitive word is included, performing step S104 to step S108 instead of directly returning, indicating that the sensitive word is included; If the sensitive word is not included, step S104 is performed.
  • sensitive words can be words such as illegal drugs, yellow-related and other illegal laws.
  • the present invention provides a preferred intelligent question answering method.
  • the user input problem is required.
  • Class, in the intelligent question answering system, the user's input can be divided into the following categories:
  • Ordinary question and answer (equivalent to the general problem information in the above embodiment):
  • the ordinary question and answer is that the user enters a question and wants to directly obtain the answer to the question.
  • the difference with a normal search engine is that the search engine returns multiple answers to a question, requiring the user to select the desired result from multiple answers; and the intelligent question answering system directly returns the most similar answer to the user.
  • Guided question and answer is an extension of the general question and answer. A question cannot be directly obtained. It must be interactively guided to obtain some necessary information before the final result can be obtained. If the user enters "query call charge", this question must guide the user to enter the mobile phone number, month and other information to get the final answer.
  • the intelligent question answering system has different processing logic depending on the type of problem.
  • the question answering library in the intelligent question answering system is divided into the following types, and the corresponding data is saved through the following question and answer library:
  • the chilling database (corresponding to the slang corpus in the above embodiment): the corpus of the chilling dialogue such as the slang and the answer corresponding to the slang, the data is saved to the system index library (corresponding to the slang corpus in the above embodiment).
  • the general question and answer library (equivalent to the general question and answer library in the above embodiment): the general problem and the answer corresponding to the common question, and the corpus of the guided question.
  • Equivalent sentence and standard sentence library (equivalent to the equivalent sentence and standard sentence library in the above embodiment): Save the standard sentence corresponding to the personalized question and the personalized question.
  • the general question and answer library stores The standard question and the answer corresponding to the standard question, this corpus is relatively small, and in the formal intelligent question answering system, the user input problem is in various forms, and the equivalent sentence and the standard sentence library also store the user input problem and Correspondence of standard questions.
  • the above preferred intelligent question and answer method may include the following steps:
  • Step 1 the user enters a question
  • Step 2 The sensitive word determination includes the following steps: Step 21: Determine whether the input contains a sensitive word, if the sensitive word is included, perform step 22, and do not include performing step 31; Step 22, including the sensitive word, directly returning, and not continuing, The prompt contains sensitive words;
  • Step 3 Hanyu judgment: Step 31: Determine whether the user input is a slang word, search from the slang corpus, and if the searched result has a value after threshold filtering, the input question is considered to be a chilling conversation; step 32, if input Is a cold dialogue, choose one of the results to return to the user, do not continue to execute; if it is not a cold dialogue, go to step 41;
  • Step 4 Equivalence sentence search and standard question replacement: Step 41: Using the user input question as a query condition, querying in the equivalence sentence and the standard sentence library, and querying all relevant results; Step 42, performing similarity on the query result Calculate, if there is a unique result after filtering the calculation result, replace the standard question of the result with the user's input question, if not Exist, retain the original problem;
  • Step 5 Search the question and answer library: Step 51, after processing in step 4, search the general question and answer library with the processed question, and query all relevant results; Step 52, perform the similarity calculation on the query result, and if there is a unique result after filtering the calculation result For a result, the result is taken as a question and answer record, and the answer field of the record is taken as a pre-return result.
  • step 6 the process is arranged to determine whether the result is a guided problem: in step 61, after the step 5 is processed, the pre-return result is subjected to the guided question determination; and in step 62, if the guided question has subsequent processing, the process is performed.
  • the arrangement process prompts the user to input; step 63, if it is not a guided question, directly returns the pre-return result as an answer to the user.
  • step 1 corresponds to step S102 in the above embodiment
  • steps 2 to 4 correspond to steps S202 to S214 in the above embodiment
  • step 5 corresponds to step S108
  • step 6 corresponds to the above steps. S402 to step S406.
  • the similarity calculation method may be: parameter 1: user input (corresponding to problem information in the above embodiment) parameter 2: search result (corresponding to the target problem in the above embodiment),
  • the above similarity calculation method includes steps S1 to S6:
  • Step S1 If the user input is exactly the same as the search result, the similarity is 1.0; if the parameter 1 contains the parameter 2, or the parameter 2 includes the parameter 1 to perform the step S2; otherwise, the step S3 is performed.
  • step S2 the longer value of the parameter is length1 and the other is length2, and the similarity score is calculated: alpha1+beta1*length2/length1; the calculation result is returned.
  • the alpha1 and beta1 are empirical values.
  • Step S3 performing word segmentation and part-of-speech tagging on user input and search results.
  • Step S4 adjusting the weight after the word segmentation, the noun and the verb are adjusted to 2, and the other parts of speech are unchanged.
  • Step S5 the number of the same words after the statistical parameter 1 and the parameter 2 word segmentation, the weight is 2, calculated twice, and the count is samewords.
  • Step S6 after the parameter 1 word segmentation is words1, after the parameter 2 word segmentation is words2, the samewords contains the number of words in the word1 is num1, and the samewords contains the number of words in the words2 is num2.
  • the algorithm for specific similarity is:
  • Double dp Math.min(1.0*words1.size()/words2.size(),1.0*words2.size()/words1.size());
  • Double part1 alpha*(1.0*samewords.size()/words1.size()+1.0*samewords.size()/words2.size())/2.0;
  • Double part2 beta*dp*(num1/words1.size()+num2/words2.size())/2.0;
  • the similarity is the value of part1+part2, where size() in the preferred embodiment is used to calculate the number of elements.
  • the threshold filtering method includes the following steps 1 to 4:
  • Step 1 calculating the phase of the input question and the search hit result problem (corresponding to the target problem in the above embodiment) field Similarity
  • Step 3 If after step 1, 2, only one problem result remains after processing, the result is the final result, and the answer field value is returned from the result. If the result of the problem after the processing of steps 1 and 2 is greater than one, the remaining results are filtered by the ranking of the search engine searched from the question and answer library, and the item with the highest sorting score (scoreMax) is taken as the final result. Filter out the remaining problem results.
  • Step 4 After the processing in step 3, if the final result is one, the result is the final result, and the answer field value is returned from the result.
  • the smart question answering method includes:
  • Step S502 the user inputs a question
  • Step S504 it is determined whether the session is set (session); if not, step S506 is performed; in the case of YES, step S508 is performed;
  • Step S506 performing a normal search
  • Step S508 the robot searches whether the question input by the user contains a sensitive word; if it is included, step S510 is performed; if not, step S512 is performed;
  • Step S510 returning directly, reminding the user to include the sensitive word
  • Step S512 normalizing the problem input by the user, such as special symbol processing
  • Step S514 it is determined whether the session exists and there is a cache; if yes, step S516 is performed; if not, step S522 is performed;
  • Step S5128 it is determined whether the guided problem is processed normally, in the case of normal processing, step S520 is performed; if the processing is not normal, step S522 is performed;
  • Step S520 caching the problem, and returning the result
  • Step S522 it is determined whether the problem is a slang; if yes, step S524 is performed; if not, step S526 is performed;
  • Step S530 it is determined whether it is a guided question, if yes, step S536 is performed; if not, step S538 is performed;
  • Step S532 determining context information; performing step S538;
  • step S540 the result is returned.
  • step S526 can be implemented by the following process. As shown in FIG. 6, the process includes steps S602 to S626:
  • Step S602 accurately querying the equivalent sentence in the equivalent sentence and the standard sentence library
  • Step S604 it is determined whether an equivalence sentence is found, if yes, step S606 is performed; if not, step S608 is performed;
  • Step S606 performing standard sentence replacement
  • Step S608 using regular expression matching
  • Step S610 it is determined whether the unique result is matched; if yes, step S606 is performed;
  • Step S612 searching for the standard sentence in the general question and answer library
  • Step S614 performing similarity filtering
  • Step S616 it is determined whether there is a problem result corresponding to the standard sentence after the similarity filtering; if not, step S618 is performed; if yes, step S626 is performed;
  • Step S618, the word segmentation query standard sentence; the standard sentence is divided into words, and the problem corresponding to the standard sentence is segmented;
  • Step S620 performing similarity filtering
  • Step S622 it is determined whether there is a unique problem result corresponding to the standard sentence after filtering; if yes, step S624 is performed;
  • Step S624 searching the general question and answer library to query the answer
  • step S626 the number of answers is obtained.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, CD-ROM, including a number of instructions to make a terminal device (can be a mobile phone, a computer, The server, or network device, etc.) performs the methods described in various embodiments of the present invention.
  • module may implement a combination of software and/or hardware of a predetermined function.
  • apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • FIG. 7 is a structural block diagram 1 of an intelligent response apparatus according to an embodiment of the present invention. As shown in FIG. 7, the apparatus includes:
  • the receiving module 72 is configured to receive the problem information input through the user terminal;
  • the first searching module 74 is connected to the receiving module 72, and is configured to search for a question and answer library corresponding to the type of the problem information from the plurality of question and answer libraries;
  • the second searching module 76 is connected to the first searching module 74, and is configured to search for an answer corresponding to the problem information from a question and answer library corresponding to the type of the problem information according to a preset rule.
  • the returning module 78 is connected to the second searching module 76, and is configured to return the answer corresponding to the question information to the user terminal as a return result.
  • the first searching module 74 and the second searching module 76 search for the problem information from the question and answer library corresponding to the type of the problem information.
  • the answer corresponding to the problem information that is, by dividing the question and answer library into multiples, the types of different problem information correspond to different question and answer libraries, that is, different question and answer libraries store different types of questions and answers, compared with the intelligence in related technologies.
  • the response system enhances the semantic support ability and improves the speed of question and answer.
  • different question and answer libraries store different types of questions and answers, it is more convenient to solve the problematic library for targeted update and maintenance.
  • the intelligent question answering system is inflexible in semantic support and inconvenient to maintain.
  • the above problem information may include: “Hello”, “How is the weather” and the like, with certain characteristics such as using dialects to describe how to query the specific fee information, etc., “How to check the phone bill”
  • Ordinary problem information such as "how to send a text message”, a guided question such as "query call charge”
  • the types of the above question and answer library may include: a slang corpus, an equivalent sentence and a standard sentence library, and a general question and answer library;
  • the slang corpus stores a slang word and an answer corresponding to the slang word;
  • the equivalent sentence and the standard sentence library store the specific question and a standard sentence or an equivalent sentence corresponding to the specific question; Stores common questions and answers to the common questions.
  • Each type of question information corresponds to a type of question and answer library.
  • the second searching module 76 is further configured to: according to the question information and the question stored in the question and answer library corresponding to the type of the question information, from the question answering library corresponding to the type of the question information.
  • the similarity degree is filtered by the question and answer library corresponding to the type of the problem information; the filtered answer corresponding to the question is used as the answer corresponding to the question information.
  • FIG. 8 is a structural block diagram of an intelligent response apparatus according to an embodiment of the present invention. As shown in FIG. 8, the second searching module 76 includes:
  • the first obtaining unit 82 is configured to obtain, from the question and answer library corresponding to the type of the problem information, the problem information Target problem
  • the second obtaining unit 84 is connected to the first acquiring unit 82, and is configured to acquire the similarity between the problem information and the target problem;
  • the filtering unit 86 is connected to the second obtaining unit 84, and is configured to filter a target problem in the Q&A library corresponding to the type of the problem information that is less than a preset threshold, to obtain a first filtering result;
  • the searching unit 88 is connected to the filtering unit 86, and is configured to: when the first filtering result includes only one target question, the answer corresponding to the one target question is used as an answer corresponding to the problem information; and at the first When the plurality of the target questions are included in the filtering result, the answer corresponding to the target question with the highest priority among the plurality of the target questions is taken as the answer corresponding to the problem information.
  • the foregoing target problem may be a problem related to the problem information
  • the second searching module 76 finds related problems in the question and answer library corresponding to the type of the problem information, and calculates the problem information and the correlation.
  • the similarity of the problem first filter out the related problems whose similarity is less than a certain threshold. If there is only one related problem after filtering, the answer corresponding to the related question is taken as the answer corresponding to the problem information; If there are multiple related problems after filtering out, the answers corresponding to the questions with the highest priority can be taken as the answers corresponding to the problem information according to the priority of these related questions.
  • the priority may be the ranking score of the search engine of the related question, and the priority of the sorted high is high.
  • the preset threshold may be preset, may be a fixed value, or may be adjusted in real time according to actual conditions, and the preset threshold may be set as empirical data.
  • the second obtaining unit 84 may obtain the number of words included after the word segmentation of the problem information by using the following rule: segmenting the problem information to obtain a plurality of words; each of the words according to the part of the word a word assigning weight; the number of each of the plurality of words and the weighted sum of each of the words as the number of words included after the word segmentation of the question information; the word segmentation of the target question can be obtained by the following rules
  • Each The weighted sum of words is the number of words included after the word segmentation of the target question.
  • the weights of different part-of-speech allocations are different.
  • the weight of a noun can be 2
  • the weight of a verb can be 2
  • the weight of an adjective is 1, wherein a weight of 1 means that when calculating the total number of words included, The word is only calculated once. If the weight is 2, it means that when calculating the total number of words included, the word needs to be calculated twice.
  • mode 2 may be employed, but is not limited thereto.
  • FIG. 9 is a structural block diagram 3 of an intelligent response apparatus according to an embodiment of the present invention.
  • the first search module 74 may include:
  • the first determining unit 92 is configured to determine whether the problem information is the first type of problem information
  • the third obtaining unit 94 is connected to the first determining unit 92, and is configured to acquire a first type of question answering library corresponding to the first type of question information if the problem information is the first type of question information;
  • the second determining unit 96 is connected to the third acquiring unit 94, and is configured to determine whether the problem information is the second type of problem information if the problem information is not the first type of problem information;
  • the fourth obtaining unit 98 is connected to the second determining unit 96, and is configured to acquire a second type of question answering library corresponding to the second type of question information if the question information is the second type of question information;
  • the confirmation unit 910 is connected to the fourth obtaining unit 98, and is configured to re-confirm the problem information according to the preset rule from the second type of question and answer library;
  • the third determining unit 912 is connected to the confirming unit 910, and is configured to determine whether the reconfirmed question information is the third type of problem information;
  • the fifth obtaining unit 914 is connected to the third determining unit 912, and is configured to acquire a third type of question answering library corresponding to the reconfirmed question information if the reconfirmed question information is the third type of question information.
  • the first type of problem information may include: the above-mentioned slang; the first type of question and answer library may include: the slang corpus; the second type of problem information may include: specific problem information;
  • the quiz library may include: an equivalence sentence and a standard sentence library;
  • the third type of problem information may include: general problem information;
  • the third type of question and answer library may include: a general question and answer library.
  • the above specific problem may be some personalized problem.
  • the corresponding answer is found by searching for the equivalent sentence or standard sentence corresponding to the equivalent sentence and the standard sentence database. .
  • FIG. 10 is a block diagram showing the structure of an intelligent response device according to an embodiment of the present invention.
  • the confirmation unit 910 may include:
  • the query subunit 1002 is configured to query all questions corresponding to the problem information from the second type of question and answer library;
  • the filtering subunit 1004 is connected to the query subunit 1002, and is configured to filter all the questions according to the preset rule to obtain a second filtering result.
  • the confirmation subunit 1006 is connected to the filtering subunit 1004, and is configured to use the filtering result as the problem information after the reconfirmation when the second filtering result is unique; and in the case where the second filtering result does not exist Next, the problem information input through the user terminal is used as the problem information after the reconfirmation.
  • the preset rule may be the similarity filtering mode described above, and the problem of low similarity is filtered out by setting the threshold value by calculating the similarity between the problem information and all the questions corresponding to the problem information. The remaining question may be the issue of reconfirmation.
  • FIG 11 is a block diagram showing the structure of an intelligent response device according to an embodiment of the present invention. As shown in Figure 11, the device further includes:
  • the determining module 1102 is configured to determine whether the answer corresponding to the problem information is the fourth type of problem information; wherein the fourth type of problem information includes: a guided question;
  • the display module 1104 is connected to the determining module 1102, and is configured to trigger the display of the prompt information when the answer corresponding to the question information is the fourth type of question information, wherein the prompt information is used to prompt the user terminal to input and Guidance information corresponding to the fourth type of problem information;
  • the returning module 78 is further configured to directly return the answer corresponding to the question information as a return result to the user terminal if the answer corresponding to the question information is not the fourth type of question information.
  • the above-mentioned guided question may be an extension of the ordinary question and answer.
  • the guided question cannot directly obtain the answer, and must obtain some necessary information through interactive guidance to obtain the final result.
  • the foregoing apparatus may further include another determining module, and is connected to the receiving module 72, and is configured to determine whether the problem information includes a sensitive word, and if the sensitive word is included, the answer corresponding to the problem information is not queried. Instead, it returns directly, the prompt contains sensitive words; if the sensitive words are not included, the first search module 74, the second search module 76, and the return module 78 continue to work.
  • sensitive words can be words such as illegal drugs, yellow-related and other illegal laws.
  • FIG. 12 is a schematic structural diagram of a smart question answering system according to a preferred embodiment of the present invention.
  • the smart question answering system includes: a management platform 1202, Search engine module 1204, interactive question and answer service module 1206;
  • the interactive question answering service module 1206 includes: a sensitive word filtering module 1208, configured to determine a user input question. Whether the sensitive word is included; the greeting dialog module 1210 (corresponding to the first determining unit 92 in the above embodiment) is configured to determine whether the question input by the user is a slang; the equivalent sentence and the standard sentence conversion module 1212 (equivalent to the above implementation)
  • the second judging unit 96 and the fourth obtaining unit 98) in the example are configured to convert the question input by the user into an equivalent sentence or a standard sentence; the regular expression matching module 1214 is set to not find a problem corresponding to the question input by the user.
  • the regular input matching is performed on the question input by the user;
  • the participle part-of-speech tagging module 1216 is set to segment the question input by the user, and the part of the word after the word segmentation is marked, and/or, the searched As a result, the word segmentation is performed, and the part of speech of the word after the word segmentation is marked;
  • the similarity calculation module 1218 (corresponding to the filter subunit 1004 in the above embodiment) is set to calculate the similarity between the user input question and the searched problem result, wherein
  • the flow programming module 1220 is set to perform process scheduling processing when the problem input by the user is a guided problem, and prompt the user to input relevant guiding information.
  • each of the above modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple In the processor.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be configured to store program code for performing the following steps:
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the problem information input through the user terminal is received; from the plurality of question and answer libraries, the question and answer library corresponding to the type of the problem information is searched; and the information related to the problem is obtained according to the preset rule.
  • the answer corresponding to the question information is searched in the question answering library corresponding to the type; the answer corresponding to the question information is returned as a return result to the user terminal.
  • the question and answer library is divided into multiple question and answer libraries. According to the type of the question information input, the answers corresponding to the question information are searched from the question and answer library corresponding to the type of the question information in the plurality of question and answer libraries, and the intelligence in the related technology is solved.
  • the question and answer system has inflexible semantic support and inconvenient maintenance, which improves the flexibility of semantic support and facilitates the maintenance and update of the intelligent question answering system.

Abstract

A smart response method and apparatus. The method comprises: receiving question information input through a user terminal (S102); searching a plurality of question and answer libraries for a question and answer library corresponding to the type of the question information (S104); searching the question and answer library corresponding to the type of the question information for an answer corresponding to the question information according to a preset rule (S106); and returning an answer corresponding to the question information to the user terminal by serving as a return result (S108). The method resolves the problems in the related art of non-flexible semantic support of a smart question-answering system and inconvenient maintenance, thus improving the flexibility of semantic support, and conveniently maintaining and updating the smart question-answering system.

Description

智能应答方法及装置Intelligent response method and device 技术领域Technical field
本发明涉及通信领域,具体而言,涉及一种智能应答方法及装置。The present invention relates to the field of communications, and in particular to an intelligent response method and apparatus.
背景技术Background technique
传统的客户服务中心以电话呼叫中心为主,但随着互联网的发展、用户数量的增多以及用户问题多样等因素的影响,传统客户服务中心逐渐不能满足客户的需要。很多大型服务企业在不断拓展更为经济高效的客服中心,减小人工成本,增强用户体验,如智能在线客服、智能手机应用等。智能客服的核心是智能问答,问答系统能够根据用户输入得到简短、精确的答案。The traditional customer service center is mainly based on the telephone call center. However, with the development of the Internet, the increase in the number of users and the diversity of users, the traditional customer service center can not meet the needs of customers. Many large service companies are constantly expanding their more cost-effective customer service centers, reducing labor costs and enhancing user experience, such as smart online customer service and smartphone applications. The core of intelligent customer service is intelligent question and answer. The question and answer system can get short and accurate answers based on user input.
随着问答系统被大量广泛的研究,智能问答系统的相关技术及其产品引起了国内外许多科研机构和公司的极大兴趣,已经有许多产品出现,很好的适应了市场的需求。With the extensive research on the question and answer system, the related technologies and products of the intelligent question answering system have aroused great interest from many scientific research institutions and companies at home and abroad. Many products have emerged, which are well adapted to the needs of the market.
在智能客服系统中,如何对用户输入问题进行处理,从预设的问题答案中正确选择出用户所需的答案是系统的核心。在智能问答中,用户输入的问题都不全是标准问题,和问答库保存的标准问答对差距较大,只用搜索或相似度计算很难从中找出用户想要的答案。并且,在相关技术中的智能问答系统中,所有的问题和答案都只保存在一个问答库中,对语义的支持不灵活,更新维护也不方便。In the intelligent customer service system, how to deal with the user input problem, and correctly select the user's required answer from the preset question answer is the core of the system. In the intelligent question and answer, the questions input by the users are not all standard questions, and the standard question and answer pairs stored in the question and answer library are quite different. It is difficult to find the answers that the user wants by using only the search or similarity calculation. Moreover, in the intelligent question answering system in the related art, all the questions and answers are only stored in a question and answer library, the semantic support is not flexible, and the update and maintenance are not convenient.
针对相关技术中,智能问答系统对语义支持不灵活,维护不方便的问题,目前尚未提出有效的解决方案。In view of the related technology, the intelligent question answering system has inflexible semantic support and inconvenient maintenance, and no effective solution has been proposed yet.
发明内容Summary of the invention
本发明实施例提供了一种智能应答方法及装置,以至少解决相关技术中智能问答系统对语义支持不灵活,维护不方便的问题。The embodiment of the invention provides an intelligent response method and device, so as to at least solve the problem that the intelligent question answering system in the related art is inflexible in semantic support and inconvenient to maintain.
根据本发明实施例的一个方面,提供了一种智能应答方法,包括:接收通过用户终端输入的问题信息;从多个问答库中,查找与该问题信息的类型对应的问答库;按照预设规则从与该问题信息的类型对应的问答库中查找与该问题信息对应的答案;将与该问题信息对应的答案作为返回结果返回给用户终端。According to an aspect of the embodiments of the present invention, an intelligent response method includes: receiving problem information input through a user terminal; searching a plurality of question and answer libraries for a question and answer library corresponding to the type of the problem information; The rule searches for an answer corresponding to the question information from a question answering library corresponding to the type of the question information; and returns an answer corresponding to the question information as a return result to the user terminal.
在本发明实施例中,按照预设规则从与该问题信息的类型对应的问答库中查找与该问题信息对应的答案包括:从该问题信息的类型对应的问答库中,按照该问题信息和在与该问题信息的类型对应的问答库中存储的问题的相似度,对该问题信息的类型对应的问答库中的问题进行过滤;将过滤后的该问题对应的答案作为与该问题信息对应的答案。In the embodiment of the present invention, searching for the answer corresponding to the question information from the question and answer library corresponding to the type of the question information according to the preset rule includes: selecting the question and answer library corresponding to the type of the question information, according to the question information and The similarity of the question stored in the question and answer library corresponding to the type of the problem information, filtering the question in the question answering library corresponding to the type of the problem information; and the corresponding answer corresponding to the filtered question is corresponding to the problem information s answer.
在本发明实施例中,按照该问题信息和在与该问题信息的类型对应的问答库中存储的问 题的相似度,对该问题信息的类型对应的问答库中的问题进行过滤包括:从与该问题信息的类型对应的问答库中获取与该问题信息匹配的目标问题;获取该问题信息和该目标问题的相似度;过滤与该问题信息的类型对应的问答库中该相似度小于预设阈值的目标问题,得到第一过滤结果;在该第一过滤结果中仅包含一个该目标问题时,将该一个该目标问题对应的答案作为与该问题信息对应的答案;在该第一过滤结果中包括多个该目标问题时,取该多个该目标问题中优先级最高的该目标问题对应的答案作为与该问题信息对应的答案。In the embodiment of the present invention, the question information is stored according to the question information and the question and answer library corresponding to the type of the question information. The similarity of the problem, the filtering of the problem in the question answering library corresponding to the type of the problem information includes: obtaining a target problem matching the problem information from the question answering library corresponding to the type of the problem information; obtaining the problem information and the The similarity of the target problem; filtering the target problem in the question and answer library corresponding to the type of the problem information that is less than the preset threshold, and obtaining the first filtering result; when only one target problem is included in the first filtering result, The answer corresponding to the one target question is the answer corresponding to the problem information; when the plurality of the target questions are included in the first filtering result, the target problem corresponding to the highest priority among the plurality of the target questions is taken The answer is the answer to the question information.
在本发明实施例中,通过以下至少之一方式获取该问题信息和该目标问题的相似度值:方式一:S=alpha1+beta1*(length2/length1);其中,S表示该问题信息和该目标问题的相似度值;length2为该问题信息的信息长度和该目标问题的信息长度较大者,length1为该问题信息的信息长度和该目标问题的信息长度较小者;alpha1和beta1都为实数;方式二:S=alpha*(Samewords/words1+Samewords/words2)/2+beta*dp*(num1/words1+num2/words2);其中,words1为对该问题信息进行分词后所包含的词的个数;words2为对该目标问题进行分词后所包含的词的个数;Samewords为对该问题信息进行分词后与对该目标问题进行分词后所包含的相同的词的个数;num1为Samewords中包含的对该问题信息进行分词后的词的个数;num2为Samewords中包含的对该目标问题进行分词后的词的个数;dp为words1/words2与words2/words1中的最小值,alpha和beta都为实数。In the embodiment of the present invention, the problem information and the similarity value of the target problem are obtained by at least one of the following manners: Mode 1: S=alpha1+beta1*(length2/length1); wherein S represents the problem information and the The similarity value of the target problem; length2 is the information length of the problem information and the information length of the target problem is greater, length1 is the information length of the problem information and the information length of the target problem is smaller; both alpha1 and beta1 are Real number; mode 2: S=alpha*(Samewords/words1+Samewords/words2)/2+beta*dp*(num1/words1+num2/words2); where word1 is the word contained after the word segmentation of the question information Number of words; words2 is the number of words included after the word segmentation of the target question; Samewords is the number of words included after the word segmentation of the question information and the word segmentation of the target question; num1 is The number of words in the wordword that are included in the word segmentation; num2 is the number of words in the wordwords that are segmented for the target question; dp is the minimum value in words1/words2 and words2/words1, a Both lpha and beta are real numbers.
在本发明实施例中,该方式一应用于以下至少之一场景:该问题信息与该目标问题相同;该问题信息包含该目标问题;该目标问题包含该问题信息。In the embodiment of the present invention, the method 1 is applied to at least one of the following scenarios: the problem information is the same as the target problem; the problem information includes the target problem; and the target problem includes the problem information.
在本发明实施例中,通过以下规则获取对该问题信息分词后所包含的词的个数:对该问题信息进行分词,得到多个词;按照每个该词的词性对每个该词分配权重;将该多个该词的每个词的个数和该每个词的加权和作为对该问题信息分词后所包含的词的个数;通过以下规则获取对该目标问题分词后所包含的词的个数:对该目标问题进行分词,得到多个词;按照每个该词的词性对每个该词分配权重;将该多个该词的每个词的个数和该每个词的加权和作为对该目标问题分词后所包含的词的个数。In the embodiment of the present invention, the number of words included in the segmentation of the problem information is obtained by the following rules: segmenting the problem information to obtain a plurality of words; assigning each word according to the part of speech of each word Weighting; the number of each of the plurality of words and the weighted sum of each of the words as the number of words included after the word segmentation of the question; the following rules are used to obtain the word segmentation after the target problem is included The number of words: segmentation of the target question, obtaining a plurality of words; assigning a weight to each of the words according to the part of speech of each word; the number of each of the plurality of words and each of the words The weighted sum of words is the number of words included after the word segmentation of the target question.
在本发明实施例中,从多个问答库中,查找与所述问题信息的类型对应的问答库包括:判断该问题信息是否是第一类问题信息;在该问题信息是该第一类问题信息的情况下,获取与该第一类问题信息对应的第一类问答库;在该问题信息不是该第一类问题信息的情况下,判断该问题信息是否是第二类问题信息;在该问题信息是第二类问题信息的情况下,获取与该第二类问题信息对应的第二类问答库;从该第二类问答库中,按照该预设规则重新确认该问题信息;判断该重新确认的问题信息是否是第三类问题信息;在该重新确认的问题信息是第三类问题信息的情况下,获取与该重新确认的问题信息对应的第三类问答库。In the embodiment of the present invention, searching, from a plurality of question and answer libraries, the question and answer library corresponding to the type of the problem information includes: determining whether the problem information is the first type of problem information; and the problem information is the first type of problem In the case of information, obtaining a first type of question and answer library corresponding to the first type of question information; and if the question information is not the first type of question information, determining whether the question information is the second type of question information; When the problem information is the second type of problem information, the second type of question answering library corresponding to the second type of question information is obtained; from the second type of question answering library, the problem information is reconfirmed according to the preset rule; The reconfirmed question information is the third type of question information; in the case where the reconfirmed question information is the third type of question information, the third type of question answering library corresponding to the reconfirmed question information is obtained.
在本发明实施例中,该第一类问题信息包括:寒暄语;该第一类问答库包括:寒暄语语料库;其中,该寒暄语语料库中存储有寒暄语以及与该寒暄语对应的答案;该第二类问题信息包括:特定问题信息;该第二类问答库包括:等价句与标准句库;其中,该等价句与标准句库中存储有该特定问题以及与该特定问题对应的标准句或者等价句;该第三类问题信息包括:普通问题信息;该第三类问答库包括:普通问题以及与该普通问题对应的答案。 In the embodiment of the present invention, the first type of problem information includes: slang; the first type of question and answer library includes: a slang corpus; wherein the slang corpus stores a slang word and an answer corresponding to the slang word; The second type of problem information includes: specific problem information; the second type of question and answer library includes: an equivalence sentence and a standard sentence library; wherein the equivalence sentence and the standard sentence library store the specific problem and correspond to the specific problem a standard sentence or an equivalent sentence; the third type of problem information includes: general problem information; the third type of question and answer library includes: a general question and an answer corresponding to the ordinary question.
在本发明实施例中,从该第二类问答库中,按照该预设规则重新确认该问题信息包括:从该第二类问答库中,查询与该问题信息对应的所有问题;按照该预设规则对该所有问题进行过滤后,得到第二过滤结果;在该第二过滤结果唯一的情况下,将该过滤结果作为该重新确认后的问题信息;在不存在该第二过滤结果的情况下,将通过该用户终端输入的问题信息作为该重新确认后的问题信息。In the embodiment of the present invention, from the second type of question and answer library, reconfirming the problem information according to the preset rule includes: querying, from the second type of question and answer library, all the questions corresponding to the problem information; After the rule is filtered to obtain all the second filtering results, if the second filtering result is unique, the filtering result is used as the re-confirmed problem information; in the case where the second filtering result does not exist Next, the problem information input through the user terminal is used as the problem information after the reconfirmation.
在本发明实施例中,在将与该问题信息对应的答案作为返回结果返回给该用户终端之前,该方法还包括:判断与该问题信息对应的答案是否是第四类问题信息;其中,该第四类问题信息包括:引导式问题;如果是,触发显示提示信息,其中,该提示信息用于提示通过用户终端输入与该第四类问题信息对应的引导信息;如果不是,直接将与该问题信息对应的答案作为返回结果返回给该用户终端。In the embodiment of the present invention, before returning the answer corresponding to the problem information to the user terminal as a return result, the method further includes: determining whether the answer corresponding to the problem information is the fourth type of problem information; wherein The fourth type of problem information includes: a guided question; if yes, triggering display of the prompt information, wherein the prompt information is used to prompt the user terminal to input the guide information corresponding to the fourth type of problem information; if not, directly The answer corresponding to the question information is returned to the user terminal as a return result.
根据本发明实施例的另一个实施例,提供了一种智能应答装置,包括:接收模块,设置为接收通过用户终端输入的问题信息;第一查找模块,设置为从多个问答库中,查找与该问题信息的类型对应的问答库;第二查找模块,设置为按照预设规则从与该问题信息的类型对应的问答库中查找与该问题信息对应的答案;返回模块,设置为将与该问题信息对应的答案作为返回结果返回给该用户终端。According to another embodiment of the present invention, an intelligent response apparatus is provided, including: a receiving module configured to receive problem information input through a user terminal; and a first searching module configured to search from a plurality of question and answer libraries a question answering library corresponding to the type of the problem information; the second searching module is configured to search for an answer corresponding to the question information from the question answering library corresponding to the type of the question information according to the preset rule; and returning the module, set to be The answer corresponding to the question information is returned to the user terminal as a return result.
在本发明实施例中,该第二查找模块还设置为从该问题信息的类型对应的问答库中,按照该问题信息和在与该问题信息的类型对应的问答库中存储的问题的相似度,对该问题信息的类型对应的问答库中的问题进行过滤;将过滤后的该问题对应的答案作为与该问题信息对应的答案。In the embodiment of the present invention, the second searching module is further configured to: according to the problem information, the similarity between the problem information and the question stored in the question and answer library corresponding to the type of the problem information, from the question answering library corresponding to the type of the problem information. Filtering the question in the question and answer library corresponding to the type of the problem information; and using the filtered answer corresponding to the question as the answer corresponding to the question information.
在本发明实施例中,该第二查找模块包括:第一获取单元,设置为从与该问题信息的类型对应的问答库中获取与该问题信息匹配的目标问题;第二获取单元,设置为获取该问题信息和该目标问题的相似度;过滤单元,设置为过滤与该问题信息的类型对应的问答库中该相似度小于预设阈值的目标问题,得到第一过滤结果;查找单元,设置为在该第一过滤结果中仅包含一个该目标问题时,将该一个该目标问题对应的答案作为与该问题信息对应的答案;以及在该第一过滤结果中包括多个该目标问题时,取该多个该目标问题中优先级最高的该目标问题对应的答案作为与该问题信息对应的答案。In the embodiment of the present invention, the second searching module includes: a first acquiring unit, configured to acquire a target problem that matches the problem information from a question and answer library corresponding to the type of the problem information; and the second obtaining unit is configured to Obtaining a similarity between the problem information and the target problem; the filtering unit is configured to filter the target problem in the Q&A library corresponding to the type of the problem information that is less than a preset threshold, to obtain a first filtering result; In order to include only one of the target questions in the first filtering result, the answer corresponding to the one target question is used as an answer corresponding to the problem information; and when the plurality of the target questions are included in the first filtering result, The answer corresponding to the target question with the highest priority among the plurality of the target questions is taken as the answer corresponding to the question information.
在本发明实施例中,该第二获取单元通过以下至少之一方式获取该问题信息和该目标问题的相似度值:方式一:S=alpha1+beta1*(length2/length1);其中,S表示该问题信息和该目标问题的相似度值;length2为该问题信息的信息长度和该目标问题的信息长度较大者,length1为该问题信息的信息长度和该目标问题的信息长度较小者;alpha1和beta1都为实数;方式二:S=alpha*(Samewords/words1+Samewords/words2)/2+beta*dp*(num1/words1+num2/words2);其中,words1为对该问题信息进行分词后所包含的词的个数;words2为对该目标问题进行分词后所包含的词的个数;Samewords为对该问题信息进行分词后与对该目标问题进行分词后所包含的相同的词的个数;num1为Samewords中包含的对该问题信息进行分词后的词的个数;num2为Samewords中包含的对该目标问题进行分词后的词的个数;dp为words1/words2与words2/words1中的最小值,alpha和beta都为实数。 In the embodiment of the present invention, the second obtaining unit acquires the similarity value of the problem information and the target problem by using at least one of the following manners: mode 1: S=alpha1+beta1*(length2/length1); wherein, S represents The similarity value between the problem information and the target problem; length2 is the information length of the problem information and the information length of the target problem is greater, and length1 is the information length of the problem information and the information length of the target problem is smaller; Both alpha1 and beta1 are real numbers; mode two: S=alpha*(Samewords/words1+Samewords/words2)/2+beta*dp*(num1/words1+num2/words2); where word1 is the word segmentation of the problem information The number of words included after the word; word2 is the number of words included after the word segmentation of the target question; Samewords is the same word included after the word segmentation of the question information is segmented after the word segmentation of the target question Number: num1 is the number of words in the wordwords that are segmented for the problem information; num2 is the number of words in the wordwords that are segmented for the target question; dp is words1/words2 and words2/word The minimum value in s1, alpha and beta are both real numbers.
在本发明实施例中,该第一查找模块包括:第一判断单元,设置为判断该问题信息是否是第一类问题信息;第三获取单元,设置为在该问题信息是该第一类问题信息的情况下,获取与该第一类问题信息对应的第一类问答库;第二判断单元,设置为在该问题信息不是该第一类问题信息的情况下,判断该问题信息是否是第二类问题信息;第四获取单元,设置为在该问题信息是第二类问题信息的情况下,获取与该第二类问题信息对应的第二类问答库;确认单元,设置为从该第二类问答库中,按照该预设规则重新确认该问题信息;第三判断单元,设置为判断该重新确认的问题信息是否是第三类问题信息;第五获取单元,设置为在该重新确认的问题信息是第三类问题信息的情况下,获取与该重新确认的问题信息对应的第三类问答库。In the embodiment of the present invention, the first searching module includes: a first determining unit, configured to determine whether the problem information is the first type of problem information; and a third obtaining unit, configured to: the problem information is the first type of problem In the case of information, a first type of question and answer library corresponding to the first type of question information is obtained; and the second determining unit is configured to determine whether the question information is the first if the question information is not the first type of question information. a second type of problem information, wherein the fourth obtaining unit is configured to obtain a second type of question and answer library corresponding to the second type of question information if the problem information is the second type of question information; and the confirming unit is set to be from the first In the second type of question answering library, the problem information is reconfirmed according to the preset rule; the third determining unit is configured to determine whether the reconfirmed question information is the third type of problem information; and the fifth obtaining unit is set to reconfirm the In the case where the problem information is the third type of problem information, a third type of question answering library corresponding to the reconfirmed problem information is obtained.
在本发明实施例中,该确认单元包括:查询子单元,设置为从该第二类问答库中,查询与该问题信息对应的所有问题;过滤子单元,设置为按照该预设规则对该所有问题进行过滤后,得到第二过滤结果;确认子单元,设置为在该第二过滤结果唯一的情况下,将该过滤结果作为该重新确认后的问题信息;以及在不存在该第二过滤结果的情况下,将通过该用户终端输入的问题信息作为该重新确认后的问题信息。In the embodiment of the present invention, the confirmation unit includes: a query subunit, configured to query all the questions corresponding to the problem information from the second type of question and answer library; and the filtering subunit is set to follow the preset rule After filtering all the questions, the second filtering result is obtained; the confirmation subunit is set to use the filtering result as the problem information after the reconfirmation if the second filtering result is unique; and in the absence of the second filtering In the case of the result, the problem information input by the user terminal is used as the problem information after the reconfirmation.
在本发明实施例中,该装置还包括:判断模块,设置为判断与该问题信息对应的答案是否是第四类问题信息;其中,该第四类问题信息包括:引导式问题;显示模块,设置为在与该问题信息对应的答案是第四类问题信息的情况下,触发显示提示信息,其中,该提示信息用于提示通过用户终端输入与该第四类问题信息对应的引导信息;该返回模块,还设置为在与该问题信息对应的答案不是第四类问题信息的情况下,直接将与该问题信息对应的答案作为返回结果返回给该用户终端。In the embodiment of the present invention, the device further includes: a determining module, configured to determine whether the answer corresponding to the problem information is the fourth type of problem information; wherein the fourth type of problem information includes: a guided question; a display module, When the answer corresponding to the question information is the fourth type of question information, triggering the display of the prompt information, wherein the prompt information is used to prompt the user terminal to input the guide information corresponding to the fourth type of problem information; The returning module is further configured to directly return the answer corresponding to the question information as a return result to the user terminal if the answer corresponding to the question information is not the fourth type of question information.
本发明的实施例还提供了一种存储介质,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:接收通过用户终端输入的问题信息;从多个问答库中,查找与该问题信息的类型对应的问答库;按照预设规则从与该问题信息的类型对应的问答库中查找与该问题信息对应的答案;将与该问题信息对应的答案作为返回结果返回给用户终端。Embodiments of the present invention also provide a storage medium, which may be configured to store program code for performing the following steps: receiving problem information input through a user terminal; searching for the problem from a plurality of question and answer libraries A question answering library corresponding to the type of information; searching for an answer corresponding to the question information from a question and answer library corresponding to the type of the question information according to a preset rule; and returning the answer corresponding to the question information as a return result to the user terminal.
通过本发明实施例,采用接收通过用户终端输入的问题信息;从多个问答库中,查找与该问题信息的类型对应的问答库;按照预设规则从与该问题信息的类型对应的问答库中查找与该问题信息对应的答案;将与该问题信息对应的答案作为返回结果返回给用户终端。即将问答库分为多个问答库,根据输入的问题信息的类型,从多个问答库中的与该问题信息的类型对应的问答库中查找该问题信息对应的答案,解决了相关技术中智能问答系统对语义支持不灵活,维护不方便的问题,进而提高了语义支持的灵活度,方便维护和更新智能问答系统。Through the embodiment of the present invention, the problem information input through the user terminal is received; from the plurality of question and answer libraries, the question and answer library corresponding to the type of the problem information is searched; and the question and answer library corresponding to the type of the problem information is selected according to the preset rule. Find an answer corresponding to the question information; return the answer corresponding to the question information as a return result to the user terminal. The question and answer library is divided into multiple question and answer libraries. According to the type of the question information input, the answers corresponding to the question information are searched from the question and answer library corresponding to the type of the question information in the plurality of question and answer libraries, and the intelligence in the related technology is solved. The question and answer system has inflexible semantic support and inconvenient maintenance, which improves the flexibility of semantic support and facilitates the maintenance and update of the intelligent question answering system.
附图说明DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawing:
图1是根据本发明实施例的智能应答方法的流程图一; 1 is a flowchart 1 of an intelligent response method according to an embodiment of the present invention;
图2是根据本发明实施例的智能应答方法的流程图二;2 is a second flowchart of an intelligent response method according to an embodiment of the present invention;
图3是根据本发明实施例的智能应答方法的流程图三;3 is a third flowchart of an intelligent response method according to an embodiment of the present invention;
图4是根据本发明实施例的智能应答方法的流程图四;4 is a flowchart 4 of an intelligent response method according to an embodiment of the present invention;
图5是根据本发明优选实施例的智能问答方法的流程图;5 is a flow chart of a smart question answering method in accordance with a preferred embodiment of the present invention;
图6是根据本发明优选实施例的查询问答处理流程示意图;6 is a schematic flow chart of a query question and answer process according to a preferred embodiment of the present invention;
图7是根据本发明实施例的智能应答装置的结构框图一;7 is a structural block diagram 1 of an intelligent response device according to an embodiment of the present invention;
图8根据本发明实施例的智能应答装置的结构框图二;FIG. 8 is a structural block diagram 2 of an intelligent response apparatus according to an embodiment of the present invention; FIG.
图9根据本发明实施例的智能应答装置的结构框图三;FIG. 9 is a structural block diagram 3 of an intelligent response apparatus according to an embodiment of the present invention; FIG.
图10根据本发明实施例的智能应答装置的结构框图四;FIG. 10 is a structural block diagram 4 of an intelligent response apparatus according to an embodiment of the present invention; FIG.
图11根据本发明实施例的智能应答装置的结构框图五;FIG. 11 is a structural block diagram 5 of an intelligent response apparatus according to an embodiment of the present invention; FIG.
图12是根据本发明优选实施例的智能问答系统的架构示意图。12 is a block diagram showing the architecture of a smart question answering system in accordance with a preferred embodiment of the present invention.
具体实施方式detailed description
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。The invention will be described in detail below with reference to the drawings in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It is to be understood that the terms "first", "second" and the like in the specification and claims of the present invention are used to distinguish similar objects, and are not necessarily used to describe a particular order or order.
在本实施例中提供了一种智能应答方法,图1是根据本发明实施例的智能应答方法的流程图一,如图1所示,该流程包括如下步骤:An intelligent response method is provided in this embodiment. FIG. 1 is a flowchart 1 of an intelligent response method according to an embodiment of the present invention. As shown in FIG. 1 , the process includes the following steps:
步骤S102,接收通过用户终端输入的问题信息;Step S102, receiving problem information input through the user terminal;
步骤S104,从多个问答库中,查找与该问题信息的类型对应的问答库;Step S104, searching for a question and answer library corresponding to the type of the problem information from the plurality of question and answer libraries;
步骤S106,按照预设规则从与该问题信息的类型对应的问答库中查找与该问题信息对应的答案;Step S106, searching for an answer corresponding to the problem information from a question and answer library corresponding to the type of the problem information according to a preset rule;
步骤S108,将与该问题信息对应的答案作为返回结果返回给用户终端。In step S108, the answer corresponding to the question information is returned to the user terminal as a return result.
由于相关技术中的智能应答系统,所有的问题和答案只保存在一个问答库中,从而对更新和维护该问答库并不方便,通过上述步骤,通过将问答库分为多个,不同的问题信息的类型对应不同的问答库,即不同的问答库中存储有不同类型的问题和答案,当接收输入的问题信息时,通过问题信息的类型,从与该问题信息的类型对应的问答库中来查找与该问题信息对应的答案,增强了语义支持能力,提高了问答的速度,同时,由于不同的问答库中存储有不同类型的问题和答案,因而可以更方便地问答库进行针对性的更新和维护,进而解决了相 关技术中,智能问答系统对语义支持不灵活,维护不方便的问题。Due to the intelligent answering system in the related art, all the questions and answers are only stored in a question and answer library, which is not convenient for updating and maintaining the question and answer library. Through the above steps, the question and answer library is divided into multiple, different questions. The type of information corresponds to different question and answer libraries, that is, different question and answer libraries store different types of questions and answers. When receiving the input question information, the type of the question information is from the question and answer library corresponding to the type of the question information. To find the answer corresponding to the problem information, enhance the semantic support ability, improve the speed of question and answer, and at the same time, because different question and answer libraries store different types of questions and answers, it is more convenient to answer the library for targeted Update and maintenance to solve the phase In the technology, the intelligent question answering system is inflexible in semantic support and inconvenient to maintain.
需要说明的是,上述问题信息可以包括:“你好”、“天气怎么样”之类的寒暄语,具有一定特点比如采用方言描述怎样查询话费等之类的特定问题信息,“怎样查询话费”、“怎样发送短信”之类的普通问题信息,“查询话费”之类的引导式问题;上述问答库的类型可以包括:寒暄语语料库、等价句与标准句库、普通问答库;其中,该寒暄语语料库中存储有寒暄语以及与该寒暄语对应的答案;该等价句与标准句库中存储有该特定问题以及与该特定问题对应的标准句或者等价句;普通问答库中存储有普通问题以及与该普通问题对应的答案。每种类型的问题信息对应一个类型的问答库。It should be noted that the above problem information may include: "Hello", "How is the weather" and the like, with certain characteristics such as using dialects to describe how to query the specific fee information, etc., "How to check the phone bill" Ordinary problem information such as "how to send a text message", a guided question such as "query call charge"; the types of the above question and answer library may include: a slang corpus, an equivalent sentence and a standard sentence library, and a general question and answer library; The slang corpus stores a slang word and an answer corresponding to the slang word; the equivalent sentence and the standard sentence library store the specific question and a standard sentence or an equivalent sentence corresponding to the specific question; Stores common questions and answers to the common questions. Each type of question information corresponds to a type of question and answer library.
在本发明的一个实施例中,上述步骤S104可以包括:从该问题信息的类型对应的问答库中,按照该问题信息和在与该问题信息的类型对应的问答库中存储的问题的相似度,对该问题信息的类型对应的问答库中的问题进行过滤;将过滤后的该问题对应的答案作为与该问题信息对应的答案。具体地,可以通过以下方式实现:从与该问题信息的类型对应的问答库中获取与该问题信息匹配的目标问题;获取该问题信息和该目标问题的相似度;过滤与该问题信息的类型对应的问答库中该相似度小于预设阈值的目标问题,得到第一过滤结果;在该第一过滤结果中仅包含一个该目标问题时,将该一个该目标问题对应的答案作为与该问题信息对应的答案;在该第一过滤结果中包括多个该目标问题时,取该多个该目标问题中优先级最高的该目标问题对应的答案作为与该问题信息对应的答案。In an embodiment of the present invention, the step S104 may include: selecting, from the question and answer library corresponding to the type of the problem information, the similarity of the problem information and the question stored in the question and answer library corresponding to the type of the question information. Filtering the question in the question and answer library corresponding to the type of the problem information; and using the filtered answer corresponding to the question as the answer corresponding to the question information. Specifically, the method may be: obtaining a target problem that matches the problem information from a question and answer library corresponding to the type of the problem information; obtaining a similarity between the problem information and the target problem; filtering the type of the problem information In the corresponding question and answer library, the target problem with the similarity less than the preset threshold is obtained, and the first filtering result is obtained; when only one target problem is included in the first filtering result, the answer corresponding to the target problem is taken as the problem The answer corresponding to the information; when the plurality of the target questions are included in the first filtering result, the answer corresponding to the target question with the highest priority among the plurality of the target questions is taken as the answer corresponding to the problem information.
需要说明的是,上述目标问题可以为与该问题信息相关的问题,在与该问题信息的类型对应的问答库中找到这些相关的问题,在通过计算问题信息和这些相关的问题的相似度,先将相似度小于一定阈值的这些相关的问题滤掉,如果滤掉后,只剩一个相关的问题,那么将该相关的问题对应的答案作为该问题信息对应的答案;如果滤掉后还有多个相关的问题时,可以按照这些相关的问题的优先级,取优先级最高的问题对应的答案作为该问题信息对应的答案。需要说明的是,该优先级可以是该相关的问题的搜索引擎的排序得分,排序的分高的优先级高。即通过搜索和相似度结合过滤的方式,找到与该问题信息对应的答案,解决了相关技术中搜索引擎命中到的结果过多,不能直接返回给用户答案的问题,同时克服了普通的相似度计算对语义支持较弱的问题。It should be noted that the above-mentioned target problem may be a problem related to the problem information, and the related questions are found in the question and answer library corresponding to the type of the problem information, and the similarity between the problem information and the related problems is calculated. First, the related problems whose similarity is less than a certain threshold are filtered out. If there is only one related problem after filtering, the answer corresponding to the related question is taken as the answer corresponding to the problem information; if it is filtered out, When multiple related questions are concerned, the answer corresponding to the question with the highest priority may be taken as the answer corresponding to the question information according to the priority of the related questions. It should be noted that the priority may be the ranking score of the search engine of the related question, and the priority of the ranked high is high. That is to find the answer corresponding to the problem information through the combination of search and similarity filtering, and solve the problem that the search engine hits too many results in the related art, can not directly return to the user's answer, and overcomes the common similarity. Calculate the problem of weak semantic support.
上述预设阈值可以是预先设定的,可以是一个固定值,也可以是根据实际情况进行实时调整,该预设阈值的设定可以是经验数据。The preset threshold may be preset, may be a fixed value, or may be adjusted in real time according to actual conditions, and the preset threshold may be set as empirical data.
在本发明的一个实施例中,通过以下至少之一方式获取该问题信息和该目标问题的相似度值:方式一:S=alpha1+beta1*(length2/length1);其中,S表示该问题信息和该目标问题的相似度值;length2为该问题信息的信息长度和该目标问题的信息长度较大者,length1为该问题信息的信息长度和该目标问题的信息长度较小者;alpha1和beta1都为实数;方式二:S=alpha*(Samewords/words1+Samewords/words2)/2+beta*dp*(num1/words1+num2/words2);其中,words1为对该问题信息进行分词后所包含的词的个数;words2为对该目标问题进行分词后所包含的词的个数;Samewords为对该问题信息进行分词后与对该目标问题进行分词后所包含的相同的词的个数;num1为Samewords中包含的对该问题信息进行分词后的词的个数; num2为Samewords中包含的对该目标问题进行分词后的词的个数;dp为words1/words2与words2/words1中的最小值,alpha和beta都为实数;words1/words2为words1与words2的比值,words2/words1为words2与words1的比值。In an embodiment of the present invention, the problem information and the similarity value of the target problem are obtained by at least one of the following manners: Mode 1: S=alpha1+beta1*(length2/length1); wherein S represents the problem information The similarity value with the target problem; length2 is the information length of the problem information and the information length of the target problem is greater, length1 is the information length of the problem information and the information length of the target problem is smaller; alpha1 and beta1 Both are real numbers; mode two: S=alpha*(Samewords/words1+Samewords/words2)/2+beta*dp*(num1/words1+num2/words2); where word1 is included after the word segmentation of the problem information The number of words; words2 is the number of words included after the word segmentation of the target question; Samewords is the number of words included in the word segmentation after the word segmentation is performed after segmentation of the target question; Num1 is the number of words in the Samewords that are segmented after the problem information is included; Num2 is the number of words in Samewords that are segmented for the target problem; dp is the minimum value of words1/words2 and words2/words1, alpha and beta are both real numbers; words1/words2 is the ratio of words1 to words2, Words2/words1 is the ratio of words2 to words1.
在本发明的一个实施例中,可以通过以下规则获取对该问题信息分词后所包含的词的个数:对该问题信息进行分词,得到多个词;按照每个该词的词性对每个该词分配权重;将该多个该词的每个词的个数和该每个词的加权和作为对该问题信息分词后所包含的词的个数;可以通过以下规则获取对该目标问题分词后所包含的词的个数:对该目标问题进行分词,得到多个词;按照每个该词的词性对每个该词分配权重;将该多个该词的每个词的个数和该每个词的加权和作为对该目标问题分词后所包含的词的个数。In an embodiment of the present invention, the number of words included in the word segmentation of the problem information may be obtained by dividing the problem information into a plurality of words; each word of the word is used for each word. The word assigns a weight; the number of each of the plurality of words and the weighted sum of the words are the number of words included after the word segmentation of the question information; the target problem can be obtained by the following rules The number of words included after the word segmentation: segmentation of the target question, obtaining a plurality of words; assigning a weight to each word according to the part of speech of each word; the number of each word of the plurality of words And the weighted sum of each word as the number of words included after the word segmentation of the target question.
需要说明的是,不同的词性分配的权重不同,比如名词的权重可以为2,动词的权重可以为2,形容词的权重为1,其中,权重为1代表在计算包含的词的总数时,该词只计算一次,若权重为2,则表示在计算包含的词的总数时,该词需要计算两次,比如:问题信息为查询1月份的话费;进行分词得到3个词:查询(动词)、1月份的(形容词)、话费(名词);根据动词和名词词性的权重为2,形容词的权重为1,那么在计算分词后的该问题信息包含的词的个数时,查询算2个词,1月份的算1个词,话费算2个词;即分词后的该问题信息包含的词的个数为2+1+2=5个。It should be noted that the weights of different part-of-speech allocations are different. For example, the weight of a noun can be 2, the weight of a verb can be 2, and the weight of an adjective is 1, wherein a weight of 1 means that when calculating the total number of words included, The word is only calculated once. If the weight is 2, it means that when calculating the total number of words included, the word needs to be calculated twice. For example, the question information is the query for the month of January; the word segmentation is used to get 3 words: the query (verb) In January (adjective), telephone charge (noun); according to the verb and noun part of the weight of 2, the adjective weight is 1, then the number of words in the question information after the word segmentation is calculated, the query counts 2 The word counts 1 word in January, and the phone bill counts 2 words; that is, the number of words included in the question information after the word segmentation is 2+1+2=5.
需要说明的是,上述方式一可以应用于以下至少之一场景:该问题信息与该目标问题相同;该问题信息包含该目标问题;该目标问题包含该问题信息。在除了上述场景之外,可以采用方式二,但并不限于此。It should be noted that the foregoing manner 1 may be applied to at least one of the following scenarios: the problem information is the same as the target problem; the problem information includes the target problem; and the target problem includes the problem information. In addition to the above scenarios, mode 2 may be employed, but is not limited thereto.
在本发明的一个实施例中,图2是根据本发明实施例的智能应答方法的流程图二,如图2所示,上述步骤S104可以包括:In an embodiment of the present invention, FIG. 2 is a flowchart 2 of an intelligent response method according to an embodiment of the present invention. As shown in FIG. 2, the foregoing step S104 may include:
步骤S104-1,判断该问题信息是否是第一类问题信息;Step S104-1, determining whether the problem information is the first type of problem information;
步骤S104-2,在该问题信息是该第一类问题信息的情况下,获取与该第一类问题信息对应的第一类问答库;Step S104-2, if the problem information is the first type of problem information, acquiring a first type of question answering library corresponding to the first type of problem information;
步骤S104-3,在该问题信息不是该第一类问题信息的情况下,判断该问题信息是否是第二类问题信息;Step S104-3, if the problem information is not the first type of problem information, determining whether the problem information is the second type of problem information;
步骤S104-4,在该问题信息是第二类问题信息的情况下,获取与该第二类问题信息对应的第二类问答库;Step S104-4, if the problem information is the second type of problem information, acquiring a second type of question answering library corresponding to the second type of problem information;
步骤S104-5,从该第二类问答库中,按照该预设规则重新确认该问题信息;Step S104-5, from the second type of question and answer library, re-confirm the problem information according to the preset rule;
步骤S104-6,判断该重新确认的问题信息是否是第三类问题信息;Step S104-6, determining whether the reconfirmed problem information is the third type of problem information;
步骤S104-7,在该重新确认的问题信息是第三类问题信息的情况下,获取与该重新确认的问题信息对应的第三类问答库。Step S104-7, in the case where the reconfirmed problem information is the third type of question information, acquire a third type of question answering library corresponding to the reconfirmed question information.
在本发明实施例中,上述第一类问题信息可以包括:上述寒暄语;上述可以第一类问答 库包括:上述寒暄语语料库;上述第二类问题信息可以包括:特定问题信息;上述第二类问答库可以包括:等价句与标准句库;上述第三类问题信息可以包括:普通问题信息;上述第三类问答库可以包括:普通问答库。In the embodiment of the present invention, the first type of problem information may include: the above-mentioned slang language; the above-mentioned first type question and answer The library includes: the above-mentioned slang corpus; the second type of problem information may include: specific problem information; the second type of question and answer library may include: an equivalent sentence and a standard sentence library; the third type of problem information may include: general problem information The third type of question and answer library mentioned above may include: a general question and answer library.
需要说明的是,上述特定问题可以是一些个性化的问题,对于这些个性化的问题,通过从等价句与标准句库中寻找与其对应的等价句或者标准句的方式来找到对应的答案。It should be noted that the above specific problem may be some personalized problem. For these personalized problems, the corresponding answer is found by searching for the equivalent sentence or standard sentence corresponding to the equivalent sentence and the standard sentence database. .
在本发明的一个实施例中,图3是根据本发明实施例的智能应答方法的流程图三,如图3所示,上述步骤S212可以包括:In an embodiment of the present invention, FIG. 3 is a flowchart of a smart response method according to an embodiment of the present invention. As shown in FIG. 3, the foregoing step S212 may include:
步骤S212-1,从该第二类问答库中,查询与该问题信息对应的所有问题;Step S212-1, querying, from the second type of question and answer library, all the questions corresponding to the problem information;
步骤S212-2,按照该预设规则对该所有问题进行过滤后,得到第二过滤结果;Step S212-2, after filtering all the questions according to the preset rule, obtaining a second filtering result;
步骤S212-3,在该第二过滤结果唯一的情况下,将该过滤结果作为该重新确认后的问题信息;在不存在该第二过滤结果的情况下,将通过该用户终端输入的问题信息作为该重新确认后的问题信息。Step S212-3, in the case that the second filtering result is unique, the filtering result is used as the re-confirmed problem information; and in the case where the second filtering result does not exist, the problem information input through the user terminal is to be As the problem information after the reconfirmation.
需要说明的是,该预设规则可以是上述的相似度过滤方式,通过计算该问题信息和与该问题信息对应的所有问题的相似度,通过阈值的设定将相似度低的问题滤掉,剩下的问题可能就是重新确认的问题。It should be noted that the preset rule may be the similarity filtering mode described above, and the problem of low similarity is filtered out by setting the threshold value by calculating the similarity between the problem information and all the questions corresponding to the problem information. The remaining question may be the issue of reconfirmation.
在本发明的一个实施例中,图4是根据本发明实施例的智能应答方法的流程图四,如图4所示,在步骤S108之前,该方法还可以包括:In an embodiment of the present invention, FIG. 4 is a flowchart of a smart response method according to an embodiment of the present invention. As shown in FIG. 4, before the step S108, the method may further include:
步骤S402,判断与该问题信息对应的答案是否是第四类问题信息;其中,该第四类问题信息包括:引导式问题;Step S402, determining whether the answer corresponding to the problem information is the fourth type of problem information; wherein the fourth type of problem information includes: a guided question;
步骤S404,如果是,触发显示提示信息,其中,该提示信息用于提示通过用户终端输入与该第四类问题信息对应的引导信息;Step S404, if yes, triggering display of the prompt information, wherein the prompt information is used to prompt the user terminal to input the guide information corresponding to the fourth type of problem information;
步骤S406,如果不是,直接将与该问题信息对应的答案作为返回结果返回给该用户终端。Step S406, if not, directly returning the answer corresponding to the question information to the user terminal as a return result.
需要说明的是,上述引导式问题可以是普通问答的扩展,该引导式问题不能直接获取答案,必须经过交互引导获取一些必要信息后才能得到最后的结果。It should be noted that the above-mentioned guided question may be an extension of the ordinary question and answer. The guided question cannot directly obtain the answer, and must obtain some necessary information through interactive guidance to obtain the final result.
比如:输入“查询话费”,这个问题,需要引导用户输入手机号码、月份等信息才能获取最终的答案,引导问题即为“查询话费”,引导信息为手机号码、月份等信息。For example, if you enter "query call charge", you need to guide the user to enter the mobile phone number, month and other information to get the final answer. The guide problem is "query call charge", and the guide information is mobile phone number, month and other information.
需要说明的是,在步骤S104之前,上述方法还包括:判断该问题信息中是否包含敏感词,如果包含敏感词,则不再执行步骤S104至步骤S108,而是直接返回,提示包含敏感词;如果不包含敏感词,则执行步骤S104。需要说明的是,敏感词可以是涉毒、涉黄等违法之类的词。It should be noted that, before the step S104, the method further includes: determining whether the problem information includes a sensitive word, and if the sensitive word is included, performing step S104 to step S108 instead of directly returning, indicating that the sensitive word is included; If the sensitive word is not included, step S104 is performed. It should be noted that sensitive words can be words such as illegal drugs, yellow-related and other illegal laws.
为了更好地理解本发明实施例,以下结合优选的实施例对本发明做进一步解释。In order to better understand the embodiments of the present invention, the present invention is further explained in conjunction with the preferred embodiments.
本发明提供了一种优选的智能问答方法,在本优选实施例中,需要对用户输入问题的分 类,在智能问答系统中,用户的输入可以分为以下几类:The present invention provides a preferred intelligent question answering method. In the preferred embodiment, the user input problem is required. Class, in the intelligent question answering system, the user's input can be divided into the following categories:
普通寒暄对话(相当于上述实施例中的寒暄语):如“你好”、“天气怎么样”等,这类问题属性寒暄式问题。Ordinary greetings (equivalent to the slang in the above examples): such as "Hello", "How is the weather", etc.
普通问答(相当于上述实施例中的普通问题信息):普通问答是用户输入一个问题,想直接获得问题答案。与普通搜索引擎的区别在于:搜索引擎对一个问题会返回多个答案,需要用户从多个答案中选择出想要的结果;而智能问答系统则直接把最相似的答案返回给用户。Ordinary question and answer (equivalent to the general problem information in the above embodiment): The ordinary question and answer is that the user enters a question and wants to directly obtain the answer to the question. The difference with a normal search engine is that the search engine returns multiple answers to a question, requiring the user to select the desired result from multiple answers; and the intelligent question answering system directly returns the most similar answer to the user.
引导式问答(相当于上述实施例中的引导式问题):引导式问答属于普通问答的扩展,一个问题不能直接获得答案,必须经过交互引导获得一些必要信息后才能得到最后的结果。如用户输入“查询话费”,这个问题,必须引导用户输入手机号码、月份等信息才能获得最终的答案。Guided question and answer (equivalent to the guided question in the above embodiment): Guided question and answer is an extension of the general question and answer. A question cannot be directly obtained. It must be interactively guided to obtain some necessary information before the final result can be obtained. If the user enters "query call charge", this question must guide the user to enter the mobile phone number, month and other information to get the final answer.
针对问题的类型的不同,智能问答系统有不同的处理逻辑。The intelligent question answering system has different processing logic depending on the type of problem.
另外,在本优选实施例中,智能问答系统中问答库分为以下几种类型,通过以下的问答库来保存相应的数据:In addition, in the preferred embodiment, the question answering library in the intelligent question answering system is divided into the following types, and the corresponding data is saved through the following question and answer library:
寒暄数据库(相当于上述实施例中的寒暄语语料库):寒暄对话的语料比如寒暄语以及该寒暄语对应的答案,这些数据保存到系统索引库(相当于上述实施例中的寒暄语语料库)。The chilling database (corresponding to the slang corpus in the above embodiment): the corpus of the chilling dialogue such as the slang and the answer corresponding to the slang, the data is saved to the system index library (corresponding to the slang corpus in the above embodiment).
普通问答库(相当于上述实施例中的普通问答库):保存普通问题及与该普通问题对应的答案,引导式问题的语料。The general question and answer library (equivalent to the general question and answer library in the above embodiment): the general problem and the answer corresponding to the common question, and the corpus of the guided question.
等价句与标准句库(相当于上述实施例中的等价句与标准句库):保存个性化问题及个性化问题对应的标准句,在智能问答系统中,普通问答库中存放的是标准问题及与该标准问题对应的答案,这种语料比较少,而在正式的智能问答系统中,用户的输入问题却是各种形式,等价句与标准句库中也存放用户输入问题与标准问题的对应关系。Equivalent sentence and standard sentence library (equivalent to the equivalent sentence and standard sentence library in the above embodiment): Save the standard sentence corresponding to the personalized question and the personalized question. In the intelligent question answering system, the general question and answer library stores The standard question and the answer corresponding to the standard question, this corpus is relatively small, and in the formal intelligent question answering system, the user input problem is in various forms, and the equivalent sentence and the standard sentence library also store the user input problem and Correspondence of standard questions.
在上述的基础上,上述优选的智能问答方法可以包括以下步骤:Based on the above, the above preferred intelligent question and answer method may include the following steps:
步骤1,用户输入问题; Step 1, the user enters a question;
步骤2,敏感词判定,具体包括步骤:步骤21、判断输入是否包含敏感词,如果包含敏感词,执行步骤22,不包含执行步骤31;步骤22、包含敏感词,直接返回,不继续执行,提示包含敏感词;Step 2: The sensitive word determination includes the following steps: Step 21: Determine whether the input contains a sensitive word, if the sensitive word is included, perform step 22, and do not include performing step 31; Step 22, including the sensitive word, directly returning, and not continuing, The prompt contains sensitive words;
步骤3,寒暄语判断:步骤31、判断用户输入是否是寒暄语,从寒暄语语料中搜索,如果搜索出的结果经过阈值过滤后有值,则认为输入问题是寒暄对话;步骤32、如果输入是寒暄对话,从结果中选择一条返回给用户,不继续执行;如果不是寒暄对话,执行步骤41;Step 3: Hanyu judgment: Step 31: Determine whether the user input is a slang word, search from the slang corpus, and if the searched result has a value after threshold filtering, the input question is considered to be a chilling conversation; step 32, if input Is a cold dialogue, choose one of the results to return to the user, do not continue to execute; if it is not a cold dialogue, go to step 41;
步骤4,等价句搜索及标准问题替换:步骤41、把用户输入问题作为查询条件,在等价句与标准句库中进行查询,查询出所有相关结果;步骤42、把查询结果进行相似度计算,计算结果过滤后如果存在唯一一条结果,则把该结果的标准问题替换用户的输入问题,如果不 存在,保留原始问题;Step 4: Equivalence sentence search and standard question replacement: Step 41: Using the user input question as a query condition, querying in the equivalence sentence and the standard sentence library, and querying all relevant results; Step 42, performing similarity on the query result Calculate, if there is a unique result after filtering the calculation result, replace the standard question of the result with the user's input question, if not Exist, retain the original problem;
步骤5,搜索问答库:步骤51、经过步骤4处理后,用处理后的问题搜索普通问答库,查询出所有相关结果;步骤52、把查询结果进行相似度计算,计算结果过滤后如果存在唯一一条结果,则把该结果作为问答记录,取记录的答案字段,作为预返回结果。Step 5: Search the question and answer library: Step 51, after processing in step 4, search the general question and answer library with the processed question, and query all relevant results; Step 52, perform the similarity calculation on the query result, and if there is a unique result after filtering the calculation result For a result, the result is taken as a question and answer record, and the answer field of the record is taken as a pre-return result.
步骤6,流程编排处理,判断结果是否是引导式问题:步骤61、经步骤5处理后,把预返回结果进行引导式问题判断;步骤62、如果是引导式问题,有后续处理,则进行流程编排处理,提示用户输入;步骤63、如果不是引导式问题,直接把预返回结果作为答案返回给用户。In step 6, the process is arranged to determine whether the result is a guided problem: in step 61, after the step 5 is processed, the pre-return result is subjected to the guided question determination; and in step 62, if the guided question has subsequent processing, the process is performed. The arrangement process prompts the user to input; step 63, if it is not a guided question, directly returns the pre-return result as an answer to the user.
需要说明的是,步骤1相当于上述实施例中的步骤S102,上述步骤2至4相当于上述实施例中的步骤S202至步骤S214;上述步骤5相当于步骤S108,上述步骤6相当于上述步骤S402至步骤S406。It should be noted that step 1 corresponds to step S102 in the above embodiment, and steps 2 to 4 correspond to steps S202 to S214 in the above embodiment; step 5 corresponds to step S108, and step 6 corresponds to the above steps. S402 to step S406.
在本发明的优选实施例中,上述相似度计算方法可以为:参数1:用户输入(相当于上述实施例中的问题信息)参数2:搜索结果(相当于上述实施例中的目标问题),上述相似度计算方法包括步骤S1至步骤S6:In a preferred embodiment of the present invention, the similarity calculation method may be: parameter 1: user input (corresponding to problem information in the above embodiment) parameter 2: search result (corresponding to the target problem in the above embodiment), The above similarity calculation method includes steps S1 to S6:
步骤S1、如果用户输入与搜索结果完全相同,相似度为1.0;如果参数1包含参数2,或者参数2包含参数1执行步骤S2;否则执行步骤S3。Step S1: If the user input is exactly the same as the search result, the similarity is 1.0; if the parameter 1 contains the parameter 2, or the parameter 2 includes the parameter 1 to perform the step S2; otherwise, the step S3 is performed.
步骤S2、取参数较长的值为length1,另一个为length2,计算相似度得分:alpha1+beta1*length2/length1;返回计算结果。其中,该alpha1和beta1为经验值。In step S2, the longer value of the parameter is length1 and the other is length2, and the similarity score is calculated: alpha1+beta1*length2/length1; the calculation result is returned. Among them, the alpha1 and beta1 are empirical values.
步骤S3、对用户输入及搜索结果做分词及词性标注。Step S3, performing word segmentation and part-of-speech tagging on user input and search results.
步骤S4、调整分词后的权重,名词和动词调整为2,其它词性不变。Step S4, adjusting the weight after the word segmentation, the noun and the verb are adjusted to 2, and the other parts of speech are unchanged.
步骤S5、统计参数1和参数2分词后相同的词的个数,权重为2按两次来计算,计数为samewords。Step S5, the number of the same words after the statistical parameter 1 and the parameter 2 word segmentation, the weight is 2, calculated twice, and the count is samewords.
步骤S6、参数1分词后为words1,参数2分词后为words2,samewords包含words1中词的个数为num1,samewords包含words2中词的个数为num2。具体相似度的算法为:Step S6, after the parameter 1 word segmentation is words1, after the parameter 2 word segmentation is words2, the samewords contains the number of words in the word1 is num1, and the samewords contains the number of words in the words2 is num2. The algorithm for specific similarity is:
double dp=Math.min(1.0*words1.size()/words2.size(),1.0*words2.size()/words1.size());Double dp=Math.min(1.0*words1.size()/words2.size(),1.0*words2.size()/words1.size());
double part1=alpha*(1.0*samewords.size()/words1.size()+1.0*samewords.size()/words2.size())/2.0;Double part1=alpha*(1.0*samewords.size()/words1.size()+1.0*samewords.size()/words2.size())/2.0;
double part2=beta*dp*(num1/words1.size()+num2/words2.size())/2.0;Double part2=beta*dp*(num1/words1.size()+num2/words2.size())/2.0;
相似度为:part1+part2的值,其中,本优选实施例中的size()用于计算元素的个数。The similarity is the value of part1+part2, where size() in the preferred embodiment is used to calculate the number of elements.
在本优选的实施例中,该阈值过滤的方法包括以下步骤1至步骤4:In the preferred embodiment, the threshold filtering method includes the following steps 1 to 4:
步骤1,计算输入问题与搜索命中结果问题(相当于上述实施例中的目标问题)字段的相 似度; Step 1, calculating the phase of the input question and the search hit result problem (corresponding to the target problem in the above embodiment) field Similarity
步骤2,取相似度阈值,将所有相似度小于该相似度阈值的结果问题过滤掉;其中,该相似度阈值(similarityThreshold)=百分比*最大相似度,其中,该百分比为经验值;Step 2: The similarity threshold is taken, and all the result problems whose similarity is less than the similarity threshold are filtered out; wherein the similarity threshold (similarityThreshold)=percent*maximum similarity, wherein the percentage is an empirical value;
步骤3,如果经过步骤1、2,处理后只剩一条问题结果,则该结果即为最终结果,从该结果中取答案字段值返回。如果经过步骤1、2处理后的问题结果大于1条,把剩余的结果用从问答库中搜索出的搜索引擎的排序打分再进行一次过滤,取排序得分最大的项(scoreMax)作为最终结果,将其余的问题结果都过滤掉。Step 3: If after step 1, 2, only one problem result remains after processing, the result is the final result, and the answer field value is returned from the result. If the result of the problem after the processing of steps 1 and 2 is greater than one, the remaining results are filtered by the ranking of the search engine searched from the question and answer library, and the item with the highest sorting score (scoreMax) is taken as the final result. Filter out the remaining problem results.
步骤4,经过步骤3处理后,如果最终结果为一条,则该结果即为最终结果,从该结果中取答案字段值返回。Step 4: After the processing in step 3, if the final result is one, the result is the final result, and the answer field value is returned from the result.
本发明实施例还提供了另一种优选的智能问答方法,如图5所示,该智能问答方法包括:Another preferred intelligent question answering method is also provided in the embodiment of the present invention. As shown in FIG. 5, the smart question answering method includes:
步骤S502,用户输入问题;Step S502, the user inputs a question;
步骤S504,判断是否设置session(会话);在否的情况下,执行步骤S506;在是的情况下,执行步骤S508;Step S504, it is determined whether the session is set (session); if not, step S506 is performed; in the case of YES, step S508 is performed;
步骤S506,进行普通搜索;Step S506, performing a normal search;
步骤S508,机器人搜索用户输入的问题是否包含敏感词;如果包含,执行步骤S510;如果没有包含,执行步骤S512;Step S508, the robot searches whether the question input by the user contains a sensitive word; if it is included, step S510 is performed; if not, step S512 is performed;
步骤S510,直接返回,提醒用户包含敏感词;Step S510, returning directly, reminding the user to include the sensitive word;
步骤S512,对用户输入的问题进行标准化处理,比如特殊符号处理等;Step S512, normalizing the problem input by the user, such as special symbol processing;
步骤S514,判断会话是否存在且有缓存;如果是,执行步骤S516;如果否,执行步骤S522;Step S514, it is determined whether the session exists and there is a cache; if yes, step S516 is performed; if not, step S522 is performed;
步骤S516,进行引导式问题处理;Step S516, performing guided problem processing;
步骤S518,判断该引导式问题是否处理正常,在处理正常的情况下,执行步骤S520;在处理不正常的情况下,执行步骤S522;Step S518, it is determined whether the guided problem is processed normally, in the case of normal processing, step S520 is performed; if the processing is not normal, step S522 is performed;
步骤S520,缓存问题,并且返回结果;Step S520, caching the problem, and returning the result;
步骤S522,判断所述问题是否是寒暄语;如果是,执行步骤S524;如果否,执行步骤S526;Step S522, it is determined whether the problem is a slang; if yes, step S524 is performed; if not, step S526 is performed;
步骤S524,返回对话;Step S524, returning to the dialogue;
步骤S526,查询问答处理流程;Step S526, querying the question and answer processing flow;
步骤S528,得到结果数,在结果数为1的情况下,执行步骤S530;在结果数为0的情况下,执行步骤S532;在结果数大于1的情况下,执行步骤S534;Step S528, the result number is obtained, in the case that the number of results is 1, step S530 is performed; in the case where the number of results is 0, step S532 is performed; and in the case where the number of results is greater than 1, step S534 is performed;
步骤S530,判断是否是引导式问题,如果是,执行步骤S536;如果否,执行步骤S538; Step S530, it is determined whether it is a guided question, if yes, step S536 is performed; if not, step S538 is performed;
步骤S532,对上下文信息判定;执行步骤S538;Step S532, determining context information; performing step S538;
步骤S534,更新结果;Step S534, updating the result;
步骤S536,交互问题处理;Step S536, interaction problem processing;
步骤S538,更新结果并且缓存该更新结果;Step S538, updating the result and buffering the update result;
步骤S540,返回结果。In step S540, the result is returned.
在上述优选实施例中,步骤S526可以通过以下流程实现,如图6所示,该流程包括步骤S602至步骤S626:In the above preferred embodiment, step S526 can be implemented by the following process. As shown in FIG. 6, the process includes steps S602 to S626:
步骤S602,在等价句与标准句库中精确查询等价句;Step S602, accurately querying the equivalent sentence in the equivalent sentence and the standard sentence library;
步骤S604,判断是否查找到等价句,如果是,执行步骤S606;如果否,执行步骤S608;Step S604, it is determined whether an equivalence sentence is found, if yes, step S606 is performed; if not, step S608 is performed;
步骤S606,进行标准句替换;Step S606, performing standard sentence replacement;
步骤S608,采用正则表达式匹配;Step S608, using regular expression matching;
步骤S610,判断是否匹配到唯一结果;如果是,执行步骤S606;Step S610, it is determined whether the unique result is matched; if yes, step S606 is performed;
步骤S612,在普通问答库中搜索该标准句;Step S612, searching for the standard sentence in the general question and answer library;
步骤S614,进行相似度过滤;Step S614, performing similarity filtering;
步骤S616,判断相似度过滤后是否有与该标准句对应的问题结果;如果否,执行步骤S618;如果是,执行步骤S626;Step S616, it is determined whether there is a problem result corresponding to the standard sentence after the similarity filtering; if not, step S618 is performed; if yes, step S626 is performed;
步骤S618,分词查询标准句;即将标准句进行分词,将与该标准句对应的问题进行分词;Step S618, the word segmentation query standard sentence; the standard sentence is divided into words, and the problem corresponding to the standard sentence is segmented;
步骤S620,进行相似度过滤;Step S620, performing similarity filtering;
步骤S622,判断过滤后是否存在唯一的与该标准句对应的问题结果;如果是,执行步骤S624;Step S622, it is determined whether there is a unique problem result corresponding to the standard sentence after filtering; if yes, step S624 is performed;
步骤S624,搜索普通问答库查询答案;Step S624, searching the general question and answer library to query the answer;
步骤S626,得到答案的个数。In step S626, the number of answers is obtained.
需要说明的是,具体的相似度计算方法与上述步骤S1至步骤S6所示的相同,相似度过滤与上述步骤1至步骤4所示的方式相同。It should be noted that the specific similarity calculation method is the same as that shown in the above steps S1 to S6, and the similarity filtering is the same as the manner shown in the above steps 1 to 4.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机, 服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, CD-ROM, including a number of instructions to make a terminal device (can be a mobile phone, a computer, The server, or network device, etc.) performs the methods described in various embodiments of the present invention.
在本实施例中还提供了一种智能应答装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。An intelligent response device is also provided in the embodiment, which is used to implement the above-mentioned embodiments and preferred embodiments, and has not been described again. As used below, the term "module" may implement a combination of software and/or hardware of a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
图7是根据本发明实施例的智能应答装置的结构框图一,如图7所示,该装置包括:FIG. 7 is a structural block diagram 1 of an intelligent response apparatus according to an embodiment of the present invention. As shown in FIG. 7, the apparatus includes:
接收模块72,设置为接收通过用户终端输入的问题信息;The receiving module 72 is configured to receive the problem information input through the user terminal;
第一查找模块74,与上述接收模块72连接,设置为从多个问答库中,查找与该问题信息的类型对应的问答库;The first searching module 74 is connected to the receiving module 72, and is configured to search for a question and answer library corresponding to the type of the problem information from the plurality of question and answer libraries;
第二查找模块76,与上述第一查找模块74连接,设置为按照预设规则从与该问题信息的类型对应的问答库中查找与该问题信息对应的答案;The second searching module 76 is connected to the first searching module 74, and is configured to search for an answer corresponding to the problem information from a question and answer library corresponding to the type of the problem information according to a preset rule.
返回模块78,与上述第二查找模块76连接,设置为将与该问题信息对应的答案作为返回结果返回给该用户终端。The returning module 78 is connected to the second searching module 76, and is configured to return the answer corresponding to the question information to the user terminal as a return result.
通过上述装置,接收模块72接收到输入的问题信息后,通过第一查找模块74和第二查找模块76根据该问题信息的类型,从与该问题信息的类型对应的问答库中来查找与该问题信息对应的答案,即通过将问答库分为多个,不同的问题信息的类型对应不同的问答库,即不同的问答库中存储有不同类型的问题和答案,相对于相关技术中的智能应答系统,增强了语义支持能力,提高了问答的速度,同时,由于不同的问答库中存储有不同类型的问题和答案,因而可以更方便地问答库进行针对性的更新和维护,进而解决了相关技术中,智能问答系统对语义支持不灵活,维护不方便的问题。After the receiving module 72 receives the input problem information, the first searching module 74 and the second searching module 76 search for the problem information from the question and answer library corresponding to the type of the problem information. The answer corresponding to the problem information, that is, by dividing the question and answer library into multiples, the types of different problem information correspond to different question and answer libraries, that is, different question and answer libraries store different types of questions and answers, compared with the intelligence in related technologies. The response system enhances the semantic support ability and improves the speed of question and answer. At the same time, because different question and answer libraries store different types of questions and answers, it is more convenient to solve the problematic library for targeted update and maintenance. In the related art, the intelligent question answering system is inflexible in semantic support and inconvenient to maintain.
需要说明的是,上述问题信息可以包括:“你好”、“天气怎么样”之类的寒暄语,具有一定特点比如采用方言描述怎样查询话费等之类的特定问题信息,“怎样查询话费”、“怎样发送短信”之类的普通问题信息,“查询话费”之类的引导式问题;上述问答库的类型可以包括:寒暄语语料库、等价句与标准句库、普通问答库;其中,该寒暄语语料库中存储有寒暄语以及与该寒暄语对应的答案;该等价句与标准句库中存储有该特定问题以及与该特定问题对应的标准句或者等价句;普通问答库中存储有普通问题以及与该普通问题对应的答案。每种类型的问题信息对应一个类型的问答库。It should be noted that the above problem information may include: "Hello", "How is the weather" and the like, with certain characteristics such as using dialects to describe how to query the specific fee information, etc., "How to check the phone bill" Ordinary problem information such as "how to send a text message", a guided question such as "query call charge"; the types of the above question and answer library may include: a slang corpus, an equivalent sentence and a standard sentence library, and a general question and answer library; The slang corpus stores a slang word and an answer corresponding to the slang word; the equivalent sentence and the standard sentence library store the specific question and a standard sentence or an equivalent sentence corresponding to the specific question; Stores common questions and answers to the common questions. Each type of question information corresponds to a type of question and answer library.
在本发明的一个实施例中,上述第二查找模块76还设置为从该问题信息的类型对应的问答库中,按照该问题信息和在与该问题信息的类型对应的问答库中存储的问题的相似度,对该问题信息的类型对应的问答库中的问题进行过滤;将过滤后的该问题对应的答案作为与该问题信息对应的答案。具体地,图8根据本发明实施例的智能应答装置的结构框图二,如图8所示,上述第二查找模块76包括:In an embodiment of the present invention, the second searching module 76 is further configured to: according to the question information and the question stored in the question and answer library corresponding to the type of the question information, from the question answering library corresponding to the type of the question information. The similarity degree is filtered by the question and answer library corresponding to the type of the problem information; the filtered answer corresponding to the question is used as the answer corresponding to the question information. Specifically, FIG. 8 is a structural block diagram of an intelligent response apparatus according to an embodiment of the present invention. As shown in FIG. 8, the second searching module 76 includes:
第一获取单元82,设置为从与该问题信息的类型对应的问答库中获取与该问题信息匹配 的目标问题;The first obtaining unit 82 is configured to obtain, from the question and answer library corresponding to the type of the problem information, the problem information Target problem
第二获取单元84,与上述第一获取单元82连接,设置为获取该问题信息和该目标问题的相似度;The second obtaining unit 84 is connected to the first acquiring unit 82, and is configured to acquire the similarity between the problem information and the target problem;
过滤单元86,与上述第二获取单元84连接,设置为过滤与该问题信息的类型对应的问答库中该相似度小于预设阈值的目标问题,得到第一过滤结果;The filtering unit 86 is connected to the second obtaining unit 84, and is configured to filter a target problem in the Q&A library corresponding to the type of the problem information that is less than a preset threshold, to obtain a first filtering result;
查找单元88,与过滤单元86连接,设置为在该第一过滤结果中仅包含一个该目标问题时,将该一个该目标问题对应的答案作为与该问题信息对应的答案;以及在该第一过滤结果中包括多个该目标问题时,取该多个该目标问题中优先级最高的该目标问题对应的答案作为与该问题信息对应的答案。The searching unit 88 is connected to the filtering unit 86, and is configured to: when the first filtering result includes only one target question, the answer corresponding to the one target question is used as an answer corresponding to the problem information; and at the first When the plurality of the target questions are included in the filtering result, the answer corresponding to the target question with the highest priority among the plurality of the target questions is taken as the answer corresponding to the problem information.
需要说明的是,上述目标问题可以为与该问题信息相关的问题,上述第二查找模块76在与该问题信息的类型对应的问答库中找到这些相关的问题,在通过计算问题信息和这些相关的问题的相似度,先将相似度小于一定阈值的这些相关的问题滤掉,如果滤掉后,只剩一个相关的问题,那么将该相关的问题对应的答案作为该问题信息对应的答案;如果滤掉后还有多个相关的问题时,可以按照这些相关的问题的优先级,取优先级最高的问题对应的答案作为该问题信息对应的答案。需要说明的是,该优先级可以为该相关的问题的搜索引擎的排序得分,排序的分高的优先级高。即通过搜索和相似度结合过滤的方式,找到与该问题信息对应的答案,解决了相关技术中搜索引擎命中到的结果过多,不能直接返回给用户答案的问题,同时克服了普通的相似度计算对语义支持较弱的问题。It should be noted that the foregoing target problem may be a problem related to the problem information, and the second searching module 76 finds related problems in the question and answer library corresponding to the type of the problem information, and calculates the problem information and the correlation. The similarity of the problem, first filter out the related problems whose similarity is less than a certain threshold. If there is only one related problem after filtering, the answer corresponding to the related question is taken as the answer corresponding to the problem information; If there are multiple related problems after filtering out, the answers corresponding to the questions with the highest priority can be taken as the answers corresponding to the problem information according to the priority of these related questions. It should be noted that the priority may be the ranking score of the search engine of the related question, and the priority of the sorted high is high. That is to find the answer corresponding to the problem information through the combination of search and similarity filtering, and solve the problem that the search engine hits too many results in the related art, can not directly return to the user's answer, and overcomes the common similarity. Calculate the problem of weak semantic support.
上述预设阈值可以是预先设定的,可以是一个固定值,也可以是根据实际情况进行实时调整,该预设阈值的设定可以是经验数据。The preset threshold may be preset, may be a fixed value, or may be adjusted in real time according to actual conditions, and the preset threshold may be set as empirical data.
在本发明的一个实施例中,该第二获取单元84可以通过以下至少之一方式获取该问题信息和该目标问题的相似度值:方式一:S=alpha1+beta1*(length2/length1);其中,S表示该问题信息和该目标问题的相似度值;length2为该问题信息的信息长度和该目标问题的信息长度较大者,length1为该问题信息的信息长度和该目标问题的信息长度较小者;alpha1和beta1都为实数;方式二:S=alpha*(Samewords/words1+Samewords/words2)/2+beta*dp*(num1/words1+num2/words2);其中,words1为对该问题信息进行分词后所包含的词的个数;words2为对该目标问题进行分词后所包含的词的个数;Samewords为对该问题信息进行分词后与对该目标问题进行分词后所包含的相同的词的个数;num1为Samewords中包含的对该问题信息进行分词后的词的个数;num2为Samewords中包含的对该目标问题进行分词后的词的个数;dp为words1/words2与words2/words1中的最小值,alpha和beta都为实数。In an embodiment of the present invention, the second obtaining unit 84 may obtain the similarity value of the problem information and the target problem in at least one of the following manners: Mode 1: S=alpha1+beta1*(length2/length1); Wherein, S represents the similarity value of the problem information and the target problem; length2 is the information length of the problem information and the information length of the target problem, and length1 is the information length of the problem information and the information length of the target problem. The smaller ones; both alpha1 and beta1 are real numbers; mode two: S=alpha*(Samewords/words1+Samewords/words2)/2+beta*dp*(num1/words1+num2/words2); where word1 is the The number of words included in the problem information after word segmentation; words2 is the number of words included after the word segmentation of the target question; Samewords is the word included after the word segmentation of the question information and the word segmentation of the target question The number of the same word; num1 is the number of words after the word segmentation included in Samewords; num2 is the number of words in the Samewords after the word segmentation of the target question; dp is words1/wor The minimum values in ds2 and words2/words1, alpha and beta are both real numbers.
其中,上述第二获取单元84可以通过以下规则获取对该问题信息分词后所包含的词的个数:对该问题信息进行分词,得到多个词;按照每个该词的词性对每个该词分配权重;将该多个该词的每个词的个数和该每个词的加权和作为对该问题信息分词后所包含的词的个数;可以通过以下规则获取对该目标问题分词后所包含的词的个数:对该目标问题进行分词,得到多个词;按照每个该词的词性对每个该词分配权重;将该多个该词的每个词的个数和该每 个词的加权和作为对该目标问题分词后所包含的词的个数。The second obtaining unit 84 may obtain the number of words included after the word segmentation of the problem information by using the following rule: segmenting the problem information to obtain a plurality of words; each of the words according to the part of the word a word assigning weight; the number of each of the plurality of words and the weighted sum of each of the words as the number of words included after the word segmentation of the question information; the word segmentation of the target question can be obtained by the following rules The number of words included after: segmentation of the target question, obtaining a plurality of words; assigning a weight to each of the words according to the part of speech of each word; the number of each of the plurality of words Each The weighted sum of words is the number of words included after the word segmentation of the target question.
需要说明的是,不同的词性分配的权重不同,比如名词的权重可以为2,动词的权重可以为2,形容词的权重为1,其中,权重为1代表在计算包含的词的总数时,该词只计算一次,若权重为2,则表示在计算包含的词的总数时,该词需要计算两次,比如:问题信息为查询1月份的话费;进行分词得到3个词:查询(动词)、1月份的(形容词)、话费(名词);根据动词和名词词性的权重为2,形容词的权重为1,那么在计算分词后的该问题信息包含的词的个数时,查询算2个词,1月份的算1个词,话费算2个词;即分词后的该问题信息包含的词的个数为2+1+2=5个。It should be noted that the weights of different part-of-speech allocations are different. For example, the weight of a noun can be 2, the weight of a verb can be 2, and the weight of an adjective is 1, wherein a weight of 1 means that when calculating the total number of words included, The word is only calculated once. If the weight is 2, it means that when calculating the total number of words included, the word needs to be calculated twice. For example, the question information is the query for the month of January; the word segmentation is used to get 3 words: the query (verb) In January (adjective), telephone charge (noun); according to the verb and noun part of the weight of 2, the adjective weight is 1, then the number of words in the question information after the word segmentation is calculated, the query counts 2 The word counts 1 word in January, and the phone bill counts 2 words; that is, the number of words included in the question information after the word segmentation is 2+1+2=5.
需要说明的是,上述方式一可以应用于以下至少之一场景:该问题信息与该目标问题相同;该问题信息包含该目标问题;该目标问题包含该问题信息。在除了上述场景之外,可以采用方式二,但并不限于此。It should be noted that the foregoing manner 1 may be applied to at least one of the following scenarios: the problem information is the same as the target problem; the problem information includes the target problem; and the target problem includes the problem information. In addition to the above scenarios, mode 2 may be employed, but is not limited thereto.
图9根据本发明实施例的智能应答装置的结构框图三,如图9所示,上述第一查找模块74可以包括:FIG. 9 is a structural block diagram 3 of an intelligent response apparatus according to an embodiment of the present invention. As shown in FIG. 9, the first search module 74 may include:
第一判断单元92,设置为判断该问题信息是否是第一类问题信息;The first determining unit 92 is configured to determine whether the problem information is the first type of problem information;
第三获取单元94,与上述第一判断单元92连接,设置为在该问题信息是该第一类问题信息的情况下,获取与该第一类问题信息对应的第一类问答库;The third obtaining unit 94 is connected to the first determining unit 92, and is configured to acquire a first type of question answering library corresponding to the first type of question information if the problem information is the first type of question information;
第二判断单元96,与上述第三获取单元94连接,设置为在该问题信息不是该第一类问题信息的情况下,判断该问题信息是否是第二类问题信息;The second determining unit 96 is connected to the third acquiring unit 94, and is configured to determine whether the problem information is the second type of problem information if the problem information is not the first type of problem information;
第四获取单元98,与第二判断单元96连接,设置为在该问题信息是第二类问题信息的情况下,获取与该第二类问题信息对应的第二类问答库;The fourth obtaining unit 98 is connected to the second determining unit 96, and is configured to acquire a second type of question answering library corresponding to the second type of question information if the question information is the second type of question information;
确认单元910,与第四获取单元98连接,设置为从该第二类问答库中,按照该预设规则重新确认该问题信息;The confirmation unit 910 is connected to the fourth obtaining unit 98, and is configured to re-confirm the problem information according to the preset rule from the second type of question and answer library;
第三判断单元912,与确认单元910连接,设置为判断该重新确认的问题信息是否是第三类问题信息;The third determining unit 912 is connected to the confirming unit 910, and is configured to determine whether the reconfirmed question information is the third type of problem information;
第五获取单元914,与第三判断单元912连接,设置为在该重新确认的问题信息是第三类问题信息的情况下,获取与该重新确认的问题信息对应的第三类问答库。The fifth obtaining unit 914 is connected to the third determining unit 912, and is configured to acquire a third type of question answering library corresponding to the reconfirmed question information if the reconfirmed question information is the third type of question information.
在本发明实施例中,上述第一类问题信息可以包括:上述寒暄语;上述可以第一类问答库包括:上述寒暄语语料库;上述第二类问题信息可以包括:特定问题信息;上述第二类问答库可以包括:等价句与标准句库;上述第三类问题信息可以包括:普通问题信息;上述第三类问答库可以包括:普通问答库。In the embodiment of the present invention, the first type of problem information may include: the above-mentioned slang; the first type of question and answer library may include: the slang corpus; the second type of problem information may include: specific problem information; The quiz library may include: an equivalence sentence and a standard sentence library; the third type of problem information may include: general problem information; the third type of question and answer library may include: a general question and answer library.
需要说明的是,上述特定问题可以是一些个性化的问题,对于这些个性化的问题,通过从等价句与标准句库中寻找与其对应的等价句或者标准句的方式来找到对应的答案。 It should be noted that the above specific problem may be some personalized problem. For these personalized problems, the corresponding answer is found by searching for the equivalent sentence or standard sentence corresponding to the equivalent sentence and the standard sentence database. .
图10根据本发明实施例的智能应答装置的结构框图四,如图10所示,上述确认单元910可以包括:FIG. 10 is a block diagram showing the structure of an intelligent response device according to an embodiment of the present invention. As shown in FIG. 10, the confirmation unit 910 may include:
查询子单元1002,设置为从该第二类问答库中,查询与该问题信息对应的所有问题;The query subunit 1002 is configured to query all questions corresponding to the problem information from the second type of question and answer library;
过滤子单元1004,与上述查询子单元1002连接,设置为按照该预设规则对该所有问题进行过滤后,得到第二过滤结果;The filtering subunit 1004 is connected to the query subunit 1002, and is configured to filter all the questions according to the preset rule to obtain a second filtering result.
确认子单元1006,与上述过滤子单元1004连接,设置为在该第二过滤结果唯一的情况下,将该过滤结果作为该重新确认后的问题信息;以及在不存在该第二过滤结果的情况下,将通过该用户终端输入的问题信息作为该重新确认后的问题信息。The confirmation subunit 1006 is connected to the filtering subunit 1004, and is configured to use the filtering result as the problem information after the reconfirmation when the second filtering result is unique; and in the case where the second filtering result does not exist Next, the problem information input through the user terminal is used as the problem information after the reconfirmation.
需要说明的是,该预设规则可以是上述的相似度过滤方式,通过计算该问题信息和与该问题信息对应的所有问题的相似度,通过阈值的设定将相似度低的问题滤掉,剩下的问题可能就是重新确认的问题。It should be noted that the preset rule may be the similarity filtering mode described above, and the problem of low similarity is filtered out by setting the threshold value by calculating the similarity between the problem information and all the questions corresponding to the problem information. The remaining question may be the issue of reconfirmation.
图11根据本发明实施例的智能应答装置的结构框图五,如图11所示,上述装置还包括:Figure 11 is a block diagram showing the structure of an intelligent response device according to an embodiment of the present invention. As shown in Figure 11, the device further includes:
判断模块1102,设置为判断与该问题信息对应的答案是否是第四类问题信息;其中,该第四类问题信息包括:引导式问题;The determining module 1102 is configured to determine whether the answer corresponding to the problem information is the fourth type of problem information; wherein the fourth type of problem information includes: a guided question;
显示模块1104,与上述判断模块1102连接,设置为在与该问题信息对应的答案是第四类问题信息的情况下,触发显示提示信息,其中,该提示信息用于提示通过用户终端输入与该第四类问题信息对应的引导信息;The display module 1104 is connected to the determining module 1102, and is configured to trigger the display of the prompt information when the answer corresponding to the question information is the fourth type of question information, wherein the prompt information is used to prompt the user terminal to input and Guidance information corresponding to the fourth type of problem information;
上述返回模块78,还设置为在与该问题信息对应的答案不是第四类问题信息的情况下,直接将与该问题信息对应的答案作为返回结果返回给该用户终端。The returning module 78 is further configured to directly return the answer corresponding to the question information as a return result to the user terminal if the answer corresponding to the question information is not the fourth type of question information.
需要说明的是,上述引导式问题可以是普通问答的扩展,该引导式问题不能直接获取答案,必须经过交互引导获取一些必要信息后才能得到最后的结果。It should be noted that the above-mentioned guided question may be an extension of the ordinary question and answer. The guided question cannot directly obtain the answer, and must obtain some necessary information through interactive guidance to obtain the final result.
比如:输入“查询话费”,这个问题,需要引导用户输入手机号码、月份等信息才能获取最终的答案,引导问题即为“查询话费”,引导信息为手机号码、月份等信息。For example, if you enter "query call charge", you need to guide the user to enter the mobile phone number, month and other information to get the final answer. The guide problem is "query call charge", and the guide information is mobile phone number, month and other information.
需要说明的是,上述装置还可以包括另一个判断模块,与接收模块72连接,设置为判断该问题信息中是否包含敏感词,如果包含敏感词,则不再查询与该问题信息对应的答案,而是直接返回,提示包含敏感词;如果不包含敏感词,上述第一查找模块74,第二查找模块76,返回模块78继续工作。需要说明的是,敏感词可以是涉毒、涉黄等违法之类的词。It should be noted that the foregoing apparatus may further include another determining module, and is connected to the receiving module 72, and is configured to determine whether the problem information includes a sensitive word, and if the sensitive word is included, the answer corresponding to the problem information is not queried. Instead, it returns directly, the prompt contains sensitive words; if the sensitive words are not included, the first search module 74, the second search module 76, and the return module 78 continue to work. It should be noted that sensitive words can be words such as illegal drugs, yellow-related and other illegal laws.
为了更好的理解本发明,以下结合优选的实施例对本发明做进一步地解释。For a better understanding of the invention, the invention will be further explained in conjunction with the preferred embodiments.
本发明提供了一种优选实施例的智能问答系统的架构图,图12是根据本发明优选实施例的智能问答系统的架构示意图,如图12所示,该智能问答系统包括:管理平台1202,搜索引擎模块1204,交互问答服务模块1206;The present invention provides an architectural diagram of a smart question answering system of a preferred embodiment, and FIG. 12 is a schematic structural diagram of a smart question answering system according to a preferred embodiment of the present invention. As shown in FIG. 12, the smart question answering system includes: a management platform 1202, Search engine module 1204, interactive question and answer service module 1206;
其中,交互问答服务模块1206包括:敏感词过滤模块1208,设置为判断用户输入的问题 是否包含敏感词;寒暄对话模块1210(相当于上述实施例中的第一判断单元92),设置为判断用户输入的问题是否是寒暄语;等价句与标准句转换模块1212(相当于上述实施例中的第二判断单元96和第四获取单元98),设置为将用户输入的问题转换为等价句或者标准句;正则表达式匹配模块1214,设置为没有找到与用户输入的问题对应的等价句的情况下,对用户输入的问题进行正则表达式匹配;分词词性标注模块1216,设置为对用户输入的问题进行分词,并标注分词后的词的词性,和/或,搜索到的结果进行分词,并标注分词后的词的词性;相似度计算模块1218(相当于上述实施例中的过滤子单元1004),设置为计算用户输入的问题和搜索到的问题结果的相似度,其中,具体的相似度的计算算法,参见上述方法实施例中的相似度计算算法,此处不再赘述;流程编排模块1220,设置为在用户输入的问题是引导式问题的情况下,进行流程编排处理,提示用户输入相关的引导信息。The interactive question answering service module 1206 includes: a sensitive word filtering module 1208, configured to determine a user input question. Whether the sensitive word is included; the greeting dialog module 1210 (corresponding to the first determining unit 92 in the above embodiment) is configured to determine whether the question input by the user is a slang; the equivalent sentence and the standard sentence conversion module 1212 (equivalent to the above implementation) The second judging unit 96 and the fourth obtaining unit 98) in the example are configured to convert the question input by the user into an equivalent sentence or a standard sentence; the regular expression matching module 1214 is set to not find a problem corresponding to the question input by the user. In the case of an equivalent sentence, the regular input matching is performed on the question input by the user; the participle part-of-speech tagging module 1216 is set to segment the question input by the user, and the part of the word after the word segmentation is marked, and/or, the searched As a result, the word segmentation is performed, and the part of speech of the word after the word segmentation is marked; the similarity calculation module 1218 (corresponding to the filter subunit 1004 in the above embodiment) is set to calculate the similarity between the user input question and the searched problem result, wherein For the calculation algorithm of the specific similarity, refer to the similarity calculation algorithm in the above method embodiment, which is not described here again; the flow programming module 1220 is set to perform process scheduling processing when the problem input by the user is a guided problem, and prompt the user to input relevant guiding information.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述模块分别位于多个处理器中。It should be noted that each of the above modules may be implemented by software or hardware. For the latter, the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple In the processor.
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:Embodiments of the present invention also provide a storage medium. Optionally, in the embodiment, the foregoing storage medium may be configured to store program code for performing the following steps:
S1,接收通过用户终端输入的问题信息;S1, receiving problem information input through the user terminal;
S2,从多个问答库中,查找与该问题信息的类型对应的问答库;S2, from a plurality of question and answer libraries, searching for a question and answer library corresponding to the type of the problem information;
S3,按照预设规则从与该问题信息的类型对应的问答库中查找与该问题信息对应的答案;S3, searching for an answer corresponding to the problem information from a question and answer library corresponding to the type of the problem information according to a preset rule;
S4,将与该问题信息对应的答案作为返回结果返回给用户终端。S4. Return the answer corresponding to the problem information to the user terminal as a return result.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory. A variety of media that can store program code, such as a disc or a disc.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。For example, the specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the optional embodiments, and details are not described herein again.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。It will be apparent to those skilled in the art that the various modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等 同替换、改进等,均应包含在本发明的保护范围之内。The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, etc. made within the spirit and principles of the present invention The same substitutions, improvements, and the like are intended to be included in the scope of the present invention.
工业实用性Industrial applicability
基于本发明实施例提供的上述技术方案,采用接收通过用户终端输入的问题信息;从多个问答库中,查找与该问题信息的类型对应的问答库;按照预设规则从与该问题信息的类型对应的问答库中查找与该问题信息对应的答案;将与该问题信息对应的答案作为返回结果返回给用户终端。即将问答库分为多个问答库,根据输入的问题信息的类型,从多个问答库中的与该问题信息的类型对应的问答库中查找该问题信息对应的答案,解决了相关技术中智能问答系统对语义支持不灵活,维护不方便的问题,进而提高了语义支持的灵活度,方便维护和更新智能问答系统。 According to the foregoing technical solution provided by the embodiment of the present invention, the problem information input through the user terminal is received; from the plurality of question and answer libraries, the question and answer library corresponding to the type of the problem information is searched; and the information related to the problem is obtained according to the preset rule. The answer corresponding to the question information is searched in the question answering library corresponding to the type; the answer corresponding to the question information is returned as a return result to the user terminal. The question and answer library is divided into multiple question and answer libraries. According to the type of the question information input, the answers corresponding to the question information are searched from the question and answer library corresponding to the type of the question information in the plurality of question and answer libraries, and the intelligence in the related technology is solved. The question and answer system has inflexible semantic support and inconvenient maintenance, which improves the flexibility of semantic support and facilitates the maintenance and update of the intelligent question answering system.

Claims (17)

  1. 一种智能应答方法,包括:An intelligent response method, including:
    接收通过用户终端输入的问题信息;Receiving problem information input through the user terminal;
    从多个问答库中,查找与所述问题信息的类型对应的问答库;From a plurality of question and answer libraries, searching for a question and answer library corresponding to the type of the problem information;
    按照预设规则从与所述问题信息的类型对应的问答库中查找与所述问题信息对应的答案;Finding an answer corresponding to the problem information from a question and answer library corresponding to the type of the problem information according to a preset rule;
    将与所述问题信息对应的答案作为返回结果返回给所述用户终端。The answer corresponding to the question information is returned to the user terminal as a return result.
  2. 根据权利要求1所述的方法,其中,按照预设规则从与所述问题信息的类型对应的问答库中查找与所述问题信息对应的答案包括:The method according to claim 1, wherein the finding an answer corresponding to the question information from a question and answer library corresponding to the type of the question information according to a preset rule comprises:
    从所述问题信息的类型对应的问答库中,按照所述问题信息和在与所述问题信息的类型对应的问答库中存储的问题的相似度,对所述问题信息的类型对应的问答库中的问题进行过滤;From the question answering library corresponding to the type of the question information, a question answering library corresponding to the type of the question information according to the problem information and the similarity of the questions stored in the question answering library corresponding to the type of the question information Filtering in the problem;
    将过滤后的所述问题对应的答案作为与所述问题信息对应的答案。The filtered answer corresponding to the question is taken as an answer corresponding to the question information.
  3. 根据权利要求2所述的方法,其中,按照所述问题信息和在与所述问题信息的类型对应的问答库中存储的问题的相似度,对所述问题信息的类型对应的问答库中的问题进行过滤包括:The method according to claim 2, wherein in the question and answer library corresponding to the type of the problem information, according to the problem information and the degree of similarity of the question stored in the question answering library corresponding to the type of the question information The problem filtering includes:
    从与所述问题信息的类型对应的问答库中获取与所述问题信息匹配的目标问题;Obtaining a target problem matching the problem information from a question and answer library corresponding to the type of the problem information;
    获取所述问题信息和所述目标问题的相似度;Obtaining similarity between the problem information and the target problem;
    过滤与所述问题信息的类型对应的问答库中所述相似度小于预设阈值的目标问题,得到第一过滤结果;Filtering, in the question and answer library corresponding to the type of the problem information, a target problem whose degree of similarity is less than a preset threshold, and obtaining a first filtering result;
    在所述第一过滤结果中仅包含一个所述目标问题时,将所述一个所述目标问题对应的答案作为与所述问题信息对应的答案;When only one of the target questions is included in the first filtering result, the answer corresponding to the one of the target questions is taken as an answer corresponding to the problem information;
    在所述第一过滤结果中包括多个所述目标问题时,取所述多个所述目标问题中优先级最高的所述目标问题对应的答案作为与所述问题信息对应的答案。When the plurality of the target questions are included in the first filtering result, an answer corresponding to the target problem having the highest priority among the plurality of the target questions is taken as an answer corresponding to the problem information.
  4. 根据权利要求3所述的方法,其中,通过以下至少之一方式获取所述问题信息和所述目标问题的相似度值:The method according to claim 3, wherein the problem information and the similarity value of the target problem are acquired by at least one of the following:
    方式一:S=alpha1+beta1*(length2/length1);其中,S表示所述问题信息和所述目标问题的相似度值;length2为所述问题信息的信息长度和所述目标问题的信息长度较大者,length1为所述问题信息的信息长度和所述目标问题的信息长度较小者;alpha1和beta1都为实数;Mode 1: S=alpha1+beta1*(length2/length1); wherein S represents a similarity value of the problem information and the target problem; length2 is an information length of the problem information and an information length of the target problem Larger, length1 is the information length of the problem information and the information length of the target problem is smaller; both alpha1 and beta1 are real numbers;
    方式二:S=alpha*(Samewords/words1+Samewords/words2)/2+beta*dp*(num1/ words1+num2/words2);其中,words1为对所述问题信息进行分词后所包含的词的个数;words2为对所述目标问题进行分词后所包含的词的个数;Samewords为对所述问题信息进行分词后与对所述目标问题进行分词后所包含的相同的词的个数;num1为Samewords中包含的对所述问题信息进行分词后的词的个数;num2为Samewords中包含的对所述目标问题进行分词后的词的个数;dp为words1/words2与words2/words1中的最小值,alpha和beta都为实数。Method 2: S=alpha*(Samewords/words1+Samewords/words2)/2+beta*dp*(num1/ Words1+num2/words2); wherein, words1 is the number of words included after the word segmentation of the question information; words2 is the number of words included after the word segmentation of the target question; Samewords is the pair The number of words in the problem information after the word segmentation is included in the segmentation of the target question; num1 is the number of words included in the Samewords that are segmented by the problem information; num2 is included in the Samewords The number of words after the word segmentation of the target question; dp is the minimum value of words1/words2 and words2/words1, and both alpha and beta are real numbers.
  5. 根据权利要求4所述的方法,其中,所述方式一应用于以下至少之一场景:The method of claim 4, wherein the mode one is applied to at least one of the following scenarios:
    所述问题信息与所述目标问题相同;The problem information is the same as the target problem;
    所述问题信息包含所述目标问题;The problem information includes the target problem;
    所述目标问题包含所述问题信息。The target question contains the problem information.
  6. 根据权利要求4所述的方法,其中,The method of claim 4, wherein
    通过以下规则获取对所述问题信息分词后所包含的词的个数:对所述问题信息进行分词,得到多个词;按照每个所述词的词性对每个所述词分配权重;将所述多个所述词的每个词的个数和所述每个词的加权和作为对所述问题信息分词后所包含的词的个数;Obtaining, by the following rules, the number of words included after the word segmentation of the problem information: segmenting the problem information to obtain a plurality of words; assigning weights to each of the words according to the part of speech of each of the words; a number of each of the plurality of words and a weighted sum of each of the words as a number of words included after the word segmentation of the question information;
    通过以下规则获取对所述目标问题分词后所包含的词的个数:对所述目标问题进行分词,得到多个词;按照每个所述词的词性对每个所述词分配权重;将所述多个所述词的每个词的个数和所述每个词的加权和作为对所述目标问题分词后所包含的词的个数。Obtaining, by the following rules, the number of words included after the segmentation of the target question: segmenting the target question to obtain a plurality of words; assigning weights to each of the words according to the part of speech of each of the words; The number of each of the plurality of words and the weighted sum of each of the words as the number of words included after the word segmentation of the target question.
  7. 根据权利要求1至6中任一项所述的方法,其中,从多个问答库中,查找与所述问题信息的类型对应的问答库包括:The method according to any one of claims 1 to 6, wherein from among the plurality of question and answer libraries, finding a question and answer library corresponding to the type of the question information comprises:
    判断所述问题信息是否是第一类问题信息;Determining whether the problem information is the first type of problem information;
    在所述问题信息是所述第一类问题信息的情况下,获取与所述第一类问题信息对应的第一类问答库;When the problem information is the first type of problem information, acquiring a first type of question answering library corresponding to the first type of problem information;
    在所述问题信息不是所述第一类问题信息的情况下,判断所述问题信息是否是第二类问题信息;If the problem information is not the first type of problem information, determining whether the problem information is the second type of problem information;
    在所述问题信息是第二类问题信息的情况下,获取与所述第二类问题信息对应的第二类问答库;When the problem information is the second type of problem information, acquiring a second type of question answering library corresponding to the second type of problem information;
    从所述第二类问答库中,按照所述预设规则重新确认所述问题信息;Retrieving the problem information from the second type of question and answer library according to the preset rule;
    判断所述重新确认的问题信息是否是第三类问题信息;Determining whether the reconfirmed problem information is a third type of problem information;
    在所述重新确认的问题信息是第三类问题信息的情况下,获取与所述重新确认的问题信息对应的第三类问答库。In the case where the reconfirmed problem information is the third type of question information, a third type of question answering library corresponding to the reconfirmed question information is acquired.
  8. 根据权利要求7所述的方法,其中,所述第一类问题信息包括:寒暄语;所述第一类问 答库包括:寒暄语语料库;其中,所述寒暄语语料库中存储有寒暄语以及与所述寒暄语对应的答案;所述第二类问题信息包括:特定问题信息;所述第二类问答库包括:等价句与标准句库;其中,所述等价句与标准句库中存储有所述特定问题以及与所述特定问题对应的标准句或者等价句;所述第三类问题信息包括:普通问题信息;所述第三类问答库包括:普通问答库,其中,所述普通问答库中存储有普通问题以及与所述普通问题对应的答案。The method according to claim 7, wherein said first type of question information comprises: slang; said first type of question The answer library includes: a slang corpus; wherein the slang corpus stores a slang word and an answer corresponding to the slang word; the second type of problem information includes: specific problem information; the second type of question and answer library The method includes: an equivalent sentence and a standard sentence library; wherein the equivalent sentence and the standard sentence library store the specific question and a standard sentence or an equivalent sentence corresponding to the specific question; the third type of problem information The utility model includes: general problem information; the third type of question answering library includes: a general question answering library, wherein the general question answering library stores an ordinary question and an answer corresponding to the common question.
  9. 根据权利要求7所述的方法,其中,从所述第二类问答库中,按照所述预设规则重新确认所述问题信息包括:The method according to claim 7, wherein, from the second type of question and answer library, reconfirming the problem information according to the preset rule comprises:
    从所述第二类问答库中,查询与所述问题信息对应的所有问题;From the second type of question and answer library, query all questions corresponding to the problem information;
    按照所述预设规则对所述所有问题进行过滤后,得到第二过滤结果;After filtering all the questions according to the preset rule, obtaining a second filtering result;
    在所述第二过滤结果唯一的情况下,将所述过滤结果作为所述重新确认后的问题信息;If the second filtering result is unique, the filtering result is used as the problem information after the reconfirmation;
    在不存在所述第二过滤结果的情况下,将通过所述用户终端输入的问题信息作为所述重新确认后的问题信息。In the case where the second filtering result does not exist, the problem information input through the user terminal is used as the problem information after the reconfirmation.
  10. 根据权利要求7所述的方法,其中,在将与所述问题信息对应的答案作为返回结果返回给所述用户终端之前,所述方法还包括:The method of claim 7, wherein the method further comprises: before returning the answer corresponding to the question information as a return result to the user terminal, the method further comprising:
    判断与所述问题信息对应的答案是否是第四类问题信息;其中,所述第四类问题信息包括:引导式问题;Determining whether the answer corresponding to the problem information is the fourth type of problem information; wherein the fourth type of problem information includes: a guided question;
    如果是,触发显示提示信息,其中,所述提示信息用于提示通过用户终端输入与所述第四类问题信息对应的引导信息;If yes, the display prompt information is triggered, wherein the prompt information is used to prompt to input the guide information corresponding to the fourth type of problem information by using the user terminal;
    如果不是,直接将与所述问题信息对应的答案作为返回结果返回给所述用户终端。If not, the answer corresponding to the question information is directly returned to the user terminal as a return result.
  11. 一种智能应答装置,包括:An intelligent response device comprising:
    接收模块,设置为接收通过用户终端输入的问题信息;a receiving module, configured to receive problem information input through the user terminal;
    第一查找模块,设置为从多个问答库中,查找与所述问题信息的类型对应的问答库;a first search module, configured to search, from the plurality of question and answer libraries, a question and answer library corresponding to the type of the problem information;
    第二查找模块,设置为按照预设规则从与所述问题信息的类型对应的问答库中查找与所述问题信息对应的答案;a second searching module, configured to search for an answer corresponding to the problem information from a question and answer library corresponding to the type of the problem information according to a preset rule;
    返回模块,设置为将与所述问题信息对应的答案作为返回结果返回给所述用户终端。The return module is configured to return an answer corresponding to the question information as a return result to the user terminal.
  12. 根据权利要求11所述的装置,其中,所述第二查找模块还设置为从所述问题信息的类型对应的问答库中,按照所述问题信息和在与所述问题信息的类型对应的问答库中存储的问题的相似度,对所述问题信息的类型对应的问答库中的问题进行过滤;将过滤后的所述问题对应的答案作为与所述问题信息对应的答案。 The apparatus according to claim 11, wherein said second search module is further configured to select a question and answer message corresponding to the type of the question information from the question answering library corresponding to the type of the question information The similarity of the questions stored in the library, filtering the questions in the question answering library corresponding to the type of the problem information; and using the filtered answer corresponding to the question as the answer corresponding to the question information.
  13. 根据权利要求12所述的装置,其中,所述第二查找模块包括:The apparatus of claim 12, wherein the second lookup module comprises:
    第一获取单元,设置为从与所述问题信息的类型对应的问答库中获取与所述问题信息匹配的目标问题;a first obtaining unit, configured to acquire a target problem that matches the problem information from a question and answer library corresponding to the type of the problem information;
    第二获取单元,设置为获取所述问题信息和所述目标问题的相似度;a second acquiring unit, configured to acquire a similarity between the problem information and the target problem;
    过滤单元,设置为过滤与所述问题信息的类型对应的问答库中所述相似度小于预设阈值的目标问题,得到第一过滤结果;a filtering unit, configured to filter a target problem in which the similarity is less than a preset threshold in a question and answer library corresponding to the type of the problem information, to obtain a first filtering result;
    查找单元,设置为在所述第一过滤结果中仅包含一个所述目标问题时,将所述一个所述目标问题对应的答案作为与所述问题信息对应的答案;以及在所述第一过滤结果中包括多个所述目标问题时,取所述多个所述目标问题中优先级最高的所述目标问题对应的答案作为与所述问题信息对应的答案。a searching unit, configured to: when the first filtering result includes only one of the target questions, use an answer corresponding to the one of the target questions as an answer corresponding to the problem information; and in the first filtering When the plurality of the target questions are included in the result, an answer corresponding to the target question having the highest priority among the plurality of the target questions is taken as an answer corresponding to the problem information.
  14. 根据权利要求13所述的装置,其中,所述第二获取单元通过以下至少之一方式获取所述问题信息和所述目标问题的相似度值:The apparatus according to claim 13, wherein the second obtaining unit acquires the similarity value of the problem information and the target question by at least one of the following:
    方式一:S=alpha1+beta1*(length2/length1);其中,S表示所述问题信息和所述目标问题的相似度值;length2为所述问题信息的信息长度和所述目标问题的信息长度较大者,length1为所述问题信息的信息长度和所述目标问题的信息长度较小者;alpha1和beta1都为实数;Mode 1: S=alpha1+beta1*(length2/length1); wherein S represents a similarity value of the problem information and the target problem; length2 is an information length of the problem information and an information length of the target problem Larger, length1 is the information length of the problem information and the information length of the target problem is smaller; both alpha1 and beta1 are real numbers;
    方式二:S=alpha*(Samewords/words1+Samewords/words2)/2+beta*dp*(num1/words1+num2/words2);其中,words1为对所述问题信息进行分词后所包含的词的个数;words2为对所述目标问题进行分词后所包含的词的个数;Samewords为对所述问题信息进行分词后与对所述目标问题进行分词后所包含的相同的词的个数;num1为Samewords中包含的对所述问题信息进行分词后的词的个数;num2为Samewords中包含的对所述目标问题进行分词后的词的个数;dp为words1/words2与words2/words1中的最小值,alpha和beta都为实数。Method 2: S=alpha*(Samewords/words1+Samewords/words2)/2+beta*dp*(num1/words1+num2/words2); wherein, word1 is the word included after the word segmentation of the problem information Words2 is the number of words included after the word segmentation of the target question; Samewords is the number of the same words included after the word segmentation of the question information is performed after segmentation of the target question; Num1 is the number of words in the Samewords that are segmented by the problem information; num2 is the number of words included in the Samewords for the target problem; dp is words1/words2 and words2/words1 The minimum, alpha and beta are both real numbers.
  15. 根据权利要求11至14中任一项所述的装置,其中,所述第一查找模块包括:The apparatus according to any one of claims 11 to 14, wherein the first lookup module comprises:
    第一判断单元,设置为判断所述问题信息是否是第一类问题信息;a first determining unit, configured to determine whether the problem information is the first type of problem information;
    第三获取单元,设置为在所述问题信息是所述第一类问题信息的情况下,获取与所述第一类问题信息对应的第一类问答库;a third obtaining unit, configured to acquire a first type of question answering library corresponding to the first type of question information if the problem information is the first type of question information;
    第二判断单元,设置为在所述问题信息不是所述第一类问题信息的情况下,判断所述问题信息是否是第二类问题信息;a second determining unit, configured to determine whether the problem information is the second type of problem information if the problem information is not the first type of problem information;
    第四获取单元,设置为在所述问题信息是第二类问题信息的情况下,获取与所述第二类问题信息对应的第二类问答库;a fourth obtaining unit, configured to acquire a second type of question answering library corresponding to the second type of question information if the problem information is the second type of question information;
    确认单元,设置为从所述第二类问答库中,按照所述预设规则重新确认所述问题信 息;a confirmation unit, configured to re-confirm the problem letter according to the preset rule from the second type of question and answer library interest;
    第三判断单元,设置为判断所述重新确认的问题信息是否是第三类问题信息;a third determining unit, configured to determine whether the reconfirmed problem information is a third type of problem information;
    第五获取单元,设置为在所述重新确认的问题信息是第三类问题信息的情况下,获取与所述重新确认的问题信息对应的第三类问答库。The fifth obtaining unit is configured to acquire a third type of question answering library corresponding to the reconfirmed question information if the reconfirmed question information is the third type of question information.
  16. 根据权利要求15所述的装置,其中,所述确认单元包括:The apparatus of claim 15, wherein the confirmation unit comprises:
    查询子单元,设置为从所述第二类问答库中,查询与所述问题信息对应的所有问题;Querying a subunit, configured to query all questions corresponding to the problem information from the second type of question and answer library;
    过滤子单元,设置为按照所述预设规则对所述所有问题进行过滤后,得到第二过滤结果;a filtering subunit, configured to filter all the questions according to the preset rule to obtain a second filtering result;
    确认子单元,设置为在所述第二过滤结果唯一的情况下,将所述过滤结果作为所述重新确认后的问题信息;以及在不存在所述第二过滤结果的情况下,将通过所述用户终端输入的问题信息作为所述重新确认后的问题信息。a confirmation subunit, configured to use the filtering result as the problem information after the reconfirmation when the second filtering result is unique; and in the case where the second filtering result does not exist, The problem information input by the user terminal is used as the problem information after the reconfirmation.
  17. 根据权利要求15所述的装置,其中,所述装置还包括:判断模块,设置为判断与所述问题信息对应的答案是否是第四类问题信息;其中,所述第四类问题信息包括:引导式问题;显示模块,设置为在与所述问题信息对应的答案是第四类问题信息的情况下,触发显示提示信息,其中,所述提示信息用于提示通过用户终端输入与所述第四类问题信息对应的引导信息;The device according to claim 15, wherein the device further comprises: a determining module, configured to determine whether the answer corresponding to the problem information is the fourth type of problem information; wherein the fourth type of problem information comprises: a display module, configured to trigger display of the prompt information when the answer corresponding to the problem information is the fourth type of question information, wherein the prompt information is used to prompt input and the first Guidance information corresponding to the four types of problem information;
    所述返回模块,还设置为在与所述问题信息对应的答案不是第四类问题信息的情况下,直接将与所述问题信息对应的答案作为返回结果返回给所述用户终端。 The returning module is further configured to directly return an answer corresponding to the question information as a return result to the user terminal if the answer corresponding to the question information is not the fourth type of question information.
PCT/CN2016/104071 2015-12-07 2016-10-31 Smart response method and apparatus WO2017097061A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510891197.7A CN106844400A (en) 2015-12-07 2015-12-07 Intelligent response method and device
CN201510891197.7 2015-12-07

Publications (1)

Publication Number Publication Date
WO2017097061A1 true WO2017097061A1 (en) 2017-06-15

Family

ID=59013710

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/104071 WO2017097061A1 (en) 2015-12-07 2016-10-31 Smart response method and apparatus

Country Status (2)

Country Link
CN (1) CN106844400A (en)
WO (1) WO2017097061A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108509609A (en) * 2018-04-03 2018-09-07 广州幽联信息技术有限公司 Intelligent human-machine interaction method, apparatus, computer equipment and storage medium
WO2019011356A1 (en) * 2017-07-14 2019-01-17 Cognigy Gmbh Method for conducting dialog between human and computer
CN113409907A (en) * 2021-07-19 2021-09-17 广州方舟信息科技有限公司 Intelligent pre-inquiry method and system based on Internet hospital

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893552B (en) * 2016-03-31 2020-05-05 成都晓多科技有限公司 Data processing method and device
CN108446295B (en) * 2018-01-23 2021-02-12 深圳市阿西莫夫科技有限公司 Information retrieval method, information retrieval device, computer equipment and storage medium
CN108573046B (en) * 2018-04-18 2021-06-29 什伯(上海)智能技术有限公司 User instruction processing method and device based on AI system
CN108664644A (en) * 2018-05-16 2018-10-16 微梦创科网络科技(中国)有限公司 A kind of question answering system construction method, question and answer processing method and processing device
CN109002434A (en) * 2018-05-31 2018-12-14 青岛理工大学 Customer service question and answer matching process, server and storage medium
CN111382247B (en) * 2018-12-29 2023-07-14 深圳市优必选科技有限公司 Content pushing optimization method, content pushing optimization device and electronic equipment
CN109829048B (en) * 2019-01-23 2023-06-23 平安科技(深圳)有限公司 Electronic device, interview assisting method, and computer-readable storage medium
CN110110133B (en) * 2019-04-18 2020-08-11 贝壳找房(北京)科技有限公司 Intelligent voice data generation method and device
CN110059172B (en) * 2019-04-19 2021-09-21 北京百度网讯科技有限公司 Method and device for recommending answers based on natural language understanding
CN111831800A (en) * 2019-08-13 2020-10-27 北京嘀嘀无限科技发展有限公司 Question-answer interaction method, device, equipment and storage medium
CN113704434A (en) * 2021-09-01 2021-11-26 内蒙古大学 Knowledge base question and answer method, electronic equipment and readable storage medium
CN117473069B (en) * 2023-12-26 2024-04-12 深圳市明源云客电子商务有限公司 Business corpus generation method, device and equipment and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6766320B1 (en) * 2000-08-24 2004-07-20 Microsoft Corporation Search engine with natural language-based robust parsing for user query and relevance feedback learning
CN101118554A (en) * 2007-09-14 2008-02-06 中兴通讯股份有限公司 Intelligent interactive request-answering system and processing method thereof
CN103019407A (en) * 2012-11-22 2013-04-03 百度国际科技(深圳)有限公司 Input method application method, automatic question answering method, electronic equipment and server
CN103761334A (en) * 2014-02-17 2014-04-30 网之易信息技术(北京)有限公司 Method and device for searching question bank for matching question
CN104573000A (en) * 2015-01-07 2015-04-29 北京云知声信息技术有限公司 Sequential learning based automatic questions and answers device and method
CN104598445A (en) * 2013-11-01 2015-05-06 腾讯科技(深圳)有限公司 Automatic question-answering system and method
CN104657346A (en) * 2015-01-15 2015-05-27 深圳市前海安测信息技术有限公司 Question matching system and question matching system in intelligent interaction system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100416570C (en) * 2006-09-22 2008-09-03 浙江大学 FAQ based Chinese natural language ask and answer method
CN103425640A (en) * 2012-05-14 2013-12-04 华为技术有限公司 Multimedia questioning-answering system and method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6766320B1 (en) * 2000-08-24 2004-07-20 Microsoft Corporation Search engine with natural language-based robust parsing for user query and relevance feedback learning
CN101118554A (en) * 2007-09-14 2008-02-06 中兴通讯股份有限公司 Intelligent interactive request-answering system and processing method thereof
CN103019407A (en) * 2012-11-22 2013-04-03 百度国际科技(深圳)有限公司 Input method application method, automatic question answering method, electronic equipment and server
CN104598445A (en) * 2013-11-01 2015-05-06 腾讯科技(深圳)有限公司 Automatic question-answering system and method
CN103761334A (en) * 2014-02-17 2014-04-30 网之易信息技术(北京)有限公司 Method and device for searching question bank for matching question
CN104573000A (en) * 2015-01-07 2015-04-29 北京云知声信息技术有限公司 Sequential learning based automatic questions and answers device and method
CN104657346A (en) * 2015-01-15 2015-05-27 深圳市前海安测信息技术有限公司 Question matching system and question matching system in intelligent interaction system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019011356A1 (en) * 2017-07-14 2019-01-17 Cognigy Gmbh Method for conducting dialog between human and computer
US11315560B2 (en) 2017-07-14 2022-04-26 Cognigy Gmbh Method for conducting dialog between human and computer
CN108509609A (en) * 2018-04-03 2018-09-07 广州幽联信息技术有限公司 Intelligent human-machine interaction method, apparatus, computer equipment and storage medium
CN113409907A (en) * 2021-07-19 2021-09-17 广州方舟信息科技有限公司 Intelligent pre-inquiry method and system based on Internet hospital

Also Published As

Publication number Publication date
CN106844400A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
WO2017097061A1 (en) Smart response method and apparatus
US11397772B2 (en) Information search method, apparatus, and system
US10643617B2 (en) Voice recognition system
CN107609101B (en) Intelligent interaction method, equipment and storage medium
US11669698B2 (en) Method and system for automatic formality classification
CN107818781B (en) Intelligent interaction method, equipment and storage medium
US20210319051A1 (en) Conversation oriented machine-user interaction
CN107797984B (en) Intelligent interaction method, equipment and storage medium
EP3617952A1 (en) Information search method, apparatus and system
US8515975B1 (en) Search entity transition matrix and applications of the transition matrix
US9881010B1 (en) Suggestions based on document topics
US10346546B2 (en) Method and system for automatic formality transformation
CN110888990B (en) Text recommendation method, device, equipment and medium
CN104933081A (en) Search suggestion providing method and apparatus
CN109299245B (en) Method and device for recalling knowledge points
CN110415679B (en) Voice error correction method, device, equipment and storage medium
CN109597874B (en) Information recommendation method, device and server
CN110147494B (en) Information searching method and device, storage medium and electronic equipment
KR101541306B1 (en) Computer enabled method of important keyword extraction, server performing the same and storage media storing the same
CN112926308B (en) Method, device, equipment, storage medium and program product for matching text
JP2020512651A (en) Search method, device, and non-transitory computer-readable storage medium
CN113204953A (en) Text matching method and device based on semantic recognition and device readable storage medium
CN107665442B (en) Method and device for acquiring target user
CN109977292A (en) Searching method, calculates equipment and computer readable storage medium at device
CN116843376A (en) Marketing effect prejudging method, marketing effect prejudging device, storage medium and marketing effect prejudging equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16872253

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16872253

Country of ref document: EP

Kind code of ref document: A1