CN109582778B - Intelligent question and answer method, device, equipment and medium - Google Patents
Intelligent question and answer method, device, equipment and medium Download PDFInfo
- Publication number
- CN109582778B CN109582778B CN201811520542.6A CN201811520542A CN109582778B CN 109582778 B CN109582778 B CN 109582778B CN 201811520542 A CN201811520542 A CN 201811520542A CN 109582778 B CN109582778 B CN 109582778B
- Authority
- CN
- China
- Prior art keywords
- question
- conditional probability
- answered
- knowledge base
- pointing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 82
- 230000002441 reversible effect Effects 0.000 claims description 7
- 230000000694 effects Effects 0.000 abstract description 13
- 238000012423 maintenance Methods 0.000 abstract description 8
- 230000002829 reductive effect Effects 0.000 abstract description 6
- 230000000875 corresponding effect Effects 0.000 description 118
- 230000008569 process Effects 0.000 description 16
- 230000006870 function Effects 0.000 description 11
- 238000012545 processing Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 10
- 206010037660 Pyrexia Diseases 0.000 description 9
- 238000003745 diagnosis Methods 0.000 description 9
- 208000005392 Spasm Diseases 0.000 description 7
- 238000013473 artificial intelligence Methods 0.000 description 7
- 206010019233 Headaches Diseases 0.000 description 6
- 231100000869 headache Toxicity 0.000 description 6
- 206010037742 Rabies Diseases 0.000 description 4
- 208000024891 symptom Diseases 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 239000003814 drug Substances 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 208000004998 Abdominal Pain Diseases 0.000 description 2
- 206010010904 Convulsion Diseases 0.000 description 2
- 206010011224 Cough Diseases 0.000 description 2
- 208000007101 Muscle Cramp Diseases 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 230000036461 convulsion Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000005236 sound signal Effects 0.000 description 2
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 2
- 206010020741 Hyperpyrexia Diseases 0.000 description 1
- 208000019695 Migraine disease Diseases 0.000 description 1
- 206010057190 Respiratory tract infections Diseases 0.000 description 1
- 206010046306 Upper respiratory tract infection Diseases 0.000 description 1
- 238000009825 accumulation Methods 0.000 description 1
- 230000000744 blepharospasm Effects 0.000 description 1
- 206010005159 blepharospasm Diseases 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000002596 correlated effect Effects 0.000 description 1
- 238000007418 data mining Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 201000010099 disease Diseases 0.000 description 1
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 208000015181 infectious disease Diseases 0.000 description 1
- 230000002458 infectious effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000000670 limiting effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 206010027599 migraine Diseases 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000036961 partial effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000001148 spastic effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000010897 surface acoustic wave method Methods 0.000 description 1
- 238000001356 surgical procedure Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses an intelligent question answering method, which comprises the following steps: determining a question to be answered; for each question except the question to be answered in the knowledge base, determining the probability of the occurrence of each question under the condition of the occurrence of the question to be answered by using a Bayesian network model, and taking the probability as a first conditional probability corresponding to each question; selecting a guide question corresponding to the question to be answered from the knowledge base according to the first conditional probability; and displaying the guide question corresponding to the question to be answered. On one hand, related guide problems do not need to be manually set for each problem in advance, even if the knowledge base is updated, the guide problems can be determined only by re-determining the first conditional probability, and the maintenance cost is reduced; on the other hand, the context relationship is considered when the guiding question is determined, and the guiding question has strong relevance with the question to be answered, so that a good guiding effect is achieved. Correspondingly, the application also discloses a device, equipment and a medium.
Description
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to an intelligent question answering method, apparatus, device, and medium.
Background
The intelligent question-answering system is an advanced form of an information retrieval system, can answer questions provided by users with natural language by accurate and simple natural language, and at the present stage, the intelligent question-answering system can not only answer the questions of knowledge class, but also can be used in various fields closely related to the life of people, such as medical treatment, education, life, science and technology, and the like, and greatly improves the efficiency of obtaining information by people.
In practical application, the intelligent question-answering system not only needs to answer questions posed by the user, but also can recommend some related questions as guidance for the user, wherein the related questions are called as guidance questions, and based on the guidance questions, the intelligent question-answering system can guide the user to carry out question-answering interaction.
The intelligent question-answering system in the current market mainly adopts the following two methods to realize problem guidance:
one method is that relevant guide problems are manually set for each problem in advance based on a knowledge base in a manual setting mode, and based on the method, once a user proposes a certain problem, an intelligent question-answering system guides the problem for the user based on the preset incidence relation between the problem and the guide problem.
Another method is that, for the questions posed by the user, the intelligent question-answering system indexes and orders the knowledge base by using term frequency-inverse document frequency (TF-IDF), and takes the top N questions ordered in the front as the guide questions of the questions.
Disclosure of Invention
The embodiment of the application provides an intelligent question-answering method, which can determine a guide question corresponding to a question to be answered by using a Bayesian model based on a context relationship among questions in an intelligent question-answering system, has a good guide effect, and is low in maintenance cost. Correspondingly, the application also provides an intelligent question answering device, equipment and a computer readable storage medium.
A first aspect of the present application provides an intelligent question and answer method, including:
determining a question to be answered;
for each question except the question to be answered in the knowledge base, determining the probability of the occurrence of each question under the condition of the occurrence of the question to be answered by using a Bayesian network model, and taking the probability as a first conditional probability corresponding to each question;
selecting a guide question corresponding to the question to be answered from the knowledge base according to the first conditional probability;
and displaying the guide question corresponding to the question to be answered.
A second aspect of the present application provides an intelligent question answering device, comprising:
a first determination module for determining a question to be answered;
a second determining module, configured to determine, for each question except the question to be answered in the knowledge base, a probability of occurrence of each question under a condition that the question to be answered occurs by using a bayesian network model, as a first conditional probability corresponding to each question;
the first selection module is used for selecting the guide question corresponding to the question to be answered from the knowledge base according to the first conditional probability;
and the display module is used for displaying the guide question corresponding to the question to be answered.
A third aspect of the application provides an apparatus comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the steps of the intelligent question answering method according to the first aspect, according to instructions in the program code.
A fourth aspect of the present application provides a computer-readable storage medium for storing a program code for executing the intelligent question-answering method according to the first aspect.
A fifth aspect of the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the intelligent question-answering method of the first aspect described above.
According to the technical scheme, the embodiment of the application has the following advantages:
the embodiment of the application provides an intelligent question-answering method, which is used for determining a guide question corresponding to a question to be answered by utilizing a Bayesian model based on a context relationship between the question to be answered and other questions in a knowledge base. Specifically, the questions to be answered are determined, aiming at each question except the questions to be answered in the knowledge base, the occurrence probability of each question under the condition that the question to be answered appears is determined by using a Bayesian model, the occurrence probability serves as the first conditional probability of each question, the first conditional probability can represent the context relationship between the question and the question to be answered, and on the basis of the first conditional probability, the question with strong relevance can be selected from the knowledge base as the guide question corresponding to the question to be answered. On one hand, related guide problems do not need to be manually set for each problem in advance, even if the knowledge base is updated, the guide problems can be determined only by re-determining the first conditional probability, and the maintenance cost is reduced; on the other hand, the context relationship is considered when the guiding question is determined, and the guiding question has strong relevance with the question to be answered, so that a good guiding effect is achieved.
Drawings
Fig. 1 is a scene architecture diagram of an intelligent question answering method in an embodiment of the present application;
FIG. 2 is a flow chart of an intelligent question answering method in an embodiment of the present application;
FIG. 3 is a diagram of a Bayesian network model in an embodiment of the present application;
FIG. 4 is a flow chart of an intelligent question answering method in an embodiment of the present application;
FIG. 5 is a flow chart of an intelligent question answering method in an embodiment of the present application;
FIG. 6 is a schematic diagram of a history question-answering record in an embodiment of the present application
Fig. 7 is a schematic diagram of an application scenario of an intelligent question-answering method in triage consultation guidance in an embodiment of the present application;
fig. 8 is a schematic structural diagram of an intelligent question answering device in an embodiment of the present application;
fig. 9 is a schematic structural diagram of an apparatus for intelligent question answering in an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Aiming at the technical problems that related guide questions need to be manually set for all questions in advance based on a knowledge base or the technical problems that the labor cost is high and the guide effect is poor due to the fact that the knowledge base is indexed and sequenced through TF-IDF are used in the prior art, the method provides an intelligent question-answering method. Specifically, the questions to be answered are determined, aiming at each question except the questions to be answered in the knowledge base, the occurrence probability of each question under the condition that the question to be answered appears is determined by using a Bayesian model, the occurrence probability serves as the first conditional probability of each question, the first conditional probability can represent the context relationship between the question and the question to be answered, and on the basis of the first conditional probability, the question with strong relevance can be selected from the knowledge base as the guide question corresponding to the question to be answered.
On one hand, the method and the device do not need to manually set related guide problems aiming at all problems in advance, and the guide problems can be determined only by re-determining the first conditional probability even if the knowledge base is updated, so that the maintenance cost is reduced; on the other hand, the context relationship is considered when the guiding question is determined, and the guiding question has strong relevance with the question to be answered, so that a good guiding effect is achieved.
It is understood that the intelligent question-answering method provided by the present application can be applied to a data processing device, which can be any device including a Processor, such as a Central Processing Unit (CPU). In particular implementation, the data processing device may be a terminal, including but not limited to existing, developing or future developing smart phones, tablet computers, laptop personal computers, desktop personal computers, artificial intelligence robots, and the like, and of course, the data processing device may also be a server. The data processing device may be an independent terminal device or server, or may be a cluster formed by a plurality of terminal devices or a plurality of servers.
The intelligent question answering method provided by the application is stored in the data processing equipment in the form of application programs or software, and the data processing equipment executes the application programs or the software to realize the intelligent question answering method provided by the application. For convenience of introduction, hereinafter, the terminal is used as a data processing device to introduce the intelligent question answering method provided by the present application.
In order to make the technical scheme of the present application clearer and easier to understand, the intelligent question answering method provided by the present application will be introduced below with reference to specific scenarios. Referring to a scene architecture diagram of the intelligent question answering method shown in fig. 1, the scene includes an artificial intelligence robot 10, wherein a user proposes a question through the artificial intelligence robot 10, the artificial intelligence robot 10 determines a question Q0 to be answered based on the question proposed by the user, the artificial intelligence robot enables the intelligent question answering method of the present application in consideration of the context between Q0 and other questions in a knowledge base, determines the probability of each question occurring under the condition that the question to be answered occurs, and then determines a guidance question corresponding to Q0 based on the probability.
Specifically, after determining Q0, the artificial intelligence robot 10 determines, for each question in the knowledge base except the question Q0 to be answered, specifically Q1 to Qn, where n is a positive integer, a probability of occurrence of each question under a condition of occurrence of Q0 using a bayesian network model as a first conditional probability corresponding to each question, then selects a guidance question corresponding to Q0 from the knowledge base according to the first conditional probability, and displays a guidance question corresponding to Q0.
Next, the intelligent question answering method provided by the present application will be described from the perspective of the terminal. Referring to fig. 2, a flow chart of an intelligent question answering method is shown, which includes:
s201: a question to be answered is determined.
The user can ask a question through the terminal, the user can ask the question through a direct input mode, and the user can ask the question through a mode of selecting a corresponding option from a plurality of question options displayed by the terminal. For a question posed by the user, the terminal may determine a question to be answered based on a dialog record with the user. In particular implementations, the terminal may determine a currently posed question as a question to be answered.
S202: and aiming at each question except the question to be answered in the knowledge base, determining the probability of the occurrence of each question under the condition of the occurrence of the question to be answered by utilizing a Bayesian network model, and taking the probability as the first conditional probability corresponding to each question.
The Bayesian network is a probability network, in particular to a graphical network based on probability inference, and a Bayesian formula is the basis of the probability network. The probabilistic reasoning is a process of acquiring other probabilistic information through information of some variables, and the bayesian network based on the probabilistic reasoning is proposed for solving the problems of uncertainty and incompleteness.
In the present embodiment, the bayesian network model is a model established based on a bayesian network. The method is mainly used for determining the probability of each occurrence of other questions in the knowledge base under the condition that the question to be answered occurs, wherein the probability is the first conditional probability corresponding to the question. For example, the question to be answered is a, and the first conditional probability of the question B in the knowledge base excluding the question to be answered may be represented as P (B | a).
The Bayesian network model comprises a directed acyclic graph determined according to the problems in the knowledge base and a conditional probability table corresponding to each problem in the knowledge base, wherein the directed acyclic graph is used for representing a group of random variables and conditional dependency relations among the random variables, and the directed acyclic graph can be parameterized through conditional probability distribution. Specifically, referring to fig. 3, each problem in the knowledge base is a node of the directed acyclic graph, and each node may be parameterized by P (node | pa (node)), where pa (node) refers to a parent node corresponding to the entire directed acyclic graph, such as problem a shown in fig. 3.
For ease of understanding, the parameterized process is illustrated by way of example. As shown in fig. 3, if there is a path a → C → D in the directed acyclic graph, the corresponding total probability formula is:
P(a,c,d)=P(d|a,c)P(c|a)P(a) (1)
where P (a, C, D) refers to the probability that problem A, C, D occurs in sequence, P (a) refers to the probability that problem a occurs, P (C | a) refers to the probability that problem C occurs when problem a occurs, and P (D | a, C) refers to the probability that problem D occurs when problem A, C occurs in sequence.
In a specific implementation, the terminal may query the first conditional probability corresponding to each question based on the conditional probability table. Referring to fig. 3, if the question to be answered is question a, it can be known from the conditional probability table corresponding to question B that the probability of occurrence of question B is 0.5 in the case of occurrence of question a; if the question to be answered is the question C, it can be seen from the conditional probability table of the question D that the probability of the occurrence of the question D is equal to 1 in the case of the occurrence of the question C.
In some cases, the terminal may also determine the first conditional probability based on conditional dependencies between random variables in conjunction with a directed acyclic graph. Still referring to fig. 3, when the question to be answered is question a, the next question may only be question B or question C, and may not be question D, so that in the case of question a, the probability of question B is 0.5, the probability of question C is 0.5, and the probability of question D is 0, i.e. the first conditional probabilities corresponding to question B, C, D for question a to be answered are 0.5, 0, respectively.
S203: and selecting a guide question corresponding to the question to be answered from the knowledge base according to the first conditional probability.
Because the first conditional probability can represent the context relationship between the questions, the terminal can select the questions with the close context relationship and the strong correlation with the questions to be answered from the knowledge base based on the first conditional probability, and the questions with the close context relationship and the strong correlation are used as the guide questions, so that the method has a good guide effect.
When selecting a guide question corresponding to a question to be answered, the embodiment of the present application provides the following two implementation manners:
one implementation manner is to select a question with the first conditional probability greater than a second threshold from the knowledge base as a guide question corresponding to the question to be answered, where the second threshold may be set according to an actual requirement, for example, may be set to 0.9.
Another implementation manner is that, according to the sequence of the first conditional probability from large to small, N questions ranked at the top are selected from the knowledge base as the guide questions corresponding to the questions to be answered, where N is a positive integer, and in practical application, N may be set according to requirements, and as an example, N may be set to 3.
S204: and displaying the guide question corresponding to the question to be answered.
In specific implementation, the terminal displays the guide question corresponding to the question to be answered, so that the user can ask the next question based on the guide question displayed by the terminal. It should be noted that the terminal may also play the voice content corresponding to the guidance question through the player, so that the user can ask the next question based on the voice content.
In this embodiment, the timing and location of the terminal displaying the guidance question may be set according to actual needs. As a possible implementation manner, the terminal may display the guidance question after displaying the answer corresponding to the question to be answered, and when the guidance question includes a plurality of guidance questions, may display the plurality of guidance questions in parallel below the answer corresponding to the question to be answered.
Of course, the terminal may also display the answer corresponding to the question to be answered and the guidance question at the same time, where the answer corresponding to the question to be answered may be displayed directly below the question to be answered, and the guidance question may be displayed on the side of the question to be answered, e.g., on the right side.
Based on the same manner as the guidance question, when the terminal answers the question for the question to be answered, the terminal can display the answer corresponding to the question to be answered on the display screen, and can also play the voice content corresponding to the answer through the player. The user is prompted through page display or voice broadcasting, the user can be guided to quickly acquire corresponding information through the guide problem, and the information acquisition efficiency is improved.
Therefore, the embodiment of the application provides an intelligent question-answering method, which is used for determining a guide question corresponding to a question to be answered by using a Bayesian model based on the context relationship between the question to be answered and other questions in a knowledge base. Specifically, the questions to be answered are determined, aiming at each question except the questions to be answered in the knowledge base, the occurrence probability of each question under the condition that the question to be answered appears is determined by using a Bayesian model, the occurrence probability serves as the first conditional probability of each question, the first conditional probability can represent the context relationship between the question and the question to be answered, and on the basis of the first conditional probability, the question with strong relevance can be selected from the knowledge base as the guide question corresponding to the question to be answered. On one hand, related guide problems do not need to be manually set for each problem in advance, even if the knowledge base is updated, the guide problems can be determined only by re-determining the first conditional probability, and the maintenance cost is reduced; on the other hand, the context relationship is considered when the guiding question is determined, and the guiding question has strong relevance with the question to be answered, so that a good guiding effect is achieved.
In the embodiment shown in fig. 2, the terminal determines the guidance question corresponding to the question to be answered according to the first conditional probability, in some cases, the first conditional probability corresponding to each question except the question to be answered in the knowledge base is smaller, which indicates that the relevance between other questions in the knowledge base and the question to be answered is not high, if the question with the first conditional probability greater than the second threshold is selected as the guidance question, the situation that the question meeting the requirement cannot be selected may occur, and if the first N questions are selected as the guidance questions according to the sequence of the first conditional probability from large to small, the relevance between the guidance question and the question to be answered is not high due to the smaller first conditional probability, and the guidance effect is general.
Based on this, when the first conditional probability corresponding to each question is smaller than the first threshold, the terminal may calculate, for each question except the question to be answered in the knowledge base, a weighted sum value of the word frequency reverse file frequency and the first conditional probability corresponding to each question as a score value corresponding to the question, and determine, based on the score value, a guidance question corresponding to the question to be answered.
Next, a process of determining the guidance issue based on the score value will be described in detail. Referring to fig. 4, a flow chart of an intelligent question answering method is shown, which is an improvement of the embodiment shown in fig. 2, and the method includes:
s401: a question to be answered is determined.
S402: and aiming at each question except the question to be answered in the knowledge base, determining the probability of the occurrence of each question under the condition of the occurrence of the question to be answered by utilizing a Bayesian network model, and taking the probability as the first conditional probability corresponding to each question.
Specific implementation of S401 and S402 is described with reference to relevant content of the embodiment shown in fig. 2, and is not described herein again.
S403: and judging whether the first conditional probabilities corresponding to each problem are all smaller than a first threshold, if so, executing S404, and if not, executing S406.
In specific implementation, the terminal may respectively determine, for each question except the question to be answered in the knowledge base, whether a first condition probability corresponding to each question is smaller than a first threshold, or determine a maximum value of the first condition probability according to the first condition probability corresponding to each question, and determine whether the maximum value of the first condition probability is smaller than the first threshold, if so, it indicates that the association between each question and the question to be answered is small, and may determine a guidance question according to the word frequency reverse file frequency and the first condition probability, that is, perform S404, if not, it indicates that a question having a large association with the question to be answered exists, and may directly determine the guidance question based on the first condition probability, that is, perform S406.
It should be noted that the first threshold may be set according to actual requirements, and as an example of the present application, the first threshold may be set to 0.5.
S404: and respectively calculating the weighted sum value of the word frequency reverse file frequency and the first conditional probability corresponding to each question as the score value corresponding to the question aiming at each question except the question to be answered in the knowledge base.
The term frequency inverse document frequency, also known as TF-IDF, is an information retrieval and data mining technique for evaluating the importance of a word to one of a set of documents or a corpus. In particular to the present embodiment, the TF-IDF is used to assess the degree of importance of each question in the knowledge base, except for the question to be answered, to the knowledge base.
The embodiment of the application provides an implementation mode for determining TF-IDF. Specifically, for each question except the question to be answered, the terminal respectively calculates the importance degree of each participle in the question to the knowledge base, and then calculates the average value of the importance degrees of the participles to the knowledge base as the importance degree of the question to the knowledge base. The specific calculation process can be seen in the following formula:
where M denotes an arbitrary question in the knowledge base excluding the question to be answered, and M ═ M (M)1,M2,…Mn),MiWord direction corresponding to ith participle representing question MAmount, i is an integer from 1 to n, TF (M)i) Represents MiWord frequency, DF (M), occurring in the knowledge basei) Shows that M appears in question-answer pairs of the whole knowledge baseiThe number of question-answer pairs, | S | represents the number of question-answer pairs of the entire knowledge base.
For each problem, the terminal may perform weighted summation on the TD-idfscore (m) and the first conditional probability corresponding to the problem, as a score value corresponding to the problem, specifically see the following formula:
W(M)=TF-IDFScore(M)*(1-α)+α*P(M|A) (3)
wherein, w (M) is a score value of the question M, TF-idfscore (M) is a word frequency reverse file frequency of the question M, and P (M | a) is a first conditional probability of the question M when the question a occurs, 1- α and α are weights corresponding to the word frequency reverse file frequency and the first conditional probability, respectively.
In a specific implementation, α may be set based on statistics of user access to the intelligent question-answering system, where the statistics of user access to the intelligent question-answering system may specifically be the number of question-answer pairs in a dialog record generated by accessing the intelligent question-answering system, and when the number of question-answer pairs is large, a large α may be set, in some cases, if the number of question-answer pairs is greater than a first preset number, α may even be set to 1, and when the number of question-answer pairs is small, a small α may be set, and in some cases, if the number of question-answer pairs is less than a second preset number, α may tend to 0.
It should be further noted that α may also be set based on the number of knowledge bases, and when the number of knowledge bases is not accumulated to a certain extent, the accuracy of the bayesian network model in determining the first conditional probability of the questions other than the question to be answered is not high, that is, there is a cold start question, so that the terminal may adopt a strategy weighted with TF-IDF to deal with the cold start question based on the first conditional probability.
S405: and determining a guide question corresponding to the question to be answered according to the score value, and then executing S407.
Similar to selecting the guidance question corresponding to the question to be answered from the indication library according to the first conditional probability, when the terminal determines the guidance question corresponding to the question to be answered according to the score value, the embodiment provides the following two implementation manners:
one implementation is to select a question with a score value greater than a preset score threshold from the knowledge base as a guide question corresponding to a question to be answered, where the preset score threshold may be set according to actual needs.
Another implementation mode is that according to the sequence of the score values from large to small, N questions ranked at the top are selected from the knowledge base as guide questions corresponding to the questions to be answered, wherein N is a positive integer.
S406: and selecting a guide question corresponding to the question to be answered from the knowledge base according to the first conditional probability.
S407: and displaying the guide question corresponding to the question to be answered.
Specific implementation of S406 and S407 refer to the description related to the embodiment shown in fig. 2, and are not described herein again.
As can be seen from the above, the embodiment of the present application provides an intelligent question-answering method, which considers the context relationship between questions, determines, by using a bayesian model, first conditional probabilities corresponding to other questions in a knowledge base under the condition that a question to be answered occurs, where the first conditional probabilities can represent the relevance between each question and the question to be answered, and based on this, when there is a question with a large relevance, the question can be directly used as a guidance question corresponding to the question to be answered, and when there is no question with a large relevance, a score value corresponding to the question can be obtained by weighting with a TF-IDT, and based on this score value, the guidance question corresponding to the question to be answered is determined. On one hand, because expert knowledge or prior probability is not used, the labor cost can be saved; on the other hand, different strategies are respectively adopted to determine the guiding problem based on the relevance between each question and the question to be answered, so that the problem of cold start caused by insufficient statistics of a user accessing the intelligent question-answering system or insufficient accumulation of the number of knowledge bases is solved, and a better guiding effect is achieved.
In the embodiments shown in fig. 2 to 4, the bayesian network model used by the terminal is generated in advance. During specific implementation, the terminal can collect the historical question answering records of the intelligent question answering system; and generating the Bayesian network model according to the historical question-answer records, wherein the Bayesian network model comprises a directed acyclic graph determined according to the questions in the knowledge base and a conditional probability table corresponding to each question in the knowledge base. Next, a detailed description will be given of a process of generating a bayesian network model in connection with a specific embodiment.
Referring to the flow chart of the intelligent question answering method shown in fig. 5, the embodiment is an improvement on the embodiment shown in fig. 2, the embodiment shown in fig. 5 is mainly explained only about the differences from the embodiment shown in fig. 2, and the method further includes:
s501: and determining the conditional probability among the questions in the knowledge base according to the collected historical question-answer records, and determining a conditional probability table corresponding to each question.
The historical question-answering records comprise records of questions and corresponding answers generated when at least one user asks in the intelligent question-answering system. The terminal can collect the question-answer records of one user at different moments as historical question-answer records, and can also collect the question-answer records of different users in a specified time period as historical question-answer records. In practical application, a terminal generally collects historical question and answer records of different users to ensure the diversity of data.
Based on the collected historical question-answer records, the terminal can count the total times of two questions continuously proposed by the user in the historical question-answer records, it needs to be stated that in a conversation process, if the user proposes N questions, N is a positive integer greater than 1, the times of two questions continuously proposed by the user can be regarded as N-1 for the conversation process, then, the terminal respectively counts the times of each question firstly proposed when the two questions are continuously proposed, and for each question, the terminal can take the ratio of the times of the question firstly proposed when the two questions are continuously proposed to the total times of the two questions continuously proposed as the initial probability of the question.
After determining the total number of times of continuously proposing two questions and the number of times of first proposing each question when continuously proposing two questions, the terminal may respectively determine, for each question, the number of times of second proposing each question when specifying the question first proposing, and then take a ratio of the number of times of second proposing each question to the number of times of first proposing each question as a conditional probability corresponding to each question under the condition that the specified question first proposes, where the specified question may be any one of the questions in the knowledge base, and thus, for each question, the terminal may calculate the conditional probability corresponding to the condition that other questions occur or do not occur, thereby determining a conditional probability table corresponding thereto.
It should be noted that, when there are cases in the history of question-answering records where two questions are presented consecutively, a later question corresponds to a different preceding question, and there is also a correlation between the preceding questions themselves, the conditional probability table includes the conditional probability that the later question corresponds to the preceding question with or without occurrence of the correlated preceding question, and the determination process of the conditional probability may be described with reference to the above-mentioned related contents.
For ease of understanding, the following description will be made in conjunction with specific examples. As shown in fig. 6, the history question-answer records collected by the terminal of the intelligent question-answer system include 3 dialog processes, for example, dialog a → B, which shows that in the dialog process, the user firstly asks question a, and then asks question B. In this example, the user presents two questions in succession, including a → B, a → C, B → C, and C → D, so the total number of times the two questions are presented in succession is 4, whereas the number of times a was presented first is 2, the number of times B, C was presented first is 1, and the number of times D was presented first is 0, so the initial probabilities of the terminal calculating A, B, C, D are 0.5, 0.25, 0, respectively.
For the problem a, it is not proposed as a post-problem, and therefore, the conditional probability table corresponding to the problem a includes an initial probability of the problem a, and the probability of the problem a proposing P (a ═ T) or not proposing P (a ═ F) is 0.5, which can be specifically seen in fig. 3.
For the problem B, the previous problem thereof includes only the problem a, and thus, the conditional probability table corresponding to the problem B includes the probability P (B ═ T | a ═ T), P (B ═ T | a ═ F), at which the problem a occurs or does not occur, and the probability P (B ═ F | a ═ T), P (B ═ F | a ═ F), at which the problem B does not occur, wherein a is proposed twice before, and under this condition, B is proposed 1 after, and therefore, P (B ═ T | a ═ T) 0.5, P (B ═ F | a ═ T) ═ 0.5, a not proposed before includes B → C and C → D, totaling twice, and B is generated once, and therefore, P (B ═ T ═ a ═ F ═ 0.5, F ═ 0.5).
For the problem C, since there are previous problems a and B, and a and B have a correlation therebetween, the corresponding conditional probability table includes a probability P (C ═ T | a ═ T, B ═ T) that the problem C occurs when the problem a occurs and the problem B occurs, a probability P (C ═ F | a ═ T, B ═ T) that the problem C occurs when the problem B does not occur, a probability P (C ═ T | a ═ T, B ═ F) that the problem C does not occur when the problem B does not occur, a probability P (C ═ F, B ═ F) that the problem C occurs when the problem B occurs, and a probability P (C ═ F, B ═ T) that the problem C does not occur, b ═ F) and the probability P that the problem C does not occur (C ═ F | a ═ F, B ═ F).
In the history, the case where the problems A, B occur includes one, in which case C does not occur, and therefore P (C ═ T | a ═ T, B ═ T ═ 0, P (C ═ F | a ═ T, B ═ T), problem a occurs, and the case where the problem B does not occur includes a → C, and therefore P (C ═ T | a ═ T, B ═ F) —, 1, P (C ═ F | a ═ T, B ═ F) ═ 0, problem a does not occur, and the case where the problem B occurs includes B → C, that is, C necessarily occurs, and therefore P (C ═ T ═ a ═ F, B ═ T ═ 1, P (C ═ F, B ═ T ═ F), and F ═ F, F ═ F, and F ═ F → C, and F ═ F → C, and F are inevitably occurs, and F, and the case where P (C ═ F → C is F, F → C, F → C, b ═ F) ═ 0.
For problem D, its predecessor problem only includes problem C, and therefore the conditional probability table to which problem D corresponds includes probability P (D ═ T | C ═ T) that problem D occurs when problem C occurs and probability P (D ═ F | C ═ T) that problem D does not occur, and probability P (D ═ T | C ═ F) that problem D occurs and probability P (D ═ F | C ═ F) that problem D does not occur when problem C does not occur. Since C is proposed in the first place only including C → D, the problem D inevitably occurs when the problem C occurs, and the problem D is impossible to occur when the problem C does not occur, and therefore, P (D ═ T | C ═ T) ═ 1, P (D ═ F | C ═ T) ═ 0, P (D ═ T | C ═ F) ═ 1, and P (D ═ F | C ═ F) ═ 0.
S502: and converting the conditional probability corresponding to each question in the knowledge base into a directed acyclic graph.
In this embodiment, the terminal may regard each problem in the knowledge base as a node, and connect the nodes based on the conditional probability corresponding to each problem to form a directed graph, where the directed graph is used to represent the conditional dependency relationship between the nodes. Considering that the bayesian model is a prerequisite of a directed acyclic graph, when there is a loop in the directed graph, such as a → B or B → a, the terminal further needs to remove the loop in the directed graph based on the conditional probability to obtain the directed acyclic graph.
In a specific implementation, the terminal may convert the conditional probability corresponding to each question in the knowledge base into a directed acyclic graph in the following manner. Specifically, the terminal numbers each question in the knowledge base to obtain a sequence number order of the question, and then performs the following operations:
step1. two questions are selected from the conditional probability table.
In specific implementation, the terminal may select two problems in sequence according to the sequence numbers of the problems. For ease of understanding, the present embodiment is exemplified by problem a and problem B.
step2, if the conditional probability P (B ═ T | a ═ T) ≠ 0 and the sequence number of the problem a is smaller than the sequence number of the problem B, i.e. order (a) is smaller than order (B), connecting the problem a with the problem B to form a directed edge a → B; if P (B ═ T | a ≠ T) ≠ 0, and P (a ═ T | B ≠ T) ≠ 0, it indicates that the user has a case of not asking questions a and B in sequence, and specifically there are the following cases:
(1) when | P (B ═ T | a ═ T) | > α where α is a preset threshold, there can be specifically two cases as follows:
one case is that P (B ═ T | a ═ T) — P (a ═ T | B ═ T) > α, the probability of asking question a before question B is much greater than the probability of asking question B before question a, question A, B is ordered, and question a is preceded, at which time, if order (a) < order (B) remains directed edge a → B, if order (a) > order (B), directed edge a → B is replaced with directed edge B → a, if no directed loop is generated, then the order of A, B is swapped, and if a directed loop is present after replacement, directed edge a → B is not maintained.
In another case, P (B ═ T | a ═ T) — P (a ═ T | B ═ T) < - α, the probability of asking question a before question B is much smaller than the probability of asking question B before question a, the question A, B is ordered, and the question B is preceded, at this time, if order (a) is smaller than order (B), the directed edge a → B is replaced by B → a, if no directed loop is generated, the order of A, B is exchanged, if a directed loop still exists, the directed edge a → B is not retained, and if order (a) is larger than order (B), the directed edge a → B → a is replaced by directed edge a → B → a.
(2) When | P (B ═ T | a ═ T) -P (a ═ T | B ═ T) | < α, the order in which representation A, B appears is not important, and there remains a directed edge a → B, where order (a) < order (B).
step3. step1 is re-executed until the problems in the conditional probability table have all been traversed.
S503: and generating a Bayesian network model according to the conditional probability table corresponding to each problem and the directed acyclic graph.
As can be seen from the above, in the method, the conditional probability corresponding to each question in the knowledge base is determined through the historical question-answer records, the conditional probability corresponding to each question in the knowledge base is converted into a directed acyclic graph in consideration of the premise that the bayesian network must be a directed acyclic graph, then, a bayesian network model is generated according to the conditional probability table and the directed acyclic graph corresponding to each question, the bayesian network model can determine the conditional probability corresponding to any question in the knowledge base, the question with the greater relevance to the question to be answered can be selected based on the conditional probability, and the question is used as a guidance question, so that the guidance effect is better. Moreover, related guide problems do not need to be manually set aiming at all the problems in advance, even if the knowledge base is updated, the guide problems can be determined only by re-determining the first conditional probability, and the maintenance cost is reduced.
In this embodiment, as the number of access times of the intelligent question-answering system is continuously increased, the historical question-answering records are continuously updated, and the terminal can also update the bayesian model based on the updated historical question-answering records, so that the prediction accuracy of the bayesian model is improved, and the guiding effect of the guiding questions determined by the bayesian model is further improved.
Aiming at updating of a Bayesian model, the embodiment of the application provides an implementation mode. Specifically, the terminal periodically collects historical question-answer records of the intelligent question-answer system, generates a Bayesian network model corresponding to the current period according to the historical question-answer records collected by the current period, and then updates the Bayesian network model corresponding to the previous period by using the Bayesian network model corresponding to the current period. The Bayesian network model comprises a directed acyclic graph determined according to the problems in the knowledge base and a conditional probability table corresponding to each problem in the knowledge base.
In order to make the technical scheme of the present application clearer and easier to understand, the intelligent question answering method according to the embodiment of the present application will be introduced below with reference to a specific application scenario.
Referring to fig. 7, a schematic diagram of an application scenario of the intelligent question-answering method in triage diagnosis is shown, where the application scenario includes a triage diagnosis guide robot 710, which maintains a triage diagnosis guide system, a user proposes a question through the triage diagnosis guide robot, the triage diagnosis guide robot 710 obtains a corresponding answer from a knowledge base and displays the answer, and meanwhile, the triage diagnosis guide robot determines a first condition probability corresponding to each of other questions in the knowledge base under a condition that a current question is proposed through a bayesian network model, and selects a guide question corresponding to the current question from the knowledge base according to the first condition probability, and displays the guide question.
In this scenario, the user first asks: "how to register fever" actually causes many diseases with fever symptoms, and therefore most users ask another symptom after fever, for example, when fever symptoms occur, the questions asking about "abdominal pain" account for 20%, the questions asking about "cough" account for 60%, and the questions asking about "headache" account for 12%, which are not listed here. At this point, referring to interface 711, the triage referral robot 710 answers: "please hang internal medicine emergency call for fever", still show the guide problem that this problem corresponds simultaneously, specifically as follows:
1. "is a persistent fever in need of hospitalization? "
"how to treat cough? "
"where the abdominal pain goes to register? "
At this point, if the user continues to ask "headache," the probability of other questions under the headache question increases, at which point, referring to interface 712, the triage referral robot 710 answers: "upper respiratory tract infection, please hang internal medicine emergency call", while in combination with the context, the guidance questions are shown as follows:
"what medicine is taken by migraine? "
"how do headache register and see a doctor? "
"how to register for doctor for diagnosis? "
At this time, if the user clicks the third "how to register the spasm for his/her treatment", according to the bayesian network model, on the lines "fever", "headache" and "spasm", the probability of the user getting rabies will be increased, and at this time, referring to the interface 713, the answer of the triage referral robot 710 is: "you are good, children have fever and convulsion and please hang in pediatric emergency treatment, and if convulsion caused by hyperpyrexia can hang in neurosurgery". Meanwhile, the guiding problem is added with the problem related to rabies-related symptoms and the like, so that the user can select whether to inquire the problem according to the self condition so as to determine whether to infect rabies, and the guiding problem is specifically as follows:
"what family is a child spasm hanging? "
"how to register for a doctor for a muscle spasm? "
"what do you fear seeing water? "
If the user clicks a third bar again, "see what is afraid of water? "see interface 714, the question returns" you are suspected of rabies and please go to the infectious department for a visit! "
If the user does not input the previous information of fever and headache, the user directly inputs the information of how to register the spasm for treatment, and the guiding problem is that:
1 "what family is children spastic? "
2 "how do the muscle spasm to register for a doctor? "
3 "is blepharospasm in need of surgical treatment? "
Therefore, aiming at the same problem, such as ' how to register and see a doctor ' for a spasm ', the guiding problem determined by considering the context is different, the method determines the guiding problem corresponding to the problem to be answered by utilizing the Bayesian model based on the context relation between the problem to be answered and other problems in the knowledge base, has better guiding effect, does not need to manually set related guiding problems aiming at each problem in advance, and can determine the guiding problem only by re-determining the first condition probability even if the knowledge base is updated, thereby reducing the maintenance cost.
Based on the above specific implementation manners of the intelligent question answering method provided by the embodiment of the present application, the embodiment of the present application further provides a corresponding device, and the device provided by the embodiment of the present application will be introduced from the perspective of function modularization.
Referring to a schematic structural diagram of the intelligent question answering device shown in fig. 8, the device 800 includes:
a first determination module 810 for determining a question to be answered;
a second determining module 820, configured to determine, for each question except the question to be answered in the knowledge base, a probability of occurrence of each question under a condition that the question to be answered occurs by using a bayesian network model, as a first conditional probability corresponding to each question;
a first selection module 830, configured to select, according to the first conditional probability, a guidance question corresponding to the question to be answered from the knowledge base;
the display module 840 is configured to display the guidance question corresponding to the question to be answered.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring historical question answering records of the intelligent question answering system;
and the generating module is used for generating the Bayesian network model according to the historical question-answer records, wherein the Bayesian network model comprises a directed acyclic graph determined according to the questions in the knowledge base and a conditional probability table corresponding to each question in the knowledge base.
Optionally, the apparatus further comprises:
the acquisition module is used for periodically acquiring historical question answering records of the intelligent question answering system;
the generating module is used for generating a Bayesian network model corresponding to the current period according to the historical question-answer records collected by the current period;
and the updating module is used for updating the Bayesian network model corresponding to the previous period by using the Bayesian network model corresponding to the current period, and the Bayesian network model comprises a directed acyclic graph determined according to the problems in the knowledge base and a conditional probability table corresponding to each problem in the knowledge base.
Optionally, the generating module is specifically configured to:
determining conditional probability among the questions in the knowledge base according to the collected historical question-answer records, and determining a conditional probability table corresponding to each question;
converting the conditional probability corresponding to each question in the knowledge base into a directed acyclic graph;
and generating a Bayesian network model according to the conditional probability table corresponding to each problem and the directed acyclic graph.
Optionally, the apparatus further comprises:
a third determining module, configured to, when the first conditional probability corresponding to each question is smaller than a first threshold, calculate, for each question except the question to be answered in the knowledge base, a weighted sum value of the word frequency reverse file frequency and the first conditional probability corresponding to each question as a score value corresponding to the question;
and the second selection module is used for determining a guide question corresponding to the question to be answered according to the score value.
Optionally, the first selecting module 830 is specifically configured to:
selecting the question with the first conditional probability larger than a second threshold value from the knowledge base as a guide question corresponding to the question to be answered; or,
and selecting N questions ranked at the top from the knowledge base as guide questions corresponding to the questions to be answered according to the sequence of the first conditional probabilities from large to small, wherein N is a positive integer.
Therefore, the embodiment of the application provides an intelligent question-answering device, which determines a guide question corresponding to a question to be answered by using a bayesian model based on the context between the question to be answered and other questions in a knowledge base. Specifically, the questions to be answered are determined, aiming at each question except the questions to be answered in the knowledge base, the occurrence probability of each question under the condition that the question to be answered appears is determined by using a Bayesian model, the occurrence probability serves as the first conditional probability of each question, the first conditional probability can represent the context relationship between the question and the question to be answered, and on the basis of the first conditional probability, the question with strong relevance can be selected from the knowledge base as the guide question corresponding to the question to be answered. On one hand, related guide problems do not need to be manually set for each problem in advance, even if the knowledge base is updated, the guide problems can be determined only by re-determining the first conditional probability, and the maintenance cost is reduced; on the other hand, the context relationship is considered when the guiding question is determined, and the guiding question has strong relevance with the question to be answered, so that a good guiding effect is achieved.
The embodiment of the application also provides equipment, which can be specifically a terminal and is used for realizing the intelligent question answering method provided by the application. As shown in fig. 9, for convenience of explanation, only the parts related to the embodiments of the present application are shown, and details of the technology are not disclosed, please refer to the method part of the embodiments of the present application. The terminal may be any terminal device including a Point of Sales (POS), a vehicle-mounted computer, a greeting robot, a triage guide robot, and the like, taking the terminal as an example of the triage guide robot:
fig. 9 is a block diagram illustrating a partial structure related to a terminal provided in an embodiment of the present application. Referring to fig. 9, the triage lead robot includes: a memory 910, a processor 920, an input unit 930, a display unit 940, and a power supply 950. Optionally, the triage lead robot may also include an audio circuit 960. Those skilled in the art will appreciate that the configuration of the triage lead robot shown in fig. 9 does not constitute a limitation of the triage lead robot, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
The components of the diagnosis and diagnosis guide robot will be described in detail with reference to fig. 9.
The memory 910 may be used to store software programs and modules, and the processor 920 may execute various functional applications and data processing of the triage guiding robot by operating the software programs and modules stored in the memory 910. The memory 910 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phone book, etc.) created according to the use of the triage lead robot, and the like. Further, the memory 910 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 920 is a control center of the triage guiding robot, connects various parts of the entire triage guiding robot by using various interfaces and lines, and performs various functions and processes of the triage guiding robot by operating or executing software programs and/or modules stored in the memory 910 and calling data stored in the memory 910, thereby performing overall monitoring of the triage guiding robot. Optionally, processor 920 may include one or more processing units; preferably, the processor 920 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 920.
The input unit 930 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the triage guiding robot. Specifically, the input unit 930 may include a touch panel 931 and other input devices 932. The touch panel 931, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 931 (e.g., a user's operation on or near the touch panel 931 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a preset program. Alternatively, the touch panel 931 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 980, and can receive and execute commands sent by the processor 980. In addition, the touch panel 931 may be implemented by various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 930 may include other input devices 932 in addition to the touch panel 931. In particular, other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 940 may be used to display information input by the user or information provided to the user and various menus of the triage guiding robot. The Display unit 940 may include a Display panel 941, and optionally, the Display panel 941 may be configured by using a Liquid Crystal Display (LCD), an organic light-Emitting Diode (OLED), and the like. Further, the touch panel 931 can cover the display panel 941, and when the touch panel 931 detects a touch operation on or near the touch panel 931, the touch panel transmits the touch operation to the processor 920 to determine the type of the touch event, and then the processor 920 provides a corresponding visual output on the display panel 941 according to the type of the touch event. Although in fig. 9, the touch panel 931 and the display panel 941 are two independent components to implement the input and output functions of the triage guiding robot, in some embodiments, the touch panel 931 and the display panel 941 may be integrated to implement the input and output functions of the triage guiding robot.
The triage lead robot further includes a power supply 950 (e.g., a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the processor 920 through a power management system, so as to manage charging, discharging, and power consumption management functions through the power management system.
Although not shown, the triage lead robot may further include a camera, a bluetooth module, a WIreless-fidelity (Wi-Fi) module, a Radio Frequency (RF) circuit, a sensor, and the like, which will not be described herein.
In this embodiment, the processor 920 included in the terminal further has the following functions:
determining a question to be answered;
for each question except the question to be answered in the knowledge base, determining the probability of the occurrence of each question under the condition of the occurrence of the question to be answered by using a Bayesian network model, and taking the probability as a first conditional probability corresponding to each question;
selecting a guide question corresponding to the question to be answered from the knowledge base according to the first conditional probability;
and displaying the guide question corresponding to the question to be answered.
Optionally, the processor 920 is further configured to execute the steps of any implementation manner of the intelligent question answering method provided in the embodiment of the present application.
The embodiment of the present application further provides a computer-readable storage medium, configured to store a program code, where the program code is configured to execute any one implementation manner of the intelligent question answering method described in the foregoing embodiments.
The present application further provides a computer program product including instructions, which when run on a computer, causes the computer to execute any one implementation of the intelligent question answering method described in the foregoing embodiments.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.
Claims (9)
1. An intelligent question-answering method, characterized in that the method comprises:
determining a question to be answered;
aiming at each question except the question to be answered in a knowledge base, determining the probability of the occurrence of each question under the condition of the occurrence of the question to be answered by utilizing a Bayesian network model, and taking the probability as a first conditional probability corresponding to each question;
selecting a guide question corresponding to the question to be answered from the knowledge base according to the first conditional probability;
displaying a guide question corresponding to the question to be answered;
generating a Bayesian network model by: determining conditional probability among the questions in the knowledge base according to the collected historical question-answer records, and determining a conditional probability table corresponding to each question; converting the conditional probability corresponding to each question in the knowledge base into a directed acyclic graph; generating a Bayesian network model according to the conditional probability table corresponding to each problem and the directed acyclic graph;
the converting the conditional probability corresponding to each question in the knowledge base into a directed acyclic graph includes:
selecting two questions from the conditional probability table, wherein the two questions are a first question and a second question;
if the second conditional probability is not equal to 0 and the sequence number of the first problem is smaller than that of the second problem, forming a directed edge pointing to the second problem by the first problem; the second conditional probability is the probability of the second problem when the first problem occurs;
when the subtraction of the third conditional probability from the second conditional probability is larger than a preset threshold, if the sequence number of the first problem is smaller than the sequence number of the second problem, the directed edge of the first problem pointing to the second problem is reserved, if the sequence number of the first problem is larger than the sequence number of the second problem, the directed edge of the first problem pointing to the second problem is replaced by the directed edge of the second problem pointing to the first problem, if no directed ring is generated, the sequence numbers of the first problem and the second problem are exchanged, and if the directed ring exists after the replacement, the directed edge of the first problem pointing to the second problem is not reserved; the third conditional probability is the probability of the first problem when the second problem occurs;
when the subtraction of the third conditional probability from the second conditional probability is smaller than a negative preset threshold, if the sequence number of the first problem is smaller than the sequence number of the second problem, replacing the directed edge of the first problem pointing to the second problem with the directed edge of the second problem pointing to the first problem, if no directed ring is generated, replacing the sequence numbers of the first problem and the second problem, if the directed ring exists after replacement, not reserving the directed edge of the first problem pointing to the second problem, and if the sequence number of the first problem is larger than the sequence number of the second problem, replacing the directed edge of the first problem pointing to the second problem with the directed edge of the second problem pointing to the first problem;
when the absolute value of the second conditional probability minus the third conditional probability is smaller than a preset threshold, keeping the directed edge of the first question pointing to the second question, wherein the sequence number of the first question is smaller than that of the second question;
and re-executing the selection of the two problems from the conditional probability table until the problems in the conditional probability table are all traversed.
2. The intelligent question-answering method according to claim 1, characterized in that the method further comprises:
collecting historical question answering records of an intelligent question answering system;
and generating the Bayesian network model according to the historical question-answer records, wherein the Bayesian network model comprises a directed acyclic graph determined according to the questions in the knowledge base and a conditional probability table corresponding to each question in the knowledge base.
3. The intelligent question-answering method according to claim 1, characterized in that the method further comprises:
periodically collecting historical question answering records of the intelligent question answering system;
generating a Bayesian network model corresponding to the current period according to the historical question-answer records collected by the current period;
and updating the Bayesian network model corresponding to the previous period by using the Bayesian network model corresponding to the current period, wherein the Bayesian network model comprises a directed acyclic graph determined according to the problems in the knowledge base and a conditional probability table corresponding to each problem in the knowledge base.
4. The intelligent question-answering method according to claim 1, characterized in that the method further comprises:
when the first conditional probability corresponding to each question is smaller than a first threshold, calculating the weighted sum of the word frequency reverse file frequency and the first conditional probability corresponding to each question as a score value corresponding to the question aiming at each question except the question to be answered in the knowledge base;
and determining a guide question corresponding to the question to be answered according to the score value.
5. The method according to any one of claims 1 to 3, wherein the selecting the guide question corresponding to the question to be answered from the knowledge base according to the first conditional probability comprises:
selecting the question with the first conditional probability larger than a second threshold value from the knowledge base as a guide question corresponding to the question to be answered; or,
and selecting N questions ranked at the top from the knowledge base as guide questions corresponding to the questions to be answered according to the sequence of the first conditional probabilities from large to small, wherein N is a positive integer.
6. An intelligent question answering device, characterized in that the device comprises:
a first determination module for determining a question to be answered;
a second determining module, configured to determine, for each question except the question to be answered in the knowledge base, a probability of occurrence of each question under a condition of occurrence of the question to be answered by using a bayesian network model, as a first conditional probability corresponding to each question;
the first selection module is used for selecting the guide question corresponding to the question to be answered from the knowledge base according to the first conditional probability;
the display module is used for displaying the guide question corresponding to the question to be answered;
generating a Bayesian network model by: determining conditional probability among the questions in the knowledge base according to the collected historical question-answer records, and determining a conditional probability table corresponding to each question; converting the conditional probability corresponding to each question in the knowledge base into a directed acyclic graph; generating a Bayesian network model according to the conditional probability table corresponding to each problem and the directed acyclic graph;
the converting the conditional probability corresponding to each question in the knowledge base into a directed acyclic graph includes:
selecting two questions from the conditional probability table, wherein the two questions are a first question and a second question;
if the second conditional probability is not equal to 0 and the sequence number of the first problem is smaller than that of the second problem, forming a directed edge pointing to the second problem by the first problem; the second conditional probability is the probability of the second problem when the first problem occurs;
when the subtraction of the third conditional probability from the second conditional probability is larger than a preset threshold, if the sequence number of the first problem is smaller than the sequence number of the second problem, the directed edge of the first problem pointing to the second problem is reserved, if the sequence number of the first problem is larger than the sequence number of the second problem, the directed edge of the first problem pointing to the second problem is replaced by the directed edge of the second problem pointing to the first problem, if no directed ring is generated, the sequence numbers of the first problem and the second problem are exchanged, and if the directed ring exists after the replacement, the directed edge of the first problem pointing to the second problem is not reserved; the third conditional probability is the probability of the first problem when the second problem occurs;
when the subtraction of the third conditional probability from the second conditional probability is smaller than a negative preset threshold, if the sequence number of the first problem is smaller than the sequence number of the second problem, replacing the directed edge of the first problem pointing to the second problem with the directed edge of the second problem pointing to the first problem, if no directed ring is generated, replacing the sequence numbers of the first problem and the second problem, if the directed ring exists after replacement, not reserving the directed edge of the first problem pointing to the second problem, and if the sequence number of the first problem is larger than the sequence number of the second problem, replacing the directed edge of the first problem pointing to the second problem with the directed edge of the second problem pointing to the first problem;
when the absolute value of the second conditional probability minus the third conditional probability is smaller than a preset threshold, keeping the directed edge of the first question pointing to the second question, wherein the sequence number of the first question is smaller than that of the second question;
and re-executing the selection of the two problems from the conditional probability table until the problems in the conditional probability table are all traversed.
7. The intelligent question answering device according to claim 6, characterized in that the device further comprises:
the acquisition module is used for acquiring historical question answering records of the intelligent question answering system;
and the generating module is used for generating the Bayesian network model according to the historical question-answer records, wherein the Bayesian network model comprises a directed acyclic graph determined according to the questions in the knowledge base and a conditional probability table corresponding to each question in the knowledge base.
8. An apparatus, comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the intelligent question answering method according to instructions in the program code, according to any one of claims 1 to 5.
9. A computer-readable storage medium for storing a program code for executing the intelligent question answering method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811520542.6A CN109582778B (en) | 2018-12-12 | 2018-12-12 | Intelligent question and answer method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811520542.6A CN109582778B (en) | 2018-12-12 | 2018-12-12 | Intelligent question and answer method, device, equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109582778A CN109582778A (en) | 2019-04-05 |
CN109582778B true CN109582778B (en) | 2020-10-27 |
Family
ID=65929530
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811520542.6A Active CN109582778B (en) | 2018-12-12 | 2018-12-12 | Intelligent question and answer method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109582778B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110309284B (en) * | 2019-06-28 | 2021-08-06 | 广州探迹科技有限公司 | Automatic answer method and device based on Bayesian network reasoning |
US11501211B2 (en) | 2020-03-13 | 2022-11-15 | Hong Kong Applied Science And Technology Research Institute Co., Ltd | Chatbot system with model lifecycle management |
CN112528010B (en) * | 2020-12-15 | 2022-09-02 | 建信金融科技有限责任公司 | Knowledge recommendation method and device, computer equipment and readable storage medium |
CN114860912B (en) * | 2022-05-20 | 2023-08-29 | 马上消费金融股份有限公司 | Data processing method, device, electronic equipment and storage medium |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108763284A (en) * | 2018-04-13 | 2018-11-06 | 华南理工大学 | A kind of question answering system implementation method based on deep learning and topic model |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9792281B2 (en) * | 2015-06-15 | 2017-10-17 | Microsoft Technology Licensing, Llc | Contextual language generation by leveraging language understanding |
CN105554139B (en) * | 2015-12-24 | 2018-09-21 | 上海智臻智能网络科技股份有限公司 | Online customer service method of servicing, online customer service server and online customer service system |
US10642875B2 (en) * | 2017-04-28 | 2020-05-05 | International Business Machines Corporation | Accurate relationship extraction with word embeddings using minimal training data |
CN107807968B (en) * | 2017-10-13 | 2020-02-18 | 深圳壹账通智能科技有限公司 | Question answering device and method based on Bayesian network and storage medium |
CN108509617A (en) * | 2018-04-04 | 2018-09-07 | 上海智臻智能网络科技股份有限公司 | Construction of knowledge base, intelligent answer method and device, storage medium, the terminal in knowledge based library |
-
2018
- 2018-12-12 CN CN201811520542.6A patent/CN109582778B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108763284A (en) * | 2018-04-13 | 2018-11-06 | 华南理工大学 | A kind of question answering system implementation method based on deep learning and topic model |
Also Published As
Publication number | Publication date |
---|---|
CN109582778A (en) | 2019-04-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109582778B (en) | Intelligent question and answer method, device, equipment and medium | |
CN109635098B (en) | Intelligent question and answer method, device, equipment and medium | |
CN110033851B (en) | Information recommendation method and device, storage medium and server | |
EP3660854B1 (en) | Triage dialogue method, device, and system | |
US11769164B2 (en) | Interactive behavioral polling for amplified group intelligence | |
JP7108720B2 (en) | Knowledge sharing method between dialogue systems, dialogue method, knowledge sharing device, dialogue device, electronic device and storage medium | |
CN111552880A (en) | Data processing method, device and medium based on knowledge graph and electronic equipment | |
JP5299965B2 (en) | Instruction support system and instruction support information display device | |
US9305059B1 (en) | Methods, systems, and computer readable media for dynamically selecting questions to be presented in a survey | |
CN103164616A (en) | Intelligent hospital guide system and intelligent hospital guide method | |
CN110347781B (en) | Article reverse arrangement method, article recommendation method, device, equipment and storage medium | |
CN110838359A (en) | Triage method and device based on conversation robot, storage medium and robot | |
US20230274151A1 (en) | Multi-modal neural network architecture search | |
JP6397146B1 (en) | Learning support apparatus and program | |
KR102333818B1 (en) | Method for sharing health information | |
JP5615142B2 (en) | Instruction writing support system and method | |
CN111652673B (en) | Intelligent recommendation method, device, server and storage medium | |
US20190160333A1 (en) | Adaptive fitness training | |
Zandi et al. | Exploring User Interactions in AR/VR Interfaces: A Simulation-Based Study | |
CN117573946A (en) | Dialogue sample generation method, chat dialogue large model training method and related devices | |
WO2023196456A1 (en) | Adaptive wellness collaborative media system | |
CN113573091A (en) | Family rehabilitation software system and man-machine interaction method applied to family rehabilitation | |
CN114115961A (en) | Application program management method and device and electronic equipment | |
CN111858863B (en) | Reply recommendation method, reply recommendation device and electronic equipment | |
CN109360631B (en) | Man-machine interaction method and device based on picture recognition, computer equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |