CN110096584B - Response method and device - Google Patents

Response method and device Download PDF

Info

Publication number
CN110096584B
CN110096584B CN201910399999.4A CN201910399999A CN110096584B CN 110096584 B CN110096584 B CN 110096584B CN 201910399999 A CN201910399999 A CN 201910399999A CN 110096584 B CN110096584 B CN 110096584B
Authority
CN
China
Prior art keywords
user
ontology
user consultation
sentence
statement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910399999.4A
Other languages
Chinese (zh)
Other versions
CN110096584A (en
Inventor
刘聪
张瀚林
贾坤
吴聪
潘婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
JD Digital Technology Holdings Co Ltd
Jingdong Technology Holding Co Ltd
Original Assignee
JD Digital Technology Holdings Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by JD Digital Technology Holdings Co Ltd filed Critical JD Digital Technology Holdings Co Ltd
Priority to CN201910399999.4A priority Critical patent/CN110096584B/en
Publication of CN110096584A publication Critical patent/CN110096584A/en
Priority to SG11202112274SA priority patent/SG11202112274SA/en
Priority to PCT/CN2020/080265 priority patent/WO2020228416A1/en
Application granted granted Critical
Publication of CN110096584B publication Critical patent/CN110096584B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Animal Behavior & Ethology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Machine Translation (AREA)

Abstract

The embodiment of the disclosure discloses a response method and a response device. One embodiment of the method comprises: according to an analysis result obtained by analyzing the user consultation sentence, performing intention analysis on the user consultation sentence in a body layer of a pre-established knowledge map corresponding to the user consultation sentence to obtain an intention analysis result corresponding to the user consultation sentence; according to the intention analysis result, carrying out answer addressing in a physical layer of the knowledge graph to obtain an answer matched with the user consultation statement; the answer is sent to the sender from which the user consults the statement. This embodiment contributes to improvement in response efficiency and response accuracy.

Description

Response method and device
Technical Field
The embodiment of the disclosure relates to the technical field of natural language processing, in particular to a response method and a response device.
Background
With the popularization of natural language processing technology, many intelligent response systems have appeared.
The intelligent response system can collect huge internet information, solves problems of life or work and the like of the user, and provides convenience for life of the information era of people. The intelligent response system can directly carry out conversation with the user, dig out information in the user conversation, and interpret the intention in the user question, so that an answer meeting the intention of the user is given.
Disclosure of Invention
The embodiment of the disclosure provides a response method and a response device.
In a first aspect, an embodiment of the present disclosure provides an answering method, including: according to an analysis result obtained by analyzing the user consultation sentence, performing intention analysis on the user consultation sentence in a body layer of a pre-established knowledge map corresponding to the user consultation sentence to obtain an intention analysis result corresponding to the user consultation sentence; according to the intention analysis result, carrying out answer addressing in a physical layer of the knowledge graph to obtain an answer matched with the user consultation statement; the answer is sent to the sender from which the user consults the statement.
In some embodiments, performing intent analysis on the user query sentence in a body layer of a pre-established knowledge graph corresponding to the user query sentence according to an analysis result obtained by analyzing the user query sentence to obtain an intent analysis result corresponding to the user query sentence, includes: determining the type of the user consultation sentence under the preset user consultation sentence classification rule according to the analysis result; and according to the intention analysis rule matched with the type of the user consultation sentence, carrying out intention analysis on the user consultation sentence in a body layer of a pre-established knowledge map corresponding to the user consultation sentence to obtain an intention analysis result corresponding to the user consultation sentence.
In some embodiments, performing intent analysis on the user query sentence in a ontology layer of a pre-established knowledge graph corresponding to the user query sentence according to an intent analysis rule matched with the type of the user query sentence to obtain an intent analysis result corresponding to the user query sentence, includes: according to intention analysis rules matched with the types of the user consultation sentences, intention analysis is carried out on the user consultation sentences in a body layer and a physical layer of a pre-established knowledge map to obtain at least two candidate intention analysis results; and determining an intention analysis result corresponding to the user consultation sentence from the candidate intention analysis results in response to receiving the intention confirmation information sent by the sender.
In some embodiments, the user advisory statement type includes a second type, wherein the second type of user advisory statement has attributes and an ontology; according to the intention analysis rule matched with the type of the user consultation sentence, carrying out intention analysis on the user consultation sentence in a body layer of a pre-established knowledge map corresponding to the user consultation sentence to obtain an intention analysis result corresponding to the user consultation sentence, wherein the intention analysis result comprises the following steps: acquiring an ontology to which attributes included in a user consultation statement belong; adding an ontology to which the attribute belongs to an ontology included in the user consultation statement; and performing intention analysis on the user consultation sentences in the body layer based on the attributes and the bodies included in the user consultation sentences after the bodies are added to obtain intention analysis results corresponding to the user consultation sentences.
In some embodiments, the user advisory statement types include a third type, wherein the third type of user advisory statement has a relationship and an ontology; according to the intention analysis rule matched with the type of the user consultation sentence, carrying out intention analysis on the user consultation sentence in a body layer of a pre-established knowledge map corresponding to the user consultation sentence to obtain an intention analysis result corresponding to the user consultation sentence, wherein the intention analysis result comprises the following steps: acquiring an ontology connected with a relation included in a user consultation statement; adding the ontology connected by the relationship to an ontology included in the user consultation sentence; and performing intention analysis on the user consultation sentences in the body layer based on the relationship and the bodies included in the user consultation sentences after the bodies are added to obtain intention analysis results corresponding to the user consultation sentences.
In some embodiments, the user advisory statement type includes a fourth type, wherein the fourth type of user advisory statement comprises attributes, relationships, and ontologies; according to the intention analysis rule matched with the type of the user consultation sentence, carrying out intention analysis on the user consultation sentence in a body layer of a pre-established knowledge map corresponding to the user consultation sentence to obtain an intention analysis result corresponding to the user consultation sentence, wherein the intention analysis result comprises the following steps: acquiring an ontology to which attributes included in the user consultation sentence belong and an ontology connected with a relation included in the user consultation sentence; adding an ontology to which the attribute belongs and an ontology connected with the relationship to an ontology included in the user consultation statement; and performing intention analysis on the user consultation sentences in the body layer based on the attributes, the relations and the bodies included in the user consultation sentences after the bodies are added to obtain intention analysis results corresponding to the user consultation sentences.
In some embodiments, performing intent analysis on the user query sentence in a body layer of a pre-established knowledge graph corresponding to the user query sentence according to an analysis result obtained by analyzing the user query sentence to obtain an intent analysis result corresponding to the user query sentence, includes: analyzing intentions of the user consultation sentences in a body layer of a pre-established knowledge map corresponding to the user consultation sentences according to analysis results obtained by analyzing the user consultation sentences to obtain at least two candidate intention analysis results; and determining an intention analysis result corresponding to the user consultation sentence from the candidate intention analysis results in response to receiving the intention confirmation information sent by the sender.
In a second aspect, an embodiment of the present disclosure provides a responding apparatus, including: an intention analysis unit configured to perform intention analysis on the user consultation sentence in a body layer of a pre-established knowledge map corresponding to the user consultation sentence according to an analysis result obtained by analyzing the user consultation sentence, and obtain an intention analysis result corresponding to the user consultation sentence; the answer addressing unit is configured to carry out answer addressing in a physical layer of the knowledge graph according to the intention analysis result to obtain an answer matched with the user consultation sentence; an answer sending unit configured to send an answer to a sender from which the user consultation sentence comes.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; a storage device having one or more programs stored thereon; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the answering method as described in any one of the embodiments of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable medium on which a computer program is stored, which computer program, when executed by a processor, implements the answering method as described in any one of the embodiments of the first aspect.
According to the response method and the response device provided by the embodiment of the disclosure, according to an analysis result obtained by analyzing the user consultation sentence, intention analysis is carried out on the user consultation sentence in a body layer and a physical layer of a pre-established knowledge graph corresponding to the user consultation sentence to obtain an intention analysis result for representing the query intention of the user consultation sentence; searching answers matched with the user consultation sentences in a physical layer of a pre-established knowledge graph corresponding to the user consultation sentences according to intention analysis results; the answer is sent to the sender from which the user consults the statement. This embodiment contributes to improvement in response efficiency and response accuracy.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a reply method according to an embodiment of the present disclosure;
FIG. 2a is a ontology-level diagram of a knowledge-graph to which the response method of embodiments of the present disclosure may be applied;
FIG. 2b is a physical layer schematic of a knowledge graph to which the response method of embodiments of the present disclosure may be applied;
FIG. 2C is a diagram of a minimal subgraph from node A to node C to which the reply method of an embodiment of the disclosure may be applied;
FIG. 3 is a schematic diagram of one application scenario of a reply method according to an embodiment of the present disclosure;
FIG. 4 is a flow diagram of yet another embodiment of a reply method according to an embodiment of the present disclosure;
FIG. 5 is a schematic block diagram of one embodiment of a responding device according to embodiments of the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant disclosure and are not limiting of the disclosure. It should be noted that, for the convenience of description, only the parts relevant to the related disclosure are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 of a answering method or answering device to which embodiments of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 101, 102, 103 interact with a server 105 via a network 104 to receive or send messages or the like. Various communication client applications, such as an intelligent answering application, an instant messaging tool, social platform software, a search application, a shopping application, a browser application, etc., may be installed on the terminal devices 101, 102, 103.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting communication with a server, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a background server that receives requests sent by the terminal devices 101, 102, 103. The background server can receive and analyze the request sent by the client and generate a processing result.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the response method provided by the embodiment of the present disclosure may be executed by the server 105, and may also be executed by a terminal device (for example, the terminal device 101, 102, or 103 shown in fig. 1). Accordingly, the response device may be provided in the server 105, or may be provided in the terminal apparatus 101, 102, or 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a reply method according to the present disclosure is shown. The response method is applied to a server and comprises the following steps:
step 201, according to an analysis result obtained by analyzing the user consultation sentence, performing intention analysis on the user consultation sentence in a body layer of a pre-established knowledge map corresponding to the user consultation sentence to obtain an intention analysis result corresponding to the user consultation sentence.
In this embodiment, the terminals (e.g., the terminals 101, 102, 103 shown in fig. 1) and the execution subject of the response method (e.g., the server 105 shown in fig. 1) may be communicatively connected by a wired connection method or a wireless connection method. The user may input a user consultation sentence through the terminal. The terminal may transmit a response request to the execution main body as a transmission direction and receive an answer transmitted from the execution main body. The execution body may receive a query request transmitted from the terminal, perform intention analysis and answer search on a user's consultation sentence, and transmit an answer to the terminal. It should be noted that the user consultation phrase input method is not limited in the present disclosure. For example, the user may input the user consultation sentence through the terminal in a manual input manner or a voice input manner.
In this embodiment, the user may use a natural language for inputting the user's consultation sentence through the terminal. Natural language is a language peculiar to human beings and cannot be directly recognized and understood by a computer. The execution agent may analyze the user query sentence by using a Natural Language Processing (NLP) algorithm to obtain an analysis result. And then performing intention analysis and answer search on the user consultation sentence according to the analysis result. It should be noted that the parsing of the user query sentence includes, but is not limited to, chinese word segmentation, ontology recognition, entity recognition, attribute recognition, relationship recognition, voice recognition, and other processes. For example, a user inputs a user consultation sentence "issuing company of insurance a? ". The execution main body analyzes the user consultation sentence, and an obtained analysis result may include "ontology 1: insurance name, entity 1: insurance of A type; a body 2: the issuing company ".
A knowledge graph is intended to describe various entities, ontologies, attributes, and relationships between them that exist in the real world. In a knowledge graph, entities or ontologies are represented by nodes, and attributes and relationships are represented by edges. A knowledge graph is a labeled directed attribute graph. Each node in the knowledge graph has a plurality of attributes and attribute values, edges between entities represent relationships between the nodes, the pointing direction of the edges represents the direction of the relationships, and labels on the edges represent the types of the relationships.
In this embodiment, the executive body may pre-establish a knowledge graph of the industry vertical for intent analysis and answer addressing. The executive body can construct different knowledge maps for different vertical industries. For example, the executive may build a knowledge graph that includes, but is not limited to, the insurance domain. The industry verticals and the inclusion of specific content to which the pre-established knowledge-graph relates are not limited herein.
In this embodiment, the knowledge-graph may be logically divided into a body layer and a physical layer. The ontology layer is the core of the knowledge graph, is an ontology template of the entity layer and provides the relationship between ontology definition and ontology of related fields. The Ontology layer may be described by using an Ontology Web Language (OWL). The entity layer may store data in entity units under the constraint of the entity layer. An entity may be expressed by a triple of (entity 1, relationship, entity 2) and (entity, attribute value). The physical layer may employ a graph database (e.g., NEO4J) as a storage medium.
In this embodiment, fig. 2a is a body-level schematic diagram of a knowledge-graph to which the response method of embodiments of the present disclosure may be applied. FIG. 2b is a physical layer schematic of a knowledge graph to which the response method of embodiments of the present disclosure may be applied. It should be understood that fig. 2a and 2b are only schematic. The ontology and entity layers of knowledge graphs for different vertical industries applying the response methods of embodiments of the present disclosure may be constructed as needed for implementation. The execution main body can select a pre-established knowledge graph corresponding to the user consultation sentence according to the vertical industry to which the user consultation sentence belongs. Then, the executing body may perform intent analysis on the user consultation sentence in the ontology layer of the pre-established knowledge graph by:
firstly, searching a knowledge link corresponding to a user consultation statement in a body layer of the pre-established knowledge graph.
In this embodiment, the execution agent may use an ontology parser (e.g., Jena) to parse and load the ontology layer into the memory. Here, since the access speed of the memory is high, analyzing the body layer to the memory can improve the efficiency of intent analysis. And then, the execution main body can find out the knowledge link corresponding to the user consultation statement from the body layer according to the analysis result of the user consultation statement. In this embodiment, the step of finding the knowledge link corresponding to the user query statement from the body layer by the execution main body according to the parsing result of the user query statement may include, but is not limited to, the following steps:
first, the ontology included in the user's consultation statement parsing result is on the same knowledge link.
For example, as one example, the user consult statement parsing results include three ontologies of insurance name, heavy disease safeguard, and heavy disease exemption. In the body layer shown in fig. 2a, there is a connection relationship between the insurance name and the heavy disease policy, and there is a connection relationship between the heavy disease policy and the heavy disease policy, where the heavy disease policy points to the heavy disease policy. Based on the connection relationship between the three entities, the executing entity can determine a knowledge link from insurance name to heavy disease guarantee to heavy disease exemption, namely "insurance name → heavy disease guarantee → heavy disease exemption".
Secondly, the ontology included in the user consultation statement analysis result is on the same knowledge link after link completion.
For example, as one example, the user advisory statement parsing result includes two ontologies of insurance name and capital property. There is no linking relationship between the insurance name and the capital property in the ontology layer shown in fig. 2 a. But there is a corporate ontology between insurance names and capital properties. The company has a connection relationship with the insurance name directed to the company by the insurance name and a connection relationship with the capital property directed to the capital property by the company. The enforcement agent may use the company and the connection relationship between the company and the insurance name and capital property for link completion. A knowledge link from insurance name to company to capital property is obtained "insurance name → company → capital property".
Thirdly, the ontology included in the user consultation sentence analysis result is not on the same knowledge link.
For example, as one example, the user consultation statement parsing result includes three ontologies of insurance name, company, and green channel. In the body layer shown in fig. 2a, there is a connection relationship between the insurance name and the company, which is pointed to by the insurance name. And a connection relationship between the insurance name and the green channel, wherein the insurance name points to the green channel. It can be seen that the company and green channels are located on two different relationship branches of the insurance name. The executive body can perform link splitting to obtain two knowledge links from the insurance name to the knowledge link of the company, namely the insurance name → the company, and from the insurance name to the green channel, namely the insurance name → the green channel.
It should be noted that the example herein is merely an exemplary illustration of the process of finding a knowledge link corresponding to a user consultation statement in the ontology layer. And is not used to limit the number of knowledge links corresponding to the user's consultation statement.
And secondly, performing intention anchor points on the knowledge link obtained in the first step to obtain intention analysis results corresponding to the user consultation sentences.
In this embodiment, the execution body may perform the intention anchor point on the knowledge link obtained in the first step. Wherein the process of performing the intention anchor point on the knowledge link is a process of determining on which attribute in the knowledge link an answer matching the user's consultation sentence appears.
In this embodiment, the executing agent may perform the intention anchor point on the default attribute of the ontology farthest from the central ontology in the knowledge link obtained in the first step. For example, as an example, the heavy disease exemption is described as a default attribute of the heavy disease exemption body, the execution main body can perform an intention anchor point on the heavy disease exemption description of the default attribute of the body heavy disease exemption farthest from the central body in the knowledge link "insurance name → heavy disease guarantee → heavy disease exemption" obtained in the first step of this example, and the link to which the default attribute is added is: "insurance name → protection of severe disease → exemption of severe disease → description of exemption of severe disease".
It should be noted that, if the number of knowledge links corresponding to the user query statement obtained in the first step is at least two. The execution body may perform the intention anchor for each of the at least two knowledge links, respectively.
In some optional implementation manners of this embodiment, the execution main body may perform intent analysis on the user query statement in an ontology layer of a pre-established knowledge graph corresponding to the user query statement according to an analysis result obtained by analyzing the user query statement by the following steps, so as to obtain an intent analysis result corresponding to the user query statement:
the first step, determining the type of the user consultation statement under the preset user consultation statement analysis rule according to the analysis result.
In this alternative implementation, the preset user advisory statement analysis rule may classify the user advisory statement into a first type (e.g., a user advisory statement having an ontology), a second type (e.g., a user advisory statement having an ontology and attributes), a third type (e.g., a user advisory statement having an ontology and relationships), and a fourth type (e.g., a user advisory statement including an ontology, attributes, and relationships).
And secondly, according to the intention analysis rule matched with the type of the user consultation sentence, performing intention analysis on the user consultation sentence in a body layer of a pre-established knowledge map corresponding to the user consultation sentence to obtain an intention analysis result corresponding to the user consultation sentence.
In this optional implementation, the executing may select an intention analysis rule matching the type of the user query statement, and perform intention analysis on the user query statement in an ontology layer of a pre-established knowledge graph corresponding to the user query statement. For example, as an example, for a first type of user consultation statement with an ontology, the executing agent may first find a knowledge link containing the ontology included in the user consultation statement in an ontology layer. It should be noted that the knowledge link here may be one knowledge link including an ontology included in the user query statement, may be one knowledge link including an ontology included in the user query statement after link completion, or may be at least two knowledge links after link splitting, and each of the at least two knowledge links includes an ontology included in at least two user query statements. The executing agent may then proceed with the intent anchor on a default attribute of the ontology in the knowledge link that is furthest away from the central ontology. It should be noted that, if the number of the knowledge links is at least two, the execution body may perform the intention anchor point on each of the at least two knowledge links respectively.
In this optional implementation, the execution main body classifies the user query sentence first. Then, the executing body can perform intention analysis on the user consultation statement type with simple semantic structure by adopting a relatively simple intention analysis rule matched with the type, and perform intention analysis on the user consultation statement type with complex semantic structure by adopting a relatively complex intention analysis rule matched with the type. On one hand, the method is favorable for reasonably distributing operation resources, and on the other hand, the method is favorable for obtaining more accurate intention analysis results.
In some optional implementation manners of this embodiment, the execution main body may perform intent analysis on the user query statement in an ontology layer of a pre-established knowledge graph corresponding to the user query statement according to an intent analysis rule matched with the type of the user query statement, so as to obtain an intent analysis result corresponding to the user query statement:
the method comprises the following steps of firstly, according to intention analysis rules matched with user consultation sentence types, carrying out intention analysis on the user consultation sentences in a body layer of a pre-established knowledge graph to obtain at least two candidate intention analysis results.
In this alternative implementation, the user consultation sentence input by the user through the user terminal may include at least two query intents. The execution main body performs intention analysis on the user consultation sentence according to the intention analysis rule matched with the type of the user consultation sentence, and can identify at least two candidate intention analysis results in the user consultation sentence.
And a second step of determining an intention analysis result corresponding to the user's consultation sentence from the candidate intention analysis results in response to receiving the intention confirmation information sent by the sender.
In this alternative implementation, the sender may consult the user for the user about the user terminal from which the statement came. And the execution main body sends the intention inquiry information to the user terminal when the number of the candidate intention analysis results obtained in the first step is more than 1. The user of the user terminal may select one intention analysis result from the candidate intention analysis results and transmit intention confirmation information to the execution main body. The execution body may determine an intention analysis result corresponding to the user consultation sentence according to the received intention confirmation information.
In this alternative implementation, the execution body may analyze and recognize a plurality of intention analysis results of the user consultation sentence. The execution body may determine an intention analysis result required by a user from among a plurality of intention analysis results through information interaction with the user terminal. So that a user-desired answer can be obtained and sent to the user terminal in step 202. On one hand, the response accuracy can be improved, and on the other hand, the information transmission flow and the display resource consumption can be reduced.
In some optional implementations of this embodiment, the user advisory statement type includes a second type, wherein the second type of user advisory statement has attributes and an ontology. The execution main body may perform intent analysis on the user consultation sentence in an ontology layer of a pre-established knowledge graph corresponding to the user consultation sentence according to an intent analysis rule matched with the type of the user consultation sentence through the following steps to obtain an intent analysis result corresponding to the user consultation sentence:
the first step is to obtain an ontology to which attributes included in the user consultation statement belong.
In this alternative implementation, the second type of user advisory statement has attributes and an ontology. The execution main body may first obtain an ontology to which an attribute included in the user consultation sentence belongs.
In this optional implementation manner, the attribute and the ontology included in the user consultation sentence may be obtained by parsing the consultation sentence through the execution main body. The attribute belongs to a certain ontology in the ontology layer. The ontology to which the attribute belongs may be an ontology included in the user query statement, or an ontology not included in the query.
And secondly, adding the ontology to which the attribute belongs to the ontology included in the user consultation statement.
In this optional implementation manner, the execution main body may add the ontology to which the attribute included in the user query statement acquired in the first step belongs to the ontology included in the user query statement. Specifically, if the ontology to which the attribute included in the user query statement acquired in the first step belongs already appears in the user query statement, the attribute does not need to be added to the ontology included in the user query statement. And if the ontology to which the attribute belongs does not appear in the user consultation sentence, the ontology to which the attribute belongs is added to the ontology included in the user consultation sentence.
And thirdly, performing intention analysis on the user consultation sentences in the body layer based on the attributes and the bodies included in the user consultation sentences after the bodies are added to obtain intention analysis results corresponding to the user consultation sentences.
In this alternative implementation, the execution subject may find a knowledge link with the ontology and the attribute included in the user query statement after updating the ontology in the ontology layer. In this optional implementation manner, the finding out, by the execution main body, the knowledge link corresponding to the user query statement from the ontology layer according to the parsing result of the user query statement may include, but is not limited to, the following cases:
first, the ontology and attributes included in the user's consultation statement parsing result are on the same knowledge link.
For example, as an example, the user consultation statement resolution result includes an insurance name, two ontologies of the company, and a registered capital attribute. In the ontology layer shown in fig. 2a, there is a connection between the insurance name and the company, which is pointed to by the insurance name, and a connection between the company and the registered capital, which is pointed to by the company, which is pointed to by the capital property. The enforcement agent may determine a knowledge link from insurance name to company to capital nature "insurance name → company → registered capital".
Secondly, the ontology and the attribute included in the user consultation statement analysis result are on the same knowledge link after link completion.
For example, as one example, the user advisory statement parsing result includes an insurance name ontology and a registered capital attribute. In the ontology layer shown in fig. 2a, the registered capital attributes do not belong to an ontology that appears in any user consultation statement. The execution subject can perform intellectual link completion using the ontology "company" to which the registered capital belongs, and obtain a intellectual link from insurance name to company to registered capital "insurance name → company → registered capital".
Thirdly, the ontology and the attribute included in the user consultation statement analysis result are not on the same knowledge link.
For example, as an example, the user advisory statement parsing result includes an insurance name, two ontologies for the green channel, and a registered capital attribute. In the ontology layer shown in fig. 2a, the registered capital attributes do not belong to an ontology that appears in any user consultation statement. The enforcement agent may use the ontology "company" to which the registered capital belongs for knowledge link completion. In addition, there is a connection between the insurance name and the green channel, which is pointed to by the insurance name. It can be seen that the registered capital and green channels are located on two different relationship branches of the insurance name. The executive may perform link splitting to obtain two knowledge links, namely, an insurance name → company → registered capital "knowledge link from insurance name to registered capital and an insurance name → green channel" knowledge link from insurance name to green channel.
It should be noted that the example herein is merely an exemplary illustration of the process of finding a knowledge link corresponding to the second type of user consultation statement in the ontology layer. And is not used to limit the number of knowledge links corresponding to the second type of user consultation statement.
In this alternative implementation, the execution body may perform an intention anchor point on the knowledge link to obtain an intention analysis result corresponding to the user consultation sentence. The position of the execution main body for the intention anchor point on the knowledge link may include an attribute included in the user consultation sentence, and a default attribute of an ontology of the knowledge link farthest from the central ontology except for an ontology to which the attribute belongs. For example, as one example, the executive may register capital intent anchors at the attribute of the ontology "company" in the knowledge link "insurance name → company → registered capital" furthest from the central ontology. It should be noted that, if the number of the knowledge links is at least two, the execution body may perform the intention anchor point on each of the at least two knowledge links respectively.
In this optional implementation manner, for the second type of user query statement, the execution subject performs intent analysis on the user query statement using the intent analysis rule matched with the type, which is helpful to improve the accuracy of the result of the intent analysis of the type of user query statement.
In some optional implementations of this embodiment, the user advisory statement type includes a third type, wherein the third type of user advisory statement has a relationship and an ontology. The execution main body may perform intent analysis on the user consultation sentence in an ontology layer of a pre-established knowledge graph corresponding to the user consultation sentence according to an intent analysis rule matched with the type of the user consultation sentence through the following steps to obtain an intent analysis result corresponding to the user consultation sentence:
the first step is to obtain an ontology connected with the relationship included in the user consultation statement.
In this alternative implementation, the user advisory statement of the third type has an ontology and a relationship. The execution main body may first obtain an ontology to which a relation included in the user consultation sentence is connected.
In this optional implementation manner, the relationship and the ontology included in the user consultation sentence may be obtained by analyzing the consultation sentence by the execution main body. This relationship connects some two of the body layers. The ontology connected by the relationship may be an ontology included in the user query statement, or an ontology not included in the query.
And secondly, adding the ontology connected by the relationship to the ontology included in the user consultation sentence.
In this optional implementation manner, the execution main body may add an ontology connected to a relationship included in the user query statement acquired in the first step to an ontology included in the user query statement. Specifically, if the ontology connected to the relationship included in the user query statement acquired in the first step appears in the user query statement, the ontology does not need to be added to the ontology included in the user query statement. And if the ontology connected with the relationship included in the user consultation sentence acquired in the first step does not appear in the user consultation sentence, adding the ontology connected with the relationship into the ontology included in the user consultation sentence.
And thirdly, performing intention analysis on the user consultation sentences in the body layer based on the relationship and the bodies included in the user consultation sentences after the bodies are added to obtain intention analysis results corresponding to the user consultation sentences.
In this alternative implementation, the execution subject may find a knowledge link in the ontology layer with the ontology and the relationship included in the user query statement after updating the ontology. The finding out the knowledge link corresponding to the user consultation statement from the ontology layer by the execution main body according to the analysis result of the user consultation statement may include, but is not limited to, the following cases:
first, the ontology and the relationship included in the user consultation statement analysis result are on the same knowledge link.
For example, as an example, the user consults statement parsing results including insurance name, company two ontologies, and issued relationship. Both bodies connected by an issue relationship in the body layer shown in fig. 2a exist in the user consultation sentence. The executive may determine a knowledge link from insurance name to company "insurance name → company".
Secondly, the ontology and the relation included in the user consultation statement analysis result are on the same knowledge link after link completion.
For example, as one example, the user advisory statement parsing result includes an insurance name ontology and capital composition relationships. In the ontology layer shown in FIG. 2a, the capital composition relationships are not subject to ontologies that appear in any user challenge statements. The enforcement agent may use the ontology company and capital nature to which the capital composition relationship is connected to make the completion of the knowledge link. The completion may be followed by a knowledge link from insurance name to company to capital property "insurance name → company → capital property".
Thirdly, the ontology and the relationship included in the user consultation statement analysis result are not on the same knowledge link.
For example, as one example, the user advisory statement parsing results include insurance name, green channel two ontologies, and capital composition relationship. In the ontology layer shown in FIG. 2a, the capital composition relationships are not subject to ontologies that appear in any user challenge statements. The enforcement agent may use the ontology company and capital nature to which the capital composition relationship is connected to make the completion of the knowledge link. In addition, the capital nature and green channel are located on two different relational branches of the insurance name. The executive may perform link splitting to obtain two knowledge links, namely, an insurance name → company → capital property knowledge link from insurance name to capital property and an insurance name → green channel knowledge link from insurance name to green channel knowledge link.
It should be noted that the example herein is merely an exemplary illustration of the process of finding a knowledge link corresponding to the third type of user consultation statement in the ontology layer. And is not used to limit the number of knowledge links corresponding to the third type of user consultation sentence.
In this alternative implementation, the execution body may perform an intention anchor point on the knowledge link to obtain an intention analysis result corresponding to the user consultation sentence. The performing body may perform the location of the intention anchor point on the knowledge link, including: the default attribute of the ontology far away from the central ontology in the two ontologies connected by the relationship included in the user consultation statement, and the default attribute of the ontology farthest from the central ontology except the ontology connected by the relationship in the knowledge link. It should be noted that, if the number of the knowledge links is at least two, the execution body may perform the intention anchor point on each of the at least two knowledge links respectively.
In this optional implementation manner, for the user query statement of the third type, the execution subject performs intent analysis on the user query statement using the intent analysis rule matched with the type, which is helpful to improve the accuracy of the result of the intent analysis of the user query statement of the type.
In some optional implementations of this embodiment, the user advisory statement type includes a fourth type, wherein the fourth type user advisory statement includes attributes, relationships, and ontologies. The execution main body may perform intent analysis on the user consultation sentence in an ontology layer of a pre-established knowledge graph corresponding to the user consultation sentence according to an intent analysis rule matched with the type of the user consultation sentence through the following steps to obtain an intent analysis result corresponding to the user consultation sentence:
the method comprises the following steps of firstly, acquiring an ontology to which attributes included in a user consultation statement belong and an ontology connected with a relation included in the user consultation statement.
In this alternative implementation, the fourth type of user advisory statement includes an ontology, attributes, and relationships. The execution main body may first obtain an ontology to which an attribute included in the user query sentence belongs and an ontology to which a relationship included in the user query sentence is connected.
In this optional implementation manner, the attributes, relationships, and ontologies included in the user query statement may be obtained by analyzing the query statement by the execution main body. The attribute belongs to a certain ontology in the ontology layer, and the relationship connects two certain ontologies in the ontology layer. The ontology to which the attribute belongs and the ontology to which the relationship is connected may be an ontology included in the user query statement, or an ontology not included in the query.
And secondly, adding the ontology to which the attribute belongs and the ontology connected by the relationship to the ontology included in the user consultation sentence.
In this optional implementation manner, the execution main body may add the ontology to which the attribute included in the user query statement acquired in the first step belongs and the ontology connected to the relationship included in the user query statement to the ontology included in the user query statement. Specifically, if the ontology to which the attribute included in the user query statement acquired in the first step belongs and the ontology connected to the relationship included in the user query statement appear in the user query statement, the ontology does not need to be added to the ontology included in the user query statement. If the ontology to which the attribute included in the user query sentence obtained in the first step belongs or the ontology connected with the relationship included in the user query sentence does not appear in the user query sentence, adding the ontology to which the attribute belongs or the ontology connected with the relationship to the ontology included in the user query sentence.
And thirdly, performing intention analysis on the user consultation sentences in the body layer based on the attributes, the relations and the bodies included in the user consultation sentences after the bodies are added to obtain intention analysis results corresponding to the user consultation sentences.
In this optional implementation manner, the execution main body may first find a knowledge link including an ontology, attributes, and relationships included in the user query statement after updating the ontology in the ontology layer. The finding out the knowledge link corresponding to the user consultation statement from the ontology layer by the execution main body according to the analysis result of the user consultation statement may include, but is not limited to, the following cases:
first, the ontology, attributes and relationships included in the user's consultation statement parsing result are on the same knowledge link.
For example, as one example, the user advisory statement parsing result includes an insurance name and two ontologies of the company, a registered capital attribute, and an issued relationship. In the ontology layer shown in fig. 2a, two ontologies, attributes and relationships included in the user consultation statement parsing result are on the same knowledge link. The enforcement agent may determine a knowledge link from insurance name to company to registered capital "insurance name → company → registered capital".
Secondly, the ontology, the attributes and the relations included in the user consultation statement analysis result are on the same knowledge link after the link completion.
For example, as one example, the user consult statement parsing results include an insurance name ontology, a heavy exemption description attribute, and an exempt relationship. In the ontology layer shown in fig. 2a, the heavy exemption description attribute does not belong to an ontology appearing in the user's consultation sentence, and an ontology connected with an exemption relationship does not appear in the user's consultation sentence. The executive body can use the weight disease guarantee and the weight disease exemption to complete the knowledge link. After completion, a knowledge link from insurance name to heavy disease guarantee to heavy disease exemption description can be obtained, namely insurance name → heavy disease guarantee → heavy disease exemption.
Thirdly, the ontology, attributes and relationships included in the user consultation statement analysis result are not on the same knowledge link.
For example, as one example, the user consultation statement parsing result includes an insurance name ontology, an insurance description attribute, and a green channel relationship. In the ontology layer shown in fig. 2a, the ontologies connected by the green service channel relation are the insurance name and the green channel, and the insurance description and the green channel are located on two different relation branches of the insurance name. The executing body can perform link splitting to obtain a knowledge link from an insurance name to a green channel, namely 'insurance name → green channel' and a knowledge link from an insurance name to an insurance description, namely 'insurance name → insurance description', which are two knowledge links.
It should be noted that the example herein is merely an exemplary illustration of the process of finding a knowledge link corresponding to the fourth type of user consultation statement in the ontology layer. And is not used to limit the number of knowledge links corresponding to the fourth type of user consultation sentence.
Then, the execution body may perform an intention anchor point on the knowledge link to obtain an intention analysis result corresponding to the user consultation sentence. The position of the execution main body for performing the intention anchor point on the knowledge link may include an attribute included in the user consultation sentence, a default attribute of an ontology, which is farther from the central ontology, of two ontologies connected by a relationship included in the user consultation sentence, and a default attribute of an ontology, which is farthest from the central ontology, of the knowledge link except for the ontology to which the attribute belongs and the ontology connected by the relationship. It should be noted that, if the number of the knowledge links is at least two, the execution body may perform the intention anchor point on each of the at least two knowledge links respectively.
In this optional implementation manner, for the fourth type of user query statement, the execution subject performs intent analysis on the user query statement using the intent analysis rule matched with the type, which is helpful to improve the accuracy of the result of the intent analysis of the type of user query statement.
Step 202, according to the intention analysis result, answer addressing is carried out in the physical layer of the knowledge graph, and an answer matched with the user consultation statement is obtained.
In the present embodiment, the intention analysis result obtained in step 201 is a knowledge link including an intention anchor point. The executing body may perform answer addressing in the entity layer according to the knowledge link including the intent anchor obtained in step 201 and the entities corresponding to the respective entities in the knowledge link, that is, find an answer matching the user query statement.
In this embodiment, the execution main body may first obtain the entity link corresponding to the user query sentence according to the knowledge link including the intent anchor and the entities corresponding to the respective ontologies in the knowledge link. The execution body may then find a minimal subgraph in the physical layer that corresponds to the physical link. The execution agent may then delete entities, relationships, or attributes in the smallest subgraph that are not related to the entity link. The execution body may then take the value on the anchor point of the intent of the remaining physical link as the answer to match the user's consultation statement.
For example, as an example, the execution main body may derive an entity link corresponding to the user consultation sentence as "a → B → C" from a knowledge link including an intention anchor on a default attribute of the entity C and entities corresponding to respective ontologies in the knowledge link. The executing entity may use an entity a closest to the central entity in the entity link as a start node, and use an entity C farthest from the central entity in the entity link as a stop node. The execution body may then find the smallest subgraph between the start node a and the end node C in the physical layer as shown in fig. 2C. The execution body may then delete entity D, entity G, and entity F that are unrelated to the entity link "a → B → C" in the smallest sub-graph, and delete the connection relationships between entity a and entity C and the unrelated entities. The final remaining entity link is "A → B → C", wherein the default attribute value of the entity C is the answer matching the user consultation sentence.
It should be noted that, if the number of the intention analysis results corresponding to the user query sentence obtained in step 201 is at least two. The execution body may address answers in the physical layer sequentially according to each of the at least two intention analysis results, and obtain an answer matching the user's consultation sentence.
Step 203, the answer is sent to the sender from which the user consultation statement comes.
In this embodiment, the sender of the user query statement may be a user terminal (e.g., terminals 101, 102, and 103 shown in fig. 1) communicatively connected to the execution body. In practice, the executing entity may send the answer obtained in step 202 to the user terminal, and the user terminal may display the answer on a display device of the user terminal. Here, the number of answers matching the user's consultation sentence obtained in step 202 and the number of answers that the execution body can send to the user terminal may be greater than 1.
With continuing reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the answering method according to the present embodiment. In the application scenario of fig. 3, the user may input a user consultation sentence 303 through the user terminal 301. The user terminal 301 transmits the user consultation sentence 303 to the server 302, requesting the server 302 to give an answer matching the user consultation sentence 303. After receiving the user query statement 303, the server 303 may perform user query statement analysis on the user query statement 303 to obtain an analysis result 304. Then, the server 303 may perform intent analysis on the user query sentence in the ontology layer of the knowledge graph corresponding to the user query sentence according to the analysis result 304, to obtain an intent analysis result 305 corresponding to the user query sentence. Then, the server 303 may address the answer at the physical layer corresponding to the user's consultation sentence according to the intention analysis result 305, and obtain an answer 306 matching the user's consultation sentence. Finally, the server 302 may send the answer 306 to the sender 301 from which the user consults the sentence.
According to the response method provided by the embodiment of the disclosure, according to an analysis result obtained by analyzing a user consultation sentence, intention analysis is performed on the user consultation sentence in a body layer of a pre-established knowledge map loaded into a memory and corresponding to the user consultation sentence, so that an intention analysis result corresponding to the user consultation sentence is obtained; then according to the intention analysis result, carrying out answer addressing in a physical layer of a pre-established knowledge graph corresponding to the user consultation sentence to obtain an answer matched with the user consultation sentence; and then sends the answer to the sender from which the user consults the statement. The embodiment has high intention analysis and answer addressing efficiency, can accurately identify a plurality of intentions in the user consultation sentences, can give accurate answers aiming at each intention, and is favorable for improving the response efficiency and the response accuracy.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method of responding according to the present disclosure. The response method is applied to a server and comprises the following steps:
step 401, according to an analysis result obtained by analyzing a user query statement, performing intent analysis on the user query statement in a body layer of a pre-established knowledge graph corresponding to the user query statement to obtain at least two candidate intent analysis results.
And 402, in response to receiving the intention confirmation information sent by the sender, determining an intention analysis result corresponding to the user consultation sentence from the candidate intention analysis results.
And 403, performing answer addressing in the physical layer of the knowledge graph according to the intention analysis result to obtain an answer matched with the user consultation statement.
Step 404, the answer is sent to the sender from which the user consultation statement came.
In this embodiment, step 401, step 403, and step 404 are respectively consistent with step 201, step 202, and step 203 in the foregoing embodiment, and the above description for step 201, step 202, and step 203 also applies to step 401, step 403, and step 404, which is not described herein again.
And 402, in response to receiving the intention confirmation information sent by the sender, determining an intention analysis result corresponding to the user consultation sentence from the candidate intention analysis results.
In this embodiment, the sender may be a user terminal from which the user consults the statement. The execution body transmits intention query information to the user terminal when the number of the intention analysis results of the user consultation sentence obtained in step 401 is greater than 1. The user of the user terminal may select one intention analysis result from the candidate intention analysis results and transmit intention confirmation information to the execution main body. The execution body may determine an intention analysis result corresponding to the user consultation sentence according to the received intention confirmation information.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the response method in this embodiment represents that, in response to receiving the intention confirmation information sent by the sender, the intention analysis result corresponding to the user consultation sentence is determined from the candidate intention analysis results. Therefore, according to the scheme described in this embodiment, the server selects an answer required by a user from a plurality of candidate answers and sends the answer to the sender, so that on one hand, the response efficiency can be improved, and on the other hand, the consumption of information transmission flow and display resources can be reduced.
With further reference to fig. 5, the present disclosure provides one embodiment of a responding device as an implementation of the methods illustrated in the above figures. The embodiment of the device corresponds to the embodiment of the method shown in fig. 2, and the device can be applied to various electronic devices.
As shown in fig. 5, the answering device 500 of the present embodiment may include: an intention analysis unit 501, an answer addressing unit 502, and an answer sending unit 503. The intention analysis unit 501 is configured to perform intention analysis on the user query statement in a body layer of a pre-established knowledge graph corresponding to the user query statement according to an analysis result obtained by analyzing the user query statement, so as to obtain an intention analysis result corresponding to the user query statement; an answer search unit 502 configured to perform answer addressing on a physical layer of a pre-established knowledge graph corresponding to the user consultation sentence according to the intention analysis result to obtain an answer matched with the user consultation sentence; an answer sending unit 503 configured to send an answer to a sender from which the user consultation sentence comes.
In the present embodiment, in the response device 500: the detailed processing of the intention analyzing unit 501, the answer addressing unit 502, and the answer sending unit 503 and the technical effects thereof can be respectively described with reference to step 201, step 202, and step 203 in the corresponding embodiment of fig. 2, and are not repeated herein.
In some optional implementations of the present embodiment, the intention analysis unit 501 includes: a determining user consultation sentence type subunit configured to determine a user consultation sentence type of the user consultation sentence under a preset user consultation sentence classification rule according to the analysis result; and the intention analysis subunit is configured to perform intention analysis on the user consultation sentence in the ontology layer of the pre-established knowledge graph corresponding to the user consultation sentence according to the intention analysis rule matched with the type of the user consultation sentence, so as to obtain an intention analysis result corresponding to the user consultation sentence.
In some optional implementations of this embodiment, the intent analysis subunit includes: the intention analysis module is configured to perform intention analysis on the user consultation sentences in a body layer of a pre-established knowledge graph according to intention analysis rules matched with the types of the user consultation sentences to obtain at least two candidate intention analysis results; and a confirmation intention module configured to determine an intention analysis result corresponding to the user consultation sentence from the candidate intention analysis results in response to receiving intention confirmation information transmitted by the sender.
In some optional implementations of this embodiment, the user advisory statement type includes a second type, wherein the second type of user advisory statement has attributes and an ontology; the intent analysis subunit includes: a second obtaining ontology module configured to obtain an ontology to which an attribute included in the user consultation sentence belongs; a second add ontology module configured to add an ontology to which the attribute belongs to an ontology included in the user consultation sentence; and the second intention analysis module is configured to perform intention analysis on the user consultation sentence in the ontology layer based on the attributes and the ontology included in the user consultation sentence after the ontology is added, so as to obtain an intention analysis result corresponding to the user consultation sentence.
In some optional implementations of this embodiment, the user advisory statement types include a third type, wherein the third type user advisory statement has a relationship and an ontology; the intent analysis subunit includes: a third ontology obtaining module configured to obtain an ontology to which a relation included in the user consultation sentence is connected; a third ontology adding module configured to add an ontology to which the relationship is connected to an ontology included in the user consultation sentence; and the third intention analysis module is configured to perform intention analysis on the user consultation sentences in the ontology layer based on the relationship and the ontology included in the user consultation sentences after the ontology is added, so as to obtain intention analysis results corresponding to the user consultation sentences.
In some optional implementations of this embodiment, the user advisory statement type includes a fourth type, where the fourth type user advisory statement includes attributes, relationships, and ontologies; the intent analysis subunit includes: a fourth ontology acquiring module configured to acquire an ontology to which an attribute included in the user consultation sentence belongs and an ontology to which a relationship included in the user consultation sentence is connected; a fourth ontology adding module configured to add an ontology to which the attribute belongs and an ontology to which the relationship is connected to an ontology included in the user consultation sentence; and the fourth intention analysis module is configured to perform intention analysis on the user consultation sentence in the ontology layer based on the attributes, the relationships and the ontology included in the user consultation sentence after the ontology is added, so as to obtain an intention analysis result corresponding to the user consultation sentence.
In some optional implementations of the present embodiment, the intention analysis unit 501 includes: a candidate intention analysis subunit configured to perform intention analysis on the user consultation sentence in a body layer of a pre-established knowledge map corresponding to the user consultation sentence according to an analysis result obtained by analyzing the user consultation sentence, to obtain at least two candidate intention analysis results; and a confirmation intention subunit configured to determine an intention analysis result corresponding to the user consultation sentence from the candidate intention analysis results in response to receiving the intention confirmation information sent by the sender.
In the apparatus provided by the above embodiment of the present disclosure, the intention analysis unit 501 performs intention analysis on the user query sentence in the ontology layer of the pre-established knowledge graph corresponding to the user query sentence, so as to obtain an intention analysis result corresponding to the user query sentence. Then, the answer addressing unit 502 performs answer addressing in a physical layer of a pre-established knowledge graph corresponding to the user's consultation sentence according to the intention analysis result, to obtain an answer matched with the user's consultation sentence. After that, the answer sending unit 503 sends the answer to the sender from which the user consultation sentence comes. The embodiment has high intention analysis and answer addressing efficiency, can accurately identify a plurality of intentions in the user consultation sentences, can give accurate answers aiming at each intention, and is favorable for improving the response efficiency and the response accuracy.
Referring now to FIG. 6, a schematic diagram of an electronic device (e.g., the server of FIG. 1) 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure.
It should be noted that the computer readable medium of the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an intention analysis unit, an answer addressing unit, and an answer sending unit. The names of these units do not limit the unit itself in some cases, and for example, the intention analysis unit may be further described as "a unit that performs intention analysis on a user query sentence in an ontology layer of a pre-established knowledge graph corresponding to the user query sentence according to an analysis result obtained by analyzing the user query sentence, and obtains an intention analysis result corresponding to the user query sentence".
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: according to an analysis result obtained by analyzing the user consultation sentence, performing intention analysis on the user consultation sentence in a body layer of a pre-established knowledge map corresponding to the user consultation sentence to obtain an intention analysis result corresponding to the user consultation sentence; according to the intention analysis result, addressing the answers in a physical layer of a pre-established knowledge graph corresponding to the user consultation sentence to obtain answers matched with the user consultation sentence; the answer is sent to the sender from which the user consults the statement.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A method of responding, comprising:
according to an analysis result obtained by analyzing a user consultation sentence, performing intention analysis on the user consultation sentence in a body layer of a pre-established knowledge map corresponding to the user consultation sentence to obtain an intention analysis result corresponding to the user consultation sentence;
according to the intention analysis result, answer addressing is carried out in a physical layer of the knowledge graph, and an answer matched with the user consultation statement is obtained;
sending the answer to a sender from which the user consultation statement comes;
wherein the intent analysis result is a knowledge link that includes an intent anchor point;
and the step of addressing answers in the entity layer of the knowledge graph according to the intention analysis result to obtain answers matched with the user consultation sentences comprises the following steps:
obtaining an entity link corresponding to the user consultation statement according to the knowledge link comprising the intention anchor point and the entities corresponding to the bodies in the knowledge link;
finding a minimum subgraph corresponding to the entity link in a physical layer of the knowledge graph;
deleting entities, relationships or attributes in the minimal subgraph that are not related to the entity link;
and taking the value on the anchor point of the meaning graph in the remaining entity link as an answer matched with the user consultation sentence.
2. The method of claim 1, wherein the analyzing intent of the user query sentence in a ontology layer of a pre-established knowledge graph corresponding to the user query sentence according to an analysis result obtained by analyzing the user query sentence to obtain an intent analysis result corresponding to the user query sentence comprises:
determining the type of the user consultation statement under a preset user consultation statement classification rule according to the analysis result;
and according to the intention analysis rule matched with the type of the user consultation statement, performing intention analysis on the user consultation statement in a body layer of a pre-established knowledge map corresponding to the user consultation statement to obtain an intention analysis result corresponding to the user consultation statement.
3. The method of claim 2, wherein the performing intent analysis on the user consultation sentence in a ontology layer of a pre-established knowledge graph corresponding to the user consultation sentence according to the intent analysis rule matched with the user consultation sentence type to obtain an intent analysis result corresponding to the user consultation sentence comprises:
according to intention analysis rules matched with the types of the user consultation sentences, intention analysis is carried out on the user consultation sentences in a body layer of the pre-established knowledge map to obtain at least two candidate intention analysis results;
and determining an intention analysis result corresponding to the user consultation sentence from the candidate intention analysis results in response to receiving intention confirmation information sent by the sender.
4. The method of claim 2, wherein the user advisory statement type includes a second type, wherein the second type user advisory statement has attributes and an ontology;
according to the intention analysis rule matched with the type of the user consultation statement, carrying out intention analysis on the user consultation statement in a body layer of a pre-established knowledge map corresponding to the user consultation statement to obtain an intention analysis result corresponding to the user consultation statement, wherein the intention analysis result comprises the following steps:
acquiring an ontology to which attributes included in the user consultation statement belong;
adding the ontology to which the attribute belongs to the ontology included in the user consultation sentence;
and performing intention analysis on the user consultation sentence in the ontology layer based on the attribute and the ontology included in the user consultation sentence after the ontology is added to obtain an intention analysis result corresponding to the user consultation sentence.
5. The method of claim 2, wherein the user advisory statement type includes a third type, wherein the third type user advisory statement has a relationship and an ontology;
according to the intention analysis rule matched with the type of the user consultation statement, carrying out intention analysis on the user consultation statement in a body layer of a pre-established knowledge map corresponding to the user consultation statement to obtain an intention analysis result corresponding to the user consultation statement, wherein the intention analysis result comprises the following steps:
acquiring an ontology connected with a relation included in the user consultation statement;
adding the ontology connected by the relationship to an ontology included in the user consultation sentence;
and performing intention analysis on the user consultation sentence in the ontology layer based on the relationship and the ontology included in the user consultation sentence after the ontology is added to obtain an intention analysis result corresponding to the user consultation sentence.
6. The method of claim 2, wherein the user advisory statement type comprises a fourth type, wherein the fourth type user advisory statement comprises attributes, relationships, and ontologies;
according to the intention analysis rule matched with the type of the user consultation statement, carrying out intention analysis on the user consultation statement in a body layer of a pre-established knowledge map corresponding to the user consultation statement to obtain an intention analysis result corresponding to the user consultation statement, wherein the intention analysis result comprises the following steps:
acquiring an ontology to which attributes included in the user consultation statement belong and an ontology connected with a relation included in the user consultation statement;
adding an ontology to which the attribute belongs and an ontology to which the relationship is connected to an ontology included in the user consultation sentence;
and performing intention analysis on the user consultation sentence in the ontology layer based on the attribute, the relationship and the ontology included in the user consultation sentence after the ontology is added to obtain an intention analysis result corresponding to the user consultation sentence.
7. The method of claim 1, wherein the analyzing intent of the user query sentence in a ontology layer of a pre-established knowledge graph corresponding to the user query sentence according to an analysis result obtained by analyzing the user query sentence to obtain an intent analysis result corresponding to the user query sentence comprises:
according to an analysis result obtained by analyzing a user consultation sentence, performing intention analysis on the user consultation sentence in a body layer of a pre-established knowledge map corresponding to the user consultation sentence to obtain at least two candidate intention analysis results;
and determining an intention analysis result corresponding to the user consultation sentence from the candidate intention analysis results in response to receiving intention confirmation information sent by the sender.
8. A transponder device comprising:
an intention analysis unit configured to perform intention analysis on a user consultation sentence in a body layer of a pre-established knowledge graph corresponding to the user consultation sentence according to an analysis result obtained by analyzing the user consultation sentence, to obtain an intention analysis result corresponding to the user consultation sentence;
an answer addressing unit configured to perform answer addressing in a physical layer of the knowledge graph according to the intention analysis result to obtain an answer matched with the user consultation sentence;
an answer sending unit configured to send the answer to a sender from which the user consultation sentence comes;
wherein the intent analysis result is a knowledge link that includes an intent anchor point;
and the step of addressing answers in the entity layer of the knowledge graph according to the intention analysis result to obtain answers matched with the user consultation sentences comprises the following steps:
obtaining an entity link corresponding to the user consultation statement according to the knowledge link comprising the intention anchor point and the entities corresponding to the bodies in the knowledge link;
finding a minimum subgraph corresponding to the entity link in a physical layer of the knowledge graph;
deleting entities, relationships or attributes in the minimal subgraph that are not related to the entity link;
and taking the value on the anchor point of the meaning graph in the remaining entity link as an answer matched with the user consultation sentence.
9. A terminal, comprising:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the answering method according to any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the answering method according to any one of claims 1-7.
CN201910399999.4A 2019-05-14 2019-05-14 Response method and device Active CN110096584B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201910399999.4A CN110096584B (en) 2019-05-14 2019-05-14 Response method and device
SG11202112274SA SG11202112274SA (en) 2019-05-14 2020-03-19 Responding method and apparatus
PCT/CN2020/080265 WO2020228416A1 (en) 2019-05-14 2020-03-19 Responding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910399999.4A CN110096584B (en) 2019-05-14 2019-05-14 Response method and device

Publications (2)

Publication Number Publication Date
CN110096584A CN110096584A (en) 2019-08-06
CN110096584B true CN110096584B (en) 2021-10-15

Family

ID=67448107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910399999.4A Active CN110096584B (en) 2019-05-14 2019-05-14 Response method and device

Country Status (3)

Country Link
CN (1) CN110096584B (en)
SG (1) SG11202112274SA (en)
WO (1) WO2020228416A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115270802A (en) * 2022-09-29 2022-11-01 中科雨辰科技有限公司 Question sentence processing method, electronic equipment and storage medium

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096584B (en) * 2019-05-14 2021-10-15 京东数字科技控股有限公司 Response method and device
CN110597992B (en) * 2019-09-10 2023-08-29 腾讯科技(深圳)有限公司 Semantic reasoning method and device based on knowledge graph and electronic equipment
CN110909138B (en) * 2019-10-31 2023-03-07 杭州未名信科科技有限公司 User intention identification method and system
CN112966178B (en) * 2021-03-05 2024-01-23 北京百度网讯科技有限公司 Consultation result distribution method, device, equipment and storage medium
CN113641833B (en) * 2021-08-17 2024-04-09 同济大学 Service demand matching method and device
CN113657102B (en) * 2021-08-17 2023-05-30 北京百度网讯科技有限公司 Information extraction method, device, equipment and storage medium
CN114238653B (en) * 2021-12-08 2024-05-24 华东师范大学 Method for constructing programming education knowledge graph, completing and intelligently asking and answering
CN115297078B (en) * 2022-07-06 2023-09-01 北京北信源软件股份有限公司 Consultation response method, consultation response device, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436206A (en) * 2008-12-22 2009-05-20 昆明理工大学 Tourism request-answer system answer abstracting method based on ontology reasoning
CN105956052A (en) * 2016-04-27 2016-09-21 青岛海尔软件有限公司 Building method of knowledge map based on vertical field
CN106354835A (en) * 2016-08-31 2017-01-25 上海交通大学 Artificial dialogue auxiliary system based on context semantic understanding
CN107977415A (en) * 2017-11-22 2018-05-01 北京寻领科技有限公司 Automatic question-answering method and device
US10140286B2 (en) * 2017-02-22 2018-11-27 Google Llc Optimized graph traversal
CN108959627A (en) * 2018-07-23 2018-12-07 北京光年无限科技有限公司 Question and answer exchange method and system based on intelligent robot
CN109684448A (en) * 2018-12-17 2019-04-26 北京北大软件工程股份有限公司 A kind of intelligent answer method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150310073A1 (en) * 2014-04-29 2015-10-29 Microsoft Corporation Finding patterns in a knowledge base to compose table answers
US10445668B2 (en) * 2017-01-04 2019-10-15 Richard Oehrle Analytical system for assessing certain characteristics of organizations
CN111095259B (en) * 2017-10-25 2023-08-22 谷歌有限责任公司 Natural Language Processing Using N-GRAM Machines
CN108595449A (en) * 2017-11-23 2018-09-28 北京科东电力控制系统有限责任公司 The structure and application process of dispatch automated system knowledge mapping
CN110096584B (en) * 2019-05-14 2021-10-15 京东数字科技控股有限公司 Response method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436206A (en) * 2008-12-22 2009-05-20 昆明理工大学 Tourism request-answer system answer abstracting method based on ontology reasoning
CN105956052A (en) * 2016-04-27 2016-09-21 青岛海尔软件有限公司 Building method of knowledge map based on vertical field
CN106354835A (en) * 2016-08-31 2017-01-25 上海交通大学 Artificial dialogue auxiliary system based on context semantic understanding
US10140286B2 (en) * 2017-02-22 2018-11-27 Google Llc Optimized graph traversal
CN107977415A (en) * 2017-11-22 2018-05-01 北京寻领科技有限公司 Automatic question-answering method and device
CN108959627A (en) * 2018-07-23 2018-12-07 北京光年无限科技有限公司 Question and answer exchange method and system based on intelligent robot
CN109684448A (en) * 2018-12-17 2019-04-26 北京北大软件工程股份有限公司 A kind of intelligent answer method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于知识图谱的农业知识服务系统研究;夏迎春;《中国优秀硕士学位论文全文数据库 信息科技辑》;20190215;第I138-2244页 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115270802A (en) * 2022-09-29 2022-11-01 中科雨辰科技有限公司 Question sentence processing method, electronic equipment and storage medium
CN115270802B (en) * 2022-09-29 2023-01-03 中科雨辰科技有限公司 Question sentence processing method, electronic equipment and storage medium

Also Published As

Publication number Publication date
SG11202112274SA (en) 2021-12-30
WO2020228416A1 (en) 2020-11-19
CN110096584A (en) 2019-08-06

Similar Documents

Publication Publication Date Title
CN110096584B (en) Response method and device
CN111522927B (en) Entity query method and device based on knowledge graph
CN112650841A (en) Information processing method and device and electronic equipment
CN112163076A (en) Knowledge question bank construction method, question and answer processing method, device, equipment and medium
CN115908640A (en) Method and device for generating image, readable medium and electronic equipment
CN110059172B (en) Method and device for recommending answers based on natural language understanding
CN111008213A (en) Method and apparatus for generating language conversion model
CN113051933B (en) Model training method, text semantic similarity determination method, device and equipment
CN113191257A (en) Order of strokes detection method and device and electronic equipment
CN111597441B (en) Information processing method and device and electronic equipment
US20240013007A1 (en) Dialogue understanding method, apparatus, readable medium and electronic device
CN112148847B (en) Voice information processing method and device
CN114239501A (en) Contract generation method, apparatus, device and medium
CN110941683B (en) Method, device, medium and electronic equipment for acquiring object attribute information in space
CN113987118A (en) Corpus acquisition method, apparatus, device and storage medium
CN113393288A (en) Order processing information generation method, device, equipment and computer readable medium
CN112148848A (en) Question and answer processing method and device
CN111339124A (en) Data display method and device, electronic equipment and computer readable medium
CN111339770A (en) Method and apparatus for outputting information
CN112307061A (en) Method and device for querying data
CN111046146B (en) Method and device for generating information
CN116881997B (en) City planning interface display method and device, electronic equipment and medium
CN111526054B (en) Method and device for acquiring network
WO2023202669A1 (en) Information processing method and apparatus, device and medium
CN113779980A (en) Method and device for recognizing text

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40006423

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Daxing Economic and Technological Development Zone, Beijing, 100176

Patentee after: Jingdong Technology Holding Co.,Ltd.

Address before: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Daxing Economic and Technological Development Zone, Beijing, 100176

Patentee before: Jingdong Digital Technology Holding Co.,Ltd.

Address after: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Daxing Economic and Technological Development Zone, Beijing, 100176

Patentee after: Jingdong Digital Technology Holding Co.,Ltd.

Address before: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Daxing Economic and Technological Development Zone, Beijing, 100176

Patentee before: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

CP01 Change in the name or title of a patent holder