CN107807968B - Question answering device and method based on Bayesian network and storage medium - Google Patents

Question answering device and method based on Bayesian network and storage medium Download PDF

Info

Publication number
CN107807968B
CN107807968B CN201710955002.XA CN201710955002A CN107807968B CN 107807968 B CN107807968 B CN 107807968B CN 201710955002 A CN201710955002 A CN 201710955002A CN 107807968 B CN107807968 B CN 107807968B
Authority
CN
China
Prior art keywords
bayesian network
question
user
parameters
acyclic graph
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710955002.XA
Other languages
Chinese (zh)
Other versions
CN107807968A (en
Inventor
徐国强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN201710955002.XA priority Critical patent/CN107807968B/en
Priority to PCT/CN2018/077344 priority patent/WO2019071904A1/en
Publication of CN107807968A publication Critical patent/CN107807968A/en
Application granted granted Critical
Publication of CN107807968B publication Critical patent/CN107807968B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

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

Abstract

The invention provides a question-answering method based on a Bayesian network, which comprises the following steps: receiving and analyzing a question input by a user through a client to identify a target parameter representing the intention of the user and an attribute parameter associated with the target parameter from the question; inputting the target parameters and the attribute parameters into a pre-trained Bayesian network model, and deducing values of the target parameters by utilizing a directed acyclic graph and a conditional probability table set of the Bayesian network model; and feeding back the value of the target parameter deduced by the Bayesian network model to the user. The method carries out causal reasoning on the question and answers the questions put forward by the user based on the reasoning result. The invention also provides a question answering device based on the Bayesian network and a computer readable storage medium.

Description

Question answering device and method based on Bayesian network and storage medium
Technical Field
The invention relates to the technical field of human-computer interaction, in particular to a question answering device and method based on a Bayesian network and a computer readable storage medium.
Background
Human-computer interaction is the science of studying the interactive relationships between systems and users. The system may be a variety of machines, and may be a computerized system and software, among others. Various artificial intelligence systems can be realized through man-machine interaction, such as an intelligent customer service system, a voice control system and the like. The intelligent question-answering system is a typical application of human-computer interaction, and automatically replies answers to questions to users after the users put the questions. However, most of the existing intelligent question-answering systems are obtained by searching texts or knowledge bases, and do not have deep reasoning capability.
Disclosure of Invention
The invention provides a question answering device and method based on a Bayesian network and a computer readable storage medium, and mainly aims to enable an intelligent question answering process to have deep reasoning capability.
To achieve the above object, the present invention provides a question answering device based on a bayesian network, the device comprising: a memory having a Bayesian network based question-answering program stored thereon, the Bayesian network based question-answering program when executed by the processor implementing the steps of:
parameter extraction: receiving and analyzing a question input by a user through a client to identify a target parameter representing the intention of the user and an attribute parameter associated with the target parameter from the question;
and (3) an inference step: inputting the target parameters and the attribute parameters into a pre-trained Bayesian network model, and deducing values of the target parameters by utilizing a directed acyclic graph and a conditional probability table set of the Bayesian network model; and
an answer generation step: and feeding back the value of the target parameter deduced by the Bayesian network model to the user.
Preferably, the method for constructing a model of a bayesian network specifically comprises the steps of:
extracting attributes associated with the default customers from each piece of historical default data of the historical service data, and calculating condition mutual information values among the attributes;
sorting the conditional mutual information values of all attributes in a descending order, selecting an attribute pair with a high conditional mutual information value as a node, constructing a maximum weight span tree according to the principle of no loop generation until n-1 edges are selected for n nodes to form a directed acyclic graph;
determining a root node of each node in the undirected acyclic graph, wherein the direction from the root node to the child nodes is the direction between the nodes, and changing the undirected acyclic graph into a directed acyclic graph; and
and calculating the conditional probability among random variables represented by each node in the directed acyclic graph according to historical service data to obtain a conditional probability table set of the Bayesian network model.
Preferably, the parameter extracting step includes:
and converting the extracted target parameters and attribute parameters into parameters in a standard format.
Preferably, the answer generating step includes:
and converting the values of the target parameters deduced by the Bayesian network model into texts, and feeding back the results in the text format as answers to the user.
In addition, to achieve the above object, the present invention further provides a question-answering method based on a bayesian network, including:
parameter extraction: receiving and analyzing a question input by a user through a client to identify a target parameter representing the intention of the user and an attribute parameter associated with the target parameter from the question;
and (3) an inference step: inputting the target parameters and the attribute parameters into a pre-trained Bayesian network model, and deducing values of the target parameters by utilizing a directed acyclic graph and a conditional probability table set of the Bayesian network model; and
an answer generation step: and feeding back the value of the target parameter deduced by the Bayesian network model to the user.
Preferably, the method for constructing a model of a bayesian network specifically comprises the steps of:
extracting attributes associated with the default customers from each piece of historical default data of the historical service data, and calculating condition mutual information values among the attributes;
sorting the conditional mutual information values of all attributes in a descending order, selecting an attribute pair with a high conditional mutual information value as a node, constructing a maximum weight span tree according to the principle of no loop generation until n-1 edges are selected for n nodes to form a directed acyclic graph;
determining a root node of each node in the undirected acyclic graph, wherein the direction from the root node to the child nodes is the direction between the nodes, and changing the undirected acyclic graph into a directed acyclic graph; and
and calculating the conditional probability among random variables represented by each node in the directed acyclic graph according to historical service data to obtain a conditional probability table set of the Bayesian network model.
Preferably, the parameter extracting step includes:
and converting the extracted target parameters and attribute parameters into parameters in a standard format.
Preferably, the answer generating step includes:
and converting the values of the target parameters deduced by the Bayesian network model into texts, and feeding back the results in the text format as answers to the user.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a bayesian network-based question-answering program, which when executed by a processor, implements the steps of the bayesian network-based question-answering method as described above.
Compared with the prior art, the question answering device and method based on the Bayesian network and the computer readable storage medium provided by the invention can carry out causal reasoning on the question sentence input by the user through the Bayesian network model and answer the question proposed by the user based on the reasoning result. User requirements are understood in a natural conversation mode, and user interaction experience is improved.
Drawings
FIG. 1 is a schematic diagram of a preferred embodiment of a Bayesian network-based question answering device according to the present invention;
FIG. 2 is a block diagram of the Bayesian network based question answering program of FIG. 1;
FIG. 2a is a schematic view of an undirected acyclic graph in a Bayesian network model;
FIG. 2b is a schematic diagram of a directed acyclic graph in a Bayesian network model;
FIG. 2c is a schematic diagram of a set of probability tables in a Bayesian network model;
FIG. 3 is a flow chart of a preferred embodiment of the Bayesian network-based question answering method of the present invention;
fig. 4 is a flowchart of a specific structure of the bayesian network model in the question-answering method based on the bayesian network of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a question answering device 1 based on a Bayesian network. Referring to fig. 1, a diagram of a question answering device 1 based on a bayesian network according to a preferred embodiment of the present invention is shown.
In the present embodiment, the bayesian-network-based question answering device 1 may be an electronic device having an arithmetic function, such as a smartphone, a tablet computer, an electronic book reader, and a portable computer.
The bayesian network-based question answering device 1 includes a memory 11, a processor 12, a display 13, a communication bus 14, and a network interface 15. The device obtains service data from a service database through a network.
The storage 11 includes a memory and at least one type of readable storage medium. The memory provides cache for the operation of the mobile terminal; the readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card type memory, and the like. In some embodiments, the readable storage medium may be an internal storage unit of the bayesian network based question-answering device 1, such as a hard disk of the bayesian network based question-answering device 1. In other embodiments, the readable storage medium may also be an external storage device of the bayesian network based question answering device 1, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the bayesian network based question answering device 1.
In the present embodiment, the readable storage medium of the memory 11 is generally used for storing application software installed in the bayesian network based question-answering device 1 and historical business data, such as the bayesian network based question-answering program 10, customer historical default data, and the like. The memory 11 may also be used to temporarily store data that has been output or is to be output.
The processor 12 may be, in some embodiments, a Central Processing Unit (CPU), microprocessor or other data Processing chip for executing program codes stored in the memory 11 or Processing data, such as executing the bayesian-based question-answering program 10, to implement any of the steps of the bayesian-based question-answering method described below.
The display 13 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch panel, or the like in some embodiments. The display 13 is used to display the results processed in the bayesian network-based question-answering apparatus 1 and a visualized user interface.
The communication bus 14 is used to enable connection communication between these components.
The network interface 15 is mainly used for connecting a server and performing data communication with the server.
Preferably, the bayesian network based question answering device 1 may further comprise a user interface, including a standard wired interface, a wireless interface. The optional user interface may include an input unit such as a Keyboard (Keyboard), a voice input device such as a microphone (microphone) or the like having a voice recognition function, a voice output device such as a stereo, a headphone, or the like.
Preferably, when the bayesian network based question answering device 1 is a mobile electronic device, such as a mobile phone, at least one sensor, such as a light sensor, a motion sensor, and other sensors, may be further included. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel according to the brightness of ambient light, and the proximity sensor can turn off the display panel and/or the backlight when the mobile phone moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
Fig. 1 shows only a bayesian network based question-answering apparatus 1 with components 11-14 and a bayesian network based question-answering program 10, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
Fig. 2 is a block diagram of a preferred embodiment of the bayesian network based question answering program 10 of fig. 1.
In this embodiment, the bayesian network based question-answering program 10 can be divided into a parameter extraction module 110, an inference module 120 and an answer generation module 130. The modules are stored in the memory 11 and executed by the one or more processors 12 to implement the present invention. The modules referred to herein are referred to as a series of computer program instruction segments capable of performing specified functions. The following description will specifically describe the operations and functions implemented by the parameter extraction module 110, the inference module 120, and the answer generation module 130.
The parameter extraction module 110 is configured to receive and parse a question input by a user through a client, so as to identify a target parameter representing an intention of the user and an attribute parameter associated with the target parameter from the question.
For a given text, the parameter extraction module 110 will parse the specific text into the parameters in the standard format, which is mainly divided into two parts, namely a rule template unit 111 and a probability discrimination unit 112.
The rule template unit 111 is mainly configured by using a regular expression and a specific syntactic structure, wherein the regular expression is used for extracting parameters, and the specific syntactic structure is used for mapping the extracted parameters in a standard format. And applying a regular expression and a preset grammar structure, extracting parameters from a character string contained in a natural language question input by a user by using the regular expression, and analyzing the extracted parameters into the preset grammar structure for outputting. The regular expression is a logic formula for operating on character strings, and a 'regular character string' is formed by using specific characters defined in advance and a combination of the specific characters, and is used for expressing a filtering logic for the character string. For example, a rule template for "age" is as follows:
Figure GDA0002289312060000061
that is, the customer's age is assigned in segments, with an assignment of 0 under 25 years, 1 under 25-30 years, 2 under 31-35 years, etc.
Similarly, the academic records of the clients are also assigned in a classified manner, wherein the academic records are assigned to 0 in the primary school-junior middle school, 1 in the senior middle school, 2 in the subject, 3 in the master students and the like.
Similarly, the income of the customers is also classified and assigned, the income per year is assigned to 0 under 50000 yuan, 1 under 50000-100000 yuan, 2 under 100000-200000 yuan and 3 under 200000 yuan.
The probability discrimination unit 112 is mainly trained through the samples and the corresponding classification models thereof, and is used for calculating the probabilities of a plurality of potential results of a section of text, and selecting a result which can represent the intention of the user most for analysis. And screening a data structure which best meets the user intention from all data structures of the natural language question by using a machine learning model. For example, the machine learning model may be a naive bayes-based classification model that is derived based on training of a large number of natural language question sentences and data structure training corpora. For example, the user enters a question: "loan 10 ten thousand XXXX bank personal car purchase loan is how much more and less money per month". The user's intent is "interest calculation" and the rule template unit 111 extracts the parameters "XXXX bank", "personal car purchase loan", "month", "10 ten thousand". The generated data structure may include:
data structure 1: (| fb: property. context. LoanAmountRange (argmax (number 1)) (number 10) (and (fb: type. lan. N fb: oranN. gerengoudaikuan 1) (fb: type. lan. company. fb: company. XXXXXX)) (reverse (lambda x (| fb: random. entry. rank (varx))))))
Data structure 2: (| fb: property. context. MonthFeeRate (| fb: property. context. LoanAmountRange fb: company.XXXX))
Data structure 3: fb company.XXXX
Data structure 4: (| fb: property. continuously. MonthFeeRated (| fb: property. continuously. MonthFeeRate) (and (fb: type. LOANNfb: LOANN. GERNGUCHEDAIKUAN1) (fb: type. LOANN. COMPANY. FB: COMPANY. XXXXX)) (fb: property. continuously. LoANAmountRange (fb: property. attribute. Max AmountRange ()))) (number100000))
After the 4 data structures are subjected to the naive bayes classification model, the probability discriminating unit 112 screens out one data structure from the 4 data structures as a data structure which can represent the user's intention most.
Further, the parameter extraction module 110 is further configured to convert the extracted target parameters and attribute parameters into parameters in a standard format. For example, the question "how much overdue is for a major research student whose annual income is 300000 dollars? "the standard mapping case for the parameters includes: annual income-recovery _ incomes-300000 Yuan-3, academic-education-Master-3, repayment-debt-overdue-1. Then, the question would be parsed as follows:
Figure GDA0002289312060000071
Figure GDA0002289312060000081
the inference module 120 is configured to input the target parameter and the attribute parameter into a pre-trained bayesian network model, and infer a value of the target parameter by using a directed acyclic graph and a conditional probability table set of the bayesian network model.
The inference of the Bayesian network is to calculate the probability of the values of other nodes after the attribute values of the nodes are given by using the structure of the Bayesian network and the conditional probability table thereof. The method adopts a message passing algorithm to carry out accurate reasoning, which is mainly to allocate a processor to each node, each processor can calculate by using the probability transmitted by adjacent nodes and the conditional probability stored in the processor to obtain the posterior probability of the processor, and the calculation result is transmitted to the adjacent nodes.
For example, when a question becomes "how much overdue rate is for a client whose annual income is 300000? "then, the client attributes appearing in the question are only annual income-receiver _ income-300000 yuan-3, repayment case-debt-overdue-1. According to the directed acyclic graph and the conditional probability table, when the annual income of the client is determined, the probability of overdue payment of the client can be estimated according to the academic situations of the client, namely, different academic situations can influence the probability of overdue payment of the client.
The answer generating module 130 is configured to feed back a value of the target parameter inferred by the bayesian network model to the user.
When a user inputs a question into the bayesian network model, the values of the target parameters are obtained as follows:
key:income=3,education=3;debt=1;value:0.01935
in order to make the result more intuitive, the answer generation module 130 converts the output target parameter values in the standard data format into a text, and feeds back the result in the text form as an answer to the user. The result after the value conversion of the target parameter is as follows:
the overdue rate for a major research student with an annual income of 300000 yuan is 1.935%.
According to the question-answering system based on the Bayesian network, the user requirements can be understood in a natural conversation mode, deep reasoning can be carried out according to the question sentences of the user, and the human-computer interaction experience of the user is improved.
In addition, the invention also provides a question-answering method based on the Bayesian network. Fig. 3 is a flowchart of a preferred embodiment of the question-answering method based on the bayesian network according to the present invention. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the question-answering method based on the bayesian network includes:
in step S10, a question input by the user through the client is received and parsed to identify a target parameter representing the user' S intention and an attribute parameter associated with the target parameter from the question.
For a given text, the specific text is analyzed into parameters in a standard format, and the parameters are mainly divided into a rule template and a probability discrimination part.
The rule template is mainly configured by using a regular expression and a specific syntactic structure, wherein the regular expression is used for extracting parameters, and the specific syntactic structure is used for carrying out standard-format mapping on the extracted parameters. And applying a regular expression and a preset grammar structure, extracting parameters from a character string contained in a natural language question input by a user by using the regular expression, and analyzing the extracted parameters into the preset grammar structure for outputting. The regular expression is a logic formula for operating on character strings, and a 'regular character string' is formed by using specific characters defined in advance and a combination of the specific characters, and is used for expressing a filtering logic for the character string. For example, a rule template for "age" is as follows:
Figure GDA0002289312060000091
Figure GDA0002289312060000101
that is, the client's age is assigned in segments, with an assignment of 0 under 25 years, 1 under 25-30 years, 2 under 31-35 years, ….
Similarly, the academic records of the clients are also assigned in a classified manner, wherein the academic records are assigned to 0 in the primary school-junior middle school, 1 in the senior middle school, 2 in the subject department and 3 in the researchers, ….
Similarly, the income of the customers is also classified and assigned, the income per year is assigned to 0 under 50000 yuan, is assigned to 1 under 50000 yuan, is assigned to 2 under 100000 yuan, and is assigned to 3 under 200000 yuan.
The probability discrimination is mainly to train through a sample and a corresponding classification model thereof, to calculate the probability of multiple potential results of a section of text, and to select a result which can represent the intention of a user most for analysis. And screening a data structure which best meets the user intention from all data structures of the natural language question by using a machine learning model. For example, the machine learning model may be a naive bayes-based classification model that is derived based on training of a large number of natural language question sentences and data structure training corpora. For example, the user enters a question: "loan 10 ten thousand XXXX bank personal car purchase loan is how much more and less money per month". The user's intent is "interest calculation" and the rule template unit 111 extracts the parameters "XXXX bank", "personal car purchase loan", "month", "10 ten thousand". The generated data structure may include:
data structure 1: (| fb: property. context. LoanAmountRange (argmax (number 1)) (number 10) (and (fb: type. lan. N fb: oranN. gerengoudaikuan 1) (fb: type. lan. company. fb: company. XXXXXX)) (reverse (lambda x (| fb: random. entry. rank (varx))))))
Data structure 2: (| fb: property. context. MonthFeeRate (| fb: property. context. LoanAmountRange fb: company.XXXX))
Data structure 3: fb company.XXXX
Data structure 4: (| fb: property. continuously. MonthFeeRated (| fb: property. continuously. MonthFeeRate) (and (fb: type. LOANNfb: LOANN. GERNGUCHEDAIKUAN1) (fb: type. LOANN. COMPANY. FB: COMPANY. XXXXX)) (fb: property. continuously. LoANAmountRange (fb: property. attribute. Max AmountRange ()))) (number100000))
After the 4 data structures are subjected to the naive bayes classification model, the probability discriminating unit 112 screens out one data structure from the 4 data structures as a data structure which can represent the user's intention most.
Further, the step S10 further includes: and converting the extracted target parameters and attribute parameters into parameters in a standard format. For example, the question "how much overdue is for a major research student whose annual income is 300000 dollars? "the standard mapping case for the parameters includes: annual income-recovery _ incomes-300000 Yuan-3, academic-education-Master-3, repayment-debt-overdue-1. Then, the question would be parsed as follows:
Figure GDA0002289312060000111
and step S20, inputting the target parameters and the attribute parameters into a pre-trained Bayesian network model, and deducing the values of the target parameters by utilizing a directed acyclic graph and a conditional probability table set of the Bayesian network model.
The inference of the Bayesian network is to calculate the probability of the values of other nodes after the attribute values of the nodes are given by using the structure of the Bayesian network and the conditional probability table thereof.
The method adopts a message passing algorithm to carry out accurate reasoning, which is mainly to allocate a processor to each node, each processor can calculate by using the probability transmitted by adjacent nodes and the conditional probability stored in the processor to obtain the posterior probability of the processor, and the calculation result is transmitted to the adjacent nodes.
For example, when a question becomes "how much overdue rate is for a client whose annual income is 300000? "then, the client attributes appearing in the question are only annual income-receiver _ income-300000 yuan-3, repayment case-debt-overdue-1. According to the directed acyclic graph and the conditional probability table, when the annual income of the client is determined, the probability of overdue payment of the client can be estimated according to the academic situations of the client, namely, different academic situations can influence the probability of overdue payment of the client.
And step S30, feeding back the values of the target parameters deduced by the Bayesian network model to the user.
When a user inputs a question into the bayesian network model, the values of the target parameters are obtained as follows:
key:income=3,education=3;debt=1;value:0.01935
in order to enable the result to be more visual, the target parameter value in the output standard data format is converted into a text, and the result in the text form is used as an answer to be fed back to the user. The result after the value conversion of the target parameter is as follows:
the overdue rate for a major research student with an annual income of 300000 yuan is 1.935%.
According to the question-answering method based on the Bayesian network, the user requirements can be understood in a natural conversation mode, deep reasoning can be carried out according to the question of the user, and the human-computer interaction experience of the user is improved.
A second embodiment of the bayesian network-based question-answering method according to the present invention is proposed based on the first embodiment. Referring to fig. 4, in this embodiment, the specific construction steps of the bayesian network model in fig. 3 include:
step S01, extracting the attribute associated with the default client from each piece of historical default data of the historical service data, and calculating the condition mutual information among the attributes;
s02, sorting the conditional mutual information values of all attributes in a descending order, selecting an attribute pair with a high conditional mutual information value as a node, constructing a maximum weight span tree according to the principle of no loop generation until n-1 edges are selected for n nodes to form an undirected acyclic graph;
step S03, determining the root node of each node in the directed acyclic graph, taking the direction from the root node to the child node as the direction between the nodes, and changing the directed acyclic graph into the directed acyclic graph; and
step S04, calculating the conditional probability among the random variables represented by each node in the directed acyclic graph according to the historical service data to obtain a conditional probability table set of the Bayesian network model.
The Bayesian network is constructed mainly by determining topological relations among random variables to form DAG (Directed acyclic graph), and the adopted method mainly comprises the steps of determining nodes of the Bayesian network and then learning the structure of the Bayesian network by using a large amount of training data. Structure learning is performed by using TAN (Tree Augmented Naive bayes) algorithm.
Training the bayesian network, i.e. parameter learning, mainly determines a conditional probability table, i.e. conditional dependency between random variables. The parameter learning is mainly divided into parameter learning of complete data and parameter learning of incomplete data, the complete data means that each instance has complete observation data, namely, both educational data and income data, and the incomplete data means that some instances have partial deletion or abnormal observation, for example, some people have educational data, and other people have income data without educational data. Usually, the data is incomplete. The parameter learning of complete observation data adopts a maximum likelihood estimation method, and the parameter learning of incomplete data adopts an EM (Expectation-maximization) algorithm.
And calculating the conditional probability among random variables represented by each node in the DAG according to the historical service data to obtain a conditional probability table set of the Bayesian network model.
The bayesian network in this embodiment comprises a DAG and a set of probability tables, as shown with reference to fig. 2b and 2 c.
In FIG. 2b, three nodes in the DAG represent three random variables, and directed edges represent conditional dependencies between the random variables.
In other embodiments, the random variable represented by each node may be a directly observable variable or a hidden variable, which refers to a variable that cannot be observed directly or accurately, but is observed but needs to be synthesized by other methods, such as mental level.
In fig. 2c, each element in the conditional probability table corresponds to a unique node in the DAG, and the joint conditional probability of this node for all its immediate predecessor nodes is stored:
Figure GDA0002289312060000131
wherein E is the academic condition of the default customer, I is the annual income condition, P is the probability, T is the overdue condition of the repayment, and F is the normal condition of the repayment.
For example, attributes associated with a default customer are extracted from historical default data for a financial services institution, such as: default customer age, academic history, annual income, gender, nationality, work experience, asset status (whether there is a car or a house), whether there is insurance and marital status, etc., and calculates conditional mutual information between different attributes.
The attribute of the class variable is added in the TAN, and because the correlation between the attributes is premised on recalculation under the determination of a certain classification attribute, different attribute values of different classes have different attribute correlations, the calculation formula is as follows:
Figure GDA0002289312060000141
wherein, P (X, Y | C) is a joint distribution of two random variables X and Y, P (X | C), P (Y | C) is a marginal distribution of the random variables X and Y, C is a class variable, C is a specific attribute value of C, P (C) represents a distribution of C, X, Y represents attribute variables associated with the default customer, and I (X, Y | C) represents mutual condition information between the attributes X, Y.
If the condition mutual information condition among the attributes is calculated as follows: mutual information value of academic and annual income (0.8) > mutual information value of annual income and overdue (0.7) > mutual information value of age and annual income (0.4) > mutual information value of gender and overdue (0.2). Then, the attribute pairs with higher mutual information values are selected in turn as nodes.
Further, the step S02 further includes: a mutual information threshold is preset as a criterion for how many attribute pairs or edges to keep. The reason for selecting the correlation information value from high to low is to keep the edge of the correlation dependency with higher correlation. Assuming that the preset mutual information threshold is 0.5, the attribute pair with the mutual information value higher than 0.5 is selected as the node, i.e. the academic history, the annual income and the overdue are taken as the node, and an undirected acyclic graph as shown in fig. 2a is formed.
The "overdue" node, the "academic" node, and the "annual income" node are connected to form a directed acyclic graph as shown in fig. 2 b.
According to the question-answering method based on the Bayesian network, the Bayesian network model is built, so that the question-answering method can understand the user requirements in a natural dialogue mode, deep reasoning is carried out according to the question of the user, and the human-computer interaction experience of the user is improved.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a bayesian network-based question-answering program is stored on the computer-readable storage medium, and when executed by a processor, the bayesian network-based question-answering program implements the following operations:
parameter extraction: receiving and analyzing a question input by a user through a client to identify a target parameter representing the intention of the user and an attribute parameter associated with the target parameter from the question;
and (3) an inference step: inputting the target parameters and the attribute parameters into a pre-trained Bayesian network model, and deducing values of the target parameters by utilizing a directed acyclic graph and a conditional probability table set of the Bayesian network model; and
an answer generation step: and feeding back the value of the target parameter deduced by the Bayesian network model to the user.
The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the above-mentioned specific implementation of the question-answering method based on the bayesian network, and therefore, the detailed description thereof is omitted.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments. Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A question answering apparatus based on a bayesian network, the apparatus comprising: the system comprises a memory and a processor, wherein the memory stores a Bayesian network-based question-answering program, and the Bayesian network-based question-answering program realizes the following steps when being executed by the processor:
parameter extraction: receiving and analyzing a question input by a user through a client to identify a target parameter representing the intention of the user and an attribute parameter associated with the target parameter from the question;
and (3) an inference step: inputting the target parameters and the attribute parameters into a pre-trained Bayesian network model, and deducing values of the target parameters by utilizing a directed acyclic graph and a conditional probability table set of the Bayesian network model, wherein the construction of the Bayesian network model comprises the following steps:
extracting attributes associated with the default customers from each piece of historical default data of the historical service data, and calculating condition mutual information values among the attributes;
sorting the conditional mutual information values of all attributes in a descending order, selecting an attribute pair with a high conditional mutual information value as a node, constructing a maximum weight span tree according to the principle of no loop generation until n-1 edges are selected for n nodes to form a directed acyclic graph;
determining a root node of each node in the undirected acyclic graph, wherein the direction from the root node to the child nodes is the direction between the nodes, and changing the undirected acyclic graph into a directed acyclic graph; and
calculating conditional probability among random variables represented by each node in the directed acyclic graph according to historical service data to obtain a conditional probability table set; and
an answer generation step: and feeding back the value of the target parameter deduced by the Bayesian network model to the user.
2. The bayesian network-based question answering device according to claim 1, wherein the parameter extracting step includes:
and converting the extracted target parameters and attribute parameters into parameters in a standard format.
3. The bayesian network-based question answering device according to claim 1, wherein the answer generating step includes:
and converting the values of the target parameters deduced by the Bayesian network model into texts, and feeding back the results in the text format as answers to the user.
4. The bayesian network-based question answering device according to claim 1, wherein a formula for calculating a conditional mutual information value between the attributes is as follows:
Figure FDA0002289312050000021
wherein, P (X, Y | C) is a joint distribution of two random variables X and Y, P (X | C) and P (Y | C) are respectively marginal distributions of the random variables X and Y, C is a class variable, C is a specific attribute value of C, P (C) represents a distribution of C, X, Y represents attribute variables associated with the default customer respectively, and I (X, Y | C) represents mutual condition information between the attributes X, Y.
5. A question-answering method based on a Bayesian network is characterized by comprising the following steps:
parameter extraction: receiving and analyzing a question input by a user through a client to identify a target parameter representing the intention of the user and an attribute parameter associated with the target parameter from the question;
and (3) an inference step: inputting the target parameters and the attribute parameters into a pre-trained Bayesian network model, and deducing values of the target parameters by utilizing a directed acyclic graph and a conditional probability table set of the Bayesian network model, wherein the construction of the Bayesian network model comprises the following steps:
extracting attributes associated with the default customers from each piece of historical default data of the historical service data, and calculating condition mutual information values among the attributes;
sorting the conditional mutual information values of all attributes in a descending order, selecting an attribute pair with a high conditional mutual information value as a node, constructing a maximum weight span tree according to the principle of no loop generation until n-1 edges are selected for n nodes to form a directed acyclic graph;
determining a root node of each node in the undirected acyclic graph, wherein the direction from the root node to the child nodes is the direction between the nodes, and changing the undirected acyclic graph into a directed acyclic graph; and
calculating conditional probability among random variables represented by each node in the directed acyclic graph according to historical service data to obtain a conditional probability table set; and
an answer generation step: and feeding back the value of the target parameter deduced by the Bayesian network model to the user.
6. The bayesian network-based question-answering method according to claim 5, wherein said parameter extracting step comprises:
and converting the extracted target parameters and attribute parameters into parameters in a standard format.
7. The bayesian network-based question-answering method according to claim 5, wherein said answer generating step includes:
and converting the values of the target parameters deduced by the Bayesian network model into texts, and feeding back the results in the text format as answers to the user.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a bayesian network based question-answering program, which when executed by a processor implements the steps of the bayesian network based question-answering method according to any one of claims 5 to 7.
CN201710955002.XA 2017-10-13 2017-10-13 Question answering device and method based on Bayesian network and storage medium Active CN107807968B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710955002.XA CN107807968B (en) 2017-10-13 2017-10-13 Question answering device and method based on Bayesian network and storage medium
PCT/CN2018/077344 WO2019071904A1 (en) 2017-10-13 2018-02-27 Bayesian network-based question-answering apparatus, method and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710955002.XA CN107807968B (en) 2017-10-13 2017-10-13 Question answering device and method based on Bayesian network and storage medium

Publications (2)

Publication Number Publication Date
CN107807968A CN107807968A (en) 2018-03-16
CN107807968B true CN107807968B (en) 2020-02-18

Family

ID=61584401

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710955002.XA Active CN107807968B (en) 2017-10-13 2017-10-13 Question answering device and method based on Bayesian network and storage medium

Country Status (2)

Country Link
CN (1) CN107807968B (en)
WO (1) WO2019071904A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241261A (en) * 2018-08-30 2019-01-18 武汉斗鱼网络科技有限公司 User's intension recognizing method, device, mobile terminal and storage medium
CN109523373B (en) * 2018-11-13 2022-07-15 深圳前海微众银行股份有限公司 Remote body-checking method, device and computer readable storage medium
CN109582778B (en) * 2018-12-12 2020-10-27 东软集团股份有限公司 Intelligent question and answer method, device, equipment and medium
CN110175227B (en) * 2019-05-10 2021-03-02 神思电子技术股份有限公司 Dialogue auxiliary system based on team learning and hierarchical reasoning
CN110309284B (en) * 2019-06-28 2021-08-06 广州探迹科技有限公司 Automatic answer method and device based on Bayesian network reasoning
CN110737687A (en) * 2019-09-06 2020-01-31 平安普惠企业管理有限公司 Data query method, device, equipment and storage medium
CN110532572A (en) * 2019-09-12 2019-12-03 四川长虹电器股份有限公司 Spell checking methods based on the tree-like naive Bayesian of TAN
CN111476371B (en) * 2020-06-24 2020-09-18 支付宝(杭州)信息技术有限公司 Method and device for evaluating specific risk faced by server

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101320374A (en) * 2008-07-10 2008-12-10 昆明理工大学 Field question classification method combining syntax structural relationship and field characteristic
US8706653B2 (en) * 2010-12-08 2014-04-22 Microsoft Corporation Knowledge corroboration
CN103425640A (en) * 2012-05-14 2013-12-04 华为技术有限公司 Multimedia questioning-answering system and method
US20140108321A1 (en) * 2012-10-12 2014-04-17 International Business Machines Corporation Text-based inference chaining
CN103279528A (en) * 2013-05-31 2013-09-04 俞志晨 Question-answering system and question-answering method based on man-machine integration
JP6460455B2 (en) * 2014-12-01 2019-01-30 Kddi株式会社 Database construction device, learning support system, database construction method, learning support method, and program
CN105989040B (en) * 2015-02-03 2021-02-09 创新先进技术有限公司 Intelligent question and answer method, device and system
CN106960069A (en) * 2016-12-27 2017-07-18 安徽理工大学 A kind of Bayesian network platform with self-learning function

Also Published As

Publication number Publication date
CN107807968A (en) 2018-03-16
WO2019071904A1 (en) 2019-04-18

Similar Documents

Publication Publication Date Title
CN107807968B (en) Question answering device and method based on Bayesian network and storage medium
CN110287479B (en) Named entity recognition method, electronic device and storage medium
US20240078386A1 (en) Methods and systems for language-agnostic machine learning in natural language processing using feature extraction
CN108804512B (en) Text classification model generation device and method and computer readable storage medium
US9081411B2 (en) Rapid development of virtual personal assistant applications
US9489625B2 (en) Rapid development of virtual personal assistant applications
US11687716B2 (en) Machine-learning techniques for augmenting electronic documents with data-verification indicators
US20190370274A1 (en) Analysis Method Using Graph Theory, Analysis Program, and Analysis System
CN111159409B (en) Text classification method, device, equipment and medium based on artificial intelligence
US9348901B2 (en) System and method for rule based classification of a text fragment
US11651015B2 (en) Method and apparatus for presenting information
CN110781273A (en) Text data processing method and device, electronic equipment and storage medium
CN111985243B (en) Emotion model training method, emotion analysis device and storage medium
CN113627797B (en) Method, device, computer equipment and storage medium for generating staff member portrait
CN111767714B (en) Text smoothness determination method, device, equipment and medium
CN113392179A (en) Text labeling method and device, electronic equipment and storage medium
CN112000778A (en) Natural language processing method, device and system based on semantic recognition
CN115730597A (en) Multi-level semantic intention recognition method and related equipment thereof
KR102185733B1 (en) Server and method for automatically generating profile
KR102410715B1 (en) Apparatus and method for analyzing sentiment of text data based on machine learning
CN112735564A (en) Mental health state prediction method, mental health state prediction apparatus, mental health state prediction medium, and computer program product
CN116306506A (en) Intelligent mail template method based on content identification
KR20220118579A (en) System for providing tutoring service using artificial intelligence and method thereof
Pandey et al. Interview bot with automatic question generation and answer evaluation
CN112328871A (en) Reply generation method, device, equipment and storage medium based on RPA module

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
TA01 Transfer of patent application right

Effective date of registration: 20180529

Address after: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant after: Shenzhen one ledger Intelligent Technology Co., Ltd.

Address before: 200030 Xuhui District, Shanghai Kai Bin Road 166, 9, 10 level.

Applicant before: Shanghai Financial Technologies Ltd

TA01 Transfer of patent application right
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1251052

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant