Knowledge graph-based querying in AI chatbots with basic query element detection and graph path generation
By identifying query features in an artificial intelligence chatbot and mapping them to the basic elements of the knowledge graph, generating and verifying the query path, the problem of insufficient flexibility in the existing technology is solved, and more flexible and reasonable query result generation is achieved.
Patent Information
- Application Number
- CN202080060816.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-08-26
- Filing Date
- 2020-08-18
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2040-08-18
AI Technical Summary
Existing technologies for using knowledge graphs in artificial intelligence chatbots have problems such as insufficient flexibility, inflexible predefined rules, difficult template maintenance, unexplainable query results, and performance dependence on the quality of training data.
By identifying query features, mapping them to the basic elements of the knowledge graph, generating and verifying query paths, and using calculated scores to determine valid paths to generate query results.
It improves the flexibility of AI chatbots and the rationality of query results, providing more flexible and explainable query solutions suitable for a variety of industries and organizations.
Smart Images

Figure CN114365118B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates generally to knowledge graphs, and more particularly to utilizing knowledge graphs in artificial intelligence chatbots with basic query element detection and graph path generation. Background Art
[0002] In computing, a graph database is a database that represents stored data using a semantically queryable graph structure with nodes, edges, and attributes. The graph structure associates data items with a collection of nodes and edges, with edges representing relationships between nodes. These relationships allow data to be linked together directly and, in many cases, retrieved with a single operation. Querying relationships within a graph database is fast because the relationships are stored within the database itself. Graph databases can be used to visualize relationships intuitively, making them useful for highly interconnected data. Retrieving data from a graph database requires a query language. In addition to having a query language interface, some graph databases are accessed via an application programming interface.
[0003] A knowledge graph is a knowledge base integrated with a graph database. By integrating a knowledge base with a graph database, a knowledge graph supports a wider and deeper range of services than a standard graph database. In other words, a knowledge graph links together information such as facts, entities, and locations to create more accurate and relevant interconnected search results. More specifically, a knowledge graph is a knowledge base composed of millions of pieces of data corresponding to frequently searched information and the context or intent of the request based on available content.
[0004] A chatbot is a computer program that conducts a conversation with a user through auditory or textual methods. Chatbots are designed to simulate how a human would act as a conversational partner. Typically, chatbots are used in dialogue systems for various practical purposes, such as customer service or information acquisition. Current chatbots scan for keywords within the input and then retrieve responses with the best matching keywords or the most similar word patterns from a database. Many industries, organizations, businesses, and institutions, such as banks, insurance companies, media companies, e-commerce companies, airlines, hotel chains, retailers, healthcare providers, educational institutions, government agencies, restaurant chains, etc., use chat systems to answer simple questions and increase user engagement.
[0005] However, current approaches to using knowledge graphs with artificial intelligence currently have several problems. For example, one current approach to using knowledge graphs with artificial intelligence is based on an AI program that uses predefined rules to call the knowledge graph to complete a certain type of query or computation via an application programming interface. The problem with this first approach is that the predefined rules are inflexible and can only be used to answer predefined questions.
[0006] A second current approach to using knowledge graphs with artificial intelligence is based on artificial intelligence programs that use predefined question-answering templates. The goal of this second approach is to find a template that corresponds to the query submitted and then fill in the missing slots of that template. In other words, popular queries are translated into templates and entities are left as slots in the template, which can be filled in while answering the user's query. Examples of templates could be XXX (person) is the president of XXX (country) or XXX (city) is the capital of XXX (country). The problem with this second approach is that templates can only fit small knowledge graphs, enumerating all query paths in a knowledge graph is challenging, preparing templates is time consuming, and maintaining templates is difficult.
[0007] The third current approach to using knowledge graphs with artificial intelligence is based on embedding knowledge graphs using vertices and edges and exploring the embedded knowledge graphs using deep learning methods (such as, for example, graph neural networks). The problem with this third approach is that query results are not interpretable, query performance depends mainly on the quality of training data, and it is difficult to use in industry or organizations compared to academic research.
[0008] Therefore, there is a need in the art to solve the above problems. Summary of the Invention
[0009] From a first aspect, the present invention provides a computer-implemented method for generating query results using a knowledge graph in an artificial intelligence chat robot, the computer-implemented method comprising: identifying features of a query by a computer; mapping the features of the query to basic elements of the knowledge graph in the artificial intelligence chat robot by the computer; generating a set of query paths in the knowledge graph based on the mapping of the features of the query to the basic elements of the knowledge graph by the computer; verifying one or more query paths in the set of query paths in the knowledge graph based on the corresponding score of each query path by the computer; and generating a query result corresponding to the query by the computer based on the verified one or more query paths in the knowledge graph.
[0010] From a first aspect, the present invention provides a computer system for generating query results using a knowledge graph in an artificial intelligence chat robot, the computer system comprising: a bus system; a storage device connected to the bus system, wherein the storage device stores program instructions; and a processor connected to the bus system, wherein the processor executes the program instructions to: identify features of a query; map the features of the query to basic elements of the knowledge graph in the artificial intelligence chat robot; generate a set of query paths in the knowledge graph based on the mapping of the features of the query to the basic elements of the knowledge graph; verify one or more query paths in a set of query paths in the knowledge graph based on the corresponding score of each query path; and generate a query result corresponding to the query based on the verified one or more query paths in the knowledge graph.
[0011] Viewed from another perspective, the present invention provides a computer program product for generating query results using a knowledge graph in an artificial intelligence chatbot, the computer program product comprising a computer-readable storage medium readable by a processing circuit and storing instructions for execution by the processing circuit to perform a method for executing the steps of the present invention.
[0012] Viewed from another aspect, the invention provides a computer program stored on a computer readable medium and loadable into the internal memory of a digital computer, the computer program comprising software code portions for performing the steps of the invention when said program is run on a computer.
[0013] From another perspective, the present invention provides a computer program product for generating query results using a knowledge graph in an artificial intelligence chatbot, the computer program product comprising a computer-readable storage medium having program instructions embodied therein, the program instructions being executable by a computer to cause the computer to perform a method comprising: identifying features of a query by the computer; mapping the features of the query to basic elements of the knowledge graph in the artificial intelligence chatbot by the computer; generating a set of query paths in the knowledge graph based on the mapping of the features of the query to the basic elements of the knowledge graph by the computer; verifying one or more query paths in a set of query paths in the knowledge graph based on the corresponding score of each query path by the computer; and generating a query result corresponding to the query by the computer based on the verified one or more query paths in the knowledge graph.
[0014] According to one illustrative embodiment, a computer-implemented method for generating query results using a knowledge graph in an artificial intelligence chatbot is provided. A computer identifies features of a query. The computer maps the features of the query to basic elements of a knowledge graph in the artificial intelligence chatbot. The computer generates a set of query paths in the knowledge graph based on the mapping of the features of the query to the basic elements of the knowledge graph. The computer validates one or more query paths in the set of query paths in the knowledge graph based on a corresponding score for each query path. The computer generates a query result corresponding to the query based on the validated one or more query paths in the knowledge graph. According to other illustrative embodiments, a computer system and computer program product for generating query results using a knowledge graph in an artificial intelligence chatbot are provided.
[0015] Thus, the illustrative embodiments improve the performance of artificial intelligence chatbots by leveraging knowledge graph technology with basic query element detection, graph path generation, and graph path validation. Furthermore, the artificial intelligence chatbots of the illustrative embodiments are more flexible than current rule-based and template-based chatbots because they are defined using basic query elements in the knowledge graph. Therefore, the artificial intelligence chatbots of the illustrative embodiments are not limited to predefined queries. Furthermore, the artificial intelligence chatbots of the illustrative embodiments provide reasonable query results, which is important for industries and organizations because they validate query paths generated in the knowledge graph by calculating a query path score for each generated query path. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The present invention will now be described, by way of example only, with reference to preferred embodiments as illustrated in the following drawings:
[0017] Figure 1 is a pictorial representation of a network of data processing systems in which the illustrative embodiments may be implemented;
[0018] Figure 2 is a diagram of a data processing system in which the illustrative embodiments may be implemented;
[0019] Figure 3 is a diagram illustrating an example of a query result generation process according to an exemplary embodiment;
[0020] Figure 4 is a diagram illustrating an example of a query path generation process according to an exemplary embodiment;
[0021] Figure 5 is a diagram illustrating an example of a query path verification process according to an exemplary embodiment; and
[0022] Figure 6is a flowchart illustrating a process for generating query results corresponding to a natural language query according to an exemplary embodiment. DETAILED DESCRIPTION
[0023] The present invention may be a system, method and / or computer program product of any possible degree of technical detail integration. The computer program product may include a computer-readable storage medium (or multiple media) having computer-readable program instructions thereon for causing a processor to execute various aspects of the present invention.
[0024] Computer-readable storage media can be a tangible device that can retain and store the instructions used by the instruction execution device.Computer-readable storage media can be, for example, but not limited to, electronic storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the above. A non-exhaustive list of more specific examples of computer-readable storage media includes the following: portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), static random access memories (SRAM), portable compact disc read-only memories (CD-ROM), digital versatile discs (DVD), memory sticks, floppy disks, mechanical encoding devices such as punch cards, or projection structures in the grooves with instructions recorded thereon, and any suitable combination of the above. Computer-readable storage media as used herein should not be interpreted as temporary signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagated by waveguides or other transmission media (for example, light pulses passing through fiber optic cables), or electrical signals emitted by wires.
[0025] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to a corresponding computing / processing device via a network (e.g., the Internet, a local area network, a wide area network, and / or a wireless network), or downloaded to an external computer or external storage device. The network can include copper transmission cables, optical transmission fibers, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in a computer-readable storage medium within the corresponding computing / processing device.
[0026] The computer-readable program instructions for performing the operation of the present invention can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, the configuration data of integrated circuit or source code or object code written in any combination of one or more programming languages, these programming languages include object-oriented programming languages (such as Smalltalk, C++ etc.) and process programming languages (such as " C " programming languages or similar programming languages). The computer-readable program instructions can be performed completely on the user's computer, partly on the user's computer, performed as an independent software package, partly on the user's computer, partly on a remote computer or fully on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer by any type of network (including local area network (LAN) or wide area network (WAN)), or can be connected to an external computer (for example, using an internet service provider through the internet). In certain embodiments, the electronic circuit comprising for example programmable logic circuit, field programmable gate array (FPGA) or programmable logic array (PLA) can make the electronic circuit personalized to perform computer-readable program instructions by utilizing the state information of computer-readable program instructions, so as to perform various aspects of the present invention.
[0027] The present invention will be described below with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.
[0028] These computer-readable program instructions can be provided to a processor of a computer or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device create a device for implementing the functions / actions specified in the flowchart and / or block diagram or multiple blocks. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to operate in a specific manner. Thus, the computer-readable storage medium having the instructions stored therein includes an article of manufacture containing instructions that implement aspects of the functions / actions specified in the flowchart and / or block diagram or multiple blocks.
[0029] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device, so that a series of operational steps are performed on the computer, other programmable apparatus, or other device to produce computer-implemented processing, so that the instructions executed on the computer, other programmable apparatus, or other device implement the functions / actions specified in the flowchart and / or block diagram or multiple boxes.
[0030] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functions and operations of possible implementations of the systems, methods and computer program products according to different embodiments of the present invention. To this end, each box in the flowchart or block diagram may represent a module, segment or portion of an instruction, which includes one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the box may not occur in the order marked in the figure. For example, the two boxes shown in succession can actually be completed as a step, simultaneously, substantially simultaneously, in a partially or completely time-overlapping manner, or the boxes can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or action or performs a combination of dedicated hardware and computer instructions.
[0031] Referring now to the drawings, and in particular to the Figure 1 and Figure 2 , provides a diagram of a data processing environment in which the illustrative embodiments may be implemented. It should be understood that Figure 1 and Figure 2 This is meant to be an example only and is not intended to assert or imply any limitation with regard to the environments in which different embodiments may be implemented. Many modifications to the depicted environments may be made.
[0032] Figure 1 A pictorial representation of a network of data processing systems in which the illustrative embodiments may be implemented is shown. Network data processing system 100 is a network of computers, data processing systems, and other devices in which the illustrative embodiments may be implemented. Network data processing system 100 contains network 102, which is a medium for providing communications links between the computers, data processing systems, and other devices connected together within network data processing system 100. Network 102 may include connections such as, for example, wired communications links, wireless communications links, fiber optic cables, and the like.
[0033] In the depicted example, server 104 and server 106 are connected to network 102 along with storage device 108. Server 104 and server 106 may be, for example, server computers with high-speed connections to network 102. Furthermore, server 104 and server 106 provide a set of one or more chatbot services to client devices. Furthermore, it should be noted that server 104 and server 106 may represent a cluster of servers in a data center. Alternatively, server 104 and server 106 may be computing nodes in a cloud environment.
[0034] Clients 110, 112, and 114 are also connected to network 102. Clients 110, 112, and 114 are clients to servers 104 and 106. In this example, clients 110, 112, and 114 are shown as desktop computers or personal computers with wired communication links to network 102. However, it should be noted that clients 110, 112, and 114 are merely examples and may represent other types of data processing systems with wired or wireless communication links to network 102, such as, for example, laptop computers, handheld computers, smartphones, smart watches, smart TVs, smart appliances, gaming devices, kiosks, etc. Users of clients 110, 112, and 114 may utilize clients 110, 112, and 114 to access and utilize chatbot services provided by servers 104 and 106.
[0035] Storage device 108 is a network storage device capable of storing any type of data in a structured or unstructured format. Furthermore, storage device 108 may represent multiple network storage devices. Furthermore, storage device 108 may represent a graph database including a knowledge graph corresponding to one or more data domains (e.g., an insurance domain, a financial domain, an education domain, an entertainment domain, a gaming domain, etc.). Furthermore, storage device 108 may store other types of data, such as authentication or credential data, which may include, for example, usernames, passwords, and biometric data associated with system administrators and client device users.
[0036] Furthermore, it should be noted that network data processing system 100 may include any number of additional servers, clients, storage devices, and other devices not shown. Program code located in network data processing system 100 may be stored on a computer-readable storage medium and downloaded to a computer or other data processing device for use. For example, program code may be stored on a computer-readable storage medium on server 104 and downloaded to client 110 via network 102 for use on client 110.
[0037] In the depicted example, network data processing system 100 may be implemented as many different types of communications networks, such as, for example, the Internet, an intranet, a local area network (LAN), a wide area network (WAN), a telecommunications network, or any combination thereof. Figure 1 It is intended only as an example, and not as an architectural limitation for the different illustrative embodiments.
[0038] Now see Figure 2 , depicts a diagram of a data processing system according to an illustrative embodiment. Data processing system 200 is a computer (such as Figure 1In the example of server 104 in FIG. 1 , computer readable program code or instructions implementing the processes of the illustrative embodiments may be located in the computer. In this illustrative example, data processing system 200 includes communications fabric 202, which provides communications between processor unit 204, memory 206, persistent storage 208, communications unit 210, input / output (I / O) unit 212, and display 214.
[0039] Processor unit 204 serves to execute instructions for software applications and programs that may be loaded into memory 206. Processor unit 204 may be a set of one or more hardware processor devices or may be a multi-core processor, depending on the particular implementation.
[0040] Memory 206 and permanent storage 208 are examples of storage devices 216. A computer-readable storage device is any hardware capable of storing information (such as, for example, but not limited to, data, computer-readable program code in functional form, and / or other suitable information) on a transient basis and / or a persistent basis. Further, a computer-readable storage device excludes propagation media. In these examples, memory 206 may be, for example, random access memory (RAM) or any other suitable volatile or non-volatile storage device. Persistent storage 208 may take various forms, depending on the specific implementation. For example, permanent storage 208 may include one or more devices. For example, permanent storage 208 may be a hard drive, a solid-state drive, flash memory, a rewritable optical disk, a rewritable magnetic tape, or some combination thereof. The media used by permanent storage 208 may be removable. For example, a removable hard drive may be used for permanent storage 208.
[0041] In this example, persistent storage 208 stores chatbot 218. However, it should be noted that even though chatbot 218 is shown as residing in persistent storage 208, in alternative illustrative embodiments, chatbot 218 may be a separate component of data processing system 200. For example, chatbot 218 may be a hardware component or a combination of hardware and software components coupled to communications fabric 202.
[0042] Chatbot 218 can be, for example, an artificial intelligence program or other type of machine learning program. Data processing system 200 utilizes chatbot 218 to interact with a client device user who submits a query via voice or text input. Chatbot 218 utilizes graph database 220 (which includes knowledge graph 222) to generate query results for the received query by defining basic elements 224 in knowledge graph 222 that meet the requirements of the received query and generating a query path in knowledge graph 222 based on a mapping of features of the received query to basic elements 224.
[0043] Base elements 224 are defined basic query elements that correspond to a graph query language identifiable by graph database 220. In this example, base elements 224 include anchor elements 226, jump elements 228, filter elements 230, and target elements 232. However, it should be noted that alternative illustrative embodiments may include more base elements based on industry or organizational needs.
[0044] Anchor elements 226 represent entities in the knowledge graph 222, such as, for example, people, places, objects, events, companies, etc. Jump elements 228 represent relationships between data stored in the knowledge graph 222. Filter elements 230 represent filter conditions on data stored in the knowledge graph 222. Target elements 232 represent target attributes of data stored in the knowledge graph 222.
[0045] Query 234 represents a natural language query. In addition, query 234 can represent any type of query or question. Data processing system 200 receives data from a client device (such as Figure 1 The client 110 in the data processing system 200 receives the query 234. The data processing system 200 uses the chatbot 218 to identify and extract characteristics 236 of the query 234. For example, the characteristics 236 include one or more of keywords, key phrases, traits, features, attributes, etc. contained in the query 234.
[0046] After identifying and extracting features 236 from query 234, chatbot 218 performs query feature to base element mapping 238. Query feature to base element mapping 238 represents a mapping between each of features 236 of query 234 and a corresponding base element in base elements 224 of knowledge graph 222. Chatbot 218 utilizes query feature to base element mapping 238 to generate a query path 240 in knowledge graph 222. Query path 240 represents a set of one or more possible paths in knowledge graph 222 to find appropriate information for, or an answer to, query 234.
[0047] After generating query paths 240 for query 234 in knowledge graph 222, chatbot 218 generates scores 242 for each query path in query path 240 based on dimensions 244. Chatbot 218 can represent score 242 as, for example, a number, a percentage, etc. Dimensions 244 can include, for example, the ranking of terms within query 234, information or basic facts about the availability of valid results for query 234 in knowledge graph 222, the likelihood of submitting query 234 based on query history, etc.
[0048] Furthermore, chatbot 218 may compare score 242 for each query path to threshold 246. Threshold 246 represents a minimum query path score threshold level. Chatbot 218 utilizes threshold 246 to identify valid query paths 248. Valid query paths 248 represent a set of one or more valid query paths in knowledge graph 222. In other words, if chatbot 218 generates a score for a particular query path that is higher than threshold 246, chatbot 218 identifies that particular query path as a valid query path. Alternatively, chatbot 218 may select the highest-scoring query path as the only valid query path. Chatbot 218 utilizes valid query paths 248 to generate query results 250. Query results 250 represent valid, reasonable answers to query 234.
[0049] In this example, the communication unit 210 communicates with the user via a network (eg, Figure 1 The network 102 in FIG. 1 provides communications with other computers, data processing systems, and devices. Communications unit 210 may provide communications using both physical and wireless communication links. Physical communication links may utilize, for example, wires, cables, universal serial buses, or any other physical technology to establish a physical communication link for data processing system 200. Wireless communication links may utilize, for example, shortwave, high frequency, ultra-high frequency, microwave, wireless fidelity (Wi-Fi), technology, Global System for Mobile Communications (GSM), Code Division Multiple Access (CDMA), second generation (2G), third generation (3G), fourth generation (4G), 4G Long Term Evolution (LTE), Advanced LTE, fifth generation (5G), or any other wireless communication technology or standard to establish a wireless communication link for the data processing system 200.
[0050] Input / output unit 212 allows for input and output of data with other devices that may be connected to data processing system 200. For example, input / output unit 212 may provide a connection for user input via a keypad, keyboard, mouse, microphone, and / or some other suitable input device. Display 214 provides a mechanism for displaying information to a user and may include touch screen capabilities that allow a user to make on-screen selections through, for example, a user interface or input data.
[0051] Instructions for the operating system, applications, and / or programs may be located in storage device 216, which communicates with processor unit 204 via communication fabric 202. In this illustrative example, the instructions are in functional form on persistent storage 208. These instructions may be loaded into memory 206 for execution by processor unit 204. The processes of various embodiments may be performed by processor unit 204 using computer-implemented instructions, which may be located in a memory, such as memory 206. These program instructions are referred to as program code, computer-usable program code, or computer-readable program code that can be read and executed by a processor in processor unit 204. In various implementations, the program instructions may be implemented on different physical computer-readable storage devices, such as memory 206 or persistent storage 208.
[0052] Program code 252 is located in functional form on a selectively removable computer-readable medium 254 and can be loaded or transferred to data processing system 200 for execution by processor unit 204. Program code 252 and computer-readable medium 254 form computer program product 256. In one example, computer-readable medium 254 can be computer-readable storage medium 258 or computer-readable signal medium 260. Computer-readable storage medium 258 can include, for example, an optical or magnetic disk that is inserted or placed into a drive or other device that is part of persistent storage 208 for transfer to a storage device, such as a hard drive that is part of persistent storage 208. Computer-readable storage medium 258 can also take the form of permanent storage, such as a hard drive, thumb drive, or flash memory that is connected to data processing system 200. In some instances, computer-readable storage medium 258 may not be removable from data processing system 200.
[0053] Alternatively, program code 252 can be transmitted to data processing system 200 using computer readable signal media 260. Computer readable signal media 260 can be, for example, a propagated data signal containing program code 252. For example, computer readable signal media 260 can be an electromagnetic signal, an optical signal, and / or any other suitable type of signal. These signals can be transmitted via a communication link (e.g., a wireless communication link, a fiber optic cable, a coaxial cable, an electric wire, and / or any other suitable type of communication link). In other words, in the illustrative examples, the communication link and / or connection can be physical or wireless. Computer readable media can also take the form of non-tangible media, such as a communication link or wireless transmission containing program code.
[0054] In some illustrative embodiments, program code 252 may be downloaded from another device or data processing system via computer readable signal media 260 over a network to persistent storage 208 for use within data processing system 200. For example, program code stored in a computer readable storage medium in a data processing system may be downloaded from the data processing system over a network to data processing system 200. The data processing system providing program code 252 may be a server computer, a client computer, or some other device capable of storing and transmitting program code 252.
[0055] The different components shown for data processing system 200 are not meant to provide architectural limitations to the manner in which different embodiments may be implemented. The different illustrative embodiments may be implemented in a data processing system including components in addition to or in place of those shown for data processing system 200. Figure 2 Other components shown in the figures may vary from the illustrative examples shown. Various embodiments may be implemented using any hardware device or system capable of executing program code. As an example, data processing system 200 may include organic components integrated with inorganic components and / or may be composed entirely of organic components that do not include humans. For example, a memory device may be composed of an organic semiconductor.
[0056] As another example, a computer-readable storage device in data processing system 200 is any hardware device that can store data. Memory 206, persistent storage 208, and computer-readable storage media 258 are examples of physical storage devices in a tangible form.
[0057] In another example, a bus system can be used to implement the communication structure 202 and can include one or more buses, such as a system bus or an input / output bus. Of course, the bus system can be implemented using any suitable type of architecture that provides data transmission between different components or devices attached to the bus system. In addition, the communication unit can include one or more devices for sending and receiving data, such as a modem or a network adapter. Further, the memory can be, for example, the memory 206 or a cache such as found in an interface and memory controller hub that may be present in the communication structure 202.
[0058] Today, AI chatbots play a vital role in many industries and organizations. Currently, retrieval, ranking, and classification are the most common techniques used in AI chatbots to find the most relevant answers to user-submitted queries. Furthermore, knowledge graphs are a cutting-edge and popular technology today. Using knowledge graphs in AI chatbots offers several advantages over retrieval, ranking, and classification. For example, using knowledge graphs in AI chatbots provides the ability to more easily understand user queries than retrieval and ranking or classification. Furthermore, using knowledge graphs in AI chatbots provides the ability to expand beyond the submitted user query. Furthermore, using knowledge graphs in AI chatbots enables more flexible user queries and provides more comprehensive and reasonable answers to those queries.
[0059] The artificial intelligence chatbot of the illustrative embodiment recognizes the characteristics of a user's natural language query and automatically converts the natural language query into a graph query language that can be recognized by a graph database containing a knowledge graph through several steps. First, the artificial intelligence chatbot of the illustrative embodiment defines basic query elements in the knowledge graph to meet the needs of the submitted natural language query. The illustrative embodiment utilizes four defined types of basic query elements in the knowledge graph. The four defined basic elements include anchor elements, jump elements, filter elements, and target elements. Anchor elements represent entities in the knowledge graph. Jump elements represent relationships in the knowledge graph. Filter elements represent filter conditions in the knowledge graph. Target elements represent target attributes in the knowledge graph. However, it should be noted that the number of basic query elements can be increased if required by the industry or organization. The illustrative embodiment maps each basic query element to a graph query language script based on the graph database and the selected graph query language.
[0060] Second, the artificial intelligence chatbot of the illustrative embodiments uses natural language processing to extract useful information, such as features (e.g., key terms), from the submitted natural language query. The artificial intelligence chatbot of the illustrative embodiments then maps the extracted information to defined basic query elements in the knowledge graph.
[0061] Third, the AI chatbot of the illustrative embodiment dynamically constructs one or more query paths within the knowledge graph based on mapping the extracted information to defined basic query elements within the knowledge graph. Fourth, the AI chatbot of the illustrative embodiment generates a score for each constructed query path based on multiple dimensions to determine whether each particular query path is valid. These dimensions may include, for example, the order of terms in the natural language query, ground truth that validates the results of the natural language query within the knowledge graph, the likelihood of submitting a natural language query based on query history, and so on. Fifth, the AI chatbot of the illustrative embodiment finds query results within the knowledge graph based on valid query paths.
[0062] Thus, the illustrative embodiment improves the performance of an AI chatbot by utilizing knowledge graph technology with basic query element detection, graph path generation, and graph path validation. Furthermore, the AI chatbot system of the illustrative embodiment is more flexible than current rule-based and template-based chat systems because it utilizes basic query element definitions within a knowledge graph. Therefore, the AI chatbot of the illustrative embodiment is not limited to predefined queries. Furthermore, the AI chatbot of the illustrative embodiment provides reasonable query results, which is important for industries and organizations because it validates query paths within the knowledge graph by calculating query path scores. Furthermore, the illustrative embodiment is scalable because the query translation layer, natural language processing layer, and query path generation layer are isolated from each other.
[0063] Therefore, the illustrative embodiments provide one or more technical solutions to overcome the technical problems of using knowledge graphs with artificial intelligence chatbots. Therefore, these one or more technical solutions provide technical effects and practical applications in the field of artificial intelligence chat. Figure 3 , depicts a diagram showing an example of a query result generation process according to an illustrative embodiment. The query result generation process 300 may be performed on a network of data processing systems such as Figure 1 The query result generation process 300 is implemented in the network data processing system 100 in FIG. The query result generation process 300 is a process for generating query results corresponding to a natural language query using a knowledge graph in an artificial intelligence chatbot with basic query element detection, query path generation, and query path verification.
[0064] In this example, the query result generation process 300 includes steps 302, 304, 306, 308, and 310. However, it should be noted that the query result generation process 300 may include more or fewer steps than shown. For example, one step may be divided into two or more steps, two or more steps may be combined into one step, one or more steps not shown may be added, and so on.
[0065] In step 302, a data processing system (such as Figure 1 Server 104 or Figure 2 The data processing system 200 in the embodiment receives data from a client device (such as Figure 1For example, a natural language query is received from client 110 in the example, "I want to travel to the capital of China. Are there any recommended places worth visiting?" In step 304, the data processing system uses an artificial intelligence chatbot to define basic query elements in the knowledge graph to match the requirements of the received natural language query. In this example, the defined basic query elements include the anchor element "China," the jump element "capital," and the jump element "famous places."
[0066] At step 306, the AI chatbot generates a query path in the knowledge graph based on the defined basic query elements that satisfy the received natural language query. In this example, the generated query path includes the anchor element "country" with a jump element "capital" to the anchor element "city." The anchor element "city" has three "famous" jump elements, namely, anchor elements "big wall," "summer," and "...".
[0067] At step 308, the AI chatbot verifies the query paths by calculating a score for each query path. The AI chatbot may, for example, compare each query path score to a score threshold level and only verify those query paths with a query path score greater than the score threshold level. Alternatively, the AI chatbot may only verify the query path with the highest query path score.
[0068] In step 310, the AI chatbot generates query results corresponding to the received natural language query based on the valid query paths in the knowledge graph. In this example, for the natural language query "I want to travel to the capital of China. Are there any recommended places worth visiting?", the query results are "The Great Wall," "The Summer Palace," and "..." The AI chatbot outputs the query results to the client device via text or voice.
[0069] Now see Figure 4 , depicts a diagram illustrating an example of a query path generation process according to an illustrative embodiment. The query path generation process 400 may be performed on a computer such as Figure 1 Server 104 or Figure 2 In this example, the query path generation process 400 shows query paths 402, 404, 406, and 408.
[0070] Query path 402 includes an anchor element with a jump element for "China's capital." In this example, the anchor element is the anchor element "China" with the jump element "capital." The query result for this example would be Beijing. Query path 404 includes an anchor element with a jump element for the filter element "China's capital population." In this example, the anchor element is the anchor element "China" with the jump element "capital" to the target element "population." The query result for this example would be approximately 21.5 million.
[0071] Query path 406 includes a filter element with a jump element for "famous scenes in the capital of China". In this example, the filter element is an anchor element "China" with a jump element "capital" to a jump element "famous scenes". The query result of this example will be the Summer Palace. Query path 408 includes an anchor element for the question "Is the Summer Palace located in China?" to another anchor element. In this example, it is the anchor element "China" to another anchor element "Summer Palace". In this example, an artificial intelligence chatbot of a computer (such as Figure 2 The chatbot 218 in the knowledge graph searches for a valid path between two anchor elements. If the chatbot does not find a valid path for the query in the knowledge graph, the chatbot determines that there is no connection between the two anchor elements. If the chatbot finds a valid path for the query in the knowledge graph, the chatbot determines that the Summer Palace is located in China.
[0072] Now see Figure 5 , depicts a diagram illustrating an example of a query path validation process in accordance with an illustrative embodiment. The query path validation process 500 may be performed on a computer such as Figure 1 Server 104 or Figure 2 In this example, the query path verification process 500 is used for the received natural language query 502, which is "Who is the mother of Yao Ming's daughter?"
[0073] The query path 504 includes an anchor element "Yao Ming" with a jump element "daughter" to a jump element "mother". In this example, the computer's artificial intelligence chat robot (such as, Figure 2 The chatbot 218 in FIG. 5 generates a query path validation score of "0.9" for query path 504. Query path 506 includes the anchor element "Yao Ming" with a jump element "mother" to a jump element "daughter." In this example, the artificial intelligence chatbot generates a query path validation score of "0.6" for query path 506. In this example, the artificial intelligence chatbot selects query path 504 with the highest query path score as the valid query path for generating query results for the received natural language query 502.
[0074] Now see Figure 6 , showing a flowchart of a process for generating query results corresponding to a natural language query using a knowledge graph in an artificial intelligence chatbot according to an illustrative embodiment. Figure 6 The process shown in Figure 1 Server 104 or Figure 2 The data processing system 200 is implemented in a computer.
[0075] The process begins when a computer receives a natural language query from a client device corresponding to a user via a network (step 602). The computer uses an artificial intelligence chatbot (such as Figure 2 The chatbot 218 in the graph database is used to define basic query elements of the knowledge graph contained in the graph database to match the requirements of the natural language query received from the client device (step 604). The computer uses the artificial intelligence chatbot to use natural language processing to identify the characteristics of the natural language query (step 606).
[0076] The computer uses an artificial intelligence chatbot to map the recognition features of the natural language query to the basic query elements defined in the knowledge graph (step 608). In addition, the computer uses the artificial intelligence chatbot to generate a set of one or more query paths in the knowledge graph based on mapping the recognition features of the natural language query to the basic query elements defined in the knowledge graph (step 610). Further, the computer uses the artificial intelligence chatbot to calculate a score for each query path in the set of query paths in the knowledge graph based on multiple dimensions (step 612). The multiple dimensions may include, for example, sentence structure (e.g., order of words, grammar, punctuation, etc.), basic facts for verifying the query results in the knowledge graph, whether the query is included in the query history (e.g., the same or similar query was previously submitted), etc.
[0077] The computer then uses an artificial intelligence chatbot to verify one or more query paths in the set of query paths in the knowledge graph based on the corresponding calculated scores of each query path (step 614). The computer then uses the artificial intelligence chatbot to generate a query result corresponding to the natural language query based on the verified one or more query paths in the knowledge graph (step 616). The computer transmits the query result corresponding to the natural language query to the client device corresponding to the user via the network (step 618). The process then terminates.
[0078] Therefore, the illustrative embodiments of the present invention provide a computer-implemented method, computer system, and computer program product for generating query results using a knowledge graph in an artificial intelligence chatbot. Descriptions of various embodiments of the present invention have been presented for illustrative purposes, but are not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope of the described embodiments. The terms used herein are selected to best explain the principles of the embodiments, practical applications, or technical improvements to technologies found in the marketplace, or to enable those of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A computer-implemented method for generating query results using a knowledge graph in an artificial intelligence chatbot, the computer-implemented method comprising: Identify characteristics of the query by computer; Mapping, by the computer, the features of the query to basic elements of the knowledge graph in the artificial intelligence chatbot; generating, by the computer, a set of query paths in the knowledge graph based on the mapping of the features of the query to the basic elements of the knowledge graph; validating, by the computer, one or more query paths from a set of query paths in the knowledge graph based on a corresponding score of each query path; as well as The computer generates a query result corresponding to the query based on one or more verified query paths in the knowledge graph; wherein the basic elements of the knowledge graph in the artificial intelligence chatbot are defined basic query elements, and wherein the defined basic query elements are selected from the group consisting of anchor elements, jump elements, filter elements and target elements, wherein the anchor elements represent entities in the knowledge graph, the jump elements represent relationships between data stored in the knowledge graph, the filter elements represent filtering conditions for data stored in the knowledge graph, and the target elements represent target attributes of data stored in the knowledge graph.
2. The computer-implemented method of claim 1 , further comprising: The query is received by the computer from a client device corresponding to a user via a network.
3. The computer-implemented method of claim 2 , further comprising: The query result corresponding to the query is transmitted by the computer to the client device corresponding to the user via the network.
4. The computer-implemented method according to any one of claims 1 to 3, further comprising: The basic elements of the knowledge graph are defined by the computer to match the requirements of the query.
5. The computer-implemented method of claim 4, wherein: Defining the basic elements of the knowledge graph by the computer to match the requirements of the query further includes: The computer calculates a corresponding score for each query path in the set of query paths in the knowledge graph based on multiple dimensions.
6. The computer-implemented method of claim 5, wherein: The multiple dimensions include an order of terms in the query, ground facts for verifying the query result in the knowledge graph, and whether the query is submitted based on the query history.
7. The computer-implemented method of any one of claims 1 to 3, wherein: The query is a natural language query.
8. The computer-implemented method of any one of claims 1 to 3, wherein: The computer utilizes natural language processing to identify the features of the query.
9. The computer-implemented method of claim 1 , wherein: The defined basic query elements correspond to a graph query language that can be recognized by a graph database containing the knowledge graph.
10. The computer-implemented method of any one of claims 1-3, wherein: The verified valid query paths among the one or more query paths have corresponding query path scores that are higher than a query path score threshold level.
11. The computer-implemented method of any one of claims 1 to 3, wherein: The validated valid query path among the one or more query paths has a highest query path score.
12. The computer-implemented method of any one of claims 1 to 3, wherein: The features of the query include keywords contained in the query.
13. A computer system for generating query results using a knowledge graph in an artificial intelligence chatbot, the computer system comprising: bus system; a storage device connected to the bus system, wherein the storage device stores program instructions; and a processor connected to the bus system, wherein the processor executes the program instructions to: Identify characteristics of the query; mapping the features of the query to basic elements of the knowledge graph in the artificial intelligence chatbot; generating a set of query paths in the knowledge graph based on the mapping of the features of the query to the basic elements of the knowledge graph; validating one or more query paths in the set of query paths in the knowledge graph based on the corresponding score of each query path; and Generate a query result corresponding to the query based on the verified one or more query paths in the knowledge graph; wherein the basic elements of the knowledge graph in the artificial intelligence chatbot are defined basic query elements, and wherein the defined basic query elements are selected from the group consisting of anchor elements, jump elements, filter elements and target elements, wherein the anchor elements represent entities in the knowledge graph, the jump elements represent relationships between data stored in the knowledge graph, the filter elements represent filtering conditions for data stored in the knowledge graph, and the target elements represent target attributes of data stored in the knowledge graph.
14. The computer system according to claim 13, wherein: The processor further executes the program instructions to: The query is received via a network from a client device corresponding to a user.
15. The computer system according to claim 14, wherein: The processor further executes the program instructions to: The query result corresponding to the query is transmitted to the client device corresponding to the user via a network.
16. The computer system according to any one of claims 13 to 15, wherein: The processor further executes the program instructions to: The basic elements of the knowledge graph are defined to match the requirements of the query.
17. The computer system according to claim 16, wherein: Defining the basic elements of the knowledge graph to match the requirements of the query includes: A corresponding score is calculated for each query path in the set of query paths in the knowledge graph based on a plurality of dimensions.
18. A computer program product for generating query results using a knowledge graph in an artificial intelligence chatbot, the computer program product comprising: Computer instructions readable by a processing circuit and for execution by the processing circuit to perform the method according to any one of claims 1 to 12.
19. A computer-readable storage medium storing program instructions and capable of loading the program instructions into an internal memory of a digital computer, wherein when the program instructions are executed on the computer, the method according to any one of claims 1 to 12 is executed.
Citation Information
Patent Citations
Natural language processing based search
CN105900081A