CN111538844A - Target field knowledge base generation and problem solution method and device - Google Patents
Target field knowledge base generation and problem solution method and device Download PDFInfo
- Publication number
- CN111538844A CN111538844A CN202010202748.5A CN202010202748A CN111538844A CN 111538844 A CN111538844 A CN 111538844A CN 202010202748 A CN202010202748 A CN 202010202748A CN 111538844 A CN111538844 A CN 111538844A
- Authority
- CN
- China
- Prior art keywords
- event
- predicate
- concept
- slot
- logic formula
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Animal Behavior & Ethology (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a method and a device for generating a target field knowledge base and solving a problem, and the method and the device determine a concept map, a case map and a predicate logic formula of the target field knowledge according to the knowledge type of the target field knowledge; and further generating a target domain knowledge base. The concept graph is used for representing the static relation among concept words; the event map is used for expressing the sequence among the events and the event relation among the events; the predicate logic formula is used to represent business rules in the target domain knowledge. The problem solving method comprises the following steps: determining M events triggered by N participle phrases of the problem from the concept map, and determining slot position values of slot positions of the M events according to K participle phrases matched with the concept map in the N participle phrases; calculating a predicate logic formula corresponding to a consultation object of the problem according to the M events and slot position values of slot positions of the M events; and then determine the answer to the question.
Description
Technical Field
The application relates to the technical field of computers, mainly relates to a natural language processing technology in artificial intelligence, and particularly relates to a method and a device for generating a knowledge base in a target field and solving problems.
Background
The key step of the question answering system is to search relevant knowledge from the existing reserve knowledge base to generate answers. In the prior art, the catalogue classification of knowledge can be carried out according to the range related to the problem, and the knowledge map is established. Or, directly facing to the application question-answer example, a common question-answer (FAQ) library is established, and a knowledge graph can be combined with the FAQ library, wherein the nodes of the knowledge graph are linked with the content-related FQA. However, in both the FAQ search and the search in which the FAQ and the ontology library are merged, answers can only be obtained from the existing FAQ and the knowledge base extended based on the ontology library, and if the content of the user's question does not exist in the existing FAQ library, the answer cannot be generated.
Disclosure of Invention
The application provides a method and a device for generating a knowledge base in a target field and solving a problem, which are used for solving the problem that a question-answering system in the prior art cannot generate an answer if the content of a question of a user does not exist in an original knowledge base.
In a first aspect, the present application provides a question answering method, including: determining N word-segmentation phrases from the question; determining M events triggered by the N word-separating phrases from a concept map, and determining slot position values of slot positions of the M events according to K word-separating phrases matched with the concept map in the N word-separating phrases; n, M, K is a positive integer; k is less than or equal to N, and M is less than or equal to N; determining a predicate logic formula corresponding to the consultation object of the problem according to the corresponding relation between a preset event and the predicate logic formula; the method comprises the steps that a predicate function in a predicate logic formula corresponds to an event in a case map, parameters of the predicate function correspond to slot positions of the event, and parameter values of the predicate function correspond to slot positions of the event; the predicate logic formula corresponding to the consultation object is obtained according to a business rule in the target domain knowledge corresponding to the consultation object; calculating the predicate logic formula according to the M events and slot bit values of slots of the M events; and determining an answer of the question according to an operation result of the predicate logic formula.
Aiming at the complex problem which is difficult to obtain by a search method and can be obtained only by logic inference, according to multi-knowledge expression formed by a case map, a concept map and a predicate logic formula in a target field knowledge base, on the basis of logic linkage between knowledge established by the case map, the concept map and the predicate logic formula, M events triggered by N participle phrases are determined from N participle phrases determined from problems input by a user, event instances of the M events, namely slot positions of slots of the M events, are determined according to K participle phrases matched with the concept map in the N participle phrases, and then, a predicate logic formula corresponding to a consultation object of the problem is determined according to the correlation of the consultation object of the problem and the predicate logic formula, logic derivation is carried out, a problem result is deduced, and knowledge inference is completed, the method and the system can be used for obtaining the answers of the problems, and solving the problems that the question answering system in the prior art cannot process reasoning of complex problems and is difficult to obtain the answers of the complex problems.
A possible design, for each of the M events, the event satisfying the following condition: one of the N participle phrases is matched with a trigger of the event, and: and a word segmentation phrase exists in the K word segmentation phrases matched with the concept map, a concept associated with the word segmentation phrase in the concept map is matched with the slot position type of a first slot position of the event, and the first slot position is a slot position in the event.
The method comprises the steps of determining an event which is possibly matched in N participle phrases by matching one participle phrase which exists in the N participle phrases with a trigger word of the event, determining the event which is possibly matched in the N participle phrases by matching the K participle phrases which are matched with a concept map with the type of a slot of a first slot in the event, and further determining M events which are matched in the N participle phrases, wherein the events can be matched from 2 aspects of the types of the slot of the starting word and the event, and the accuracy of event matching and the probability of event identification are effectively improved.
A possible design, for each of the M events, the event satisfying the following condition: one of the N participle phrases is matched with a trigger of the event, and: the K word phrases matched with the concept map have a word phrase, a concept associated with the word phrase in the concept map is matched with the slot type of the first slot of the event, the word phrase is the slot value of the first slot of the event, and the first slot is a slot in the event.
Matching the event from 2 aspects of starting words and the slot type of the event, further determining the slot value of the first slot in the event instance of the matched event by matching a concept associated in the concept map with the slot type of the first slot of the event, and further laying a foundation for determining the parameter value of the predicate function in the subsequent predicate logic formula.
A possible design, the concept word comprising a concept and a concept instance; for a word segmentation phrase in the K word segmentation phrases, the word segmentation phrase includes an associated concept in the concept graph, and the method includes: concepts of upstream nodes corresponding to the matched concept instances in the concept graph; or, concepts that match in the concept graph.
By the method, the matched concept words can be expanded into concepts and concept examples in the concept map, the probability of slot type matching between the concept words and the events in the concept map is effectively improved, and the success rate of event and event example determination is improved.
In one possible design, if the type of the question is a judgment type question, the operation result of the predicate logic formula is used as the answer; and if the type of the question is an interpretation type question, taking the operation process of the predicate logic formula and the operation result of the predicate logic formula as the answer.
By the method, the type of the problem provided by the user can be effectively determined, and further, different answer contents are provided for different problem types, so that the user experience is improved.
A possible design, the predicate logic formula including one or more predicate functions; the predicate logic formula comprises a predicate function, and the predicate function is an operation result of another predicate logic formula.
By the method, a logical operation method of the predicate logical formula is effectively utilized, and further, the logical operation between the events is realized through the corresponding relation between the events and the predicate function, so that the logic derivation required in the complex problem is realized, and the problem that the question-answering system in the prior art cannot process the complex reasoning is solved.
A possible design that performs, for each predicate function in the predicate logic formula: if the event corresponding to the predicate function is a first event, the first event is one of the M events, and: the slot position of the event corresponding to the parameter of the predicate function is the same as the first slot position of the first event, and then: and the parameter value of the predicate function is a slot bit value of the first slot of the first event.
According to the method, parameters of the predicate function in the corresponding predicate logic formula are determined through the corresponding relation between the event and the predicate function and the slot position value of the slot position of the event, so that the predicate logic formula corresponding to the consultation object is determined, the logic operation among the events is realized, the logic derivation required in the complex problem is realized, and the problem that the question-answering system in the prior art cannot process the complex reasoning is solved.
One possible design, the problem scenario is in the field of financial management accounting.
In a second aspect, the present application provides a method for generating a target domain knowledge base, including: determining a concept map, a case map and a predicate logic formula of the target domain knowledge according to the knowledge type of the target domain knowledge; wherein, the concept map is used for representing the static relation among concept words; the concept word is used for representing an object of the target domain knowledge; the event map is used for expressing the sequence among the events and the event relation among the events; the event is used for representing the relation between concept words expressed by predicates in the target field knowledge or the action between the concept words; a predicate function in the predicate logic formula corresponds to an event in the event graph, a parameter of the predicate function corresponds to a slot position of the event, and a parameter value of the predicate function corresponds to a slot position value of the slot position of the event; the predicate logic formula is used for representing business rules in the target domain knowledge; and generating a target field knowledge base according to the concept map, the affair map and the predicate logic formula.
By the method, a case map, a concept map and a predicate logic formula in a target field knowledge base are established to form multi-knowledge representation of the target field knowledge base, static relation among concept words is represented by the concept map, sequence among events and case relation among the events are represented by the case map, relation among concept words expressed by predicates in the target field knowledge or action among concept words is represented by the events, furthermore, a predicate function in the predicate logic formula corresponds to the events in the case map, parameters of the predicate function correspond to slot positions of the events, and parameter values of the predicate function correspond to slot positions of the slots of the events; the method comprises the steps of establishing logical relations among a case map, a concept map and a predicate logic formula, realizing logical links among different types of knowledge, realizing the possibility of logic deduction among the knowledge through the predicate logic formula, providing a knowledge deduction basis for a problem solution system, and solving the technical problem that in the prior art, answers of problems can only be obtained through a searching mode, so that complicated problems cannot be deduced and the answers of the problems are difficult to obtain.
A possible design, the event comprising: triggering a word and a slot position of an event; the trigger word is used for identifying a corresponding predicate when the event occurs; the slot type of the slot of the event corresponds to at least one concept word in the concept map.
The method comprises the steps of establishing a logical relation between an event and concept words by triggering words and slot positions of the event, wherein the slot positions of the event correspond to at least one concept word in the concept map, and providing a basis for representing various knowledge in a knowledge base.
One possible design, the predicate logic formula determination method includes: determining a predicate function in the predicate logic formula according to the event related to the business rule; determining a logical operator between the predicate functions according to the logical relationship between the events in the business rules; and connecting predicate functions in the predicate logic formula through the logic operator to determine the predicate logic formula.
By determining predicate functions corresponding to events and logical relations between events determined by business rules and expressing the logical operators between the predicate functions in the form of predicate logical formulas, business rules in languages are converted into predicate logical formulas capable of performing logical operations, further, logical deduction between the business rules is achieved, logical relations between knowledge in a knowledge base are established, a scheme for deducing knowledge through the logical operations is achieved, and support is provided for a problem solving system.
In a third aspect, the present application provides a problem solving apparatus, comprising: an obtaining unit, configured to determine N word-segmentation phrases from the question; determining M events triggered by the N word-separating phrases from a concept map, and determining slot position values of slot positions of the M events according to K word-separating phrases matched with the concept map in the N word-separating phrases; n, M, K is a positive integer; k is less than or equal to N, and M is less than or equal to N; the determining unit is used for determining a predicate logic formula corresponding to the consultation object of the problem according to the corresponding relation between a preset event and the predicate logic formula; the method comprises the steps that a predicate function in a predicate logic formula corresponds to an event in a case map, parameters of the predicate function correspond to slot positions of the event, and parameter values of the predicate function correspond to slot positions of the event; the predicate logic formula corresponding to the consultation object is obtained according to a business rule in the target domain knowledge corresponding to the consultation object; calculating the predicate logic formula according to the M events and slot bit values of slots of the M events; and determining an answer of the question according to an operation result of the predicate logic formula.
A possible design, for each of the M events, the event satisfying the following condition: one of the N participle phrases is matched with a trigger of the event, and: and a word segmentation phrase exists in the K word segmentation phrases matched with the concept map, a concept associated with the word segmentation phrase in the concept map is matched with the slot position type of a first slot position of the event, and the first slot position is a slot position in the event.
A possible design, for each of the M events, the event satisfying the following condition: one of the N participle phrases is matched with a trigger of the event, and: the K word phrases matched with the concept map have a word phrase, a concept associated with the word phrase in the concept map is matched with the slot type of the first slot of the event, the word phrase is the slot value of the first slot of the event, and the first slot is a slot in the event.
A possible design, the concept word comprising a concept and a concept instance; for a word segmentation phrase in the K word segmentation phrases, the word segmentation phrase includes an associated concept in the concept graph, and the method includes: concepts of upstream nodes corresponding to the matched concept instances in the concept graph; or, concepts that match in the concept graph.
A possible design, the determining unit being specifically configured to: if the type of the question is a judgment type question, taking the operation result of the predicate logic formula as the answer; and if the type of the question is an interpretation type question, taking the operation process of the predicate logic formula and the operation result of the predicate logic formula as the answer.
A possible design, the predicate logic formula including one or more predicate functions; the predicate logic formula comprises a predicate function, and the predicate function is an operation result of another predicate logic formula.
A possible design, the determining unit being specifically configured to: for each predicate function in the predicate logic formula, performing: if the event corresponding to the predicate function is a first event, the first event is one of the M events, and: the slot position of the event corresponding to the parameter of the predicate function is the same as the first slot position of the first event, and then: and the parameter value of the predicate function is a slot bit value of the first slot of the first event.
One possible design, the problem scenario is in the field of financial management accounting.
In a fourth aspect, the present application provides an apparatus for generating a target domain knowledge base, including: the determining unit is used for determining a concept map, a case map and a predicate logic formula of the target domain knowledge according to the knowledge type of the target domain knowledge; wherein, the concept map is used for representing the static relation among concept words; the concept word is used for representing an object of the target domain knowledge; the event map is used for expressing the sequence among the events and the event relation among the events; the event is used for representing the relation between concept words expressed by predicates in the target field knowledge or the action between the concept words; a predicate function in the predicate logic formula corresponds to an event in the event graph, a parameter of the predicate function corresponds to a slot position of the event, and a parameter value of the predicate function corresponds to a slot position value of the slot position of the event; the predicate logic formula is used for representing business rules in the target domain knowledge; and the generating unit is used for generating a target field knowledge base according to the concept map, the affair map and the predicate logic formula.
A possible design, the event comprising: triggering a word and a slot position of an event; the trigger word is used for identifying a corresponding predicate when the event occurs; the slot type of the slot of the event corresponds to at least one concept word in the concept map.
A possible design, the determining unit being specifically configured to: determining a predicate function in the predicate logic formula according to the event related to the business rule; determining a logical operator between the predicate functions according to the logical relationship between the events in the business rules; and connecting predicate functions in the predicate logic formula through the logic operator to determine the predicate logic formula.
In a fifth aspect, an embodiment of the present application further provides an electronic device, where the electronic device has a function of implementing the behavior of the electronic device in the example of the method in the first aspect. The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above-described functions.
In a possible design, the structure of the electronic device includes a processing unit, an input unit, and an output unit, and these units may perform corresponding functions in the method example of the first aspect, for specific reference, detailed description in the method example is given, and details are not repeated here.
In one possible design, the electronic device may include a processor and a communication unit in its structure, and may further include a memory. The communication unit is used for interacting with a user; the processor is configured to enable the electronic device to perform the respective functions of the method of the first aspect. The memory is coupled to the processor and retains program instructions and data necessary for the electronic device.
In one possible design, the electronic device includes a processor and a memory connected to each other, and the processor is configured to read and execute program instructions stored in the memory to perform the method mentioned in any one of the possible designs of the first aspect.
In a sixth aspect, an embodiment of the present application further provides an electronic device, where the electronic device has a function of implementing the behavior of the electronic device in the method example in the second aspect. The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above-described functions.
In a possible design, the structure of the electronic device includes a processing unit and an output unit, and may further include an input unit, and these units may perform corresponding functions in the method example of the second aspect, for specific reference, detailed description in the method example is given, and details are not repeated here.
In one possible design, the electronic device may include a processor and a communication unit in its structure, and may further include a memory. The communication unit is used for interacting with a user; the processor is configured to enable the electronic device to perform the corresponding functions of the method of the second aspect. The memory is coupled to the processor and retains program instructions and data necessary for the electronic device.
In one possible design, the electronic device includes a processor and a memory connected to each other, and the processor is configured to read and execute program instructions stored in the memory to perform the method mentioned in any one of the possible designs of the second aspect.
In a seventh aspect, this application embodiment further provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are called by the computer, the computer is configured to cause the computer to perform the method mentioned in any possible design of the first aspect or the second aspect.
In an eighth aspect, embodiments of the present application further provide a computer program product including instructions, which, when run on an electronic device, cause the electronic device to perform the method mentioned in any one of the possible designs of the first aspect or the second aspect.
In a ninth aspect, an embodiment of the present application further provides an electronic device, where the electronic device may be a chip, and the chip is connected to a memory and configured to read and execute program instructions stored in the memory, so as to implement the method mentioned in any one of the possible designs of the first aspect or the second aspect.
Drawings
FIG. 1 is a schematic diagram of an artificial intelligence body framework provided by the present application;
fig. 2 is a schematic diagram of an application scenario provided in the present application;
fig. 3 is a schematic structural diagram of an electronic device provided in the present application;
FIG. 4A is a schematic diagram of a method for generating a target domain knowledge base according to the present disclosure;
4B-4D are schematic diagrams of a target domain knowledge base provided herein;
FIG. 5 is a schematic diagram of a case map provided herein;
FIG. 6 is a schematic flow chart of a problem solving method provided by the present application;
FIGS. 7A-7B are schematic diagrams of a problem identification method provided herein;
FIGS. 8A-8B are schematic diagrams of a problem identification method provided herein;
FIG. 9 is a schematic diagram of a problem solving method provided by the present application;
fig. 10 is a schematic structural diagram of a problem solving device provided in the present application;
fig. 11 is a schematic structural diagram of a target domain knowledge base generation apparatus provided in the present application;
fig. 12 is a block diagram of an electronic device provided in the present application.
Detailed Description
Embodiments of the present application will be described below with reference to the accompanying drawings.
FIG. 1 shows a schematic diagram of an artificial intelligence body framework describing the overall workflow of an artificial intelligence system, which is applicable to the general artificial intelligence field requirements.
The artificial intelligence topic framework described above is set forth below in terms of two dimensions, the "intelligent information chain" (horizontal axis) and the "IT value chain" (vertical axis).
The "smart information chain" reflects a list of processes processed from the acquisition of data. For example, the general processes of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision making and intelligent execution and output can be realized. In this process, the data undergoes a "data-information-knowledge-wisdom" refinement process. The 'IT value chain' reflects the value of the artificial intelligence to the information technology industry from the bottom infrastructure of the human intelligence, information (realization of providing and processing technology) to the industrial ecological process of the system.
(1) Infrastructure: the infrastructure provides computing power support for the artificial intelligent system, realizes communication with the outside world, and realizes support through a foundation platform. Communicating with the outside through a sensor; the computing power is provided by intelligent chips (hardware acceleration chips such as CPU, NPU, GPU, ASIC, FPGA and the like); the basic platform comprises distributed computing framework, network and other related platform guarantees and supports, and can comprise cloud storage and computing, interconnection and intercommunication networks and the like. For example, sensors and external communications acquire data that is provided to intelligent chips in a distributed computing system provided by the base platform for computation.
(2) Data: data at the upper level of the infrastructure is used to represent the data source for the field of artificial intelligence. The data relates to graphs, images, voice and texts, and also relates to the data of the Internet of things of traditional equipment, including service data of the existing system and sensing data such as force, displacement, liquid level, temperature, humidity and the like.
(3) Data processing: data processing typically includes data training, machine learning, deep learning, searching, reasoning, decision making, and the like. The machine learning and the deep learning can perform symbolized and formalized intelligent information modeling, extraction, preprocessing, training and the like on data. Inference means a process of simulating an intelligent human inference mode in a computer or an intelligent system, using formalized information to think about and solve a problem by a machine according to an inference control strategy, and a typical function is searching and matching. The decision-making refers to a process of making a decision after reasoning intelligent information, and generally provides functions of classification, sequencing, prediction and the like.
(4) General-purpose capability: after the above-mentioned data processing, further based on the result of the data processing, some general capabilities may be formed, such as algorithms or a general system, e.g. translation, analysis of text, computer vision processing, speech recognition, recognition of images, etc.
(5) Intelligent products and industrial applications: the intelligent product and industry application refers to the product and application of an artificial intelligence system in various fields, and is the encapsulation of an artificial intelligence integral solution, the intelligent information decision is commercialized, and the landing application is realized, and the application field mainly comprises: intelligent manufacturing, intelligent transportation, intelligent home, intelligent medical treatment, intelligent security, automatic driving, safe city, intelligent terminal and the like.
Artificial intelligence has wide application in many fields, such as human-computer question-answer interaction and the like. The application provides a problem solution method based on a target field knowledge base, and belongs to the field of artificial intelligence.
The problem solving method based on the target field knowledge base is applied to a problem solving system of the target field knowledge base. It should be understood that a question and answer is a question and answer, and such a question and answer generally includes two types: one is a robot question and a robot answer, and the other is a robot question and a robot answer. The problem solution method based on the target domain knowledge base provided by the embodiment of the application generally occurs in the process that the machine is used as a user to interact with the target domain knowledge base, and the question and answer interaction between the user and the machine occurs.
Fig. 2 shows one possible application scenario to which the target domain knowledge base-based question answering method provided by the embodiment of the present application is applicable, where the application scenario may include a user and an electronic device. Wherein:
in the embodiment of the present application, the user generally refers to a user who needs to operate (e.g., read, query, etc.) on the target domain knowledge base, and therefore, in the embodiment of the present application, only the user is taken as an example for description. The electronic device may be an entity device having a function of outputting voice, and in a specific embodiment, the electronic device may be an intelligent terminal, such as a smart phone, an intelligent terminal and the like shown in fig. 2; the electronic device may also be a wearable terminal or a robot as shown in fig. 2. Of course, the electronic device is not limited to the example shown in fig. 2, and may be other electronic devices, such as a notebook computer, a tablet computer, a vehicle-mounted computer, a Personal Digital Assistant (PDA), a smart watch, a Personal Computer (PC), a television, and so on.
The electronic device at least has functions of receiving sound and voice and outputting the sound and voice.
In an optional mode, the electronic device has functions of sound or voice analysis, semantic analysis, voice synthesis, and the like in addition to the above functions, and if the electronic device can have data storage and data processing capabilities, only the user and the electronic device exist in the application scenario, and the problem solution process based on the target domain knowledge base can be completed.
In another alternative embodiment, if the electronic device does not have data storage and data processing capabilities, the electronic device may be connected to a server through a network, and the server stores and processes data, as shown in fig. 2.
Of course, when the electronic device has the capability of data storage and data processing, in order to reduce the energy consumption of the electronic device, the electronic device may also be connected to the server through the network, and the server completes the storage and processing of the data, which is not limited in this application.
Optionally, the electronic device may further include a camera in addition to the above functions, and the camera may be configured to capture a knowledge object (text) to read the knowledge object (text), or capture an image of a user for subsequent image analysis, and the like. Of course, in the case of a robot or other device with movable parts, the electronic device may also interact with the user more flexibly, such as hugging, pointing, etc., through limbs or movable parts.
It should be noted that the application scenario diagram shown in fig. 2 may also include other devices, which are not shown here.
Since the problem solving method based on the target domain knowledge base provided by the embodiment of the application is applicable to the electronic equipment, the electronic equipment is briefly introduced below. Fig. 3 shows a block diagram of a part of the structure of the electronic apparatus related to the present embodiment. Referring to fig. 3, the electronic device 300 may include: communication unit 310, power supply 320, processor 330, memory 340, input unit 350, output unit 360, audio circuitry 370, and the like. Those skilled in the art will appreciate that the configuration of the electronic device shown in fig. 3 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the electronic device 300 in detail with reference to fig. 3:
the communication unit 310 may provide voice or data communication capability, and may provide an interface for wired or wireless communication. Optionally, the communication unit 310 may include some or all of a Radio Frequency (RF) transceiver component, a Global Positioning System (GPS) transceiver component (e.g., the RF circuit 311 shown in fig. 3), a wireless fidelity (WiFi) component (e.g., the WiFi module 312 shown in fig. 3), other components, and so on; the communication unit 310 may also be a combination of software and hardware (e.g., antenna, modulator/demodulator, codec, analog/digital processing circuit, etc.).
The RF circuit 311 may be used for receiving and transmitting data during a message transmission or a call. Specifically, the RF circuit 311 sends the downlink data of the base station to the processor 330 for processing after receiving the downlink data; and in addition, sending the uplink data to be sent to the base station. Generally, the RF circuit 311 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuitry 311 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to global system for mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), etc.
The audio circuit 370, the speaker 371, and the microphone 372 may provide an audio interface between a user and the electronic device 300. The audio circuit 370 may transmit the electrical signal converted from the received audio data to the speaker 371, and the electrical signal is converted into a sound signal by the speaker 371 and output; on the other hand, the microphone 372 converts the collected sound signals into electrical signals, which are received by the audio circuit 370 and converted into audio data, which are then output to the RF circuit 310 for transmission to, for example, another electronic device, or output to the memory 340 for further processing.
WiFi belongs to short-distance wireless transmission technology, and the electronic device 300 can be connected with an Access Point (AP) through the WiFi module 312, so that access to a data network is realized. The WiFi module 312 may be used for receiving and transmitting data during communication with other devices.
The memory 340 may be used to store software programs and modules. The processor 330 executes various functional applications and data processing of the electronic device 300 by executing software programs and modules stored in the memory 340. Optionally, the memory 340 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, various application programs, and the like; the storage data area may store data created according to the use of the electronic device 300, and the like. Specifically, optionally, the processor 340 may further store static data (such as images and the like) and rules and the like required by the processor 330 and other modules. For example, in the embodiment of the present application, the memory 340 may store the content of the knowledge object (text), a database related to the knowledge object (text), and the like. In addition, the memory 340 may include a high speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid state storage device.
It should be noted that the functions of the memory 340 may be embodied in the electronic device 300 shown in fig. 3, and may also be implemented in a server (e.g., a cloud server), etc., which is only illustrated as a part of the electronic device 300, but is not limited to the memory.
The input unit 350 may be used to receive input numeric, voice or character information and generate key signal inputs related to user settings and function control of the electronic device 300. For example, the input unit 350 may receive a voice of an input user in the present embodiment. Specifically, the input unit 350 may include a touch panel 351 and other input devices 352.
The touch panel 351, which may also be referred to as a touch screen, may collect touch operations of a user on or near the touch panel 351 (for example, operations of the user on or near the touch panel 351 using any suitable object or accessory such as a finger or a stylus pen), and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 351 may include two parts, namely, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts the touch information into touch point coordinates, transmits the touch point coordinates to the processor 330, and can receive and execute commands sent by the processor 330. For example, when the user touches a knowledge object (text) directory displayed on the display panel 3611 with a hand on the touch panel 351, the touch detection device detects the signal caused by the touch, and then transmits the signal to the touch controller, the touch controller converts the signal into coordinates and transmits the coordinates to the processor 330, the processor 330 determines an operation to be performed on the knowledge object (text) directory according to the coordinates and the type (touch) of the signal (selects a knowledge object (text) in the knowledge object (text) directory), and then the processor 330 indicates to read the selected knowledge object (text).
In addition, the touch panel 351 can be implemented by various types, such as resistive, capacitive, infrared, and surface acoustic wave.
Optionally, the other input devices 352 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The output unit 360 may be used to output various information for user interaction or provided to the user. Optionally, the output unit 360 may include a display unit 361, and may further include a vibration motor (which may be used to provide vibration feedback), and the like.
The display unit 361 may be configured to display information input by a user, information provided to the user, and various menus of the electronic device 300, where the display unit 361 is a display system of the electronic device 300 and is configured to present an interface to implement human-computer interaction. For example, when receiving an instruction of a user requiring human-computer interaction, the input unit 350 transmits the instruction to the processor 330, and then the processor 330 displays a knowledge object (text) through the display unit 361 according to the instruction (specifically, the knowledge object (text) may be displayed through the display panel 3611), so that the user sees the knowledge object (text), and human-computer interaction may be realized.
The display unit 361 may include a display panel 3611, and optionally, the display panel 3611 may be configured in the form of a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), or the like. Further, the touch panel 351 can cover the display panel 3611, and when the touch panel 351 detects a touch operation on or near the touch panel, the touch panel transmits the touch operation to the processor 330 to determine the type of the touch event, and then the processor 330 provides a corresponding visual output on the display panel 3611 according to the type of the touch event. For example, when the touch panel 351 detects that a knowledge object (text) is selected by a user by clicking on the touch panel, the type of the touch event is determined by the processor 330 as a click, and the content of the selected corresponding knowledge object (text), such as a picture in the selected knowledge object (text), is displayed on the display panel 3611, so as to achieve the purpose of displaying the knowledge object (text).
Although in fig. 3, the touch panel 351 and the display panel 3611 are two independent components to implement the input and output functions of the electronic device 300, in some embodiments, the touch panel 351 and the display panel 3611 may be integrated to implement the input and output functions of the electronic device 300.
The processor 330 is a control center of the electronic device 300, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device 300 and processes data by operating or executing software programs and/or modules stored in the memory 340 and calling data stored in the memory 340, thereby implementing various services based on the electronic device 300. Optionally, the processor 330 may include one or more processing units; specifically, the processor 330 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, an application program, and the like, and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 330. For example, in the present application, the processor 330 may include a display driving unit, and after the processor 330 generates a knowledge object (text), the display driving unit may control the display panel 3611 to present the knowledge object (text) content. For another example, the memory 340 stores a display driver, and the processor 330 may call the driver in the memory 340 to control the display panel 3611 to present the content of a knowledge object (text).
The electronic device 300 further comprises the power source 320 (such as a battery) for supplying power to each component, and optionally, the power source 320 may be logically connected to the processor 330 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
It should be noted that, although not shown in fig. 3, the electronic device 300 may further include a camera, a bluetooth module, a sensor, and the like, which are not described herein again.
The problem solving system needs to search relevant knowledge from the existing reserve knowledge to generate answers. Therefore, in the problem-solving system, the representation of knowledge is important. In the current digital era, a large amount of data is accumulated in the operation process of internal business processes of internet industry or traditional enterprises, the data comprises records generated in the process of bottom layer operation, and also has different levels of experience accumulated by experts in various professional fields in actual work, rules for decision and judgment of professional problems and the like, and knowledge in different expression forms. Background knowledge in the existing business field is complex, for example, knowledge representations of different enterprises are various, and an effective knowledge representation method is lacked to fuse the existing relations among different knowledge representations, so that the functions of different knowledge types are fully exerted. Especially, when a knowledge consumption system (such as a question answering system) is constructed, since the knowledge accumulated by experts already exists, most of the knowledge is scattered in various texts, the knowledge between the texts lacks a structured representation, and the knowledge association based on internal logic is difficult to establish, so that the effective application of the knowledge is prevented. For example, when the question answering system searches for answers for users, it is difficult to take into account knowledge directly related to the answers and business background knowledge. In the process of obtaining the final answer by using the existing knowledge, the problem solution system needs to synthesize a plurality of knowledge points and determine the internal relation among the knowledge points, and finally the accurate answer can be given. Without proper knowledge representation, it is difficult to support knowledge acquisition, determine the internal connections between knowledge points through logical inference, and infer the process of giving an accurate answer.
Based on the problems that the professional knowledge types in the service field are various, the logic chain is long, and a knowledge representation mode cannot express the panoramic view of the knowledge in the target field, the embodiment of the application provides a problem solution method, the problem solution method is based on a knowledge base related to the knowledge in the target field, the knowledge base needs to be established in advance and can be pre-stored in the electronic equipment to be used for data processing, or the knowledge base is pre-stored in a server connected with the electronic equipment to be used for data processing with the assistance of the server. As shown in fig. 4B, the target domain knowledge base in the embodiment of the present application may include: concept maps, affair maps and predicate logic formulas. As shown in fig. 4A, the present application provides a method for generating a target domain knowledge base, including the following steps:
step 401: determining a concept map, a case map and a predicate logic formula of the target domain knowledge according to the knowledge type of the target domain knowledge;
wherein, the concept map is used for representing the static relation among concept words; the concept word is used for representing an object of the target domain knowledge; the event map is used for expressing the sequence among the events and the event relation among the events; the event is used for representing the relation between concept words expressed by predicates in the target field knowledge or the action between the concept words; a predicate function in the predicate logic formula corresponds to an event in the event graph, a parameter of the predicate function corresponds to a slot position of the event, and a parameter value of the predicate function corresponds to a slot position value of the slot position of the event; the predicate logic formula is used for representing business rules in the target domain knowledge;
step 402: and generating a target field knowledge base according to the concept map, the affair map and the predicate logic formula.
For step 401, the target domain knowledge may be split into 3 levels according to knowledge types. The target domain knowledge may be business domain knowledge, for example, financial management accounting domain, or professional domain, industrial domain, public domain, or other domain knowledge, which is not limited herein.
In the first layer, concept examples and concepts of the target domain knowledge can be determined to determine concept words of the target domain knowledge, and further, a concept graph is determined according to the relation between the concept words, so that the method can be used as a method for representing the first layer knowledge. Concept words may be used to define objects in the target domain knowledge.
Concept map: used for describing static objects and semantic relationships between concepts or concept instances. For example, expressing knowledge in the professional domain, the public domain, in a form that more closely resembles the human cognitive world provides an ability to better organize, manage, and understand knowledge in the target domain. Determining the catalogue, the concept instance or the term of the concept map by collecting related corpora, policies, documents and the like in the range related to the problem solving system of the target domain knowledge. For example, a question-answer library is acquired from a corpus, and the corpus is collected by a web crawler and combined with corpora stored in a relational database to form the question-answer library; the ontology library is extracted manually, and ontology knowledge is extracted from the corpus as concept examples, including knowledge catalogues and classifications in the target field and concept examples of each category; and the ontology library is established in a structured form on the basis of the ontology concept and is used for describing concept examples in the objective world and the relation among the concept examples. The term library may include a definition description of proper nouns, synonyms of terms, attributes. A concept graph is established through a corpus, an ontology base, a term base and the like, concepts are abstracted and extracted, and the concepts can be root nodes corresponding to concept instances. The concept instances serve as downstream or leaf nodes of the concept. In the concept graph, taking the concept instances as nodes and the concept instance relations as edges, the relations between the concept instances may include: upper and lower relations, or an inclusive relation.
For example, as shown in fig. 4C, the concept graph represents a concept instance, which may include: personnel, company employees, outsourcing employees. Concept example relationships are personnel including company employees, outsourcing employees. Customer, individual user, organization company. For example, a concept instance of a concept graph representation may include: project expenditure, personnel expenditure, equipment expenditure. The concept example relationship is as follows: project expenditure includes personnel expenditure and equipment expenditure. As another example, concept instances, such as "liu de hua", concepts, such as "actors", may have a generic relationship (isA relationship) between them, such as "liu de hua isA actors", and concepts may include a generic relationship (sublassof relationship) between them. Such as "movie actor isA actor".
The target domain knowledge can be used as a second-layer knowledge representation mode through the representation of the affair atlas, and is used for describing the procedural dynamic knowledge such as single or multiple object actions and behaviors.
In one possible embodiment, the event graph includes events and event relationships between the events. The event can be represented by a frame, and the frame can contain one or more slots, the slots of the event are used for describing elements of the event, and the types of the slots to which the slots belong can correspond to concepts or concept instances in the concept graph. Further, the semantic relationship of the elements of the event may be obtained by linking to a concept graph. Each event node is represented in the frame of the event, and the slot bit value of a slot is related to the slot type of the slot. The slot type of the slot of the event corresponds to at least one concept word in the concept map. Wherein the corresponding at least one concept word may be a concept of an upstream node corresponding to the matched concept instance in the concept graph; or, concepts that match in the concept graph.
In addition, the event may further include a trigger word, and the trigger word may be used to identify a predicate corresponding to the event when the event occurs, and further may be used to match the event.
As shown in fig. 4D, "delivery under contract event", the trigger of the delivery under contract event is delivery under contract. There are the deliverer, the party to be delivered, the content delivered, these several elements make up a slot called the event framework. The value of the slot position is also limited by the type of the slot position, for example, the type of the slot position in which the value of the consignor is to be filled is a person; examples of concepts may be employees, company employees, outsourcing employees, etc. The slot position type corresponding to the slot position value filled by the delivery party is a client; corresponding concept examples are personal users, organization companies; the slot type corresponding to the delivery content can comprise a contract and a site; the concept example corresponding to the slot value of the delivered content filling can be the specific contract content, the contract delivery place.
For another example, a pay-off event is defined, the trigger word for generating pay-off is provided for providing labor, the slot of the event frame includes a main body and pay-off contents, the slot type corresponding to the main body slot may be a contract delivery activity, and the slot value corresponding to the main body slot may be a specific concept example of contract delivery. The type of the slot position corresponding to the expenditure content slot position can be activity expenditure and personnel expenditure. The slot value corresponding to the payout content slot may include project payout, personnel payout, equipment payout, and the like.
And establishing connection between events and concept words through the slot type of the event slot and the concept words so as to establish the relationship between the concept map and the affair map. The establishment of the relation provides mutual verification and verification between knowledge for subsequent event identification and knowledge reasoning.
A reason map: the event graph takes events as carriers to describe the procedural dynamic knowledge. The study objects are the constituent events and the relationships between the events. An event is composed of multiple elements, a unit of knowledge that is more granular than a concept.
The event graph focuses on describing events in the target domain knowledge and the event-physical relationship among the events. The nodes in the event graph represent events, the edges in the event graph represent the order of occurrence between events, and the event relationships between events. And forming a affair map by using the relation of the connection events as an edge. At present, the establishment of the affair map mainly uses manual work as the main factor and is used for determining the affair relations among events, and the affair relations can include sequence relations, causal relations, condition relations, implication relations and the like. For example, a fact map may be used to represent financial events and order of occurrence. As shown in FIG. 5, the contract delivery event and the generation of the payout event are directly causal.
The matter relationship may represent the following:
in the embodiment of the application, the business rule of the target domain knowledge can be expressed by the predicate logic formula and can be used as a third-layer knowledge expression mode of the target domain knowledge. When complex business rules in the professional field are expressed, a plurality of events are involved, the implication relation among long paths among the events cannot be determined only through a case map. The operation of the predicate logic formula is a form inference method, does not depend on a specific field, and has high universality and high logic expression capability.
Predicate logic: a system of symbolic forms in mathematical logic. The predicate logic divides simple propositions into main terms, predicate terms and quantity terms and researches the formal structure of the propositions and the logic checking theory of the rules and the rules of reasoning of the propositions. The predicate logic has stronger logic expression capability in the aspect of describing the logic relation of the domain knowledge. The method is suitable for being applied to a scene of selecting an adaptation rule to carry out knowledge inference through known conditions. The general process comprises the following steps: and (3) inputting the known conditions as facts by a user, and reasoning through a rule base containing the domain knowledge and expressed by a predicate logic formula to obtain an answer. For example, some expert systems, such as medical diagnostics, financial investment decisions, and the like, have many inferences that are done based on predicate logic. For another example, a system for evaluating the quality of a mathematical question answer based on a predicate logic formula is provided, and the reasoning correctness of students in the process of making a mathematical proof question is analyzed. However, in the problem answering system, the language expression of the user problem is flexible, the precondition of the predicate logic expression is fixed, the language corresponding to the user problem is difficult to be directly associated with the rule expressed by the predicate logic formula, and the existing problem answering system cannot determine the answer of the problem based on the existing predicate logic formula.
In the embodiment of the application, business rules among the target domain knowledge are expressed by predicate logic formulas. A predicate function in the predicate logic formula is used for representing an action and corresponds to an event of the physical graph; parameters of predicate functions in the predicate logic formula are used to represent static relationships between objects, and may correspond to concept instances or concepts of the concept graph.
Predicate logic formula: and expressing business rules among a plurality of events in the domain knowledge through a predicate logic formula on the basis of concept instances or concepts defined by the concept graph and events defined by the event graph.
The predicate logic formula can be divided into a rule header and a rule body, wherein the rule body is a precondition and is also called a FACT, and the rule header is a conclusion deduced based on the FACT. Both parts are composed of predicate functions. In the embodiment of the application, a first-order predicate logic formula is taken as an example to represent business rules in the professional field.
The basic elements of the first order predicate logic formula may include: punctuation, parentheses, logical operators, constant symbol sets, quantifier, n-gram function symbol sets, n-gram predicate symbol sets.
For example, expressed in a predicate logic formula — the parent of a parent is a grandparent can be expressed as:
And (3) a predicate function: fatherof (X, Y), Fatherof (Y, Z), Grandfatherof (X, Z)
The logical operator: lambda, representing the conjunction, i.e., when the predicate function farmotherof (X, Y) and the predicate function farmotherof (Y, Z) occur simultaneously, the predicate function grandfarmotherof (X, Z) can be derived.
For example: the operation accounting rules in the finance field are described by texts: the activity or personnel incurred expenses associated with delivery of the service contract should be credited with the cost of the service. The business rule defined by the service cost comprises 3 levels of knowledge, and the lowest level is a conceptual example of the field, including activities, personnel and service cost. Events above the concept-based instance, including contract delivery events, generate expenditure events, pertain to cost of service events, pertain to activity expenditure events, and pertain to personnel expenditure events. Business rules established on top of the concept instances and events, wherein the business rules comprise the rule bodies as follows: service contract delivery, which generates expenditure, belongs to activity expenditure and personnel expenditure; the business rules include a rule header that pertains to the cost of service. At this time, the predicate function may include: generates an expenditure (X, Y), contract delivery (X), belongs to an activity expenditure (Y), belongs to a personnel expenditure (Y), and belongs to a service cost (Y). Wherein, X can be personnel or activities, and Y is a value corresponding to expenditure. At this time, the predicate logic formula may be expressed as:
ep X ep Y (production expenditure (X, Y) Λ contract delivery (X) Λ (belonging to activity expenditure (Y) v-v belonging to personnel expenditure (Y))) - > belongs to service cost (Y).
Wherein Э x Э y indicates the existence of the x existence y. logical operator, for example, a V-shaped graph indicates extraction (if only one event occurs in two or more events, the extraction is required), Λ indicates conjunction (if two or more events must occur simultaneously, the conjunction is required), inclusion, or negationAnd the like. The predicate functions are connected through logical operators, express incidence relations and implication relations among events, and express new events derived from known events or derive relations among new events.
When the predicate logic formula is used for operation, the predicate logic formula can be generated according to the common properties and laws of formal deductive reasoning, and the predicate logic formula comprises the following steps:
law of moke
Law of distribution
Law of exchange
Law of association
Quantifier distribution
Inverse law of negativity
Negative word measure
Virtual element of constraint variable (constraint variable name does not affect)
The predicate logic formula is a knowledge representation method which can carry out logic operation among business rules expressed on the basis of knowledge representation of concept words and events. A predicate function in a predicate logic formula corresponds to an event, a parameter in the predicate function corresponds to a slot of the event, and a parameter value type of the predicate function corresponds to a concept instance or concept in a concept graph. And the predicate logic formula is used as knowledge representation of the rule, and the expression of the predicate logic and the fusion between the concept graph and the case graph are realized by associating the predicate function with the event and corresponding the predicate function parameter and the event slot position.
The knowledge representation method of 3 levels is effectively extracted by combining three knowledge representation modes of the concept map, the case map and the predicate logic formula, and the integrity of the knowledge expressing the target field is improved by utilizing the advantages of the concept map, the case map and the predicate logic formula when the target field knowledge is expressed. And expressing the logic relation among the business rules by adopting a predicate logic formula mode, and realizing the logic operation of the business rules so as to realize the knowledge reasoning among the business rules. And the knowledge representation of the concept map and the case map is fused, the internal logic relation between knowledge points is established, so that the relation between concept words, events and business rules in the target domain knowledge is established, the inference among the knowledge is supported, and different knowledge expression forms in the complex target domain knowledge are solved. By establishing three knowledge representation modes of a concept graph, a case graph and a predicate logic formula and relations of the knowledge representation modes, different knowledge is extracted from flexible languages, knowledge points are abstracted and generalized, inference among knowledge is facilitated, and answering of difficult explanatory questions in a question answering system is facilitated.
Example 1
The embodiment of the application provides a knowledge representation mode in the field of financial management and accounting rules, wherein the field of the management and accounting rules is mainly used for defining accounting rules or accounting apertures for main operation indexes of a company. The hardware platform used in the implementation of the present application may be a general-purpose PC computer, the software may be implemented using python3.5, and the step of constructing the target domain knowledge base may include:
determining three types of knowledge representation modes: concept words, events, predicate logic formulas. Concept words include concept instances or concepts, which are abstractions of objects in the knowledge of the target domain, expressing static knowledge. Events describe the behavior, action or state of an object, expressing knowledge of dynamics. The predicate logic formula is an abstract description of rules in the target domain knowledge (for example, specifications and criteria followed in the target domain knowledge), and the predicate logic formula may be composed of a rule header and a rule body, and the rule header may be derived through a logic operation of the rule body to express business rules among multiple events in the target domain knowledge, so as to implement explicit implication relationships among the knowledge.
And (I) constructing a map.
And extracting and collecting concept words in the target field knowledge, and combing the relation between the concept words to form a concept map. Take the definition of the cost of service as an example.
Examples of concepts may include: cost of service, concepts related to cost of service include: service cost differences, settlement costs, labor costs, definition of service costs, accounting ranges, settlement rules, other service costs. Wherein, the accounting range includes: the attribution method comprises the following steps: by department, by subject and product, by subject and project. Wherein the settlement rules include: a delivery field; the delivery field includes: and (5) settlement scene.
Concepts related to human costs include: definition of human cost, accounting range, human cost type, settlement human cost and project absorption cost.
The direct apportionment rules may include: cost under the scenes of project delivery cost, service department cost and the like; the cost of the delivery item may include the service product; for example, the service products may include service product 3, service product 4, and service product 5.
(II) Chart of affairs
And refining and collecting the events in the target field knowledge, and combing the relationship among the events to form a matter graph.
As shown in fig. 5, the event map may include a contract delivery event, a production expenditure event, a service cost confirmation event, a human cost confirmation event, a work order settlement event, and a settlement cost confirmation event.
Wherein, the trigger words of the service cost confirmation event comprise: and the service cost confirms that the slot of the event comprises a subject and an object, and the slot type of the subject in the event comprises: labor expenditure or personnel expenditure. The slot types of the objects in the cost of service validation event include: the cost of service.
The trigger words of the human cost confirmation event include: yes/belong to, the slot position of human cost, human cost confirmation event includes subject and object, and the slot position type of subject in the human cost confirmation event includes: the expenditure of personnel. The slot types of the object in the human cost validation event include: the cost of labor.
The trigger words of the settlement cost confirmation event include: and the slot position type of the subject in the human cost confirmation event comprises: and (5) settlement of the work order. The slot types of the object in the human cost validation event include: and (5) settlement cost.
The trigger words of the work order settlement event comprise: the work order settlement, the slot position of the work order settlement event comprises the settlement cost, and the slot position type corresponding to the slot position of the work order settlement event can be as follows:
the contract delivery event and the generated expenditure event are in causal relationship, the generated expenditure event and the service cost confirmation event are in conditional relationship, the generated expenditure event and the human cost confirmation event are in conditional relationship, the contract delivery event and the work order settlement event are in causal relationship, and the work order settlement event and the settlement cost confirmation event are in conditional relationship.
(III) predicate logic formula:
for the concept graph and the corresponding events, related business rules can be searched, the business rules (such as accounting rules) in the knowledge of the collected target field can be extracted, and a predicate logic formula set can be generated according to the predicate logic. The business rule corresponding to the predicate logic formula can include: a service cost rule, a human cost rule, a settlement cost rule, and a settlement cost difference rule. The rule type of the cost of service rule is a business guideline. The rule types of the human cost rule, the settlement cost rule and the service cost difference rule are accounting indexes. The following describes a method for generating predicate logic formulas corresponding to the above 4 business rules by using examples 1 to 4.
Example 1
Specifically, the service cost rule includes: expenses incurred by activities or personnel directly associated with delivery of the service contract should be credited with the cost of the service, including direct engagement with the service and expenses incurred by personnel directly managing and supporting the engagement with the service.
In the cost of service rule, events that can be identified include: examples of concepts that may be identified for generating expense events, contract delivery events, service cost validation events include: activities, personnel. Thus, the cost of service rule may be expressed as: ethylene oxide X ethylene oxide Y (production expenditure (X, Y) Λ contract delivery (X) Λ (activity expenditure (Y) v-shaped staff expenditure (Y))) - > service cost (Y)
And determining a rule header included by the service cost rule as a service cost confirmation event according to a generation rule of the predicate logic. The rule body includes: generating an expenditure event, a contract delivery event, belonging to an activity expenditure event, belonging to a personnel expenditure event. The corresponding predicate function may include:
generating a payout event correspondence predicate function: generating an expenditure (subject ═ X, content ═ Y)
And (3) a predicate function corresponding to the contract delivery event: contract delivery (deliverer X)
Matching the recognizable concepts through slot types of slots of the events, determining the events corresponding to the recognizable concepts, and further determining event instances (specific knowledge) contained in the predicate logic according to concepts defined in a concept graph or a case graph.
The event corresponding to the activity expenditure belongs to the activity expenditure event, and the event corresponding to the personnel expenditure belongs to the personnel expenditure event, so that the event instance corresponding to the concept can be determined according to the event corresponding to the concept. For example, the expense belonging to the activity is the event, and the cost of purchasing the raw material is the event instance corresponding to the expense belonging to the activity.
And (3) a predicate function corresponding to the activity expenditure event: belonging to a movable expenditure (Y)
And (3) a predicate function corresponding to the personnel expenditure event: belonging to the personal expenditure (Y)
And (3) belonging to predicate functions corresponding to the service cost events: belonging to the service cost (Y)
Therefore, the predicate logic formula corresponding to the service cost rule can be expressed as: ep X ep Y (generation of expenditure (main body ═ X, content ═ Y) Λ contract delivery (deliverer ═ X) Λ (belonging to activity expenditure (Y) v-cutter belonging to personnel expenditure (Y))) - > belonging to service cost (Y)
Example 2
The human cost rules include the expenses of the company and the outsourcing human resources, which mainly refer to the delivery activities, and can include wages, bonus, social insurance, water, electricity and gas fees, communication fees, travelling fees and the like.
In the human cost rule, the events that can be identified include: generating expenditure events, contract delivery events, labor cost validation events, identifiable concepts including: the company has manpower, outsourcing manpower, and the expenditure content is as follows: wages, prizes, social insurance, water, electricity and gas fees, communication fees, travelling fees and the like. Therefore, the predicate logic formula corresponding to the human cost rule can be expressed as: EPE X EPE Y (expenditure (X, Y) Lambda contract delivery (X) Lambda (company personnel expenditure (Y) V-shaped outsourcing personnel expenditure (Y))) - > manpower cost (Y)
In the human cost rule, the rule header is a service cost validation event. The rule body includes: generating an expenditure event, a contract delivery event, an expenditure event pertaining to a company personnel, an expenditure event pertaining to an outsourced personnel. The corresponding predicate function may include:
generating a payout event instance correspondence predicate function: generating an expenditure (subject ═ X, content ═ Y)
And (3) a predicate function corresponding to the contract delivery event instance: contract delivery (deliverer X)
And (3) a predicate function corresponding to the human cost event instance: belonging to the expenditure of manpower cost (Y)
Matching the recognizable concepts through slot types of slots of the events, determining the recognized concept instances or events corresponding to the concepts, and further determining event instances (specific knowledge) contained in the predicate logic according to the concept instances or concepts defined in the concept graph or the event graph.
The corresponding events of the expenditure of the company personnel are as follows: belonging to a staff expenditure event; the corresponding events of outsourcing personnel expenditure are as follows: belonging to personnel expenditure events, and further determining corresponding event instances according to concepts.
And (3) a predicate function corresponding to an event instance belonging to the personnel expenditure event: belonging to company personal expenditure (Y)
And (3) a predicate function corresponding to an event instance belonging to the personnel expenditure event: belonging to outsourcing personal expenditure (Y)
Therefore, the predicate logic formula corresponding to the service cost rule can be expressed as: ep X ep xy (generation of expenditure (main body ═ X, content ═ Y) Λ contract delivery (deliverer ═ X) Λ (belonging to company staff expenditure (Y) v-shaped belonging to outsourced staff expenditure (Y))) - > belonging to human cost (Y)
Example 3
Settlement cost rules comprising: the work order settlement cost under the global service delivery sharing center department, and the like.
In the settlement cost rule, events that can be identified include: a work order settlement cost event, a service delivery occurrence event and a settlement cost confirmation event; examples of concepts that may be identified include: and the service delivery sharing center department, settlement and service cost. Thus, the settlement cost rule can be expressed as: cost of settlement for EPE X work order (X) Lambda service delivery occurrence (X) - > cost of settlement (X)
In the settlement cost rule, the rule header is a settlement cost confirmation event. The rule body includes: work order settlement cost events, service delivery events. The corresponding predicate function may include:
the work order settlement cost event instance corresponds to a predicate function: work order settlement cost (X)
Matching the concept instances which can be identified through slot types of slots of the events, determining the events corresponding to the identified concept instances, and further determining the event instances (specific knowledge) contained in the predicate logic according to the concept instances or concepts defined in the concept graph or the event graph.
And (3) a predicate function of an event instance corresponding to the service delivery occurrence event: service delivery occurrence (X)
And (3) a predicate function corresponding to the settlement cost event instance: belonging to settlement cost (Y)
Example 4
A cost of service differentiation rule comprising: in resource departments such as manpower and service, the service cost of the delivered item is not absorbed by direct collection or internal settlement (such as filling and reporting work hours).
In the cost of service differentiation rules, events that can be identified include: a service cost validation event, a service cost differential event, grouped to a delivery project event. Concepts that may be identified include: the fee is directly collected to the delivery item and is internally settled to the delivery item. Thus, the cost of service differentiation rule can be expressed as: EPE Y SERVICE COST (Y) (L (fee directly collected to delivery item (Y)) + (interior settled to delivery item (Y))) - > service COST DIFFERENCE (Y)
Wherein "" indicates a negative relationship, and "E" indicates the presence.
The service cost event instance corresponds to a predicate function: cost of service (Y)
The service cost difference instance corresponds to a predicate function: cost of service Difference (Y)
Matching the recognizable concepts through slot types of slots of the events, determining the events corresponding to the recognizable concepts, and further determining event instances (specific knowledge) contained in the predicate logic according to concepts defined in a concept graph or a case graph.
Here, the events corresponding to the direct aggregation of the fees to the delivery items may be: aggregation to delivery item events
The events corresponding to internal settlement to delivery items may be: aggregation to delivery item events
Thus, the predicate function of the corresponding event instance is: the fees are directly collected to the delivery item (Y) and internally settled to the delivery item (Y)
Therefore, the predicate logic formula corresponding to the service cost difference rule can be expressed as: EPE Y SERVICE COST (Y) (L (fee directly collected to delivery item (Y)) + (interior settled to delivery item (Y))) - > service COST DIFFERENCE (Y)
For the generation methods of other predicate logic formulas in the target field, reference may be made to the above embodiments, which are not described herein again.
Based on the knowledge base provided by the present application, as shown in fig. 6, an embodiment of the present application provides a problem solution method, which may include the following interaction processes: the user asks questions to the electronic device, which answers the user's questions. Of course, there are other voice interactions between the user and the electronic device in the above process, and the like, which is not limited herein. The method specifically comprises the following steps:
step 601: determining N word-segmentation phrases from the question; n is a positive integer;
step 602: determining M events triggered by the N word-separating phrases from a concept map, and determining slot position values of slot positions of the M events according to K word-separating phrases matched with the concept map in the N word-separating phrases;
step 603: determining a predicate logic formula corresponding to the consultation object of the problem according to the corresponding relation between a preset event and the predicate logic formula; the method comprises the steps that a predicate function in a predicate logic formula corresponds to an event in a case map, parameters of the predicate function correspond to slot positions of the event, and parameter values of the predicate function correspond to slot positions of the event; a predicate logic formula corresponding to the consultation object is obtained according to a rule corresponding to the consultation object;
step 604: calculating the predicate logic formula according to the M events and slot bit values of slots of the M events;
step 605: and determining an answer of the question according to an operation result of the predicate logic formula.
The question answering method aiming at the user questions is flexible, when the problem answering system in the professional field provides the explanation type questions for the user, no ready-made answers exist in the target field knowledge base, namely the answers of the questions cannot be determined in a retrieval mode, and especially when the field knowledge comprises more complex logic relations of business rules, such as a plurality of precondition, and the reasoning path between the questions and the answers is long, the answers cannot be obtained through the retrieval scheme in the prior art. In the embodiment of the application, according to the problem input by the user, the corresponding relation between the preset consulting object and the predicate logic formula is called from the target field knowledge base by the method, and the predicate logic formula corresponding to the consulting object of the problem is determined; and according to the fact map and the concept map, assigning values to parameters of a predicate function in the predicate logic formula, calculating the predicate logic formula, and deducing answers of the problems through a reasoning method. For example, in one possible scenario, when an electronic device (e.g., a financial questioning and answering robot) receives an explanatory question posed by a user (financial business person), the user is provided with an answer using a target domain knowledge base (e.g., a target domain knowledge base that may be formed for relevant knowledge of accounting policy statements).
Firstly, the question answering system can analyze texts from questions collected by a user side to finish semantic understanding (including word segmentation phrase recognition, word syntax analysis, concept word recognition and event recognition); taking the result of semantic understanding as input, further identifying the intention of the user: the method comprises the steps of analyzing information such as a consultation object of a question provided by a user, the type of the question and the like to more comprehensively understand the question of the user, being beneficial to determining a predicate logic formula corresponding to the consultation object, and further realizing the operation of the predicate logic formula to obtain the answer of the question.
As shown in fig. 7A, the problem solving system may include the following modules: the system comprises a preprocessing module, a concept word recognition module, an event recognition module, an intention recognition module, an event slot position value determination module, a predicate logic formula screening module, a predicate logic formula operation module, an operation result output module and an answer generation module.
With respect to step 601, the step of obtaining N word-segmented phrases may be performed by a text pre-processing module. The text preprocessing module is used for completing processes of word segmentation of the problem, removal of stop words in the problem, part-of-speech tagging of word segmentation phrases determined by word segmentation in the text and the like so as to obtain N word segmentation phrases in the problem.
Preprocessing a user's question, including: and performing preprocessing modes such as word segmentation on the problem and removing stop words in the problem. The stop word is a word that is used to save storage space and improve search efficiency, and the search engine may automatically ignore some words or words, such as assist words, adverbs, prepositions, conjunctions, etc., when indexing a page or processing a search request, and usually has no definite meaning. In the word segmentation process, the text is matched with the phrases in the new word dictionary by loading the new word dictionary, and the word segmentation phrases are determined. The new word dictionary comprises a large number of frequently-appearing fixed collocation phrases in the documents determined by a new word discovery mode from a large number of field linguistic data.
For example, a question input by a user includes n atomic words, W1,,W2,W3,,W4,,W5,,W6,…,Wn-1,Wn. According to the sequence relation between n atomic words and n atomic words in the question, matching with the phrase in the new word dictionary to determine W1,,W2To fix collocated new word phrases, therefore, n atomic words can be divided into k phrases, as shown in the following formula:
W1,,W2,W3,,W4,,W5,,W6,…,Wn-1,Wn=>(W1,,W2),W3,,W4,,(W5,,W6,…), Wn-1,Wn=S1,S2,S3,.....Sk,
the method for discovering new words can refer to the prior art, and is not described herein in detail.
Furthermore, the N word segmentation phrases can be identified by a concept word identification module of the concept graph, so as to determine concepts or concept instances associated with the word segmentation phrases in the question.
The concept map of the target domain knowledge base comprises concept instances or concepts appearing in the corpus corresponding to the target domain knowledge, and the relationship such as the superior-inferior relationship, the inclusion relationship, the correlation relationship and the like among the concept instances or concepts. And determining a concept word associated with the word segmentation phrase in the concept map by matching the word segmentation phrase ontology with the concept instance or concept in the concept map through a word segmentation phrase identification process.
Specifically, fuzzy matching and similarity calculation can be performed according to concept examples or concepts in the concept graph, and concept word recognition is completed. Through a concept word recognition algorithm, a word segmentation phrase set S ═ S input by a user1,S2,S3,.....SN,The associated concept or concept instance in S is identifiedk->Cj,And establishing a link with the concept map. The similarity calculation can be determined by the following formula:
in a first mode
Wherein Si ∈ S, S is a set of word-segmentation phrases, Cj ∈ C, C is a concept instance or concept in a concept map, Ldist represents a character string SiAnd C isjThe edit distance of (1). I Si|,|CiRespectively representing character strings SiAnd CiLength of (d). 1 ≦ i, j ≦ N. N, i, j are positive integers.
Mode two
Similarity2(Si,Cj)=COS(word2vec(Si),word2vec(Cj))
Wherein, word2vec (S)i) Meaning the word SiThe corresponding word vector representation. COS (word2vec (S)i),word2vec(Cj) ) represents SiAnd CjCosine similarity of (c). Word vectors may be trained through domain specials corpora. The granularity of the word phrase in word vector training keeps the minimum granularity of the semantic at the atomic level. Wherein S isi=W1,W2…WnConsists of a plurality of atomic words, and the corresponding word vector can be represented as:
mode III
Similarity(Si,Cj)=W1×Similarity1(Si,Cj)+(1-W1)×Similarity2(Si,Cj)
And carrying out weighted average by combining the similarity in the first mode and the second mode to determine a concept example or concept corresponding to the word segmentation phrase, and finding the concept of an upstream node of the concept example through a concept graph to serve as the concept related to the word segmentation phrase for matching the event related to the word segmentation phrase.
For example, the user asks for a phrase "three Zhang in contract delivery process generates an expense belonging to a participle phrase of which the service cost is" three Zhang "appears," three Zhang can find a node corresponding to the concept instance of the three Zhang in the concept graph according to the similarity algorithm, further find the concept of an upstream node corresponding to the concept instance through the concept graph, determine that "three Zhang" is a concept instance of the concept of "company employee," and further complete concept word recognition of the participle phrase "three Zhang".
For step 602, M events triggered by the N word segmentation phrases are determined from the geographic graph, where 1 ≦ M ≦ N. M is a positive integer. The event recognition module can be used for completing event recognition by combining slot position pattern matching calculation according to triggering word meaning similarity calculation. And storing the events appearing in the linguistic data of the professional field and the sequence relation among the events in a case map. Each type of event is defined by a framework, the framework comprises a plurality of slot positions describing the event, the value type of the slot position is a certain slot position type, such as a contract delivery event, the slot position of a deliverer is provided, and the value of the slot position is corresponding to the slot position type of an employee.
A possible design, for each of the M events, the event satisfying the following condition: one word segmentation phrase exists in the N word segmentation phrases and is matched with the trigger word of the event, one word segmentation phrase exists in the N word segmentation phrases, a concept instance associated with the word segmentation phrase in a concept map is matched with the slot position type of a first slot position of the event, and the first slot position is one slot position in the event.
For example, the following steps may be included:
step 6021: concept word C associated with participle phrases in concept graphjAnd traversing the concept graph along the upstream node direction (the side of the isA relationship) by taking the value range of j as a starting point, and finding a concept instance or concept corresponding to the slot type of the first slot in the event associated with the participle phrase, wherein the concept instance or concept comprises the slot value corresponding to the slot in the event and the slot type corresponding to the slot.
As shown in FIG. 7B, according to S1,S2,SlNode C on the corresponding concept graph11,C41,Cl1Searching the concept example corresponding to the slot position type of the first slot position in the corresponding event along the isA relation, wherein at the moment, the node C11Corresponds to C1,C1The concept instance corresponding to the slot type of element 1 in Event 1. Node C41Corresponds to C2,C2Concept entity corresponding to slot type of element 2 in Event1For example. Node Cl1Corresponds to Cl,ClThe concept instance corresponding to the slot type of element 2 in Event 2. Node Cl1Corresponds to C51,C51The concept instance corresponding to the slot type of element 1 in Event 2.
It should be noted that, the concept word recognition may also be used to assist in the event recognition process. According to the frame of the contract delivery event, determining that the slot value type corresponding to the slot position of the deliverer is in accordance with the participle phrase 'company staff', and according to the contract delivery event corresponding to the company staff, determining whether the participle phrase is matched with the trigger word corresponding to the contract delivery event. Thereby increasing the probability of a contract delivery event confirmation.
Step 6022: removing K word-separating phrases of which the corresponding associated concept examples or concepts are found in the concept map from the word-separating phrase set S to form a first word-separating phrase setThe first word segmentation phrase set comprises N-K word segmentation phrases which are used for matching trigger words of events. Further, the interference of concept instances or word segmentation phrases corresponding to concepts on event recognition can be avoided, and the complexity of event recognition is reduced.
As shown in fig. 7B, finding word-segmented phrases of corresponding concepts in the concept graph may include: s1,S2,Sl. Therefore, the first word segmentation phrase set after the word segmentation phrases corresponding to the concept example association are found in the concept graph is eliminated, and the first word segmentation phrase set comprises the following steps:
step 6023: computing a first set of word-segmented phrasesThe similarity between the phrase of the participle and the trigger word in the event.
The method for calculating the similarity between the segmented phrase and the trigger word in the event is similar to the similarity of the concept word recognition, and reference may be made to the method for calculating the similarity in the concept word recognition, which is not repeated herein. The formula can be expressed as:
wherein, TjIs the trigger word in event j. In the above formula of the similarity between the word segmentation phrase and the trigger word in the event, j is less than or equal to N-K, and j is a positive integer.
Step 6024: determining a trigger word TkThe event k is the event identified in the participle phrase set S. K is a positive integer, and 1 ≦ K ≦ N-K.
Further, a participle phrase that matches a concept instance associated in the concept graph with the slot type of the first slot of the event may be used as the slot value of the first slot of the event, that is, the concept instance and participle phrase S established in event k through step 6032iAnd the concept instance corresponds to a concept instance of a slot type matching the slot value of the first slot of the event. Thus, SiThat is, the slot value of the first slot in the identified event of the event k, and further determine the event instance of the event k.
As shown in FIG. 7B, Event1 and Event2 may be determined, where the slots in Event1 include: c1And C2The value of the slot may be filled as: s1And S2(ii) a The elements in Event2 include: c51And ClThe value of the slot may be filled as: s2And Sl。
In conjunction with the above example, the "deliverer" slot is filled with "Zhang three" in the event instance of the contract delivery event.
Further, the event identification and event slot populated event instance may be determined by looping through steps 6031-6035.
For example, an event instance generated after the contract delivery event fills the slot is used as a predicate function in the predicate logic formula, for example: the predicate function corresponding to the contract delivery event instance is as follows: and (4) delivering the contract (X is Zhang three), and generating a predicate function corresponding to the event instance to be paid out as follows: a payout is generated (X three, Y a delivery contract). The above event instances can be input as facts for subsequent predicate logic formulas.
In step 603, the advisory object of the problem may be determined by the intent recognition module. The intent recognition module may also be used to determine the type of question of the user in order to give answers with pertinence. The type of the problem can be determined by a classification model, which can be used to identify the type of the problem. The method can comprise the following steps: a judgment type question for judging the authenticity of the event; an interpretive question may also be included to explain why the event holds. The consulting objects of the problems can be predicted by establishing a classification model in a sequence marking mode and used for identifying the consulting objects of the problems. For example, "do the expenditure caused by zhang san during the delivery of the contract belong to the service cost" belong to the judgment problem type, "why does the expenditure caused by zhang san during the delivery of the contract belong to the service cost? "belongs to the type of interpretation problem. The consulting objects of the problems are service cost confirmation events.
Specifically, the question may be labeled by N participle phrases in the question, M events identified in the N participle phrases, and associated concept words in the N participle phrases. And determining the type of the problem and the consultation object of the problem by using the marked problem as the input of the classification model.
As shown in FIG. 8A, for the classification model training for problem type determination, the classification model may employ a combined long-short term memory network BI-LSTM model. The BI-LSTM model is a classification model combining a forward long short-term memory network LSTM and a backward long short-term memory network LSTM. The specific training process may include:
step 801: and preprocessing the N word-segmentation phrases.
Replacing the participle phrase of the associated event in the N participle phrases with the event-triggered word criteria name, e.g., replacing S2 with E2, replacing Sk with Em, based on the determined M events and associated concept instances or concepts in the N participle phrases. And replacing the associated concept instances or the word segmentation phrases of the concepts in the N word segmentation phrases by the standard names of the concepts in the concept graph. For example, mixing S1Is replaced by C1Will S4Is replaced by Cl. The set of word-segmentation phrases after replacement can be expressed as:
C1,E2,S3,,..Cl,...,Em
further, the substituted set of word-segmentation phrases can be labeled. For example, the labeled participle phrases include: contract delivery (event), cost of service (event), Zhang III (personnel), generate expenditure (event).
Step 802: and taking the preprocessed word segmentation phrase set as a training sample of the classification model.
Step 803: and finally splicing an event zone bit on the word vector matrix, wherein the event zone bit is used as the input of a classification model and is input into the classification model for training. The event zone bit is used for providing information of an event so as to better support sequence labeling of the text of the problem.
As shown in FIG. 8B, model training of the consulting objects labeling the questions to be answered, the classification model employs a combined long-short term memory network BI-LSTM + conditional random field CRF model for determining the type of the question and the consulting object of the question. The specific training process may refer to the method in fig. 8A, and is not described herein again.
In step 603, after the concept word recognition and the event recognition are completed, the slot value determination module of the event may match the concept instance associated in the problem with the slot value type in the recognized event, and may use the participle phrase corresponding to the matched concept instance as the slot value of the slot, thereby implementing instantiation of the event and preparing for subsequently generating the corresponding predicate logic formula.
And event recognition and concept word recognition can be used as instantiation of a predicate logic formula corresponding to the consultation object of the problem. The event corresponds to a predicate function in the predicate logic formula, and the slot bit value of the slot position in the event corresponds to the parameter value in the predicate function.
For example, the contract delivery event is matched with a contract delivery predicate function in a predicate logic formula, and after the deliverer is matched with the parameters of the predicate function, the slot position value is corresponding to the parameter value of the predicate function.
For example, an event instance generated after filling the contract delivery event into the slot value of the slot is used as a predicate function in the predicate logic formula, for example: the predicate function corresponding to the contract delivery event instance is as follows: and (4) delivering the contract (X is Zhang three), and generating a predicate function corresponding to the event instance to be paid out as follows: a payout (X — zhangsan, Y — a delivery contract) is generated, belonging to the service cost (payout of zhangsan).
And synthesizing the relation between the word segmentation phrase and the concepts in the concept map, determining a predicate logic formula corresponding to the consultation object of the problem, and further, assigning values to matching and parameters of a predicate function in the predicate logic formula, so as to be beneficial to the operation of a subsequent predicate logic formula and determine the answer of the problem.
For example, according to the concept graph, Zhang III belongs to outsourcing staff, and the outsourcing staff belongs to project staff.
The predicate function corresponding to the event belonging to the project person can be determined: belonging to project personnel (Zhang III);
and (3) a predicate function corresponding to the personnel expenditure event: belonging to the expenditure of personnel (Zhang III).
Aiming at step 603, a predicate logic formula corresponding to the consultation object of the problem can be identified and screened by intention, and the parameters in the screened predicate logic formula are assigned to determine the predicate logic formula corresponding to the consultation object of the problem. As shown in fig. 9, a predicate logic formula related to the advisory object of the problem, that is, a predicate logic formula that determines the rule header related to the advisory object of the problem, is screened out by linking the event with a predicate function in the predicate logic formula library. The method comprises the following specific steps:
step 6031: determining event E corresponding to problem consultation objecti. Wherein i is less than or equal to M and greater than or equal to 1.
As shown in fig. 9, the advisory object that determines the problem by intent recognition is Event 2. In connection with the above example, the consulting object of the question may be determined to be "belonging to cost of service".
Step 6032: traversing the identified event EiA rule header linked to the predicate logic formula Rj. And j in the predicate logic formula Rj is less than or equal to Pi and greater than or equal to 1. Pi denotes and event EiThe total number of predicate logic formulas that are relevant.
For example, as shown in fig. 9, the predicate logic formula of the rule header of Event2 is determined by Event2 corresponding to the advisory object of the question. For example, Event2 and R4If the rule head of (1) has a link, then the predicate logic formula associated with the Event2 is determined to be R4。
In combination with the above example, it can be determined that the predicate logic formula corresponding to the service cost is: ep X ep Y (generation of expenditure (main body ═ X, content ═ Y) Λ contract delivery (deliverer ═ X) Λ (belonging to activity expenditure (Y) v-cutter belonging to personnel expenditure (Y))) - > belonging to service cost (Y)
Step 6033: with RjAs a starting point, traverse RjThe pre-rule of (2).
As shown in FIG. 9, the predicate logic formula associated according to Event2 is R4Determining a pre-rule, e.g. R1,R2,R3。
In connection with the above example, the pre-rules in the predicate logic formula corresponding to the service cost include: belongs to predicate logic formulas corresponding to the personnel expenditure. Further, it may be determined that the inference chain that holds the cost of service includes: and the predicate logic formula corresponding to the personnel expenditure- > belongs to the predicate logic formula corresponding to the service cost.
Step 6024: predicate logic formula set { RxCan be used as a consultation object E for deducing problemsiThe reasoning chain of (1).
Wherein x is less than or equal to P and greater than or equal to 1. P represents the total number of predicate logic formulas R in the set of predicate logic formulas.
The predicate logic formula comprises one or more predicate functions; the predicate logic formula Rx has one predicate function, and the predicate function is an operation result of another predicate logic formula.
For example, the conclusion of the rule header of the predicate logic formula Rx can be used as the FACT in the next predicate logic formula to derive the conclusion of the predicate logic formula, and the derivation direction can be determined according to the operation rule in the predicate logic formula.
As shown in FIG. 9, it can be determined that the inference chain for Event2 is R1->R3->R4(ii) a Or, R2->R3->R4. I.e. can be according to R1Can be used as a predicate logic formula R3For deriving predicate logic formula R3To the conclusion of (1), predicate logic formula R3Can be further used as a predicate logic formula R4For deriving predicate logic formula R4And (4) concluding. Can be according to R2Can be used as a predicate logic formula R3For deriving predicate logic formula R3To the conclusion of (1), predicate logic formula R3Can be further used as a predicate logic formula R4For deriving predicate logic formula R4And (4) concluding.
Step 6025: evaluation module for predicate logic formula { R) through parameters of predicate functionxAnd (4) assigning parameters of the predicate functions in the (1).
And searching the predicate logic formula meeting the precondition in the predicate logic formula library. And assigning values to parameters of the corresponding predicate logic formulas according to the event identification and slot position values filled by the slot positions. For example, in connection with the above example, 1 logical chain can be determined: and the predicate logic formula corresponding to the personnel expenditure- > belongs to the predicate logic formula corresponding to the service cost. The method comprises 2 predicate logic formulas:
predicate logic formula for cost of service: ep X ep Y (generation of expenditure (main body ═ X, content ═ Y) Λ contract delivery (deliverer ═ X) Λ (belonging to activity expenditure (Y) v-cutter belonging to personnel expenditure (Y))) - > belonging to service cost (Y)
Predicate logic formula for personnel expenditure: ep X (generating expense (subject ═ X) Λ belongs to project personnel (deliverer ═ X)) - > belongs to personnel expense (X)
In the predicate function in each predicate logic formula in the chain, the result of the assignment can be expressed as:
generating an expense (X equals zhang san, Y equals a delivery contract)
Contract delivery (Y as A contract delivery)
Belong to the project personnel (Zhang three)
Belonging to the service cost (expenditure of Zhang san)
Belonging to personal expenditure (Zhang san)
In step 604, the assigned predicate logic formula is sent to the predicate logic formula operation module to operate the predicate logic formula, so that the knowledge reasoning from the question to the answer is completed, and the result of the predicate logic formula operation is obtained through the operation result output module.
A possible design, comprising: for each predicate function in the predicate logic formula, performing: if the event corresponding to the predicate function is a first event, the first event is one of the M events, and the slot position of the event corresponding to the parameter of the predicate function is the same as the first slot position of the first event, the parameter value of the predicate function is the slot position value of the first slot position of the first event.
And according to a predicate logic formula corresponding to the consultation object of the problem, deducing from practice to a conclusion by operating the predicate logic formula. This process may include multiple predicate logic formulasDerivation of (1): from input R1The knowledge point A in the predicate function in (1) satisfies R1The fact that R is triggered1The conclusion B is deduced according to the rule, and R is triggered by the knowledge point A + B3And D, deriving C according to the rule. In the derivation process, it is checked step by step whether the intermediate result can determine the advisory object of the problem. If so, the process is stopped. Otherwise, the process loops until the result of the problem is determined.
And (3) operation according to a predicate logic formula of personnel expenditure:
according to the concept map, Zhang III belongs to outsourcing staff, and the outsourcing staff belongs to project staff.
It can be deduced that the resulting payout (Zhang III) belongs to the project personnel (Zhang III) - > belongs to the personnel payout (Zhang III)
Operation of predicate logic formula according to service cost:
the generation of expenditure (Zhang three, Zhang three expenditure) Lambda contract delivery (Zhang three) Lambda belongs to personnel expenditure (Zhang three) - > service cost (Zhang three expenditure)
In step 605, an answer to the question may be output by an answer generation module. Specifically, the method may include: if the type of the question is a judgment type question, taking the operation result of the predicate logic formula as the answer; and if the type of the question is an interpretation type question, taking the operation process of the predicate logic formula and the operation result of the predicate logic formula as the answer.
If the problem type which is intended to be identified is to judge the truth of the event, outputting an inference result output by inference, such as yes or no; or true or false.
Namely, when the result obtained in the operation process of the predicate logic formula can correspond to the consultation object of the question, the operation of the predicate logic formula is determined to be stopped, and the answer of the question can be determined. With reference to the above example, it may be determined that the question "does the expenditure caused by zhang san in the delivery process of the contract belong to the service cost", and the result obtained in the operation process of the predicate logic formula belongs to the service cost, and it may be determined that the answer is yes. If the result obtained in the operation process of the predicate logic formula of the problem is not the service cost or is the result mutually exclusive with the service cost, the answer can be determined to be no.
When the user needs to obtain the reasoning answer and explain why the reasoning answer is obtained, the operation process of the predicate logic formula can be shown to the user. If the problem type identified by intention is an explanatory problem, outputting a predicate logic formula { R }xAnd (5) calculating.
One possible approach is to present the conclusions of the operation of the predicate logic formula, including preconditions, to the user in a structured manner to generate answers to the interpreted questions.
For example, in connection with the above example, it may be determined that the question "why the expenditure incurred Zhang III in the delivery of the contract pertains to the cost of service".
The answers may include:
according to the concept map, Zhang III belongs to outsourcing staff, and the outsourcing staff belongs to project staff.
It can be deduced that the resulting payout (Zhang III) belongs to the project personnel (Zhang III) - > belongs to the personnel payout (Zhang III)
Derivation of predicate logic formula according to cost of service:
the generation of expenditure (Zhang three, Zhang three expenditure) Lambda contract delivery (Zhang three) Lambda belongs to personnel expenditure (Zhang three) - > service cost (Zhang three expenditure)
According to multi-knowledge representation in a target domain knowledge base, on the basis of established logical links among knowledge, through semantic analysis of user input problems, abstract concepts and events in the domain are extracted, concept instances and events are analyzed, knowledge points are identified, problems brought forward by users are understood, and semantic understanding of the users is promoted. Based on the refined knowledge representation, intentions are recognized, the user focus is positioned, and an object to be interpreted by the user is obtained. And associating the object to be interpreted by the user with the predicate logic formula to complete the matching of the precondition of the predicate logic formula body, screening and loading the predicate logic formula from the condition meeting the rule body, calling the knowledge points required by inference through the link between knowledge representations and the knowledge matching, carrying out logic derivation, deducing a problem result, completing knowledge inference, and obtaining the answer of the problem.
Based on the above embodiment, the embodiment of the application also provides a problem answering device. The problem solving device is used for realizing the problem solving method provided by the embodiment of the application. Referring to fig. 10, the electronic device 1000 may include: a determination unit 1001 and an acquisition unit 1002.
In one embodiment, the problem solving apparatus shown in fig. 10 may be used to perform the operations of the electronic device in the problem solving method shown in fig. 6. Specifically, the method comprises the following steps:
an obtaining unit 1002, configured to determine N word-segmentation phrases from the question; determining M events triggered by the N word-separating phrases from a concept map, and determining slot position values of slot positions of the M events according to K word-separating phrases matched with the concept map in the N word-separating phrases; n, M, K is a positive integer; k is less than or equal to N, and M is less than or equal to N; a determining unit 1001 configured to determine a predicate logic formula corresponding to the advisory object of the problem according to a correspondence between a preset event and the predicate logic formula; the method comprises the steps that a predicate function in a predicate logic formula corresponds to an event in a case map, parameters of the predicate function correspond to slot positions of the event, and parameter values of the predicate function correspond to slot positions of the event; the predicate logic formula corresponding to the consultation object is obtained according to a business rule in the target domain knowledge corresponding to the consultation object; calculating the predicate logic formula according to the M events and slot bit values of slots of the M events; and determining an answer of the question according to an operation result of the predicate logic formula.
A possible design, for each of the M events, the event satisfying the following condition: one of the N participle phrases is matched with a trigger of the event, and: and a word segmentation phrase exists in the K word segmentation phrases matched with the concept map, a concept associated with the word segmentation phrase in the concept map is matched with the slot position type of a first slot position of the event, and the first slot position is a slot position in the event.
A possible design, for each of the M events, the event satisfying the following condition: one of the N participle phrases is matched with a trigger of the event, and: the K word phrases matched with the concept map have a word phrase, a concept associated with the word phrase in the concept map is matched with the slot type of the first slot of the event, the word phrase is the slot value of the first slot of the event, and the first slot is a slot in the event.
A possible design, the concept word comprising a concept and a concept instance; for a word segmentation phrase in the K word segmentation phrases, the word segmentation phrase includes an associated concept in the concept graph, and the method includes: concepts of upstream nodes corresponding to the matched concept instances in the concept graph; or, concepts that match in the concept graph.
In one possible design, the determining unit 1001 is specifically configured to: if the type of the question is a judgment type question, taking the operation result of the predicate logic formula as the answer; and if the type of the question is an interpretation type question, taking the operation process of the predicate logic formula and the operation result of the predicate logic formula as the answer.
A possible design, the predicate logic formula including one or more predicate functions; the predicate logic formula comprises a predicate function, and the predicate function is an operation result of another predicate logic formula.
In one possible design, the determining unit 1001 is specifically configured to: for each predicate function in the predicate logic formula, performing: if the event corresponding to the predicate function is a first event, the first event is one of the M events, and: the slot position of the event corresponding to the parameter of the predicate function is the same as the first slot position of the first event, and then: and the parameter value of the predicate function is a slot bit value of the first slot of the first event.
One possible design, the problem scenario is in the field of financial management accounting.
In another embodiment, the apparatus for generating a target domain knowledge base as shown in fig. 11 may be used to perform the operation of the electronic device in the method for generating a target domain knowledge base as shown in fig. 4A. The device for generating the target domain knowledge base may include: a determining unit 1101 and a generating unit 1102.
The determining unit 1101 is configured to determine a concept graph, a case graph and a predicate logic formula of the target domain knowledge according to a knowledge type of the target domain knowledge; wherein, the concept map is used for representing the static relation among concept words; the concept word is used for representing an object of the target domain knowledge; the event map is used for expressing the sequence among the events and the event relation among the events; the event is used for representing the relation between concept words expressed by predicates in the target field knowledge or the action between the concept words; a predicate function in the predicate logic formula corresponds to an event in the event graph, a parameter of the predicate function corresponds to a slot position of the event, and a parameter value of the predicate function corresponds to a slot position value of the slot position of the event; the predicate logic formula is used for representing business rules in the target domain knowledge;
the generating unit 1102 is configured to generate a target domain knowledge base according to the concept graph, the case graph and the predicate logic formula.
A possible design, the event comprising: triggering a word and a slot position of an event; the trigger word is used for identifying a corresponding predicate when the event occurs; the slot type of the slot of the event corresponds to at least one concept word in the concept map.
In one possible design, the determining unit 1101 is specifically configured to: determining a predicate function in the predicate logic formula according to the event related to the business rule; determining a logical operator between the predicate functions according to the logical relationship between the events in the business rules; and connecting predicate functions in the predicate logic formula through the logic operator to determine the predicate logic formula.
It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation. The functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Based on the above embodiments, the embodiments of the present application further provide an electronic device, and the electronic device may implement the problem solving method provided by the embodiments of the present application. As can be seen in fig. 12, the electronic device 1200 includes: the communication unit 1201 and the processor 1202, optionally may further include a memory 1203, wherein:
the processor 1202 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of the CPU and the NP. The processor 1202 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof. The processor 1202 may be implemented by hardware when implementing the above functions, and may of course be implemented by hardware executing corresponding software.
The communication unit 1201 and the processor 1202 are connected to each other. Optionally, the communication unit 1201 and the processor 1202 are connected to each other by a bus 1204; the bus 1204 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 12, but this is not intended to represent only one bus or type of bus.
In an alternative embodiment, a memory 1203 is coupled to the processor 1202 for storing programs and the like. In particular, the program may include program code comprising computer operating instructions. The memory 1203 may include RAM, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. The processor 1202 executes the application program stored in the memory 1203 to implement the above functions, thereby implementing the functions of the electronic device, i.e., implementing the problem solving method.
In one embodiment, the electronic device shown in fig. 12 may be used to perform the operations of the electronic device in the method for generating the target domain knowledge base in the embodiment shown in fig. 4A. Specifically, the method comprises the following steps:
the processor 1202 is configured to: determining a concept map, a case map and a predicate logic formula of the target domain knowledge according to the knowledge type of the target domain knowledge; wherein, the concept map is used for representing the static relation among concept words; the concept word is used for representing an object of the target domain knowledge; the event map is used for expressing the sequence among the events and the event relation among the events; the event is used for representing the relation between concept words expressed by predicates in the target field knowledge or the action between the concept words; a predicate function in the predicate logic formula corresponds to an event in the event graph, a parameter of the predicate function corresponds to a slot position of the event, and a parameter value of the predicate function corresponds to a slot position value of the slot position of the event; the predicate logic formula is used for representing business rules in the target domain knowledge; and generating a target field knowledge base according to the concept map, the affair map and the predicate logic formula.
In another embodiment, the electronic device shown in FIG. 12 may be used to perform the operations of the electronic device in the problem-solving method shown in FIG. 6. Specifically, the method comprises the following steps:
the processor 1202, configured to determine N word-segmented phrases from the question; determining M events triggered by the N word-separating phrases from a concept map, and determining slot position values of slot positions of the M events according to K word-separating phrases matched with the concept map in the N word-separating phrases; n, M, K is a positive integer; k is less than or equal to N, and M is less than or equal to N; determining a predicate logic formula corresponding to the consultation object of the problem according to the corresponding relation between a preset event and the predicate logic formula; the method comprises the steps that a predicate function in a predicate logic formula corresponds to an event in a case map, parameters of the predicate function correspond to slot positions of the event, and parameter values of the predicate function correspond to slot positions of the event; the predicate logic formula corresponding to the consultation object is obtained according to a business rule in the target domain knowledge corresponding to the consultation object; calculating the predicate logic formula according to the M events and slot bit values of slots of the M events; and determining an answer of the question according to an operation result of the predicate logic formula.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
Claims (24)
1. A method for answering questions, comprising:
determining N word-segmentation phrases from the question;
determining M events triggered by the N word-separating phrases from a concept map, and determining slot position values of slot positions of the M events according to K word-separating phrases matched with the concept map in the N word-separating phrases; n, M, K is a positive integer; k is less than or equal to N, and M is less than or equal to N;
determining a predicate logic formula corresponding to the consultation object of the problem according to the corresponding relation between a preset event and the predicate logic formula; the method comprises the steps that a predicate function in a predicate logic formula corresponds to an event in a case map, parameters of the predicate function correspond to slot positions of the event, and parameter values of the predicate function correspond to slot positions of the event; the predicate logic formula corresponding to the consultation object is obtained according to a business rule in the target domain knowledge corresponding to the consultation object;
calculating the predicate logic formula according to the M events and slot bit values of slots of the M events;
and determining an answer of the question according to an operation result of the predicate logic formula.
2. The method of claim 1, wherein for each of the M events, the event satisfies the following condition:
one of the N participle phrases is matched with a trigger of the event, and:
and a word segmentation phrase exists in the K word segmentation phrases matched with the concept map, a concept associated with the word segmentation phrase in the concept map is matched with the slot position type of a first slot position of the event, and the first slot position is a slot position in the event.
3. The method of claim 1, wherein for each of the M events, the event satisfies the following condition:
one of the N participle phrases is matched with a trigger of the event, and:
the K word phrases matched with the concept map have a word phrase, a concept associated with the word phrase in the concept map is matched with the slot type of the first slot of the event, the word phrase is the slot value of the first slot of the event, and the first slot is a slot in the event.
4. The method of claim 2 or 3, wherein the concept words include concepts and concept instances; for a word segmentation phrase in the K word segmentation phrases, the word segmentation phrase includes an associated concept in the concept graph, and the method includes:
concepts of upstream nodes corresponding to the matched concept instances in the concept graph; alternatively, the first and second electrodes may be,
concepts that are matched in the concept graph.
5. The method of claim 1, wherein determining an answer to the question based on a result of the operation of the predicate logic formula comprises:
if the type of the question is a judgment type question, taking the operation result of the predicate logic formula as the answer;
and if the type of the question is an interpretation type question, taking the operation process of the predicate logic formula and the operation result of the predicate logic formula as the answer.
6. The method of claim 1, wherein the predicate logic formula includes one or more predicate functions;
the predicate logic formula comprises a predicate function, and the predicate function is an operation result of another predicate logic formula.
7. The method of claim 2 or 3, wherein the operating on the predicate logic formula based on the M events and slot bit values of slots of the M events comprises:
for each predicate function in the predicate logic formula, performing:
if the event corresponding to the predicate function is a first event, the first event is one of the M events, and:
the slot position of the event corresponding to the parameter of the predicate function is the same as the first slot position of the first event, and then:
and the parameter value of the predicate function is a slot bit value of the first slot of the first event.
8. The method of any one of claims 1-7, wherein the problem scenario is in the area of financial operations accounting.
9. A method for generating a target domain knowledge base is characterized by comprising the following steps:
determining a concept map, a case map and a predicate logic formula of the target domain knowledge according to the knowledge type of the target domain knowledge;
wherein, the concept map is used for representing the static relation among concept words; the concept word is used for representing an object of the target domain knowledge;
the event map is used for expressing the sequence among the events and the event relation among the events; the event is used for representing the relation between concept words expressed by predicates in the target field knowledge or the action between the concept words;
a predicate function in the predicate logic formula corresponds to an event in the event graph, a parameter of the predicate function corresponds to a slot position of the event, and a parameter value of the predicate function corresponds to a slot position value of the slot position of the event; the predicate logic formula is used for representing business rules in the target domain knowledge;
and generating a target field knowledge base according to the concept map, the affair map and the predicate logic formula.
10. The method of claim 9, wherein the event comprises: triggering a word and a slot position of an event; the trigger word is used for identifying a corresponding predicate when the event occurs; the slot type of the slot of the event corresponds to at least one concept word in the concept map.
11. The method of claim 10, wherein the predicate logic formula is determined in a manner that includes:
determining a predicate function in the predicate logic formula according to the event related to the business rule;
determining a logical operator between the predicate functions according to the logical relationship between the events in the business rules;
and connecting predicate functions in the predicate logic formula through the logic operator to determine the predicate logic formula.
12. A problem solving device, comprising:
an obtaining unit, configured to determine N word-segmentation phrases from the question; determining M events triggered by the N word-separating phrases from a concept map, and determining slot position values of slot positions of the M events according to K word-separating phrases matched with the concept map in the N word-separating phrases; n, M, K is a positive integer; k is less than or equal to N, and M is less than or equal to N;
the determining unit is used for determining a predicate logic formula corresponding to the consultation object of the problem according to the corresponding relation between a preset event and the predicate logic formula; the method comprises the steps that a predicate function in a predicate logic formula corresponds to an event in a case map, parameters of the predicate function correspond to slot positions of the event, and parameter values of the predicate function correspond to slot positions of the event; the predicate logic formula corresponding to the consultation object is obtained according to a business rule in the target domain knowledge corresponding to the consultation object; calculating the predicate logic formula according to the M events and slot bit values of slots of the M events; and determining an answer of the question according to an operation result of the predicate logic formula.
13. The apparatus of claim 12, wherein for each of the M events, the event satisfies the following condition: one of the N participle phrases is matched with a trigger of the event, and: and a word segmentation phrase exists in the K word segmentation phrases matched with the concept map, a concept associated with the word segmentation phrase in the concept map is matched with the slot position type of a first slot position of the event, and the first slot position is a slot position in the event.
14. The apparatus of claim 12, wherein for each of the M events, the event satisfies the following condition: one of the N participle phrases is matched with a trigger of the event, and: the K word phrases matched with the concept map have a word phrase, a concept associated with the word phrase in the concept map is matched with the slot type of the first slot of the event, the word phrase is the slot value of the first slot of the event, and the first slot is a slot in the event.
15. The apparatus of claim 13 or 14, wherein the concept word comprises a concept and a concept instance; for a word segmentation phrase in the K word segmentation phrases, the word segmentation phrase includes an associated concept in the concept graph, and the method includes: concepts of upstream nodes corresponding to the matched concept instances in the concept graph; or, concepts that match in the concept graph.
16. The apparatus according to claim 12, wherein the determining unit is specifically configured to:
if the type of the question is a judgment type question, taking the operation result of the predicate logic formula as the answer; and if the type of the question is an interpretation type question, taking the operation process of the predicate logic formula and the operation result of the predicate logic formula as the answer.
17. The apparatus of claim 12, in which the predicate logic formula includes one or more predicate functions; the predicate logic formula comprises a predicate function, and the predicate function is an operation result of another predicate logic formula.
18. The apparatus according to claim 13 or 14, wherein the determining unit is specifically configured to:
for each predicate function in the predicate logic formula, performing: if the event corresponding to the predicate function is a first event, the first event is one of the M events, and: the slot position of the event corresponding to the parameter of the predicate function is the same as the first slot position of the first event, and then: and the parameter value of the predicate function is a slot bit value of the first slot of the first event.
19. The apparatus of any one of claims 1-7, wherein the problem scenario is in the area of financial operations accounting.
20. An apparatus for generating a target domain knowledge base, comprising:
the determining unit is used for determining a concept map, a case map and a predicate logic formula of the target domain knowledge according to the knowledge type of the target domain knowledge; wherein, the concept map is used for representing the static relation among concept words; the concept word is used for representing an object of the target domain knowledge; the event map is used for expressing the sequence among the events and the event relation among the events; the event is used for representing the relation between concept words expressed by predicates in the target field knowledge or the action between the concept words; a predicate function in the predicate logic formula corresponds to an event in the event graph, a parameter of the predicate function corresponds to a slot position of the event, and a parameter value of the predicate function corresponds to a slot position value of the slot position of the event; the predicate logic formula is used for representing business rules in the target domain knowledge;
and the generating unit is used for generating a target field knowledge base according to the concept map, the affair map and the predicate logic formula.
21. The apparatus of claim 20, wherein the event comprises: triggering a word and a slot position of an event; the trigger word is used for identifying a corresponding predicate when the event occurs; the slot type of the slot of the event corresponds to at least one concept word in the concept map.
22. The apparatus according to claim 21, wherein the determining unit is specifically configured to:
determining a predicate function in the predicate logic formula according to the event related to the business rule; determining a logical operator between the predicate functions according to the logical relationship between the events in the business rules; and connecting predicate functions in the predicate logic formula through the logic operator to determine the predicate logic formula.
23. An electronic device, comprising at least one processing unit and at least one memory unit, wherein the memory unit stores a computer program that, when executed by the processing unit, causes the processing unit to perform the steps of the method of any of claims 1 to 8 or 9 to 11.
24. A computer-readable medium, in which a computer program executable by a terminal device is stored, which program, when run on the terminal device, causes the terminal device to carry out the steps of the method according to any one of claims 1 to 8 or 9 to 11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010202748.5A CN111538844B (en) | 2020-03-20 | 2020-03-20 | Target field knowledge base generation and problem solution method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010202748.5A CN111538844B (en) | 2020-03-20 | 2020-03-20 | Target field knowledge base generation and problem solution method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111538844A true CN111538844A (en) | 2020-08-14 |
CN111538844B CN111538844B (en) | 2022-03-25 |
Family
ID=71978676
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010202748.5A Active CN111538844B (en) | 2020-03-20 | 2020-03-20 | Target field knowledge base generation and problem solution method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111538844B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112182242A (en) * | 2020-09-27 | 2021-01-05 | 武汉大学 | Safety control knowledge graph construction method for whole process of electric power operation |
CN112232085A (en) * | 2020-10-15 | 2021-01-15 | 海南大学 | Cross-DIKW modal text ambiguity processing method oriented to essential computing and reasoning |
CN112784064A (en) * | 2021-01-28 | 2021-05-11 | 电子科技大学 | Hierarchical super-dimensional knowledge graph construction method facing social network |
CN112966492A (en) * | 2021-02-09 | 2021-06-15 | 柳州智视科技有限公司 | Method for solving problem by using known knowledge |
CN112988704A (en) * | 2021-03-05 | 2021-06-18 | 无锡星凝互动科技有限公司 | AI consultation database cluster building method and system |
CN113392361A (en) * | 2021-05-24 | 2021-09-14 | 北京京东振世信息技术有限公司 | Service processing method and device, electronic equipment and computer readable medium |
CN114462903A (en) * | 2022-04-14 | 2022-05-10 | 四川省大数据中心 | Water, electricity and gas business applying system |
CN115032901A (en) * | 2021-12-22 | 2022-09-09 | 荣耀终端有限公司 | Equipment control method and electronic equipment |
CN115203441A (en) * | 2022-09-19 | 2022-10-18 | 江西风向标智能科技有限公司 | Method, system, storage medium and equipment for analyzing high school mathematical formula |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106055641A (en) * | 2016-05-31 | 2016-10-26 | 北京光年无限科技有限公司 | Human-computer interaction method and device oriented to intelligent robot |
US20170103069A1 (en) * | 2015-10-13 | 2017-04-13 | International Business Machines Corporation | Supplementing candidate answers |
CN108717441A (en) * | 2018-05-16 | 2018-10-30 | 腾讯科技(深圳)有限公司 | The determination method and device of predicate corresponding to question template |
CN109033305A (en) * | 2018-07-16 | 2018-12-18 | 深圳前海微众银行股份有限公司 | Question answering method, equipment and computer readable storage medium |
CN109492077A (en) * | 2018-09-29 | 2019-03-19 | 北明智通(北京)科技有限公司 | The petrochemical field answering method and system of knowledge based map |
CN109919763A (en) * | 2019-01-28 | 2019-06-21 | 深圳壹账通智能科技有限公司 | The method, apparatus and computer equipment of question and answer mode file are shown based on intelligent contract |
-
2020
- 2020-03-20 CN CN202010202748.5A patent/CN111538844B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170103069A1 (en) * | 2015-10-13 | 2017-04-13 | International Business Machines Corporation | Supplementing candidate answers |
CN106055641A (en) * | 2016-05-31 | 2016-10-26 | 北京光年无限科技有限公司 | Human-computer interaction method and device oriented to intelligent robot |
CN108717441A (en) * | 2018-05-16 | 2018-10-30 | 腾讯科技(深圳)有限公司 | The determination method and device of predicate corresponding to question template |
CN109033305A (en) * | 2018-07-16 | 2018-12-18 | 深圳前海微众银行股份有限公司 | Question answering method, equipment and computer readable storage medium |
CN109492077A (en) * | 2018-09-29 | 2019-03-19 | 北明智通(北京)科技有限公司 | The petrochemical field answering method and system of knowledge based map |
CN109919763A (en) * | 2019-01-28 | 2019-06-21 | 深圳壹账通智能科技有限公司 | The method, apparatus and computer equipment of question and answer mode file are shown based on intelligent contract |
Non-Patent Citations (3)
Title |
---|
XIANG WANG等: "A Potential Solution for Intelligent Energy Management - Knowledge Graph", 《IEEE》 * |
陈程等: "基于中医药知识图谱的智能问答技术研究", 《中国新通信》 * |
项威: "事件知识图谱构建技术与应用综述", 《计算机与现代化》 * |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112182242A (en) * | 2020-09-27 | 2021-01-05 | 武汉大学 | Safety control knowledge graph construction method for whole process of electric power operation |
CN112232085B (en) * | 2020-10-15 | 2021-10-08 | 海南大学 | Cross-DIKW modal text ambiguity processing method oriented to essential computing and reasoning |
CN112232085A (en) * | 2020-10-15 | 2021-01-15 | 海南大学 | Cross-DIKW modal text ambiguity processing method oriented to essential computing and reasoning |
CN112784064A (en) * | 2021-01-28 | 2021-05-11 | 电子科技大学 | Hierarchical super-dimensional knowledge graph construction method facing social network |
CN112784064B (en) * | 2021-01-28 | 2023-05-12 | 电子科技大学 | Hierarchical super-dimensional knowledge graph construction method for social network |
CN112966492A (en) * | 2021-02-09 | 2021-06-15 | 柳州智视科技有限公司 | Method for solving problem by using known knowledge |
CN112988704A (en) * | 2021-03-05 | 2021-06-18 | 无锡星凝互动科技有限公司 | AI consultation database cluster building method and system |
CN113392361A (en) * | 2021-05-24 | 2021-09-14 | 北京京东振世信息技术有限公司 | Service processing method and device, electronic equipment and computer readable medium |
CN113392361B (en) * | 2021-05-24 | 2024-05-17 | 北京京东振世信息技术有限公司 | Service processing method, device, electronic equipment and computer readable medium |
CN115032901A (en) * | 2021-12-22 | 2022-09-09 | 荣耀终端有限公司 | Equipment control method and electronic equipment |
CN115032901B (en) * | 2021-12-22 | 2023-03-28 | 荣耀终端有限公司 | Equipment control method and electronic equipment |
CN114462903A (en) * | 2022-04-14 | 2022-05-10 | 四川省大数据中心 | Water, electricity and gas business applying system |
CN114462903B (en) * | 2022-04-14 | 2022-07-05 | 四川省大数据中心 | Water, electricity and gas business applying system |
CN115203441A (en) * | 2022-09-19 | 2022-10-18 | 江西风向标智能科技有限公司 | Method, system, storage medium and equipment for analyzing high school mathematical formula |
CN115203441B (en) * | 2022-09-19 | 2022-12-20 | 江西风向标智能科技有限公司 | Method, system, storage medium and equipment for analyzing high school mathematical formula |
Also Published As
Publication number | Publication date |
---|---|
CN111538844B (en) | 2022-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111538844B (en) | Target field knowledge base generation and problem solution method and device | |
Tiddi et al. | Knowledge graphs as tools for explainable machine learning: A survey | |
Calegari et al. | On the integration of symbolic and sub-symbolic techniques for XAI: A survey | |
US11347783B2 (en) | Implementing a software action based on machine interpretation of a language input | |
Herrera-Viedma et al. | Revisiting fuzzy and linguistic decision making: Scenarios and challenges for making wiser decisions in a better way | |
Kim et al. | Futuristic data-driven scenario building: Incorporating text mining and fuzzy association rule mining into fuzzy cognitive map | |
Bouhana et al. | An ontology-based CBR approach for personalized itinerary search systems for sustainable urban freight transport | |
CN112106056A (en) | Constructing fictitious utterance trees to improve the ability to answer convergent questions | |
Zhang et al. | A survey on fuzzy ontologies for the Semantic Web | |
Villata et al. | Thirty years of artificial intelligence and law: the third decade | |
El-Sappagh et al. | An ontological case base engineering methodology for diabetes management | |
Barukh et al. | Cognitive augmentation in processes | |
Wang et al. | Smartphone-based bulky waste classification using convolutional neural networks | |
Calderón et al. | Distributed supervised sentiment analysis of tweets: Integrating machine learning and streaming analytics for big data challenges in communication and audience research | |
Martin et al. | Evaluating explainability methods intended for multiple stakeholders | |
Biswas et al. | A review on fundamentals of case-based reasoning and its recent application in different domains | |
Li et al. | A new fuzzy ontology development methodology (FODM) proposal | |
Okoye | Linked open data: State-of-the-art mechanisms and conceptual framework | |
Jordanov et al. | Knowledge-based and intelligent information and engineering systems | |
Zamanirad | Superimposition of natural language conversations over software enabled services | |
Umar et al. | A survey on state-of-the-art knowledge-based system development and issues | |
Daosabah et al. | Dynamic composition of services: an approach driven by the user's intention and context | |
Botega et al. | Quantify: an information fusion model based on syntactic and semantic analysis and quality assessments to enhance situation awareness | |
Globa et al. | Ontology-Driven Approach to Research and Educational Organization Information Representation | |
Fischer et al. | MULTI-CASE: A Transformer-based Ethics-aware Multimodal Investigative Intelligence Framework |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |