WO2019071904A1 - Bayesian network-based question-answering apparatus, method and storage medium - Google Patents

Bayesian network-based question-answering apparatus, method and storage medium Download PDF

Info

Publication number
WO2019071904A1
WO2019071904A1 PCT/CN2018/077344 CN2018077344W WO2019071904A1 WO 2019071904 A1 WO2019071904 A1 WO 2019071904A1 CN 2018077344 W CN2018077344 W CN 2018077344W WO 2019071904 A1 WO2019071904 A1 WO 2019071904A1
Authority
WO
WIPO (PCT)
Prior art keywords
bayesian network
attribute
parameter
parameters
question
Prior art date
Application number
PCT/CN2018/077344
Other languages
French (fr)
Chinese (zh)
Inventor
徐国强
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2019071904A1 publication Critical patent/WO2019071904A1/en

Links

Images

Classifications

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

Definitions

  • the present application relates to the field of human-computer interaction technologies, and in particular, to a Bayesian network-based question answering device, method, and computer readable storage medium.
  • Human-computer interaction is the science of studying the interaction between systems and users. Among them, the system can be a variety of machines, but also computerized systems and software.
  • Various artificial intelligence systems can be realized through human-computer interaction, for example, 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. When the customer asks a question, the intelligent question answering system automatically answers the answer to the question to the user. However, in the existing intelligent question answering system, the answers are mostly obtained by searching texts or knowledge bases, and most of them do not have deep reasoning ability.
  • the application provides a Bayesian network-based question answering device, method and computer readable storage medium, the main purpose of which is to enable the intelligent question answering process to have deep reasoning ability.
  • the present application provides a Bayesian network-based question answering device, the device comprising: a memory, a processor, and a memory-based Bayesian network-based quiz program stored on the memory, the Bayesian-based Bayesian
  • the network quiz program is executed by the processor, the following steps are implemented:
  • Parameter extraction step receiving and parsing a question input by the user through the client, to identify a target parameter representing the user's intention and an attribute parameter associated with the target parameter from the question;
  • Inference step inputting the target parameter and the attribute parameter into a pre-trained Bayesian network model, and inferring the value of the target parameter by using the directed acyclic graph and the conditional probability table set of the Bayesian network model;
  • Answer generation step feedback the value of the target parameter inferred by the Bayesian network model to the user.
  • the present application further provides a Bayesian network-based question and answer method, the method comprising:
  • Parameter extraction step receiving and parsing a question input by the user through the client, to identify a target parameter representing the user's intention and an attribute parameter associated with the target parameter from the question;
  • Inference step inputting the target parameter and the attribute parameter into a pre-trained Bayesian network model, and inferring the value of the target parameter by using the directed acyclic graph and the conditional probability table set of the Bayesian network model;
  • the answer generation step feeding back the value of the target parameter inferred by the Bayesian network model to the user.
  • the present application further provides a computer readable storage medium on which a Bayesian network-based question answering program is stored, and the Bayesian network-based question answering program is processed.
  • the steps of the Bayesian network-based question and answer method as described above are implemented when the device is executed.
  • the Bayesian network-based question answering device, method and computer readable storage medium proposed by the present application can perform causal reasoning on user input questions through a Bayesian network model, and based on the inference result Answer the questions posed by the user. Enhance the user interaction experience by understanding user needs through natural dialogue.
  • FIG. 1 is a schematic diagram of a preferred embodiment of a question and answer device based on a Bayesian network
  • FIG. 2 is a block diagram of a question and answer procedure based on a Bayesian network in FIG. 1;
  • 2a is a schematic diagram of an undirected acyclic graph in a Bayesian network model
  • Figure 2b is a schematic diagram of a directed acyclic graph in a Bayesian network model
  • Figure 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 a Bayesian network based question and answer method according to the present application
  • FIG. 4 is a flowchart of a specific configuration of the Bayesian network model in the Bayesian network-based question and answer method of the present application.
  • the application provides a question and answer device 1 based on a Bayesian network.
  • a schematic diagram of a preferred embodiment of a question and answer apparatus 1 based on a Bayesian network is provided.
  • the Bayesian network-based question answering device 1 may be an electronic device having a computing function such as a smart phone, a tablet computer, an e-book reader, or 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 business data from a service database over a network.
  • the memory 11 includes a memory and at least one type of readable storage medium.
  • the memory provides a 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, or the like.
  • the readable storage medium may be an internal storage unit of the Bayesian network based question answering device 1, such as the hard disk of the Bayesian network based question answering device 1.
  • 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 type provided on the Bayesian network-based question answering device 1.
  • the readable storage medium of the memory 11 is generally used to store application software and historical service data installed in the Bayesian network-based question answering device 1, such as a Bayesian network-based question answering program 10 , customer history default data, etc.
  • the memory 11 can also be used to temporarily store data that has been output or is about to be output.
  • the processor 12 may be a Central Processing Unit (CPU), microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as performing Bayesian based
  • the Q&A program 10 of the network to implement any of the following Bayesian network-based question and answer methods.
  • 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 sensor, or the like in some embodiments.
  • the display 13 is used to display the results of the processing in the Bayesian network based question answering device 1 and the visualized user interface.
  • Communication bus 14 is used to implement connection communication between these components.
  • the network interface 15 is mainly used to connect to a server and perform data communication with the server.
  • the Bayesian network based question answering device 1 may further comprise a user interface, including a standard wired interface and a wireless interface.
  • the optional user interface may include an input unit such as a keyboard, a voice input device such as a microphone, a device having a voice recognition function, a voice output device such as an audio, a headphone, and the like.
  • the Bayesian network based question answering device 1 is a mobile electronic device, such as a mobile phone
  • at least one type of sensor such as a light sensor, a motion sensor, and other sensors
  • 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 the ambient light, and the proximity sensor can turn off the display panel and/or the backlight when the mobile phone moves to the ear.
  • the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity.
  • gestures of the mobile phone such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as well as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, Other sensors such as thermometers and infrared sensors will not be described here.
  • Figure 1 shows only a Bayesian network based question answering device 1 having components 11-14 and a Bayesian network based question answering program 10, but it should be understood that not all illustrated components may be implemented and may be substituted. Implement more or fewer components.
  • FIG. 2 is a block diagram of a preferred embodiment of the Bayesian network based challenge program 10 of FIG.
  • 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 plurality of modules described above are stored in the memory 11 and executed by one or more processors 12 to complete the application.
  • a module as referred to in this application refers to a series of computer program instructions that are capable of performing a particular function. 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 the user through the client, to identify a target parameter representing the user's intention and an attribute parameter associated with the target parameter from the question.
  • the parameter extraction module 110 parses the specific text into parameters of the standard format, and is mainly divided into two parts: the rule template unit 111 and the probability discriminating unit 112.
  • the rule template unit 111 is mainly configured using a regular expression and a specific syntax structure, wherein a regular expression is used for parameter extraction, and a special syntax structure is used for mapping the extracted parameters in a standard format. Applying a regular expression and a preset grammatical structure, the regular expression is used to extract parameters from the string contained in the natural language question input by the user, and parse the extracted parameters into a preset syntax structure output.
  • a regular expression is a logical formula for string operations. It uses a combination of specific characters defined in advance and a combination of these specific characters to form a "rule string”. This "rule string" is used to express a pair of strings. a filtering logic. For example, the rule template for "age” is as follows:
  • the client's age is assigned in stages, the value is less than 25 years old, the value is 0, the age of 25-30 is 1, and the age of 31-35 is 2.
  • the customer's academic qualifications are also classified and assigned.
  • the academic qualifications are 0 for primary school and junior high school, 1 for high school, 2 for undergraduate students, and 3 for master's degree.
  • the customer income is also classified and assigned.
  • the annual income is less than 50,000 yuan and the value is 0, 50000-100000 yuan is 1,100,000-2,200,000 yuan is 2, and more than 200,000 yuan is 3.
  • the probability discriminating unit 112 is mainly trained by the sample and its corresponding classification model, is used to calculate the probability of multiple potential results of a piece of text, and selects a result that best represents the user's intention for parsing.
  • a machine learning model is used to filter out a data structure that best matches the user's intention from all the data structures of the natural language question.
  • the machine learning model can be based on a naive Bayesian classification model, and the naive Bayesian classification model is based on a large number of natural language questions and data structure training corpus training.
  • the user enters the question: "How much is the monthly loan for a 100,000 XXXX bank personal car loan?"
  • the user intention is "interest calculation”, and the rule template unit 111 extracts the parameters "XXXX Bank", “personal car loan”, "month”, "100,000”.
  • the resulting data structure may include:
  • the probability discriminating unit 112 filters out a data structure as the data structure most representative of the user's intention.
  • 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, in the question “What is the overdue rate of graduate students with an annual income of 300,000 yuan?”, the standard mapping of parameters includes: annual income-recent_income-300000 yuan-3, education-education-Master-3, repayment -debt-overdue-1. Then the question will be parsed as follows:
  • the inference module 120 is configured to input the target parameter and the attribute parameter into a pre-trained Bayesian network model, and infer the target parameter by using the directed acyclic graph and the conditional probability table set of the Bayesian network model. The value.
  • the Bayesian network's reasoning is to use the structure of the Bayesian network and its conditional probability table to calculate the probability of taking some other nodes after given the node attribute values.
  • the customer attribute appearing in the question only has annual income -recent_income-300000 -3, repayment -debt-overdue -1 .
  • the probability of the customer's repayment overdue can be inferred according to the customer's academic qualifications, that is, different academic qualifications will affect the customer's repayment overdue. The probability.
  • the answer generating module 130 is configured to feed back the value of the target parameter inferred by the Bayesian network model to the user.
  • the value of the target parameter is obtained as follows:
  • the answer generation module 130 converts the output target parameter value of the standard data format into text, and feeds the result in text form as an answer to the user.
  • the results of the above target parameter conversion are as follows:
  • the overdue rate of graduate students with an annual income of 300,000 yuan is 1.935%.
  • the Bayesian network-based question and answer system of the present application can understand the user's needs through natural dialogue, and perform deep reasoning according to the user's question to improve the user's human-computer interaction experience.
  • the present application also provides a question and answer method based on Bayesian network.
  • FIG. 3 it is a flowchart of a preferred embodiment of a Bayesian network based question and answer method according to the present application. The method can be performed by a device that can be implemented by software and/or hardware.
  • the Bayesian network based question and answer method includes:
  • Step S10 receiving and parsing a question input by the user through the client, to identify a target parameter representing the user's intention and an attribute parameter associated with the target parameter from the question.
  • the specific text is parsed into the parameters of the standard format, which is mainly divided into two parts: the rule template and the probability discriminant.
  • Rule templates are primarily configured using regular expressions and specific syntax structures, where regular expressions are used for parameter extraction and special syntax structures are used for standard format mapping of extracted parameters. Applying a regular expression and a preset grammatical structure, the regular expression is used to extract parameters from the string contained in the natural language question input by the user, and parse the extracted parameters into a preset syntax structure output.
  • a regular expression is a logical formula for string operations. It uses a combination of specific characters defined in advance and a combination of these specific characters to form a "rule string”. This "rule string” is used to express a pair of strings. a filtering logic. For example, the rule template for "age” is as follows:
  • the customer's age is assigned in stages, the value is less than 25 years old and the value is 0, 25-30 years old is 1, 31-35 years old is 2,...
  • the academic qualification is 0 for the elementary school-junior high school, 1 for the high school, 2 for the undergraduate, and 3 for the graduate student.
  • the customer income is also classified and assigned.
  • the annual income is less than 50,000 yuan and the value is 0, 50000-100000 yuan is 1,100,000-2,200,000 yuan is 2, and more than 200,000 yuan is 3.
  • the probabilistic discriminant is mainly trained by the sample and its corresponding classification model, used to calculate the probability of multiple potential results of a piece of text, and select a result that best represents the user's intention for parsing.
  • a machine learning model is used to filter out a data structure that best matches the user's intention from all the data structures of the natural language question.
  • the machine learning model can be based on a naive Bayesian classification model, and the naive Bayesian classification model is based on a large number of natural language questions and data structure training corpus training.
  • the user enters the question: "How much is the monthly loan for a 100,000 XXXX bank personal car loan?"
  • the user intention is "interest calculation”, and the rule template unit 111 extracts the parameters "XXXX Bank", “personal car loan”, "month”, "100,000”.
  • the resulting data structure may include:
  • the probability discriminating unit 112 filters out a data structure as the data structure most representative of the user's intention.
  • the step S10 further includes: converting the extracted target parameter and the attribute parameter into a parameter of a standard format.
  • a standard format For example, in the question “What is the overdue rate of graduate students with an annual income of 300,000 yuan?”, the standard mapping of parameters includes: annual income-recent_income-300000 yuan-3, education-education-Master-3, repayment -debt-overdue-1. Then the question will be parsed as follows:
  • Step S20 input the target parameter and the attribute parameter into a pre-trained Bayesian network model, and use the directed acyclic graph and the conditional probability table set of the Bayesian network model to infer the value of the target parameter.
  • the Bayesian network's reasoning is to use the structure of the Bayesian network and its conditional probability table to calculate the probability of taking some other nodes after given the node attribute values.
  • the customer attribute appearing in the question only has annual income -recent_income-300000 -3, repayment -debt-overdue -1 .
  • the probability of the customer's repayment overdue can be inferred according to the customer's academic qualifications, that is, different academic qualifications will affect the customer's repayment overdue. The probability.
  • step S30 the value of the target parameter inferred by the Bayesian network model is fed back to the user.
  • the value of the target parameter is obtained as follows:
  • the value of the target parameter of the output standard data format is converted into text, and the result in text form is fed back to the user as an answer.
  • the results of the above target parameter conversion are as follows:
  • the overdue rate of graduate students with an annual income of 300,000 yuan is 1.935%.
  • the Bayesian network-based question and answer method of the present application can understand the user's needs through natural dialogue, and perform deep reasoning according to the user's question to improve the user's human-computer interaction experience.
  • a second embodiment of the Bayesian network based question and answer method of the present application is proposed based on the first embodiment.
  • the specific construction steps of the Bayesian network model in FIG. 3 include:
  • Step S01 extracting, from each historical default data of the historical business data, an attribute associated with the default customer, and calculating conditional mutual information between the attributes;
  • Step S02 Sort the conditional mutual information values of each attribute in descending order, select an attribute pair with a high conditional mutual information value as a node, and follow a principle of not generating a loop, and construct a maximum weight span tree until n-1 pieces are selected for n nodes. Side, forming an undirected acyclic graph;
  • Step S03 determining a root node of each node in the undirected acyclic graph, the direction from the root node to the child node is a direction between the nodes, and changing the undirected acyclic graph into a directed acyclic graph;
  • Step S04 Calculate a conditional probability between random variables represented by each node in the directed acyclic graph according to historical service data, and obtain a conditional probability table set of the Bayesian network model.
  • the Bayesian network is mainly used to determine the topological relationship between random variables to form a DAG (Directed Acyclic Graph).
  • the method used is to first determine the nodes of the Bayesian network and then use a large amount of training data to learn.
  • the structure of the Bayesian network is performed using TAN (Tree Augmented Naive Bays) algorithm.
  • Training Bayesian networks that is, parameter learning, is mainly to determine the conditional probability table, that is, the conditional dependency between random variables.
  • Parameter learning is mainly divided into parameter learning of complete data and parameter learning of incomplete data.
  • Complete data means that each instance has complete observation data, that is, both educational data and income data, and incomplete data refers to certain Some examples are missing or observing anomalies. For example, some people have educational data, others have no educational data and have income data. Usually, it is incomplete data.
  • the parameter learning of the complete observation data adopts the method of maximum likelihood estimation.
  • the EM algorithm Exectation-maximization
  • the Bayesian network in this embodiment includes a DAG and a set of probability tables, as shown in Figures 2c, 2d.
  • 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 directly observed or can be observed but still needs to be integrated by other methods.
  • Variables such as intelligence levels.
  • each element in the conditional probability table corresponds to a unique node in the DAG, storing the joint conditional probability of this node for all its immediate precursor nodes:
  • E is the academic qualification of the defaulting customer
  • I is the annual income
  • P is the probability
  • T is the overdue condition of repayment
  • F is the normal situation of repayment.
  • extract historically related attributes from a financial service institution's historical default data such as: default customer age, education, annual income, gender, nationality, work experience, assets (whether there is a car or room), whether Have insurance and marital status, etc., and calculate conditional mutual information between different attributes.
  • c) is the joint distribution of two random variables x and y
  • c) are the marginal distribution of random variables X and Y, respectively
  • C is the class variable.
  • X, Y respectively represent the attribute variables associated with the default customer
  • C) represents the conditional mutual information between the attributes X and Y.
  • conditional mutual information between the above attributes is calculated as: mutual information value of education 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)>sex Mutual information value with overdue (0.2). Then, the attribute pairs with higher mutual information values are sequentially selected as nodes.
  • the step S02 further includes: presetting a mutual information threshold as a criterion for retaining a plurality of attribute pairs or edges.
  • a mutual information threshold is 0.5
  • the attribute pair whose mutual information value is higher than 0.5 is selected as the node, that is, the academic qualification, the annual income, and the overdue as nodes, forming an undirected acyclic graph as shown in FIG. 2a.
  • the "overdue” node, the "educational” node, and the “annual income” node are connected to form a directed acyclic graph as shown in Figure 2b.
  • the Bayesian network-based question and answer method of the present application by constructing a Bayesian network model, enables the question and answer method to understand the user's needs through natural dialogue, and performs deep reasoning according to the user's question to improve the user's human-computer interaction experience.
  • the embodiment of the present application further provides a computer readable storage medium, where the Bayesian network-based question and answer program is stored on the computer readable storage medium, and the Bayesian network-based question and answer program is executed by the processor. Implement the following operations:
  • Parameter extraction step receiving and parsing a question input by the user through the client, to identify a target parameter representing the user's intention and an attribute parameter associated with the target parameter from the question;
  • Inference step inputting the target parameter and the attribute parameter into a pre-trained Bayesian network model, and inferring the value of the target parameter by using the directed acyclic graph and the conditional probability table set of the Bayesian network model;
  • Answer generation step feedback the value of the target parameter inferred by the Bayesian network model to the user.
  • the specific implementation manner of the computer readable storage medium of the present application is substantially the same as the specific implementation method of the above-mentioned Bayesian network based question and answer method, and therefore will not be described again.
  • a disk including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
  • a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.

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

A Bayesian network-based question-answering method, a question-answering apparatus and a computer-readable storage medium. The method comprises: receiving and parsing a question input by a user by means of a client, so as to recognize in the question a target parameter representing user intent and an attribute parameter associated with the target parameter (S10); inputting the target parameter and the attribute parameter into a pre-trained Bayesian network model, and using a directed acyclic graph and a conditional probability table set of the Bayesian network model to infer a value of the target parameter (S20); returning the value of the target parameter inferred by the Bayesian network model to the user (S30). The present method performs causal inference of a question, and on the basis of an inferred result, answers a question put forth by a user.

Description

基于贝叶斯网络的问答装置、方法及存储介质Question and answer device, method and storage medium based on Bayesian network
本申请要求于2017年10月13日提交中国专利局、申请号为201710955002.X、发明名称为“基于贝叶斯网络的问答装置、方法及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。This application claims the priority of the Chinese Patent Application filed on October 13, 2017, the Chinese Patent Office, the application number is 201710955002.X, and the invention name is "Bayesian network-based question answering device, method and storage medium". The content is incorporated into the application by reference.
技术领域Technical field
本申请涉及人机交互技术领域,尤其涉及一种基于贝叶斯网络的问答装置、方法及计算机可读存储介质。The present application relates to the field of human-computer interaction technologies, and in particular, to a Bayesian network-based question answering device, method, and computer readable storage medium.
背景技术Background technique
人机交互是研究系统与用户之间的交互关系的科学。其中,系统可以是各种各样的机器,也可以是计算机化的系统和软件。通过人机交互可以实现各种人工智能系统,例如,智能客服系统、语音控制系统等等。智能问答系统是人机交互的一种典型应用,当客户提出问题后,智能问答系统自动向用户回复该问题的答案。然而,现有的智能问答系统,答案多是通过检索文本或者知识库得到,大多不具备深度推理能力。Human-computer interaction is the science of studying the interaction between systems and users. Among them, the system can be a variety of machines, but also computerized systems and software. Various artificial intelligence systems can be realized through human-computer interaction, for example, 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. When the customer asks a question, the intelligent question answering system automatically answers the answer to the question to the user. However, in the existing intelligent question answering system, the answers are mostly obtained by searching texts or knowledge bases, and most of them do not have deep reasoning ability.
发明内容Summary of the invention
本申请提供一种基于贝叶斯网络的问答装置、方法及计算机可读存储介质,其主要目的在于使智能问答过程具备深度推理能力。The application provides a Bayesian network-based question answering device, method and computer readable storage medium, the main purpose of which is to enable the intelligent question answering process to have deep reasoning ability.
为实现上述目的,本申请提供一种基于贝叶斯网络的问答装置,该装置包括:存储器、处理器,所述存储器上存储有基于贝叶斯网络的问答程序,,所述基于贝叶斯网络的问答程序被所述处理器执行时实现如下步骤:To achieve the above object, the present application provides a Bayesian network-based question answering device, the device comprising: a memory, a processor, and a memory-based Bayesian network-based quiz program stored on the memory, the Bayesian-based Bayesian When the network quiz program is executed by the processor, the following steps are implemented:
参数提取步骤:接收并解析用户通过客户端输入的问句,以从问句中识别代表用户意图的目标参数和与目标参数相关联的属性参数;Parameter extraction step: receiving and parsing a question input by the user through the client, to identify a target parameter representing the user's intention and an attribute parameter associated with the target parameter from the question;
推断步骤:将所述目标参数和属性参数输入预先训练好的贝叶斯网络模型,利用所述贝叶斯网络模型的有向无环图及条件概率表集合推断得到目标参数的取值;及Inference step: inputting the target parameter and the attribute parameter into a pre-trained Bayesian network model, and inferring the value of the target parameter by using the directed acyclic graph and the conditional probability table set of the Bayesian network model;
答案生成步骤:将贝叶斯网络模型推断得到的目标参数的取值反馈给用 户。Answer generation step: feedback the value of the target parameter inferred by the Bayesian network model to the user.
此外,为实现上述目的,本申请还提供一种基于贝叶斯网络的问答方法,该方法包括:In addition, to achieve the above object, the present application further provides a Bayesian network-based question and answer method, the method comprising:
参数提取步骤:接收并解析用户通过客户端输入的问句,以从问句中识别代表用户意图的目标参数和与目标参数相关联的属性参数;Parameter extraction step: receiving and parsing a question input by the user through the client, to identify a target parameter representing the user's intention and an attribute parameter associated with the target parameter from the question;
推断步骤:将所述目标参数和属性参数输入预先训练好的贝叶斯网络模型,利用所述贝叶斯网络模型的有向无环图及条件概率表集合推断得到目标参数的取值;及Inference step: inputting the target parameter and the attribute parameter into a pre-trained Bayesian network model, and inferring the value of the target parameter by using the directed acyclic graph and the conditional probability table set of the Bayesian network model;
答案生成步骤:将贝叶斯网络模型推断得到的目标参数的取值反馈给用户。The answer generation step: feeding back the value of the target parameter inferred by the Bayesian network model to the user.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有基于贝叶斯网络的问答程序,所述基于贝叶斯网络的问答程序被处理器执行时实现如上所述的基于贝叶斯网络的问答方法的步骤。In addition, in order to achieve the above object, the present application further provides a computer readable storage medium on which a Bayesian network-based question answering program is stored, and the Bayesian network-based question answering program is processed. The steps of the Bayesian network-based question and answer method as described above are implemented when the device is executed.
相较于现有技术,本申请提出的基于贝叶斯网络的问答装置、方法及计算机可读存储介质,可通过贝叶斯网络模型,对用户输入的问句进行因果推理,并基于推理结果回答用户提出的问题。通过自然对话的方式理解用户需求,提升用户交互体验。Compared with the prior art, the Bayesian network-based question answering device, method and computer readable storage medium proposed by the present application can perform causal reasoning on user input questions through a Bayesian network model, and based on the inference result Answer the questions posed by the user. Enhance the user interaction experience by understanding user needs through natural dialogue.
附图说明DRAWINGS
图1为本申请基于贝叶斯网络的问答装置较佳实施例的示意图;1 is a schematic diagram of a preferred embodiment of a question and answer device based on a Bayesian network;
图2为图1中基于贝叶斯网络的问答程序的模块图;2 is a block diagram of a question and answer procedure based on a Bayesian network in FIG. 1;
图2a为贝叶斯网络模型中的无向无环图示意图;2a is a schematic diagram of an undirected acyclic graph in a Bayesian network model;
图2b为贝叶斯网络模型中的有向无环图示意图;Figure 2b is a schematic diagram of a directed acyclic graph in a Bayesian network model;
图2c为贝叶斯网络模型中的概率表集合示意图;Figure 2c is a schematic diagram of a set of probability tables in a Bayesian network model;
图3为本申请基于贝叶斯网络的问答方法较佳实施例的流程图;3 is a flow chart of a preferred embodiment of a Bayesian network based question and answer method according to the present application;
图4为本申请基于贝叶斯网络的问答方法中所述贝叶斯网络模型具体构造流程图。FIG. 4 is a flowchart of a specific configuration of the Bayesian network model in the Bayesian network-based question and answer method of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步 说明。The implementation, functional features, and advantages of the present application will be further described with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
本申请提供一种基于贝叶斯网络的问答装置1。参照图1所示,为本申请基于贝叶斯网络的问答装置1较佳实施例的示意图。The application provides a question and answer device 1 based on a Bayesian network. Referring to FIG. 1, a schematic diagram of a preferred embodiment of a question and answer apparatus 1 based on a Bayesian network is provided.
在本实施例中,基于贝叶斯网络的问答装置1可以是智能手机、平板电脑、电子书阅读器、便携计算机等具有运算功能的电子设备。In the present embodiment, the Bayesian network-based question answering device 1 may be an electronic device having a computing function such as a smart phone, a tablet computer, an e-book reader, or a portable computer.
该基于贝叶斯网络的问答装置1包括存储器11、处理器12、显示器13、通信总线14及网络接口15。该装置通过网络从业务数据库获取业务数据。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 business data from a service database over a network.
存储器11包括内存及至少一种类型的可读存储介质。内存为移动终端的运行提供缓存;可读存储介质可为如闪存、硬盘、多媒体卡、卡型存储器等的非易失性存储介质。在一些实施例中,所述可读存储介质可以是所述基于贝叶斯网络的问答装置1的内部存储单元,例如该基于贝叶斯网络的问答装置1的硬盘。在另一些实施例中,所述可读存储介质也可以是所述基于贝叶斯网络的问答装置1的外部存储设备,例如所述基于贝叶斯网络的问答装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。The memory 11 includes a memory and at least one type of readable storage medium. The memory provides a 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, or 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 the 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 type provided on the Bayesian network-based question answering device 1. Hard disk, smart memory card (SMC), Secure Digital (SD) card, flash card, etc.
在本实施例中,所述存储器11的可读存储介质通常用于存储安装于所述基于贝叶斯网络的问答装置1的应用软件及历史业务数据,例如基于贝叶斯网络的问答程序10、客户历史违约数据等。所述存储器11还可以用于暂时地存储已经输出或者将要输出的数据。In the present embodiment, the readable storage medium of the memory 11 is generally used to store application software and historical service data installed in the Bayesian network-based question answering device 1, such as a Bayesian network-based question answering program 10 , customer history default data, etc. The memory 11 can also be used to temporarily store data that has been output or is about to be output.
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行基于贝叶斯网络的问答程序10,以实现下述基于贝叶斯网络的问答方法中的任一步骤。The processor 12, in some embodiments, may be a Central Processing Unit (CPU), microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as performing Bayesian based The Q&A program 10 of the network to implement any of the following Bayesian network-based question and answer methods.
显示器13在一些实施例中可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。显示器13用于显示在基于贝叶斯网络的问答装置1中处理的结果以及 可视化的用户界面。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 sensor, or the like in some embodiments. The display 13 is used to display the results of the processing in the Bayesian network based question answering device 1 and the visualized user interface.
通信总线14用于实现这些组件之间的连接通信。 Communication bus 14 is used to implement connection communication between these components.
网络接口15主要用于连接服务器,与服务器进行数据通信。The network interface 15 is mainly used to connect to a server and perform data communication with the server.
优选地,该基于贝叶斯网络的问答装置1还可以包括用户接口,包括标准的有线接口、无线接口。可选的用户接口可以包括输入单元比如键盘(Keyboard)、语音输入装置比如麦克风(microphone)等具有语音识别功能的设备、语音输出装置比如音响、耳机等。Preferably, the Bayesian network based question answering device 1 may further comprise a user interface, including a standard wired interface and a wireless interface. The optional user interface may include an input unit such as a keyboard, a voice input device such as a microphone, a device having a voice recognition function, a voice output device such as an audio, a headphone, and the like.
优选地,当基于贝叶斯网络的问答装置1为移动电子装置,例如手机时,还可以包括至少一种传感器,比如光传感器、运动传感器以及其他传感器。具体地,光传感器包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板的亮度,接近传感器可在手机移动到耳边时,关闭显示面板和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机还可配置的指纹传感器、压力传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。Preferably, when the Bayesian network based question answering device 1 is a mobile electronic device, such as a mobile phone, at least one type of sensor, such as a light sensor, a motion sensor, and other sensors, may also be 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 the 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 a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as well as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, Other sensors such as thermometers and infrared sensors will not be described here.
图1仅示出了具有组件11-14以及基于贝叶斯网络的问答程序10的基于贝叶斯网络的问答装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。Figure 1 shows only a Bayesian network based question answering device 1 having components 11-14 and a Bayesian network based question answering program 10, but it should be understood that not all illustrated components may be implemented and may be substituted. Implement more or fewer components.
如图2所示,是图1中基于贝叶斯网络的问答程序10较佳实施例的模块图。2 is a block diagram of a preferred embodiment of the Bayesian network based challenge program 10 of FIG.
在本实施例中,所述基于贝叶斯网络的问答程序10可以被分割成参数提取模块110、推断模块120及答案生成模块130。上述多个模块被存储于所述存储器11中,并由一个或多个处理器12所执行,以完成本申请。本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段。以下描述将具体介绍所述参数提取模块110、推断模块120及答案生成模块130所实现的操作和功能。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 plurality of modules described above are stored in the memory 11 and executed by one or more processors 12 to complete the application. A module as referred to in this application refers to a series of computer program instructions that are capable of performing a particular function. 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.
所述参数提取模块110,用于接收并解析用户通过客户端输入的问句,以 从问句中识别代表用户意图的目标参数和与目标参数相关联的属性参数。The parameter extraction module 110 is configured to receive and parse a question input by the user through the client, to identify a target parameter representing the user's intention and an attribute parameter associated with the target parameter from the question.
对于一段给定的文本,参数提取模块110会将特定文本解析成标准格式的参数,主要分为规则模板单元111和概率判别单元112两个部分。For a given text, the parameter extraction module 110 parses the specific text into parameters of the standard format, and is mainly divided into two parts: the rule template unit 111 and the probability discriminating unit 112.
规则模板单元111主要是使用正则表达式和特定的语法结构进行配置,其中正则表达式用于参数的提取,而特殊的语法结构用于对提取的参数进行标准格式的映射。应用一个正则表达式及预设的语法结构,利用该正则表达式从用户输入的自然语言问句所包含的字符串中提取参数,并将提取的参数解析成预设的语法结构输出。正则表达式是对字符串操作的一种逻辑公式,用事先定义好的一些特定字符、及这些特定字符的组合,组成一个“规则字符串”,这个“规则字符串”用来表达对字符串的一种过滤逻辑。例如,“年龄”的规则模板如下:The rule template unit 111 is mainly configured using a regular expression and a specific syntax structure, wherein a regular expression is used for parameter extraction, and a special syntax structure is used for mapping the extracted parameters in a standard format. Applying a regular expression and a preset grammatical structure, the regular expression is used to extract parameters from the string contained in the natural language question input by the user, and parse the extracted parameters into a preset syntax structure output. A regular expression is a logical formula for string operations. It uses a combination of specific characters defined in advance and a combination of these specific characters to form a "rule string". This "rule string" is used to express a pair of strings. a filtering logic. For example, the rule template for "age" is as follows:
Figure PCTCN2018077344-appb-000001
Figure PCTCN2018077344-appb-000001
也就是说,将客户年龄进行分段赋值,小于25岁赋值为0,25-30岁为1,31-35岁为2等。In other words, the client's age is assigned in stages, the value is less than 25 years old, the value is 0, the age of 25-30 is 1, and the age of 31-35 is 2.
同理,将客户的学历情况也进行分类赋值,学历为小学-初中的赋值为0,高中为1,本科为2,硕士研究生为3等。In the same way, the customer's academic qualifications are also classified and assigned. The academic qualifications are 0 for primary school and junior high school, 1 for high school, 2 for undergraduate students, and 3 for master's degree.
同理,将客户收入情况也进行分类赋值,年收入为50000元以下赋值为0,50000-100000元为1,100000-200000元为2,超过200000元为3。In the same way, the customer income is also classified and assigned. The annual income is less than 50,000 yuan and the value is 0, 50000-100000 yuan is 1,100,000-2,200,000 yuan is 2, and more than 200,000 yuan is 3.
概率判别单元112主要是通过样本及其对应的分类模型进行训练,用于计算一段文本多个潜在结果的概率,并选择一个最能代表用户意图的结果进行解析。利用机器学习模型从该自然语言问句所有的数据结构中筛选出一个最符合用户意图的数据结构。例如,该机器学习模型可以为基于朴素贝叶斯分类模型,朴素贝叶斯分类模型基于大量的自然语言问句与数据结构训练语料的训练得到。例如,用户输入问题:"贷10万XXXX银行个人购车贷款每月要还多少钱"。用户意图为“利息计算”,规则模板单元111提取参数“XXXX银行”、“个人购车贷款”、“月”、“10万”。生成的数据结构可能包括:The probability discriminating unit 112 is mainly trained by the sample and its corresponding classification model, is used to calculate the probability of multiple potential results of a piece of text, and selects a result that best represents the user's intention for parsing. A machine learning model is used to filter out a data structure that best matches the user's intention from all the data structures of the natural language question. For example, the machine learning model can be based on a naive Bayesian classification model, and the naive Bayesian classification model is based on a large number of natural language questions and data structure training corpus training. For example, the user enters the question: "How much is the monthly loan for a 100,000 XXXX bank personal car loan?" The user intention is "interest calculation", and the rule template unit 111 extracts the parameters "XXXX Bank", "personal car loan", "month", "100,000". The resulting data structure may include:
数据结构1:(!fb:property.context.LoanAmountRange(argmax(number 1)(number 10)(and(fb:type.loan.loanN fb:loanN.gerengouchedaikuan1)(fb:type.loan.company fb:company.XXXX))(reverse(lambda x(!fb:rank.entity.rank(var x))))))Data Structure 1: (!fb:property.context.LoanAmountRange(argmax(number 1)(number 10)(and(fb:type.loan.loanN fb:loanN.gerengouchedaikuan1)(fb:type.loan.company fb:company .XXXX))(reverse(lambda x(!fb:rank.entity.rank(var x)))))))
数据结构2:(!fb:property.context.MonthFeeRate(!fb:property.context.LoanAmountRange fb:company.XXXX))Data Structure 2: (!fb:property.context.MonthFeeRate(!fb:property.context.LoanAmountRange fb:company.XXXX))
数据结构3:fb:company.XXXXData Structure 3: fb:company.XXXX
数据结构4:(*(!fb:attribute.attribute.MonthFeeRateD(!fb:property.context.MonthFeeRate(and(and(fb:type.loan.loanNfb:loanN.gerengouchedaikuan1)(fb:type.loan.company fb:company.XXXX))(fb:property.context.LoanAmountRange(fb:attribute.attribute.MaxLoanAmountRange(>=(number 100000)))))))(number100000))Data Structure 4: (*(!fb:attribute.attribute.MonthFeeRateD(!fb:property.context.MonthFeeRate(and(and(fb:type.loan.loanNfb:loanN.gerengouchedaikuan1)(fb:type.loan.company fb :company.XXXX))(fb:property.context.LoanAmountRange(fb:attribute.attribute.MaxLoanAmountRange(>=(number 100000))))))))(number100000))
该4个数据结构经过朴素贝叶斯分类模型后,概率判别单元112会从中筛选出一个数据结构作为最能代表用户意图的数据结构。After the four data structures pass the naive Bayesian classification model, the probability discriminating unit 112 filters out a data structure as the data structure most representative of the user's intention.
进一步地,所述参数提取模块110,还用于将提取的目标参数和属性参数转换成标准格式的参数。例如,问句“年收入300000元的硕士研究生的逾期率是多少?”中,对参数的标准映射情况包括:年收入-recent_income-300000元-3,学历-education-硕士-3,还款情况-debt-逾期-1。那么,该问句会被解析如下: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, in the question “What is the overdue rate of graduate students with an annual income of 300,000 yuan?”, the standard mapping of parameters includes: annual income-recent_income-300000 yuan-3, education-education-Master-3, repayment -debt-overdue-1. Then the question will be parsed as follows:
Figure PCTCN2018077344-appb-000002
Figure PCTCN2018077344-appb-000002
Figure PCTCN2018077344-appb-000003
Figure PCTCN2018077344-appb-000003
所述推断模块120,用于将所述目标参数和属性参数输入预先训练好的贝叶斯网络模型,利用所述贝叶斯网络模型的有向无环图及条件概率表集合推断得到目标参数的取值。The inference module 120 is configured to input the target parameter and the attribute parameter into a pre-trained Bayesian network model, and infer the target parameter by using the directed acyclic graph and the conditional probability table set of the Bayesian network model. The value.
贝叶斯网络的推理是利用贝叶斯网络的结构及其条件概率表,在给定节点属性值后计算其他某些节点取值的概率。我们采用的是消息传递算法进行精确推理,它主要是给每个节点分配一个处理器,每个处理器会利用相邻节点传递来的概率和存储于该处理器内部的条件概率进行计算,求得自身的后验概率,并将计算结果向相邻节点传播。The Bayesian network's reasoning is to use the structure of the Bayesian network and its conditional probability table to calculate the probability of taking some other nodes after given the node attribute values. We use a message passing algorithm for precise reasoning. It mainly allocates a processor to each node. Each processor uses the probability passed by the neighboring node and the conditional probability stored in the processor to calculate. Get its own posterior probability and propagate the result to neighboring nodes.
例如,当问句变为“年收入300000元的客户的逾期率是多少?”则,问句中出现的客户属性只有年收入-recent_income-300000元-3,还款情况-debt-逾期-1。根据上述有向无环图和条件概率表,当客户的年收入确定时,可以根据客户的学历情况对客户还款逾期的概率进行推断,也就是说,不同的学历情况会影响客户还款逾期的概率。For example, when the question becomes "How much is the overdue rate of the customer with an annual income of 300,000 yuan?", the customer attribute appearing in the question only has annual income -recent_income-300000 -3, repayment -debt-overdue -1 . According to the above-mentioned directed acyclic graph and conditional probability table, when the customer's annual income is determined, the probability of the customer's repayment overdue can be inferred according to the customer's academic qualifications, that is, different academic qualifications will affect the customer's repayment overdue. The probability.
所述答案生成模块130,用于将贝叶斯网络模型推断得到的目标参数的取值反馈给用户。The answer generating module 130 is configured to feed back the value of the target parameter inferred by the Bayesian network model to the user.
当用户将问句输入贝叶斯网络模型之后,会得到目标参数的取值如下:When the user enters the question into the Bayesian network model, the value of the target parameter is obtained as follows:
key:income=3,education=3;debt=1;value:0.01935Key:income=3,education=3;debt=1;value:0.01935
为了使结果更为直观,答案生成模块130将输出的标准数据格式的目标参数取值转换为文本,并将文本形式的结果作为答案反馈给用户。上述目标参数取值转换后的结果如下:In order to make the result more intuitive, the answer generation module 130 converts the output target parameter value of the standard data format into text, and feeds the result in text form as an answer to the user. The results of the above target parameter conversion are as follows:
年收入300000元的硕士研究生的逾期率是1.935%。The overdue rate of graduate students with an annual income of 300,000 yuan is 1.935%.
本申请之基于贝叶斯网络的问答系统,可以通过自然对话的方式理解用户需求,并根据用户的问句进行深度推理,提升用户人机交互体验。The Bayesian network-based question and answer system of the present application can understand the user's needs through natural dialogue, and perform deep reasoning according to the user's question to improve the user's human-computer interaction experience.
此外,本申请还提供一种基于贝叶斯网络的问答方法。参照图3所示,为本申请基于贝叶斯网络的问答方法较佳实施例的流程图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。In addition, the present application also provides a question and answer method based on Bayesian network. Referring to FIG. 3, it is a flowchart of a preferred embodiment of a Bayesian network based question and answer method according to the present application. The method can be performed by a device that can be implemented by software and/or hardware.
在本实施例中,基于贝叶斯网络的问答方法包括:In this embodiment, the Bayesian network based question and answer method includes:
步骤S10,接收并解析用户通过客户端输入的问句,以从问句中识别代表用户意图的目标参数和与目标参数相关联的属性参数。Step S10, receiving and parsing a question input by the user through the client, 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 parsed into the parameters of the standard format, which is mainly divided into two parts: the rule template and the probability discriminant.
规则模板主要是使用正则表达式和特定的语法结构进行配置,其中正则表达式用于参数的提取,而特殊的语法结构用于对提取的参数进行标准格式的映射。应用一个正则表达式及预设的语法结构,利用该正则表达式从用户输入的自然语言问句所包含的字符串中提取参数,并将提取的参数解析成预设的语法结构输出。正则表达式是对字符串操作的一种逻辑公式,用事先定义好的一些特定字符、及这些特定字符的组合,组成一个“规则字符串”,这个“规则字符串”用来表达对字符串的一种过滤逻辑。例如,“年龄”的规则模板如下:Rule templates are primarily configured using regular expressions and specific syntax structures, where regular expressions are used for parameter extraction and special syntax structures are used for standard format mapping of extracted parameters. Applying a regular expression and a preset grammatical structure, the regular expression is used to extract parameters from the string contained in the natural language question input by the user, and parse the extracted parameters into a preset syntax structure output. A regular expression is a logical formula for string operations. It uses a combination of specific characters defined in advance and a combination of these specific characters to form a "rule string". This "rule string" is used to express a pair of strings. a filtering logic. For example, the rule template for "age" is as follows:
Figure PCTCN2018077344-appb-000004
Figure PCTCN2018077344-appb-000004
Figure PCTCN2018077344-appb-000005
Figure PCTCN2018077344-appb-000005
也就是说,将客户年龄进行分段赋值,小于25岁赋值为0,25-30岁为1,31-35岁为2,…。That is to say, the customer's age is assigned in stages, the value is less than 25 years old and the value is 0, 25-30 years old is 1, 31-35 years old is 2,...
同理,将客户的学历情况也进行分类赋值,学历为小学-初中的赋值为0,高中为1,本科为2,研究生为3,…。In the same way, the customer's academic qualifications are also classified and assigned. The academic qualification is 0 for the elementary school-junior high school, 1 for the high school, 2 for the undergraduate, and 3 for the graduate student.
同理,将客户收入情况也进行分类赋值,年收入为50000元以下赋值为0,50000-100000元为1,100000-200000元为2,超过200000元为3。In the same way, the customer income is also classified and assigned. The annual income is less than 50,000 yuan and the value is 0, 50000-100000 yuan is 1,100,000-2,200,000 yuan is 2, and more than 200,000 yuan is 3.
概率判别主要是通过样本及其对应的分类模型进行训练,用于计算一段文本多个潜在结果的概率,并选择一个最能代表用户意图的结果进行解析。利用机器学习模型从该自然语言问句所有的数据结构中筛选出一个最符合用户意图的数据结构。例如,该机器学习模型可以为基于朴素贝叶斯分类模型,朴素贝叶斯分类模型基于大量的自然语言问句与数据结构训练语料的训练得到。例如,用户输入问题:"贷10万XXXX银行个人购车贷款每月要还多少钱"。用户意图为“利息计算”,规则模板单元111提取参数“XXXX银行”、“个人购车贷款”、“月”、“10万”。生成的数据结构可能包括:The probabilistic discriminant is mainly trained by the sample and its corresponding classification model, used to calculate the probability of multiple potential results of a piece of text, and select a result that best represents the user's intention for parsing. A machine learning model is used to filter out a data structure that best matches the user's intention from all the data structures of the natural language question. For example, the machine learning model can be based on a naive Bayesian classification model, and the naive Bayesian classification model is based on a large number of natural language questions and data structure training corpus training. For example, the user enters the question: "How much is the monthly loan for a 100,000 XXXX bank personal car loan?" The user intention is "interest calculation", and the rule template unit 111 extracts the parameters "XXXX Bank", "personal car loan", "month", "100,000". The resulting data structure may include:
数据结构1:(!fb:property.context.LoanAmountRange(argmax(number 1)(number 10)(and(fb:type.loan.loanN fb:loanN.gerengouchedaikuan1)(fb:type.loan.company fb:company.XXXX))(reverse(lambda x(!fb:rank.entity.rank(var x))))))Data Structure 1: (!fb:property.context.LoanAmountRange(argmax(number 1)(number 10)(and(fb:type.loan.loanN fb:loanN.gerengouchedaikuan1)(fb:type.loan.company fb:company .XXXX))(reverse(lambda x(!fb:rank.entity.rank(var x)))))))
数据结构2:(!fb:property.context.MonthFeeRate(!fb:property.context.LoanAmountRange fb:company.XXXX))Data Structure 2: (!fb:property.context.MonthFeeRate(!fb:property.context.LoanAmountRange fb:company.XXXX))
数据结构3:fb:company.XXXXData Structure 3: fb:company.XXXX
数据结构4:(*(!fb:attribute.attribute.MonthFeeRateD(!fb:property.context.MonthFeeRate(and(and(fb:type.loan.loanNfb:loanN.gerengouchedaikuan1)(fb:type.loan.company fb:company.XXXX)) (fb:property.context.LoanAmountRange(fb:attribute.attribute.MaxLoanAmountRange(>=(number 100000)))))))(number100000))Data Structure 4: (*(!fb:attribute.attribute.MonthFeeRateD(!fb:property.context.MonthFeeRate(and(and(fb:type.loan.loanNfb:loanN.gerengouchedaikuan1)(fb:type.loan.company fb :company.XXXX)) (fb:property.context.LoanAmountRange(fb:attribute.attribute.MaxLoanAmountRange(>=(number 100000))))))))(number100000))
该4个数据结构经过朴素贝叶斯分类模型后,概率判别单元112会从中筛选出一个数据结构作为最能代表用户意图的数据结构。After the four data structures pass the naive Bayesian classification model, the probability discriminating unit 112 filters out a data structure as the data structure most representative of the user's intention.
进一步地,所述步骤S10还包括:将提取的目标参数和属性参数转换成标准格式的参数。例如,问句“年收入300000元的硕士研究生的逾期率是多少?”中,对参数的标准映射情况包括:年收入-recent_income-300000元-3,学历-education-硕士-3,还款情况-debt-逾期-1。那么,该问句会被解析如下:Further, the step S10 further includes: converting the extracted target parameter and the attribute parameter into a parameter of a standard format. For example, in the question “What is the overdue rate of graduate students with an annual income of 300,000 yuan?”, the standard mapping of parameters includes: annual income-recent_income-300000 yuan-3, education-education-Master-3, repayment -debt-overdue-1. Then the question will be parsed as follows:
Figure PCTCN2018077344-appb-000006
Figure PCTCN2018077344-appb-000006
步骤S20,将所述目标参数和属性参数输入预先训练好的贝叶斯网络模型,利用所述贝叶斯网络模型的有向无环图及条件概率表集合推断得到目标参数的取值。Step S20: input the target parameter and the attribute parameter into a pre-trained Bayesian network model, and use the directed acyclic graph and the conditional probability table set of the Bayesian network model to infer the value of the target parameter.
贝叶斯网络的推理是利用贝叶斯网络的结构及其条件概率表,在给定节点属性值后计算其他某些节点取值的概率。The Bayesian network's reasoning is to use the structure of the Bayesian network and its conditional probability table to calculate the probability of taking some other nodes after given the node attribute values.
我们采用的是消息传递算法进行精确推理,它主要是给每个节点分配一 个处理器,每个处理器会利用相邻节点传递来的概率和存储于该处理器内部的条件概率进行计算,求得自身的后验概率,并将计算结果向相邻节点传播。We use a message passing algorithm for precise reasoning. It mainly allocates a processor to each node. Each processor uses the probability passed by the neighboring node and the conditional probability stored in the processor to calculate. Get its own posterior probability and propagate the result to neighboring nodes.
例如,当问句变为“年收入300000元的客户的逾期率是多少?”则,问句中出现的客户属性只有年收入-recent_income-300000元-3,还款情况-debt-逾期-1。根据上述有向无环图和条件概率表,当客户的年收入确定时,可以根据客户的学历情况对客户还款逾期的概率进行推断,也就是说,不同的学历情况会影响客户还款逾期的概率。For example, when the question becomes "How much is the overdue rate of the customer with an annual income of 300,000 yuan?", the customer attribute appearing in the question only has annual income -recent_income-300000 -3, repayment -debt-overdue -1 . According to the above-mentioned directed acyclic graph and conditional probability table, when the customer's annual income is determined, the probability of the customer's repayment overdue can be inferred according to the customer's academic qualifications, that is, different academic qualifications will affect the customer's repayment overdue. The probability.
步骤S30,将贝叶斯网络模型推断得到的目标参数的取值反馈给用户。In step S30, the value of the target parameter inferred by the Bayesian network model is fed back to the user.
当用户将问句输入贝叶斯网络模型之后,会得到目标参数的取值如下:When the user enters the question into the Bayesian network model, the value of the target parameter is obtained as follows:
key:income=3,education=3;debt=1;value:0.01935Key:income=3,education=3;debt=1;value:0.01935
为了使结果更为直观,将输出的标准数据格式的目标参数取值转换为文本,并将文本形式的结果作为答案反馈给用户。上述目标参数取值转换后的结果如下:In order to make the result more intuitive, the value of the target parameter of the output standard data format is converted into text, and the result in text form is fed back to the user as an answer. The results of the above target parameter conversion are as follows:
年收入300000元的硕士研究生的逾期率是1.935%。The overdue rate of graduate students with an annual income of 300,000 yuan is 1.935%.
本申请之基于贝叶斯网络的问答方法,可以通过自然对话的方式理解用户需求,并根据用户的问句进行深度推理,提升用户人机交互体验。The Bayesian network-based question and answer method of the present application can understand the user's needs through natural dialogue, and perform deep reasoning according to the user's question to improve the user's human-computer interaction experience.
基于第一实施例提出本申请基于贝叶斯网络的问答方法的第二实施例。参照图4所示,在本实施例中,图3中所述贝叶斯网络模型的具体构建步骤包括:A second embodiment of the Bayesian network based question and answer method of the present application is proposed based on the first embodiment. Referring to FIG. 4, in the embodiment, the specific construction steps of the Bayesian network model in FIG. 3 include:
步骤S01,从历史业务数据的每一笔历史违约数据中提取违约客户相关联的属性,计算各属性之间的条件互信息;Step S01: extracting, from each historical default data of the historical business data, an attribute associated with the default customer, and calculating conditional mutual information between the attributes;
步骤S02,对各属性的条件互信息值降序排序,选择条件互信息值高的属性对作为节点,遵循不产生环路的原则,构建最大权重跨度树,直到为n个节点选择n-1条边,构成一个无向无环图;Step S02: Sort the conditional mutual information values of each attribute in descending order, select an attribute pair with a high conditional mutual information value as a node, and follow a principle of not generating a loop, and construct a maximum weight span tree until n-1 pieces are selected for n nodes. Side, forming an undirected acyclic graph;
步骤S03,确定无向无环图中每个节点的根节点,由根节点到子节点的方向为节点之间的方向,将无向无环图变为有向无环图;及Step S03, determining a root node of each node in the undirected acyclic graph, the direction from the root node to the child node is a direction between the nodes, and changing the undirected acyclic graph into a directed acyclic graph;
步骤S04,根据历史业务数据计算所述有向无环图中各个节点所代表的随机变量之间的条件概率,得到贝叶斯网络模型的条件概率表集合。Step S04: Calculate a conditional probability between random variables represented by each node in the directed acyclic graph according to historical service data, and obtain a conditional probability table set of the Bayesian network model.
构造贝叶斯网络主要是确定随机变量间的拓扑关系形成DAG(Directed  Acyclic Graph,有向无环图),采用的方法主要是先确定贝叶斯网络的节点,然后用大量的训练数据来学习贝叶斯网络的结构。采用TAN(Tree Augmented Naive Bays,树增广的朴素贝叶斯)算法进行结构学习。The Bayesian network is mainly used to determine the topological relationship between random variables to form a DAG (Directed Acyclic Graph). The method used is to first determine the nodes of the Bayesian network and then use a large amount of training data to learn. The structure of the Bayesian network. Structure learning is performed using TAN (Tree Augmented Naive Bays) algorithm.
训练贝叶斯网络,即进行参数学习,主要是确定条件概率表,即随机变量间的条件依赖关系。参数学习主要分为完整数据的参数学习和不完整数据的参数学习,完整数据是指每个实例都具有完整的观测数据,即既有教育数据又有收入数据等,不完备数据是指某些实例有部分缺失或观测异常,如,一些人有教育数据,另一些人没有教育数据而有收入数据。通常情况下,都是不完整数据。完整的观测数据的参数学习采用的是最大似然估计的方法,对于不完整数据的参数学习采用的是EM算法(Expectation-maximization,最大期望算法)。Training Bayesian networks, that is, parameter learning, is mainly to determine the conditional probability table, that is, the conditional dependency between random variables. Parameter learning is mainly divided into parameter learning of complete data and parameter learning of incomplete data. Complete data means that each instance has complete observation data, that is, both educational data and income data, and incomplete data refers to certain Some examples are missing or observing anomalies. For example, some people have educational data, others have no educational data and have income data. Usually, it is incomplete data. The parameter learning of the complete observation data adopts the method of maximum likelihood estimation. For the parameter learning of incomplete data, the EM algorithm (Expectation-maximization) is adopted.
根据历史业务数据计算所述DAG中各个节点所代表的随机变量之间的条件概率,得到贝叶斯网络模型的条件概率表集合。Calculating a conditional probability between random variables represented by each node in the DAG according to historical business data, and obtaining a conditional probability table set of the Bayesian network model.
本实施例中的贝叶斯网络包括一个DAG和一个概率表集合,参照图2c、2d所示。The Bayesian network in this embodiment includes a DAG and a set of probability tables, as shown in Figures 2c, 2d.
在图2c中,DAG中三个节点表示三个随机变量,有向边表示随机变量间的条件依赖。In Figure 2c, three nodes in the DAG represent three random variables, and the directed edges represent conditional dependencies between 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 directly observed or can be observed but still needs to be integrated by other methods. Variables, such as intelligence levels.
在图2d中,条件概率表中的每一个元素对应DAG中唯一的节点,存储此节点对于其所有直接前驱节点的联合条件概率:In Figure 2d, each element in the conditional probability table corresponds to a unique node in the DAG, storing the joint conditional probability of this node for all its immediate precursor nodes:
Figure PCTCN2018077344-appb-000007
Figure PCTCN2018077344-appb-000007
其中,E为违约客户的学历情况、I为年收入情况、P为概率、T为还款逾期情况、F为还款正常情况。Among them, E is the academic qualification of the defaulting customer, I is the annual income, P is the probability, T is the overdue condition of repayment, and F is the normal situation of repayment.
例如,从某金融服务机构的历史违约数据中提取违约客户相关联的属性,如:违约客户年龄、学历、年收入、性别、国籍、工作经验、资产情况(是否有车或有房)、是否拥有保险及婚姻状态等等,并计算不同属性之间的条件互信息。For example, extract historically related attributes from a financial service institution's historical default data, such as: default customer age, education, annual income, gender, nationality, work experience, assets (whether there is a car or room), whether Have insurance and marital status, etc., and calculate conditional mutual information between different attributes.
在TAN中会有类变量属性的加入,因为属性之间的关联性的前提是要在 某一分类属性确定下进行重新计算,不同的类属性值会有不同的属性关联性,故计算公式如下:In the TAN, there will be the addition of class variable attributes, because the premise of the association between attributes is to recalculate under certain classification attributes. Different class attribute values will have different attribute associations, so the calculation formula is as follows :
Figure PCTCN2018077344-appb-000008
Figure PCTCN2018077344-appb-000008
其中,P(x,y|c)为两个随机变量x、y的联合分布,P(x|c),P(y|c)分别为随机变量X、Y的边际分布,C为类变量,X、Y分别表示该违约客户相关联的属性变量,I(X,Y|C)表示属性X、Y之间的条件互信息。Where P(x, y|c) is the joint distribution of two random variables x and y, P(x|c), P(y|c) are the marginal distribution of random variables X and Y, respectively, and C is the class variable. X, Y respectively represent the attribute variables associated with the default customer, and I(X, Y|C) represents the conditional mutual information between the attributes X and Y.
若上述计算各属性间的条件互信息情况为:学历与年收入的互信息值(0.8)>年收入与逾期的互信息值(0.7)>年龄与年收入的互信息值(0.4)>性别与逾期的互信息值(0.2)。那么,依次选出互信息值较高的属性对作为节点。If the conditional mutual information between the above attributes is calculated as: mutual information value of education 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)>sex Mutual information value with overdue (0.2). Then, the attribute pairs with higher mutual information values are sequentially selected as nodes.
进一步地,所述步骤S02还包括:预设一个互信息阈值作为保留多少个属性对或者边的标准。之所以按照互信息值从高到低选择的原因,就是要保留关联性更高的关联依赖性的边。假设,预设的互信息阈值为0.5,那么选择互信息值高于0.5的属性对作为节点,即将学历、年收入、及逾期作为节点,构成一个如图2a所示的无向无环图。Further, the step S02 further includes: presetting a mutual information threshold as a criterion for retaining a plurality of attribute pairs or edges. The reason why the value of mutual information is selected from high to low is to preserve the edge of the associated dependency with higher relevance. Assuming that the preset mutual information threshold is 0.5, then the attribute pair whose mutual information value is higher than 0.5 is selected as the node, that is, the academic qualification, the annual income, and the overdue as nodes, forming an undirected acyclic graph as shown in FIG. 2a.
将“逾期”节点、“学历”节点和“年收入”节点连接,形成如图2b所示的有向无环图。The "overdue" node, the "educational" node, and the "annual income" node are connected to form a directed acyclic graph as shown in Figure 2b.
本申请之基于贝叶斯网络的问答方法,通过构建贝叶斯网络模型,使该问答方法通过自然对话的方式理解用户需求,并根据用户的问句进行深度推理,提升用户人机交互体验。The Bayesian network-based question and answer method of the present application, by constructing a Bayesian network model, enables the question and answer method to understand the user's needs through natural dialogue, and performs deep reasoning according to the user's question to improve the user's human-computer interaction experience.
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有基于贝叶斯网络的问答程序,所述基于贝叶斯网络的问答程序被处理器执行时实现如下操作:In addition, the embodiment of the present application further provides a computer readable storage medium, where the Bayesian network-based question and answer program is stored on the computer readable storage medium, and the Bayesian network-based question and answer program is executed by the processor. Implement the following operations:
参数提取步骤:接收并解析用户通过客户端输入的问句,以从问句中识别代表用户意图的目标参数和与目标参数相关联的属性参数;Parameter extraction step: receiving and parsing a question input by the user through the client, to identify a target parameter representing the user's intention and an attribute parameter associated with the target parameter from the question;
推断步骤:将所述目标参数和属性参数输入预先训练好的贝叶斯网络模型,利用所述贝叶斯网络模型的有向无环图及条件概率表集合推断得到目标参数的取值;及Inference step: inputting the target parameter and the attribute parameter into a pre-trained Bayesian network model, and inferring the value of the target parameter by using the directed acyclic graph and the conditional probability table set of the Bayesian network model;
答案生成步骤:将贝叶斯网络模型推断得到的目标参数的取值反馈给用 户。Answer generation step: feedback the value of the target parameter inferred by the Bayesian network model to the user.
本申请之计算机可读存储介质的具体实施方式与上述基于贝叶斯网络的问答方法的具体实施方式大致相同,故不再赘述。The specific implementation manner of the computer readable storage medium of the present application is substantially the same as the specific implementation method of the above-mentioned Bayesian network based question and answer method, and therefore will not be described again.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It is to be understood that the term "comprises", "comprising", or any other variants thereof, is intended to encompass a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a series of elements includes those elements. It also includes other elements not explicitly listed, or elements that are inherent to such a process, device, item, or method. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, the device, the item, or the method that comprises the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。The serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments. Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only a preferred embodiment of the present application, and is not intended to limit the scope of the patent application, and the equivalent structure or equivalent process transformations made by the specification and the drawings of the present application, or directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of this application.

Claims (20)

  1. 一种基于贝叶斯网络的问答装置,其特征在于,该装置包括:存储器、处理器,所述存储器上存储有基于贝叶斯网络的问答程序,所述基于贝叶斯网络的问答程序被所述处理器执行时实现如下步骤:A Bayesian network-based question answering device, comprising: a memory, a processor, wherein the memory stores a Bayesian network-based question answering program, and the Bayesian network-based question answering program is The processor implements the following steps when executed:
    参数提取步骤:接收并解析用户通过客户端输入的问句,以从问句中识别代表用户意图的目标参数和与目标参数相关联的属性参数;Parameter extraction step: receiving and parsing a question input by the user through the client, to identify a target parameter representing the user's intention and an attribute parameter associated with the target parameter from the question;
    推断步骤:将所述目标参数和属性参数输入预先训练好的贝叶斯网络模型,利用所述贝叶斯网络模型的有向无环图及条件概率表集合推断得到目标参数的取值;及Inference step: inputting the target parameter and the attribute parameter into a pre-trained Bayesian network model, and inferring the value of the target parameter by using the directed acyclic graph and the conditional probability table set of the Bayesian network model;
    答案生成步骤:将贝叶斯网络模型推断得到的目标参数的取值反馈给用户。The answer generation step: feeding back the value of the target parameter inferred by the Bayesian network model to the user.
  2. 根据权利要求1所述的基于贝叶斯网络的问答装置,其特征在于,所述贝叶斯网络的模型构建步骤具体包括:The Bayesian network-based question answering device according to claim 1, wherein the modeling step of the Bayesian network specifically comprises:
    从历史业务数据的每一笔历史违约数据中提取违约客户相关联的属性,计算各属性之间的条件互信息值;Extracting the attributes associated with the default customer from each historical default data of the historical business data, and calculating the conditional mutual information value between the attributes;
    对各属性的条件互信息值降序排序,选择条件互信息值高的属性对作为节点,遵循不产生环路的原则,构建最大权重跨度树,直到为n个节点选择n-1条边,构成一个无向无环图;The conditional mutual information values of each attribute are sorted in descending order, and the attribute pairs with high conditional mutual information values are selected as nodes, and the principle of not generating loops is constructed, and the maximum weight span tree is constructed until n-1 edges are selected for n nodes. An undirected acyclic graph;
    确定无向无环图中每个节点的根节点,由根节点到子节点的方向为节点之间的方向,将无向无环图变为有向无环图;及Determining the root node of each node in the undirected acyclic graph, the direction from the root node to the child node is the direction between the nodes, and changing the undirected acyclic graph into a directed acyclic graph;
    根据历史业务数据计算所述有向无环图中各个节点所代表的随机变量之间的条件概率,得到贝叶斯网络模型的条件概率表集合。Calculating a conditional probability between random variables represented by each node in the directed acyclic graph according to historical service data, and obtaining a conditional probability table set of the Bayesian network model.
  3. 根据权利要求2所述的基于贝叶斯网络的问答装置,其特征在于,所述各属性之间的条件互信息值的计算公式如下:The Bayesian network-based question answering apparatus according to claim 2, wherein the calculation formula of the conditional mutual information value between the attributes is as follows:
    Figure PCTCN2018077344-appb-100001
    Figure PCTCN2018077344-appb-100001
    其中,P(x,y|c)为两个随机变量x、y的联合分布,P(x|c)P,P(y|c)P分别为随机变量X、Y的边际分布,C为类变量,X、Y分别表示该违约客户相关联的属性变量,I(X,Y|C)表示属性X、Y之间的条件互信息。Where P(x, y|c) is the joint distribution of two random variables x and y, P(x|c)P, P(y|c)P are the marginal distribution of random variables X and Y, respectively, C is The class variable, X and Y respectively represent the attribute variables associated with the default customer, and I(X, Y|C) represents the conditional mutual information between the attributes X and Y.
  4. 根据权利要求1所述的基于贝叶斯网络的问答装置,其特征在于,所 述参数提取步骤包括:The Bayesian network-based question answering device according to claim 1, wherein the parameter extraction step comprises:
    将提取的目标参数和属性参数转换成标准格式的参数。The extracted target parameters and attribute parameters are converted into parameters in a standard format.
  5. 根据权利要求2所述的基于贝叶斯网络的问答装置,其特征在于,所述参数提取步骤包括:The Bayesian network-based question answering device according to claim 2, wherein the parameter extraction step comprises:
    将提取的目标参数和属性参数转换成标准格式的参数。The extracted target parameters and attribute parameters are converted into parameters in a standard format.
  6. 根据权利要求3所述的基于贝叶斯网络的问答装置,其特征在于,所述参数提取步骤包括:The Bayesian network-based question answering device according to claim 3, wherein the parameter extraction step comprises:
    将提取的目标参数和属性参数转换成标准格式的参数。The extracted target parameters and attribute parameters are converted into parameters in a standard format.
  7. 根据权利要求1-6任一项所述的基于贝叶斯网络的问答装置,其特征在于,所述答案生成步骤包括:The Bayesian network-based question answering device according to any one of claims 1 to 6, wherein the answer generating step comprises:
    将贝叶斯网络模型推断得到的目标参数的取值转换为文本,并将文本格式的结果作为答案反馈至用户。The value of the target parameter inferred by the Bayesian network model is converted into text, and the result of the text format is fed back to the user as an answer.
  8. 一种基于贝叶斯网络的问答方法,其特征在于,所述方法包括:A question and answer method based on Bayesian network, characterized in that the method comprises:
    参数提取步骤:接收并解析用户通过客户端输入的问句,以从问句中识别代表用户意图的目标参数和与目标参数相关联的属性参数;Parameter extraction step: receiving and parsing a question input by the user through the client, to identify a target parameter representing the user's intention and an attribute parameter associated with the target parameter from the question;
    推断步骤:将所述目标参数和属性参数输入预先训练好的贝叶斯网络模型,利用所述贝叶斯网络模型的有向无环图及条件概率表集合推断得到目标参数的取值;及Inference step: inputting the target parameter and the attribute parameter into a pre-trained Bayesian network model, and inferring the value of the target parameter by using the directed acyclic graph and the conditional probability table set of the Bayesian network model;
    答案生成步骤:将贝叶斯网络模型推断得到的目标参数的取值反馈给用户。The answer generation step: feeding back the value of the target parameter inferred by the Bayesian network model to the user.
  9. 根据权利要求8所述的基于贝叶斯网络的问答方法,其特征在于,所述贝叶斯网络的模型构建步骤具体包括:The Bayesian network-based question and answer method according to claim 8, wherein the modeling step of the Bayesian network specifically comprises:
    从历史业务数据的每一笔历史违约数据中提取违约客户相关联的属性,计算各属性之间的条件互信息值;Extracting the attributes associated with the default customer from each historical default data of the historical business data, and calculating the conditional mutual information value between the attributes;
    对各属性的条件互信息值降序排序,选择条件互信息值高的属性对作为节点,遵循不产生环路的原则,构建最大权重跨度树,直到为n个节点选择n-1条边,构成一个无向无环图;The conditional mutual information values of each attribute are sorted in descending order, and the attribute pairs with high conditional mutual information values are selected as nodes, and the principle of not generating loops is constructed, and the maximum weight span tree is constructed until n-1 edges are selected for n nodes. An undirected acyclic graph;
    确定无向无环图中每个节点的根节点,由根节点到子节点的方向为节点之间的方向,将无向无环图变为有向无环图;及Determining the root node of each node in the undirected acyclic graph, the direction from the root node to the child node is the direction between the nodes, and changing the undirected acyclic graph into a directed acyclic graph;
    根据历史业务数据计算所述有向无环图中各个节点所代表的随机变量之 间的条件概率,得到贝叶斯网络模型的条件概率表集合。Calculating a conditional probability between random variables represented by each node in the directed acyclic graph according to historical service data, and obtaining a conditional probability table set of the Bayesian network model.
  10. 根据权利要求9所述的基于贝叶斯网络的问答方法,其特征在于,所述各属性之间的条件互信息值的计算公式如下:The Bayesian network-based question and answer method according to claim 9, wherein the calculation formula of the conditional mutual information value between the attributes is as follows:
    Figure PCTCN2018077344-appb-100002
    Figure PCTCN2018077344-appb-100002
    其中,P(x,y|c)为两个随机变量x、y的联合分布,P(x|c)P,P(y|c)P分别为随机变量X、Y的边际分布,C为类变量,X、Y分别表示该违约客户相关联的属性变量,I(X,Y|C)表示属性X、Y之间的条件互信息。Where P(x, y|c) is the joint distribution of two random variables x and y, P(x|c)P, P(y|c)P are the marginal distribution of random variables X and Y, respectively, C is The class variable, X and Y respectively represent the attribute variables associated with the default customer, and I(X, Y|C) represents the conditional mutual information between the attributes X and Y.
  11. 根据权利要求8所述的基于贝叶斯网络的问答方法,其特征在于,其特征在于,所述参数提取步骤包括:The Bayesian network-based question and answer method according to claim 8, wherein the parameter extraction step comprises:
    将提取的目标参数和属性参数转换成标准格式的参数。The extracted target parameters and attribute parameters are converted into parameters in a standard format.
  12. 根据权利要求9所述的基于贝叶斯网络的问答方法,其特征在于,其特征在于,所述参数提取步骤包括:The Bayesian network-based question and answer method according to claim 9, wherein the parameter extraction step comprises:
    将提取的目标参数和属性参数转换成标准格式的参数。The extracted target parameters and attribute parameters are converted into parameters in a standard format.
  13. 根据权利要求10所述的基于贝叶斯网络的问答方法,其特征在于,其特征在于,所述参数提取步骤包括:The Bayesian network-based question and answer method according to claim 10, wherein the parameter extraction step comprises:
    将提取的目标参数和属性参数转换成标准格式的参数。The extracted target parameters and attribute parameters are converted into parameters in a standard format.
  14. 根据权利要求8-13任一项所述的基于贝叶斯网络的问答方法,其特征在于,所述答案生成步骤包括:The Bayesian network-based question answering method according to any one of claims 8 to 13, wherein the answer generating step comprises:
    将贝叶斯网络模型推断得到的目标参数的取值转换为文本,并将文本格式的结果作为答案反馈至用户。The value of the target parameter inferred by the Bayesian network model is converted into text, and the result of the text format is fed back to the user as an answer.
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有基于贝叶斯网络的问答程序,所述基于贝叶斯网络的问答程序被处理器执行时实现如下步骤:A computer readable storage medium, characterized in that the computer readable storage medium stores a Bayesian network-based question and answer program, and the Bayesian network-based question and answer program is executed by the processor to implement the following steps:
    参数提取步骤:接收并解析用户通过客户端输入的问句,以从问句中识别代表用户意图的目标参数和与目标参数相关联的属性参数;Parameter extraction step: receiving and parsing a question input by the user through the client, to identify a target parameter representing the user's intention and an attribute parameter associated with the target parameter from the question;
    推断步骤:将所述目标参数和属性参数输入预先训练好的贝叶斯网络模型,利用所述贝叶斯网络模型的有向无环图及条件概率表集合推断得到目标参数的取值;及Inference step: inputting the target parameter and the attribute parameter into a pre-trained Bayesian network model, and inferring the value of the target parameter by using the directed acyclic graph and the conditional probability table set of the Bayesian network model;
    答案生成步骤:将贝叶斯网络模型推断得到的目标参数的取值反馈给用户。The answer generation step: feeding back the value of the target parameter inferred by the Bayesian network model to the user.
  16. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述贝叶斯网络的模型构建步骤具体包括:The computer readable storage medium according to claim 15, wherein the step of constructing the Bayesian network specifically comprises:
    从历史业务数据的每一笔历史违约数据中提取违约客户相关联的属性,计算各属性之间的条件互信息值;Extracting the attributes associated with the default customer from each historical default data of the historical business data, and calculating the conditional mutual information value between the attributes;
    对各属性的条件互信息值降序排序,选择条件互信息值高的属性对作为节点,遵循不产生环路的原则,构建最大权重跨度树,直到为n个节点选择n-1条边,构成一个无向无环图;The conditional mutual information values of each attribute are sorted in descending order, and the attribute pairs with high conditional mutual information values are selected as nodes, and the principle of not generating loops is constructed, and the maximum weight span tree is constructed until n-1 edges are selected for n nodes. An undirected acyclic graph;
    确定无向无环图中每个节点的根节点,由根节点到子节点的方向为节点之间的方向,将无向无环图变为有向无环图;及Determining the root node of each node in the undirected acyclic graph, the direction from the root node to the child node is the direction between the nodes, and changing the undirected acyclic graph into a directed acyclic graph;
    根据历史业务数据计算所述有向无环图中各个节点所代表的随机变量之间的条件概率,得到贝叶斯网络模型的条件概率表集合。Calculating a conditional probability between random variables represented by each node in the directed acyclic graph according to historical service data, and obtaining a conditional probability table set of the Bayesian network model.
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,其特征在于,所述各属性之间的条件互信息值的计算公式如下:The computer readable storage medium according to claim 16, wherein the conditional mutual information value between the attributes is calculated as follows:
    Figure PCTCN2018077344-appb-100003
    Figure PCTCN2018077344-appb-100003
    其中,P(x,y|c)为两个随机变量x、y的联合分布,P(x|c)P,P(y|c)P分别为随机变量X、Y的边际分布,C为类变量,X、Y分别表示该违约客户相关联的属性变量,I(X,Y|C)表示属性X、Y之间的条件互信息。Where P(x, y|c) is the joint distribution of two random variables x and y, P(x|c)P, P(y|c)P are the marginal distribution of random variables X and Y, respectively, C is The class variable, X and Y respectively represent the attribute variables associated with the default customer, and I(X, Y|C) represents the conditional mutual information between the attributes X and Y.
  18. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述参数提取步骤包括:The computer readable storage medium of claim 15, wherein the parameter extraction step comprises:
    将提取的目标参数和属性参数转换成标准格式的参数。The extracted target parameters and attribute parameters are converted into parameters in a standard format.
  19. 根据权利要求16或17所述的计算机可读存储介质,其特征在于,所述参数提取步骤包括:The computer readable storage medium according to claim 16 or 17, wherein the parameter extraction step comprises:
    将提取的目标参数和属性参数转换成标准格式的参数。The extracted target parameters and attribute parameters are converted into parameters in a standard format.
  20. 根据权利要求19所述的计算机可读存储介质,其特征在于,所述答案生成步骤包括:The computer readable storage medium of claim 19, wherein the answer generating step comprises:
    将贝叶斯网络模型推断得到的目标参数的取值转换为文本,并将文本格式的结果作为答案反馈至用户。The value of the target parameter inferred by the Bayesian network model is converted into text, and the result of the text format is fed back to the user as an answer.
PCT/CN2018/077344 2017-10-13 2018-02-27 Bayesian network-based question-answering apparatus, method and storage medium WO2019071904A1 (en)

Applications Claiming Priority (2)

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

Publications (1)

Publication Number Publication Date
WO2019071904A1 true WO2019071904A1 (en) 2019-04-18

Family

ID=61584401

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/077344 WO2019071904A1 (en) 2017-10-13 2018-02-27 Bayesian network-based question-answering apparatus, method 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

Citations (4)

* 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
US20120150771A1 (en) * 2010-12-08 2012-06-14 Microsoft Corporation Knowledge Corroboration
CN103729395A (en) * 2012-10-12 2014-04-16 国际商业机器公司 Method and system for inferring inquiry answer
CN106960069A (en) * 2016-12-27 2017-07-18 安徽理工大学 A kind of Bayesian network platform with self-learning function

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103425640A (en) * 2012-05-14 2013-12-04 华为技术有限公司 Multimedia questioning-answering system and method
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

Patent Citations (4)

* 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
US20120150771A1 (en) * 2010-12-08 2012-06-14 Microsoft Corporation Knowledge Corroboration
CN103729395A (en) * 2012-10-12 2014-04-16 国际商业机器公司 Method and system for inferring inquiry answer
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
CN107807968B (en) 2020-02-18

Similar Documents

Publication Publication Date Title
US11599714B2 (en) Methods and systems for modeling complex taxonomies with natural language understanding
US20240078386A1 (en) Methods and systems for language-agnostic machine learning in natural language processing using feature extraction
WO2019071904A1 (en) Bayesian network-based question-answering apparatus, method and storage medium
CN108804512B (en) Text classification model generation device and method and computer readable storage medium
US20220188521A1 (en) Artificial intelligence-based named entity recognition method and apparatus, and electronic device
WO2022116417A1 (en) Triple information extraction method, apparatus, and device, and computer-readable storage medium
WO2020232861A1 (en) Named entity recognition method, electronic device and storage medium
US8577938B2 (en) Data mapping acceleration
CN109918506B (en) Text classification method and device
WO2022105118A1 (en) Image-based health status identification method and apparatus, device and storage medium
US9348901B2 (en) System and method for rule based classification of a text fragment
US20210358127A1 (en) Interactive image segmentation
CN113627797B (en) Method, device, computer equipment and storage medium for generating staff member portrait
CN110781302A (en) Method, device and equipment for processing event role in text and storage medium
CN112380344A (en) Text classification method, topic generation method, device, equipment and medium
CN113360654B (en) Text classification method, apparatus, electronic device and readable storage medium
CN115730597A (en) Multi-level semantic intention recognition method and related equipment thereof
JP2023088281A (en) Image generation based on ethical viewpoints
US20230214679A1 (en) Extracting and classifying entities from digital content items
CN116821373A (en) Map-based prompt recommendation method, device, equipment and medium
WO2022073341A1 (en) Disease entity matching method and apparatus based on voice semantics, and computer device
CN114722174A (en) Word extraction method and device, electronic equipment and storage medium
JP2020067987A (en) Summary creation device, summary creation method, and program
CN117932022A (en) Intelligent question-answering method and device, electronic equipment and storage medium
CN115248890A (en) User interest portrait generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A SENT 09.09.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18866896

Country of ref document: EP

Kind code of ref document: A1