CN111159376A - Session processing method, device, electronic equipment and storage medium - Google Patents

Session processing method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111159376A
CN111159376A CN201911393522.1A CN201911393522A CN111159376A CN 111159376 A CN111159376 A CN 111159376A CN 201911393522 A CN201911393522 A CN 201911393522A CN 111159376 A CN111159376 A CN 111159376A
Authority
CN
China
Prior art keywords
query
feature data
semantic
semantic feature
graph
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911393522.1A
Other languages
Chinese (zh)
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.)
Shenzhen Zhuiyi Technology Co Ltd
Original Assignee
Shenzhen Zhuiyi Technology 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 Shenzhen Zhuiyi Technology Co Ltd filed Critical Shenzhen Zhuiyi Technology Co Ltd
Priority to CN201911393522.1A priority Critical patent/CN111159376A/en
Publication of CN111159376A publication Critical patent/CN111159376A/en
Pending legal-status Critical Current

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)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a session processing method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining a query statement, then obtaining semantic feature data corresponding to the query statement, then constructing a query graph based on the semantic feature data, then judging whether a preset knowledge graph database has a query result matched with the query graph, and if so, outputting the query result. The method realizes that the query statement is abstracted into the structural query graph with semantic information by constructing the query graph based on the semantic feature data corresponding to the query statement, can realize effective transmission of the context semantic information of the query statement, and can avoid artificial design of a specific conversation process and an information collection strategy by judging whether a preset knowledge graph database has a query result matched with the query graph, thereby improving the question and answer efficiency and flexibility.

Description

Session processing method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of human-computer interaction technologies, and in particular, to a session processing method and apparatus, an electronic device, and a storage medium.
Background
Dialog Management (DM) controls the process of a human-machine Dialog, and the DM determines the reaction to the user at that moment based on the Dialog history information. The most common application is task-driven multi-turn conversation, users have definite purposes such as ordering food, ordering tickets and the like, the user requirements are complex, and the user requirements have many limiting conditions and may need to be stated in multiple turns. On one hand, the user can continuously modify or improve the own requirements in the conversation process; on the other hand, when the user states a need that is not specific or unambiguous, the machine may also help the user find a satisfactory result by asking, clarifying or confirming. In order to realize multiple rounds of conversations, conversation processes can be defined in advance, namely multiple rounds of conversations are modeled into a word slot information collection process under a certain intention, however, for some complex multiple rounds of conversation scenes, the existing conversation processes lack a uniform and efficient context inheritance strategy.
Disclosure of Invention
In view of the above problems, the present application provides a session processing method, apparatus, electronic device and storage medium to improve the above problems.
In a first aspect, an embodiment of the present application provides a session processing method, where the method includes: acquiring a query statement in a session process; obtaining semantic feature data corresponding to the query statement, wherein the semantic feature data comprises a plurality of semantic units for representing semantic information of the query statement; constructing a query graph based on the semantic feature data, wherein the query graph comprises incidence relations among a plurality of semantic units; judging whether a preset knowledge map database has a query result matched with the query map or not; and if so, outputting the query result.
Further, before constructing the query graph based on the semantic feature data, the method further includes: judging whether historical conversation information corresponding to the semantic feature data exists or not, wherein the historical conversation information corresponds to a historical query graph constructed in a historical mode; if the historical conversation information corresponding to the semantic feature data does not exist, executing the query graph constructed based on the semantic feature data; and if the historical conversation information corresponding to the semantic feature data exists, acquiring the historical query graph corresponding to the semantic feature data.
Further, if there is historical session information corresponding to the semantic feature data, acquiring the historical query graph corresponding to the semantic feature data includes: if historical session information corresponding to the semantic feature data exists, judging whether the semantic feature data has information loss relative to the historical semantic feature data corresponding to the historical session information; if the information is missing, acquiring the historical query graph corresponding to the semantic feature data; and if no information is missing, executing the query graph constructed based on the semantic feature data.
Further, the determining whether the semantic feature data has information missing includes: acquiring a semantic structure of the semantic feature data; and judging whether the semantic structure has information loss or not based on a preset rule or a preset machine learning classification model.
Further, after the obtaining the historical query graph corresponding to the semantic feature data, the method further includes: adjusting the historical query graph based on the semantic feature data.
Further, the adjusting the historical query graph based on the semantic feature data includes: and adding, modifying or deleting semantic unit information corresponding to the query graph represented by the semantic feature data and the historical query graph.
Further, the acquiring semantic feature data corresponding to the query statement includes: identifying an entity of the query statement; acquiring the relation and the attribute corresponding to the entity; and taking the entity, the relation and the attribute as semantic feature data corresponding to the query statement.
Further, the semantic units include a first semantic unit, a second semantic unit, and a third semantic unit, where the first semantic unit is configured to characterize an entity of the query statement, the second semantic unit is configured to characterize a relationship between different entities, and the third semantic unit is configured to characterize an attribute of the entity, and the constructing a query graph based on the semantic feature data includes: acquiring a query node corresponding to the first semantic unit; acquiring edges determined based on the second semantic unit, the third semantic unit and the query node; and generating a query graph comprising the query nodes and the edges based on a preset graph ontology.
Further, the step of judging whether a query result matched with the query graph exists in the preset knowledge graph database comprises the following steps: searching whether a preset knowledge graph database comprises a sub-graph semantic structure represented by the query graph or not; if yes, judging that a query result matched with the query graph exists; and if not, judging that no query result matched with the query graph exists.
Further, the method further comprises: if not, judging whether the query statement needs to be clarified; if necessary, returning a clarification technique corresponding to the query statement, and executing the semantic feature data corresponding to the query statement; if not, return the query failure reply words.
In a second aspect, an embodiment of the present application provides a session processing apparatus, where the apparatus includes: the first acquisition module is used for acquiring the query statement; a second obtaining module, configured to obtain semantic feature data corresponding to the query statement, where the semantic feature data includes a plurality of semantic units representing semantic information of the query statement; the processing module is used for constructing a query graph based on the semantic feature data, and the query graph comprises incidence relations among a plurality of semantic units; the first judgment module is used for judging whether a preset knowledge map database has a query result matched with the query map or not; and the output module is used for outputting the query result if the query result exists.
Further, the apparatus further comprises: the second judging module is used for judging whether historical session information corresponding to the semantic feature data exists or not before the query graph is constructed based on the semantic feature data; if the historical conversation information corresponding to the semantic feature data does not exist, executing the query graph constructed based on the semantic feature data; and if the historical conversation information corresponding to the semantic feature data exists, acquiring a historical query graph corresponding to the semantic feature data.
Further, the second determining module includes: the judging unit is used for judging whether the semantic feature data has information loss relative to the historical semantic feature data corresponding to the historical session information if the historical session information corresponding to the semantic feature data exists; if information is missing, acquiring a historical query graph corresponding to the semantic feature data; and if no information is missing, executing the query graph constructed based on the semantic feature data.
Further, the determining whether the semantic feature data has information loss with respect to the historical semantic feature data corresponding to the historical session information includes: acquiring a semantic structure of the semantic feature data; and judging whether the semantic structure has information loss relative to historical semantic feature data corresponding to the historical session information based on a preset rule or a preset machine learning classification model.
Further, the apparatus may further include an adjusting unit, configured to, after the historical query graph corresponding to the semantic feature data is acquired, adjust the historical query graph based on the semantic feature data.
Further, the adjusting the historical query graph based on the semantic feature data includes: and adding, modifying or deleting semantic unit information corresponding to the query graph represented by the semantic feature data and the historical query graph.
Further, the second obtaining module may be specifically configured to identify an entity of the query statement; acquiring the relation and the attribute corresponding to the entity; and taking the entity, the relation and the attribute as semantic feature data corresponding to the query statement.
Furthermore, the semantic units include a first semantic unit, a second semantic unit and a third semantic unit, where the first semantic unit is used to represent the entities of the query statement, the second semantic unit is used to represent the relationships between different entities, and the third semantic unit is used to represent the attributes of the entities. The processing module may be specifically configured to acquire a query node corresponding to the first semantic unit; acquiring edges determined based on the second semantic unit, the third semantic unit and the query node; and generating a query graph comprising the query nodes and the edges based on a preset graph ontology.
Further, sub-graph semantic structures corresponding to different types of query graphs are stored in the preset knowledge graph database, and the first judgment module may be specifically configured to search whether the sub-graph semantic structure represented by the query graph is included in the preset knowledge graph database; if yes, judging that a query result matched with the query graph exists; and if not, judging that no query result matched with the query graph exists.
Further, the apparatus may further include a second determining unit, configured to determine whether the query statement needs to be clarified if there is no query result matching the query graph; if necessary, returning a clarification technique corresponding to the query statement, and executing the semantic feature data corresponding to the query statement; if not, return the query failure reply words.
In a third aspect, an embodiment of the present application provides an electronic device, including one or more processors and a memory; one or more programs stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of the first aspect described above.
In a fourth aspect, the present application provides a computer-readable storage medium, in which a program code is stored, where the program code executes the method of the first aspect.
The embodiment of the application provides a session processing method and device, electronic equipment and a storage medium, and relates to the technical field of human-computer interaction. The method comprises the steps of obtaining a query statement, then obtaining semantic feature data corresponding to the query statement, then constructing a query graph based on the semantic feature data, then judging whether a preset knowledge graph database has a query result matched with the query graph, and if so, outputting the query result. The method realizes that the query statement is abstracted into the structural query graph with semantic information by constructing the query graph based on the semantic feature data corresponding to the query statement, can realize effective transmission of the context semantic information of the query statement, and can avoid artificial design of a specific conversation process and an information collection strategy by judging whether a preset knowledge graph database has a query result matched with the query graph, thereby improving the question and answer efficiency and flexibility.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows a method flowchart of a session processing method according to an embodiment of the present application.
Fig. 2 is a diagram illustrating an example of a constructed query graph proposed in an embodiment of the present application.
Fig. 3 shows a flowchart of a session processing method according to another embodiment of the present application.
Fig. 4 shows a flowchart of a session processing method according to another embodiment of the present application.
Fig. 5 is a flowchart illustrating a method of a session processing method according to still another embodiment of the present application.
Fig. 6 is a flowchart illustrating a method of a session processing method according to still another embodiment of the present application.
Fig. 7 is a diagram illustrating another example of a constructed query graph proposed in the embodiment of the present application.
Fig. 8 is a flowchart illustrating a method of a session processing method according to still another embodiment of the present application.
Fig. 9 is a flowchart illustrating a method of a session processing method according to still another embodiment of the present application.
Fig. 10 is a flowchart illustrating a method of a session processing method according to still another embodiment of the present application.
Fig. 11 is a flowchart illustrating a method of a session processing method according to still another embodiment of the present application.
Fig. 12 is a block diagram showing a structure of a session processing apparatus according to an embodiment of the present application.
Fig. 13 is a block diagram illustrating a structure of an electronic device for executing a session processing method according to an embodiment of the present application.
Fig. 14 is a storage unit for storing or carrying program codes for implementing a session processing method according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
With the breakthrough progress of speech recognition through the adoption of technologies such as machine deep learning, a man-machine interaction mode based on natural language interaction is more and more widely adopted. Compared with the traditional software-based interface, the natural language interaction is more flexible and more random through the interaction mode of a mouse, a keyboard and a touch screen, and the intention of a user is understood by computer equipment through natural language, and multiple rounds of conversation are needed to collect input parameters, so that the intention of the user is continuously determined, and the corresponding response is made, and the specific service function is executed.
As one way, a conversation process, i.e., a process of modeling multiple rounds of conversations as word slot information collection under a certain intention, may be defined in advance. However, in some simple scenarios with clear session flow, the method can achieve better effect, but in some more complex scenarios (such as multiple rounds of question and answer tasks of professional domain knowledge), the method lacks a uniform and efficient context inheritance policy.
Therefore, the inventor proposes a session processing method, apparatus, electronic device, and storage medium in the present application for improving the above-mentioned problems.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
First embodiment
Referring to fig. 1, an embodiment of the present application provides a session processing method, which is applicable to an electronic device, and the method includes:
step S110: and acquiring the query statement in the session process.
The session process in this embodiment may be various types of online consultation scenarios, for example, a scenario of ordering a meal, booking a ticket, or shopping consultation. Alternatively, the query statement may include statements of various mood types of the user in expressing the query intent, for example, the query statement may be a statement sentence, an interrogative sentence, and/or an anti-interrogative sentence, etc.
In one way, the statement entered by the user in the conversation state can be used as a query statement in the conversation process. For example, if the user enters "what is now available for the piece of clothing" in the customer service session window interface of a certain e-commerce shopping platform, the entry statement can be used as a query statement in the session process.
As another mode, the voice information recorded by the user in the session process may be acquired, and the query statement in the session process may be acquired after the recorded voice information is decoded. Optionally, one or more query statements may be included in the same session. Optionally, if there are multiple query statements, the query statements may be multiple query statements of the same user or different users. For example, a user continuously inputs a plurality of query sentences in the process of consulting customer service; or a plurality of users input at least one query statement to form a plurality of query statements respectively in the process of consulting customer service at the same time.
Step S120: and acquiring semantic feature data corresponding to the query statement.
The semantic feature data may include a plurality of semantic units that characterize semantic information of the query statement. The semantic unit in this embodiment may include an entity, a relationship, and an attribute corresponding to the query statement, as one way. Optionally, the entity is an abstraction of the objective individual, and may include a noun entity of the query statement, for example, how much is the query statement "wolvo S90? The entity in "is" Volvo S90 ". Relationships are abstractions of relationships between entities and entities, e.g., "Volvo S90" and "Volvo brand" are two entities between which an affiliated brand relationship exists. An attribute is an abstraction of the literal relationship between an entity and a query statement, e.g., oil consumption is 7.1L/100km for the query statement "Walvor S90," which is an intrinsic attribute of Walvor S90.
In one mode, after the query statement in the session process is obtained, semantic feature data corresponding to the query statement can be obtained, so that the intention of the user can be identified through the semantic feature data, and the accuracy of response is improved. Optionally, the semantic feature data corresponding to different query statements may be different.
As one way, semantic feature data corresponding to a query sentence may be acquired by identifying the query sentence. For example, for an entity in the semantic feature data, a keyword dictionary of the entity may be established according to a pre-established knowledge graph, where different professional fields may correspond to different knowledge graphs, and the knowledge graph includes a graph ontology, and the graph ontology is used to infer a relationship between the entity and the entity of the query statement and a relationship between the attribute and the query statement. Then, the obtained query sentence may be matched with the keyword dictionary, thereby obtaining an entity included in the query sentence. Optionally, a method based on a sequence labeling model (e.g., a hidden markov chain, a conditional random field, or the like) may be used to perform entity detection on the obtained query statement, and then an entity included in the query statement is obtained through entity linking.
For the relation and the attribute in the semantic feature data, the attribute of the query statement can be obtained by matching the query statement with a pre-constructed attribute keyword dictionary, and further the relation between the entity and the attribute and the query statement is obtained. Optionally, the relationship between the entities of the query statement may be obtained through a relationship between the entities in a pre-constructed knowledge graph. For example, for the query statement "wolwo's car recommends several money", the relationship of the entity "car" and the entity "wolwo" can be inferred as the relationship of the belonged brands through the pre-constructed atlas ontology, i.e., "wolwo" is the belonged brand of "car".
As an embodiment, entities in the professional field (for example, vehicle types in the automobile field can comprise Volvo S90 and XC 40; an engine can comprise a turbine and a power device) can be identified by identifying entities (such as a person name, a place name, a mechanism name, a numerical value, a date and the like) of a query statement; the dealer may include: 4S store, vendor, etc.), and the semantic feature data corresponding to the query sentence is obtained in a manner of identifying the relationship and attribute of the query sentence (e.g., the relationship between the vehicle type and the belonging vehicle series of the vehicle series in the field of automobiles, the competitive product relationship between the vehicle types, the fuel consumption attribute of the automobiles, the compression ratio attribute of the engines, etc.).
Step S130: and constructing a query graph based on the semantic feature data.
The query graph in this embodiment may include an association relationship between multiple semantic units.
As one way, a query graph corresponding to a query statement may be constructed through entities, relationships and attributes identified from the query statement, so that a corresponding query result may be quickly and accurately obtained in a manner of matching the query graph with a semantic web pre-constructed in a knowledge graph database.
Alternatively, a query graph corresponding to the query statement may be constructed only by the entities and attributes identified from the query statement. In this way, a complete query graph can be constructed according to the literal quantity corresponding to the attributes.
For example, in one specific application scenario, please refer to fig. 2, which is an exemplary diagram of a query graph constructed based on semantic feature data. Where the query statement is "what is the price of wolvo S90? ", the identified semantic feature data corresponding to the query statement includes: entity (wolvo S90), attribute (price). Among them, "? The amount "represents the literal amount corresponding to the attribute, and is the query graph corresponding to the query statement constructed as shown in fig. 2.
By constructing the structured query graph with the semantic information of the query statement in real time, the artificial design of a specific conversation process and an information collection strategy can be avoided, and the context semantic information of the query statement can be effectively transmitted, so that the question-answering efficiency and the flexibility of session processing are improved.
Step S140: and if the preset knowledge map database has a query result matched with the query map, outputting the query result.
As one way, the constructed query graph may be matched with a pre-constructed knowledge graph database, and if a query result matching the query graph exists in the pre-constructed knowledge graph database, the query result may be output. Optionally, the manner of outputting the query result and the content form of the query result may not be limited, for example, text output, voice output, video output, picture output, and the like may be used.
Optionally, if the preset knowledge map database does not have a query result matched with the query graph, the session may be ended or the user may be prompted to re-enter the query statement, so as to improve the accuracy of the query.
In the embodiment, the query statement is acquired, then, the semantic feature data corresponding to the query statement is acquired, then, the query graph is constructed based on the semantic feature data, then, whether the query result matched with the query graph exists in the preset knowledge graph database is judged, and if the query result exists, the query result is output. The method realizes that the query statement is abstracted into the structural query graph with semantic information by constructing the query graph based on the semantic feature data corresponding to the query statement, can realize effective transmission of the context semantic information of the query statement, and can avoid artificial design of a specific conversation process and an information collection strategy by judging whether a preset knowledge graph database has a query result matched with the query graph, thereby improving the question and answer efficiency and flexibility.
Second embodiment
Referring to fig. 3, another embodiment of the present application provides a session processing method, which can be applied to an electronic device, and the method includes:
step S210: and acquiring the query statement in the session process.
Step S220: and acquiring semantic feature data corresponding to the query statement.
Step S230: and judging whether historical session information corresponding to the semantic feature data exists or not.
The historical conversation information corresponds to a historical query graph constructed by history. Optionally, the historical session information may include previous session information during the current round of the session, and previous historical session information during multiple rounds of the session.
As a way, in order to speed up the conversation processing efficiency or avoid repeated processing (for example, the interval time for some users to input query sentences in the query process may be long, or repeated queries are performed by omitting the subject of the query sentences), it may be determined whether there is historical conversation information corresponding to the semantic feature data when the semantic feature data corresponding to the query sentences is acquired, so that in a way that there is historical conversation information corresponding to the semantic feature data, the current conversation may be processed by using the question-and-answer policy corresponding to the historical conversation information, thereby improving the efficiency.
As an embodiment, the entity or attribute included in the semantic feature data may be compared with the entity or attribute corresponding to the historical query statement, or the keyword of the query statement may be compared with the keyword of the query statement corresponding to the historical session information, and if the comparison result is consistent, it may be determined that the historical session information corresponding to the semantic feature data exists.
Step S240: and acquiring the historical query graph corresponding to the semantic feature data.
As a mode, if there is historical session information corresponding to the semantic feature data, a historical query graph corresponding to the current semantic feature data may be obtained, so that a quick query may be performed based on the historical query graph, and the session efficiency is improved.
Step S250: and constructing a query graph based on the semantic feature data.
Alternatively, if there is no historical session information corresponding to the semantic feature data, the query graph may be reconstructed based on the current semantic feature data. For the construction principle and the construction process of the query graph, reference may be made to the description in the foregoing embodiments, and details are not repeated here.
Step S260: and judging whether a preset knowledge map database has a query result matched with the query map.
As one way, the semantic information corresponding to the query graph may be matched with the semantic information in the knowledge graph database, for example, the keyword of the semantic information corresponding to the query graph may be matched with the corresponding keyword of the semantic information in the knowledge graph database, and if there is a keyword matched with the keyword of the semantic information corresponding to the query graph, it is determined that there is a query result matched with the query graph in the preset knowledge graph database. By judging whether the preset knowledge map database has the query result matched with the query map or not, the accuracy of the session processing result can be improved.
Step S270: and outputting the query result.
By one approach, if there are query results in the knowledge-graph database that match the query graph, then the query results may be output.
Step S280: the session is ended.
As one approach, the session may be ended if there are no query results in the knowledge-graph database that match the query graph.
In the embodiment, under the condition that it is determined that there is no historical session information corresponding to the semantic feature data, the query graph is constructed based on the semantic feature data corresponding to the query statement, so that the query statement is abstracted into a structured query graph with semantic information, and the context semantic information of the query statement can be effectively transferred. Under the condition that the historical conversation information corresponding to the semantic feature data is judged to exist, the historical query graph corresponding to the current semantic feature data is obtained, so that quick query can be conducted based on the historical query graph, and conversation efficiency is improved. By judging whether the preset knowledge map database has the query result matched with the query map or not, the artificial design of a specific conversation process and an information collection strategy can be avoided, and therefore the question answering efficiency and flexibility are improved.
Third embodiment
Referring to fig. 4, another embodiment of the present application provides a session processing method, which can be applied to an electronic device, and the method includes:
step S310: and acquiring the query statement in the session process.
Step S320: and acquiring semantic feature data corresponding to the query statement.
Step S330: and judging whether historical session information corresponding to the semantic feature data exists or not.
Step S340: and judging whether the semantic feature data has information loss relative to the historical semantic feature data corresponding to the historical session information.
It can be understood that although there is historical conversation information, the user may only inquire the content similar to but not identical to the historical conversation information in the inquiry process, and in this way, if the historical conversation information is still used for the conversation answering process, an identification or answering error may be brought, and an unintelligent inquiry and answering experience is brought to the user.
As a way to improve the above problem, if there is history session information corresponding to semantic feature data, it is possible to continuously determine whether there is information loss in the semantic feature data with respect to the history semantic feature data corresponding to the history session information. Optionally, if there is information missing, it may be determined that the current session is a session associated with the historical session information, that is, the current session and the historical session are multiple sessions; if no information is missing, the current session can be determined to be a new session.
The information missing may include entity missing, attribute missing of the query statement, and the like. For example, if the historical query statement is "what is the price of wolvo S90? "is the current query statement" oil consumption? ", the current query statement lacks an entity, it can be determined that the current query statement and the historical query statement are associated sessions.
Step S341: and acquiring the historical query graph corresponding to the semantic feature data.
As a mode, if there is information missing, a historical query graph corresponding to the semantic feature data may be obtained, so that a quick query may be performed based on the historical query graph, and the session efficiency is improved.
Step S350: and constructing a query graph based on the semantic feature data.
Alternatively, if there is no information missing, the query graph may be reconstructed based on the current semantic feature data.
Step S351: and judging whether a preset knowledge map database has a query result matched with the query map.
Step S3511: and outputting the query result.
Optionally, if a query result matched with the query graph exists in the preset knowledge graph database, the query result may be output.
Step S3512: the session is ended.
Optionally, if the preset knowledge graph database does not have a query result matched with the query graph, the current session may be ended.
In the embodiment, under the condition that the historical session information corresponding to the semantic feature data is judged to exist, whether the semantic feature data has information loss relative to the historical semantic feature data corresponding to the historical session information is further judged, if the information loss does not exist, the query graph is constructed based on the semantic feature data corresponding to the query statement, and the accuracy and the reliability of the query result can be improved.
Fourth embodiment
Referring to fig. 5, another embodiment of the present application provides a session processing method, which can be applied to an electronic device, and the method includes:
step S410: and acquiring the query statement in the session process.
Step S420: and acquiring semantic feature data corresponding to the query statement.
Step S430: and judging whether historical session information corresponding to the semantic feature data exists or not.
Step S440: and acquiring a semantic structure of the semantic feature data.
Optionally, when it is determined that there is historical session information corresponding to the semantic feature data, it may be further determined whether there is information loss in the semantic feature data with respect to the historical semantic feature data corresponding to the historical session information. Optionally, a semantic structure of the semantic feature data may be obtained, so as to determine whether there is information loss in the semantic feature data relative to historical semantic feature data corresponding to historical session information through the semantic structure.
Alternatively, the semantic structure of the semantic feature data may be obtained by identifying the subject, predicate, and object of the query statement. That is, it is possible to identify whether the query sentence includes a subject predicate and whether the object determines whether the semantic structure of the query sentence is complete.
Step S450: and judging whether the semantic structure has information loss relative to historical semantic feature data corresponding to the historical session information based on a preset rule or a preset machine learning classification model.
As one way, whether the semantic structure of the current query statement has information missing relative to the historical semantic feature data corresponding to the historical session information may be determined based on a preset rule or a preset machine learning classification model. The preset rules may be that the subject of the current query statement is consistent with that of the historical query statement, and the preset machine learning classification model may include a logistic regression model, a decision tree and an integrated model thereof, a support vector machine, and the like. Optionally, whether the semantic feature data of the query statement has information missing relative to the historical semantic feature data may be determined by comparing the semantic structure of the query statement with the semantic structure of the historical session information.
Step S451: and acquiring the historical query graph corresponding to the semantic feature data.
As one mode, if it is determined that there is information missing in the semantic structure of the current query statement with respect to the historical semantic feature data corresponding to the historical session information, the historical query graph corresponding to the semantic feature data may be acquired.
Step S460: and constructing a query graph based on the semantic feature data.
As a mode, if there is no history session information corresponding to the semantic feature data, it may be determined that the current session is a new session, and in this mode, a query graph may be constructed based on the semantic feature data.
It should be noted that if it is determined that the semantic structure of the current query statement does not have information missing with respect to the historical semantic feature data corresponding to the historical session information, it may be determined that the current session is a new session, and thus a query graph may be constructed based on the semantic feature data.
Through double judgment, the session processing process is faster and more accurate, and the user experience is improved.
Step S470: and judging whether a preset knowledge map database has a query result matched with the query map.
Step S471: and outputting the query result.
As one way, if there is a query result matching the query graph in the preset knowledge graph database, the query result may be output.
Step S472: the session is ended.
Alternatively, if there is no query result matching the query graph in the preset knowledge graph database, the session may be ended.
The embodiment judges whether the current session is a new session by judging whether the semantic structure has information loss, judges the current session to be the new session under the condition of information loss, and constructs a query graph based on semantic feature data corresponding to query sentences, so that the query sentences are abstracted into a structural query graph with semantic information, the context semantic information of the query sentences can be effectively transmitted, and the specific conversation process and the information collection strategy can be prevented from being artificially designed by judging whether a preset knowledge graph database has query results matched with the query graph, thereby improving the question-answering efficiency and the flexibility.
Fifth embodiment
Referring to fig. 6, another embodiment of the present application provides a session processing method, which can be applied to an electronic device, and the method includes:
step S510: and acquiring the query statement in the session process.
Step S520: and acquiring semantic feature data corresponding to the query statement.
Step S530: and judging whether historical session information corresponding to the semantic feature data exists or not.
Step S540: and judging whether the semantic feature data has information loss relative to the historical semantic feature data corresponding to the historical session information.
As a mode, if there is historical session information corresponding to the semantic feature data of the current query statement, it may be determined whether there is information loss in the semantic feature data with respect to the historical semantic feature data corresponding to the historical session information, so that it may be accurately determined whether the current session is a new session according to the determination result.
It should be noted that, if there is no historical session information corresponding to the semantic feature data of the current query statement, it may be determined that the current query statement is a new session content, and optionally, the following step S550 may be performed.
Step S541: and acquiring the historical query graph corresponding to the semantic feature data.
Optionally, if there is information missing, a historical query graph corresponding to the semantic feature data may be obtained.
Step S542: adjusting the historical query graph based on the semantic feature data.
Optionally, since the historical query graph already contains all the information of the previous session, and the query content of the user may change during the session, reasonable inheritance needs to be performed on the information in the historical query graph. As a way, the historical query graph may be adjusted based on the semantic feature data of the current query statement, and specifically, the semantic unit information corresponding to the query graph represented by the semantic feature data and the historical query graph may be added, modified, or deleted, so that the accuracy of the query result may be improved.
For example, in a specific application scenario, as shown in fig. 2 and fig. 7, fig. 2 is the first round of query statement "how much is the price of walvo S90? "corresponding query graph, fig. 7 is the query sentence" oil consumption "of the current wheel? "corresponding query graph, wherein the query statement" oil consumption? "is a query sentence for the user to follow up on the basis of the query sentence corresponding to fig. 7, and in this manner, the current query sentence" fuel consumption? "multiple rounds of sessions can be entered, and optionally, the historical query graph (fig. 2) can be adjusted by deleting the attribute (i.e., price) in the query graph (fig. 2) in the first round of sessions and increasing the attribute (i.e., oil consumption) in the current round, so as to obtain the query graph (as shown in fig. 7) of the current query statement.
Step S543: and judging whether a preset knowledge map database has a query result matched with the historical query map.
As a mode, it may be determined whether a preset knowledge graph database has a query result matching the adjusted historical query graph, and optionally, the specific determination mode and the determination process may refer to the description in the foregoing embodiment, which is not described herein again.
Step S550: and constructing a query graph based on the semantic feature data.
Optionally, if there is no historical session information corresponding to the semantic feature data of the current query statement, a query graph may be constructed based on the semantic feature data.
Step S551: and judging whether a preset knowledge map database has a query result matched with the query map.
Step S5511: and outputting the query result.
Optionally, if there is a query result matching the adjusted historical query graph, the query result may be output.
Optionally, if there is a query result matching the query graph, the query result may be output.
Step S5512: the session is ended.
Optionally, if there is no query result matching the adjusted historical query graph, the current session may be ended.
Optionally, if there is no query result matching the query graph, the current session may be ended.
According to the method and the device, the historical query graph is adjusted based on the semantic feature data, so that the accuracy of the constructed query graph is improved. By judging whether the preset knowledge map database has the query result matched with the query map or not, the artificial design of a specific conversation process and an information collection strategy can be avoided, and therefore the question answering efficiency and flexibility are improved.
Sixth embodiment
Referring to fig. 8, another embodiment of the present application provides a session processing method, which is applicable to an electronic device, and the method includes:
step S610: and acquiring the query statement in the session process.
Step S620: an entity of the query statement is identified.
Alternatively, the same query statement may include one or more entities. As one way, the entity of the query statement may be obtained by performing natural language parsing on the query statement and identifying the keyword and key information of the query statement. For example, for the query statement "can this coupon be used superimposed also when paying for clothes? "the keyword of the query sentence, which is identified by natural language, includes a coupon, clothing, and in the context of the query sentence, clothing is to be purchased, so the keyword" clothing "can be determined as an entity of the query sentence.
Step S630: and acquiring the relation and the attribute corresponding to the entity.
Optionally, after the entity of the query statement is identified, the relationship and the attribute corresponding to the entity may be obtained according to a predefined keyword dictionary, and the specific obtaining manner may refer to the description in the foregoing embodiment, which is not described herein again.
Step S640: and taking the entity, the relation and the attribute as semantic feature data corresponding to the query statement.
As one way, the entities, the relationships, and the attributes may be used as semantic feature data corresponding to the query statement, and optionally, the entities, the relationships, and the attributes may be stored in a form of a triple as the semantic feature data corresponding to the query statement. The triples may be represented as a set of shapes (x, y, z), where optionally x may correspond to a subject of the query statement, y may correspond to a predicate of the query statement, z may correspond to an object of the query statement, and a triplet represents a piece of knowledge of the knowledge-graph.
Step S650: and constructing a query graph based on the semantic feature data.
Step S660: and if the preset knowledge map database has a query result matched with the query map, outputting the query result.
In the embodiment, the entity, the relation and the attribute corresponding to the identified query statement are used as the semantic feature data corresponding to the query statement, and then the query graph is constructed based on the semantic feature data, so that the query statement is abstracted into the structural query graph with the semantic information, the context semantic information of the query statement can be effectively transmitted, and the specific dialogue process and the information collection strategy can be prevented from being artificially designed by judging whether the preset knowledge graph database has the query result matched with the query graph, so that the question and answer efficiency and the flexibility are improved.
Seventh embodiment
Referring to fig. 9, another embodiment of the present application provides a session processing method, which is applicable to an electronic device, and the method includes:
step S710: and acquiring the query statement in the session process.
Step S720: and acquiring semantic feature data corresponding to the query statement.
The semantic feature data may include a plurality of semantic units that characterize semantic information of the query statement.
Optionally, the semantic units in this embodiment may include a first semantic unit, a second semantic unit, and a third semantic unit. The first semantic unit can be used for representing entities of the query statement, the second semantic unit can be used for representing relations among different entities, and the third semantic unit can be used for representing incidence relations between the entities and the query statement.
Step S730: and acquiring a query node corresponding to the first semantic unit.
As one way, during the process of constructing the query graph, the query node corresponding to the first semantic unit can be obtained. It will be appreciated that the content of query nodes corresponding to different first semantic units may be different. Alternatively, a node containing the content of the first semantic unit may be taken as a node corresponding to the first semantic unit. For example, 3a as shown in FIG. 7 is a query node corresponding to the first semantic unit.
Step S740: and acquiring edges determined based on the second semantic unit, the third semantic unit and the query node.
As an embodiment, as shown in FIG. 7, a query graph as shown in FIG. 7 may be constructed using the third semantic unit (i.e., attribute) as a weight of the edge between the query node and the query node. The query node 3a serves as a query starting node, the query node 3a points to the query node 3b to represent the fuel consumption of the car needing to be queried in Volvo S90, and the second semantic unit here represents that the Volvo S90 and the car family are in a dependency relationship.
Step S750: and generating a query graph comprising the query nodes and the edges based on a preset graph ontology.
Optionally, a graph ontology as shown in fig. 7 may be pre-constructed, and after the entities, attributes, and relationships of the query statement are obtained, a query graph including query nodes and edges may be generated in a word slot filling manner.
Step S760: and if the preset knowledge map database has a query result matched with the query map, outputting the query result.
In the embodiment, by constructing the query graph based on the semantic feature data corresponding to the query statement, the query statement is abstracted into the structured query graph with semantic information, so that the context semantic information of the query statement can be effectively transmitted, and by judging whether the preset knowledge graph database has the query result matched with the query graph, the artificial design of a specific conversation process and an information collection strategy can be avoided, so that the question and answer efficiency and the flexibility are improved.
Eighth embodiment
Referring to fig. 10, another embodiment of the present application provides a session processing method, which is applicable to an electronic device, and the method includes:
step S810: and acquiring the query statement in the session process.
Step S820: and acquiring semantic feature data corresponding to the query statement.
Step S830: and acquiring a query node corresponding to the first semantic unit.
Step S840: and acquiring edges determined based on the second semantic unit, the third semantic unit and the query node.
Step S850: and generating a query graph comprising the query nodes and the edges based on a preset graph ontology.
Step S860: and searching whether a preset knowledge graph database comprises a sub-graph semantic structure represented by the query graph.
In the embodiment of the present application, a preset knowledge graph database stores sub-graph semantic structures corresponding to different types of query graphs. As one way, whether a query result matched with the query graph exists in the preset knowledge graph database may be determined by searching whether the preset knowledge graph database includes a sub-graph semantic structure represented by the query graph.
Step S871: determining that there is a query result that matches the query graph.
Optionally, if the preset knowledge map database includes a sub-graph semantic structure represented by the query graph, it may be determined that a query result matching the query graph exists in the preset knowledge map database.
Step S872: and outputting the query result.
Step S881: and judging that no query result matched with the query graph exists.
Optionally, if the preset knowledge map database does not include the sub-graph semantic structure represented by the query graph, it may be determined that a query result matching the query graph does not exist in the preset knowledge map database.
Step S882: the session is ended.
In the embodiment, by constructing the query graph based on the semantic feature data corresponding to the query statement, the query statement is abstracted into the structured query graph with semantic information, so that the context semantic information of the query statement can be effectively transmitted, and by judging whether the preset knowledge graph database has the query result matched with the query graph, the artificial design of a specific conversation process and an information collection strategy can be avoided, so that the question and answer efficiency and the flexibility are improved.
Ninth embodiment
Referring to fig. 11, another embodiment of the present application provides a session processing method, which is applicable to an electronic device, and the method includes:
step S910: and acquiring the query statement in the session process.
Step S920: and acquiring semantic feature data corresponding to the query statement.
Step S930: and judging whether historical session information corresponding to the semantic feature data exists or not.
Step S940: and acquiring the historical query graph corresponding to the semantic feature data.
As one mode, if there is history session information corresponding to semantic feature data, a history query graph corresponding to the semantic feature data may be acquired.
Step S950: and constructing a query graph based on the semantic feature data.
There is no historical session information corresponding to the semantic feature data, and a query graph may be constructed based on the semantic feature data.
Step S960: and judging whether a preset knowledge map database has a query result matched with the query map.
Step S971: and outputting the query result.
Optionally, if a query result matched with the query graph exists in the preset knowledge graph database, the query result may be output.
Step S972: and judging whether the query statement needs to be clarified.
Optionally, if the preset knowledge graph database does not have a query result matching the query graph, it may be determined whether the current query statement needs to be clarified, so that the session flow may be flexibly controlled according to the determination result.
Step S9721: and returning the clarification word corresponding to the query statement.
As a way, if the current query statement needs to be clarified, a clarification technique corresponding to the query statement may be returned, and semantic feature data corresponding to the query statement is obtained (step S920, optionally, a loop process may be performed at this time, that is, the semantic feature data corresponding to the query statement is obtained again and a subsequent operation process is performed under the condition that clarification is needed), so that continuous and effective multi-round response may be achieved.
Step S9722: and returning a query failure reply technique.
Alternatively, if the current query statement does not need to be clarified, a query failure reply dialog may be returned, and optionally, after the query failure dialog is returned, if the user does not respond for a long time (for example, for one minute, the specific time duration may be set according to the actual situation), the session may be ended.
In the embodiment, by constructing the query graph based on the semantic feature data corresponding to the query statement, the query statement is abstracted into the structured query graph with semantic information, so that the context semantic information of the query statement can be effectively transmitted, and by judging whether the preset knowledge graph database has the query result matched with the query graph, the artificial design of a specific conversation process and an information collection strategy can be avoided, so that the question and answer efficiency and the flexibility are improved. By judging whether the query statement needs to be clarified or not, the conversation process can be flexibly controlled according to the judgment result, and continuous and effective multi-round response can be realized.
Tenth embodiment
Referring to fig. 12, an embodiment of the present application provides a session processing apparatus 1000, operating on an electronic device, where the apparatus 1000 includes:
a first obtaining module 1010, configured to obtain the query statement.
A second obtaining module 1020, configured to obtain semantic feature data corresponding to the query statement, where the semantic feature data includes a plurality of semantic units representing semantic information of the query statement.
Optionally, the semantic units include a first semantic unit, a second semantic unit, and a third semantic unit, where the first semantic unit is used to represent the entities of the query statement, the second semantic unit is used to represent the relationships between different entities, and the third semantic unit is used to represent the attributes of the entities.
As a mode, the second obtaining module 1020 may be specifically configured to identify an entity of the query statement; acquiring the relation and the attribute corresponding to the entity; and taking the entity, the relation and the attribute as semantic feature data corresponding to the query statement.
And a processing module 1030, configured to construct a query graph based on the semantic feature data, where the query graph includes an association relationship between a plurality of semantic units.
As one mode, the processing module 1030 may be specifically configured to obtain a query node corresponding to the first semantic unit; acquiring edges determined based on the second semantic unit, the third semantic unit and the query node; and generating a query graph comprising the query nodes and the edges based on a preset graph ontology.
Optionally, the apparatus 1000 may further include: the second judging module is used for judging whether historical session information corresponding to the semantic feature data exists or not before the query graph is constructed based on the semantic feature data; if the historical conversation information corresponding to the semantic feature data does not exist, executing the query graph constructed based on the semantic feature data; and if the historical conversation information corresponding to the semantic feature data exists, acquiring a historical query graph corresponding to the semantic feature data.
Wherein the second determining module may include: the judging unit is used for judging whether the semantic feature data has information loss relative to the historical semantic feature data corresponding to the historical session information if the historical session information corresponding to the semantic feature data exists; if information is missing, acquiring a historical query graph corresponding to the semantic feature data; and if no information is missing, executing the query graph constructed based on the semantic feature data.
As one mode, the determining whether the semantic feature data has information loss with respect to the historical semantic feature data corresponding to the historical session information includes: acquiring a semantic structure of the semantic feature data; and judging whether the semantic structure has information loss relative to historical semantic feature data corresponding to the historical session information based on a preset rule or a preset machine learning classification model.
Optionally, the apparatus 1000 may further include: the adjusting unit is used for adjusting the historical query graph based on the semantic feature data after the historical query graph corresponding to the semantic feature data is obtained.
Optionally, adjusting the historical query graph based on the semantic feature data may include: and adding, modifying or deleting semantic unit information corresponding to the query graph represented by the semantic feature data and the historical query graph.
The first judging module 1040 is configured to judge whether a preset knowledge graph database has a query result matching the query graph.
Optionally, sub-graph semantic structures corresponding to different types of query graphs are stored in the preset knowledge graph database.
The first determining module 1040 is specifically configured to search whether a preset knowledge graph database includes a sub-graph semantic structure represented by the query graph; if yes, judging that a query result matched with the query graph exists; and if not, judging that no query result matched with the query graph exists.
And an output module 1050, configured to output the query result if the query result exists.
Optionally, the apparatus 1000 may further include a second determining unit, configured to determine whether to clarify the query statement if there is no query result matching the query graph; if necessary, returning a clarification technique corresponding to the query statement, and executing the semantic feature data corresponding to the query statement; if not, return the query failure reply words.
According to the conversation processing device, the query statement is obtained, then the semantic feature data corresponding to the query statement is obtained, the query graph is constructed based on the semantic feature data, then whether the query result matched with the query graph exists in the preset knowledge graph database or not is judged, and if the query result exists, the query result is output. The method realizes that the query statement is abstracted into the structural query graph with semantic information by constructing the query graph based on the semantic feature data corresponding to the query statement, can realize effective transmission of the context semantic information of the query statement, and can avoid artificial design of a specific conversation process and an information collection strategy by judging whether a preset knowledge graph database has a query result matched with the query graph, thereby improving the question and answer efficiency and flexibility.
It should be noted that the device embodiment and the method embodiment in the present application correspond to each other, and specific principles in the device embodiment may refer to the contents in the method embodiment, which is not described herein again.
An electronic device provided by the present application will be described below with reference to fig. 13.
Referring to fig. 13, based on the session processing method and apparatus, another electronic device 100 capable of executing the session processing method is further provided in the embodiment of the present application. The electronic device 100 includes one or more processors 102 (only one shown) and a memory 104 coupled to each other. The memory 104 stores therein a program that can execute the content in the foregoing embodiments, and the processor 102 can execute the program stored in the memory 104, where the memory 104 includes the apparatus 1000 described in the foregoing embodiments.
Processor 102 may include one or more processing cores, among other things. The processor 102 interfaces with various components throughout the electronic device 100 using various interfaces and circuitry to perform various functions of the electronic device 100 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 104 and invoking data stored in the memory 104. Alternatively, the processor 102 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 102 may integrate one or more of a Central Processing Unit (CPU), a video Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 102, but may be implemented by a communication chip.
The Memory 104 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 104 may be used to store instructions, programs, code sets, or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, a video image playing function, etc.), instructions for implementing the various method embodiments described above, and the like. The data storage area may also store data created by the electronic device 100 during use (e.g., phone book, audio-video data, chat log data), and the like.
Referring to fig. 14, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 1100 has stored therein program code that can be called by a processor to perform the method described in the above-described method embodiments.
The computer-readable storage medium 1100 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 1100 includes a non-volatile computer-readable storage medium. The computer readable storage medium 1100 has storage space for program code 1110 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 1110 may be compressed, for example, in a suitable form.
According to the conversation processing method, the conversation processing device, the electronic equipment and the storage medium, the query statement is obtained, then the semantic feature data corresponding to the query statement is obtained, the query graph is constructed based on the semantic feature data, then whether the query result matched with the query graph exists in the preset knowledge graph database or not is judged, and if the query result exists, the query result is output. The method realizes that the query statement is abstracted into the structural query graph with semantic information by constructing the query graph based on the semantic feature data corresponding to the query statement, can realize effective transmission of the context semantic information of the query statement, and can avoid artificial design of a specific conversation process and an information collection strategy by judging whether a preset knowledge graph database has a query result matched with the query graph, thereby improving the question and answer efficiency and flexibility.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (15)

1. A method for session processing, the method comprising:
acquiring a query statement in a session process;
obtaining semantic feature data corresponding to the query statement, wherein the semantic feature data comprises a plurality of semantic units for representing semantic information of the query statement;
constructing a query graph based on the semantic feature data, wherein the query graph comprises incidence relations among a plurality of semantic units;
judging whether a preset knowledge map database has a query result matched with the query map or not;
and if so, outputting the query result.
2. The method of claim 1, wherein prior to constructing a query graph based on the semantic feature data, further comprising:
judging whether historical conversation information corresponding to the semantic feature data exists or not, wherein the historical conversation information corresponds to a historical query graph constructed in a historical mode;
if the historical conversation information corresponding to the semantic feature data does not exist, executing the query graph constructed based on the semantic feature data;
and if the historical conversation information corresponding to the semantic feature data exists, acquiring the historical query graph corresponding to the semantic feature data.
3. The method according to claim 2, wherein the obtaining the historical query graph corresponding to the semantic feature data if there is historical session information corresponding to the semantic feature data comprises:
if historical session information corresponding to the semantic feature data exists, judging whether the semantic feature data has information loss relative to the historical semantic feature data corresponding to the historical session information;
if the information is missing, acquiring the historical query graph corresponding to the semantic feature data;
and if no information is missing, executing the query graph constructed based on the semantic feature data.
4. The method according to claim 3, wherein the determining whether the semantic feature data has information missing with respect to the historical semantic feature data corresponding to the historical session information comprises:
acquiring a semantic structure of the semantic feature data;
and judging whether the semantic structure has information loss relative to historical semantic feature data corresponding to the historical session information based on a preset rule or a preset machine learning classification model.
5. The method according to any one of claims 2-4, wherein after the obtaining the historical query graph corresponding to the semantic feature data, further comprising:
adjusting the historical query graph based on the semantic feature data.
6. The method of claim 5, wherein the adjusting the historical query graph based on the semantic feature data comprises:
and adding, modifying or deleting semantic unit information corresponding to the query graph represented by the semantic feature data and the historical query graph.
7. The method of claim 1, wherein obtaining semantic feature data corresponding to the query statement comprises:
identifying an entity of the query statement;
acquiring the relation and the attribute corresponding to the entity;
and taking the entity, the relation and the attribute as semantic feature data corresponding to the query statement.
8. The method of claim 1, wherein the semantic units comprise a first semantic unit, a second semantic unit and a third semantic unit, the first semantic unit is used for representing entities of the query statement, the second semantic unit is used for representing relations between different entities, the third semantic unit is used for representing attributes of the entities, and the building of the query graph based on the semantic feature data comprises:
acquiring a query node corresponding to the first semantic unit;
acquiring edges determined based on the second semantic unit, the third semantic unit and the query node;
and generating a query graph comprising the query nodes and the edges based on a preset graph ontology.
9. The method according to claim 8, wherein the predetermined knowledge graph database stores sub-graph semantic structures corresponding to different types of query graphs, and the determining whether there is a query result matching the query graph in the predetermined knowledge graph database comprises:
searching whether a preset knowledge graph database comprises a sub-graph semantic structure represented by the query graph or not;
if yes, judging that a query result matched with the query graph exists;
and if not, judging that no query result matched with the query graph exists.
10. The method of claim 1, further comprising:
if not, judging whether the query statement needs to be clarified;
if necessary, returning a clarification technique corresponding to the query statement, and executing the semantic feature data corresponding to the query statement;
if not, return the query failure reply words.
11. A session processing apparatus, characterized in that the apparatus comprises:
the first acquisition module is used for acquiring the query statement;
a second obtaining module, configured to obtain semantic feature data corresponding to the query statement, where the semantic feature data includes a plurality of semantic units representing semantic information of the query statement;
the processing module is used for constructing a query graph based on the semantic feature data, and the query graph comprises incidence relations among a plurality of semantic units;
the first judgment module is used for judging whether a preset knowledge map database has a query result matched with the query map or not;
and the output module is used for outputting the query result if the query result exists.
12. The apparatus of claim 11, further comprising:
the second judging module is used for judging whether historical session information corresponding to the semantic feature data exists or not before the query graph is constructed based on the semantic feature data;
if the historical conversation information corresponding to the semantic feature data does not exist, executing the query graph constructed based on the semantic feature data;
and if the historical conversation information corresponding to the semantic feature data exists, acquiring a historical query graph corresponding to the semantic feature data.
13. The apparatus of claim 12, wherein the second determining module comprises:
the judging unit is used for judging whether the semantic feature data has information loss relative to the historical semantic feature data corresponding to the historical session information if the historical session information corresponding to the semantic feature data exists;
if information is missing, acquiring a historical query graph corresponding to the semantic feature data;
and if no information is missing, executing the query graph constructed based on the semantic feature data.
14. An electronic device, comprising a memory;
one or more processors;
one or more programs stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-10.
15. A computer-readable storage medium, having program code stored therein, wherein the program code when executed by a processor performs the method of any of claims 1-10.
CN201911393522.1A 2019-12-30 2019-12-30 Session processing method, device, electronic equipment and storage medium Pending CN111159376A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911393522.1A CN111159376A (en) 2019-12-30 2019-12-30 Session processing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911393522.1A CN111159376A (en) 2019-12-30 2019-12-30 Session processing method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111159376A true CN111159376A (en) 2020-05-15

Family

ID=70559158

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911393522.1A Pending CN111159376A (en) 2019-12-30 2019-12-30 Session processing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111159376A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767379A (en) * 2020-06-29 2020-10-13 北京百度网讯科技有限公司 Image question-answering method, device, equipment and storage medium
CN112148887A (en) * 2020-09-16 2020-12-29 珠海格力电器股份有限公司 Equipment fault diagnosis method and device, storage medium and electronic equipment
CN112712056A (en) * 2021-01-14 2021-04-27 珠海格力电器股份有限公司 Video semantic analysis method and device, storage medium and electronic equipment
CN113342945A (en) * 2021-05-11 2021-09-03 北京三快在线科技有限公司 Voice session processing method and device
CN113407667A (en) * 2021-06-11 2021-09-17 上海适享文化传播有限公司 Query method based on voice fixed condition
CN114640465A (en) * 2022-03-10 2022-06-17 黑龙江省探易科技有限公司 Collaborative interaction system for assisting human beings based on artificial intelligence
CN115905497A (en) * 2022-12-23 2023-04-04 北京百度网讯科技有限公司 Method, device, electronic equipment and storage medium for determining reply sentence

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106777018A (en) * 2016-12-08 2017-05-31 竹间智能科技(上海)有限公司 To the optimization method and device of read statement in a kind of intelligent chat robots
CN108052547A (en) * 2017-11-27 2018-05-18 华中科技大学 Natural language question-answering method and system based on question sentence and knowledge graph structural analysis
CN108334487A (en) * 2017-07-14 2018-07-27 腾讯科技(深圳)有限公司 Lack semantics information complementing method, device, computer equipment and storage medium
CN110457431A (en) * 2019-07-03 2019-11-15 深圳追一科技有限公司 Answering method, device, computer equipment and the storage medium of knowledge based map
CN110532361A (en) * 2019-08-09 2019-12-03 深圳追一科技有限公司 Recognition methods, device, computer equipment and the storage medium that user is intended to

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106777018A (en) * 2016-12-08 2017-05-31 竹间智能科技(上海)有限公司 To the optimization method and device of read statement in a kind of intelligent chat robots
CN108334487A (en) * 2017-07-14 2018-07-27 腾讯科技(深圳)有限公司 Lack semantics information complementing method, device, computer equipment and storage medium
CN108052547A (en) * 2017-11-27 2018-05-18 华中科技大学 Natural language question-answering method and system based on question sentence and knowledge graph structural analysis
CN110457431A (en) * 2019-07-03 2019-11-15 深圳追一科技有限公司 Answering method, device, computer equipment and the storage medium of knowledge based map
CN110532361A (en) * 2019-08-09 2019-12-03 深圳追一科技有限公司 Recognition methods, device, computer equipment and the storage medium that user is intended to

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767379A (en) * 2020-06-29 2020-10-13 北京百度网讯科技有限公司 Image question-answering method, device, equipment and storage medium
CN111767379B (en) * 2020-06-29 2023-06-27 北京百度网讯科技有限公司 Image question-answering method, device, equipment and storage medium
CN112148887A (en) * 2020-09-16 2020-12-29 珠海格力电器股份有限公司 Equipment fault diagnosis method and device, storage medium and electronic equipment
CN112148887B (en) * 2020-09-16 2024-05-03 珠海格力电器股份有限公司 Equipment fault diagnosis method, device, storage medium and electronic equipment
CN112712056A (en) * 2021-01-14 2021-04-27 珠海格力电器股份有限公司 Video semantic analysis method and device, storage medium and electronic equipment
CN113342945A (en) * 2021-05-11 2021-09-03 北京三快在线科技有限公司 Voice session processing method and device
CN113407667A (en) * 2021-06-11 2021-09-17 上海适享文化传播有限公司 Query method based on voice fixed condition
CN113407667B (en) * 2021-06-11 2024-03-22 上海适享文化传播有限公司 Query method based on voice fixed condition
CN114640465A (en) * 2022-03-10 2022-06-17 黑龙江省探易科技有限公司 Collaborative interaction system for assisting human beings based on artificial intelligence
CN115905497A (en) * 2022-12-23 2023-04-04 北京百度网讯科技有限公司 Method, device, electronic equipment and storage medium for determining reply sentence
CN115905497B (en) * 2022-12-23 2024-03-19 北京百度网讯科技有限公司 Method, device, electronic equipment and storage medium for determining reply sentence

Similar Documents

Publication Publication Date Title
CN111159376A (en) Session processing method, device, electronic equipment and storage medium
US10733983B2 (en) Parameter collection and automatic dialog generation in dialog systems
US11030412B2 (en) System and method for chatbot conversation construction and management
CN110111780B (en) Data processing method and server
JP6657124B2 (en) Session context modeling for conversation understanding system
CN106601237B (en) Interactive voice response system and voice recognition method thereof
CN111737411A (en) Response method in man-machine conversation, conversation system and storage medium
CN110413760B (en) Man-machine conversation method, device, storage medium and computer program product
CN108255934A (en) A kind of sound control method and device
KR20200130352A (en) Voice wake-up method and apparatus
WO2023161630A1 (en) Computer implemented methods for the automated analysis or use of data, including use of a large language model
CN110162780A (en) The recognition methods and device that user is intended to
CN112154465A (en) Method, device and equipment for learning intention recognition model
CN111831795B (en) Multi-round dialogue processing method and device, electronic equipment and storage medium
CN109408799B (en) Semantic decision method and system
CN113312468B (en) Conversation mode-based conversation recommendation method, device, equipment and medium
US20220130389A1 (en) Contextual content for voice user interfaces
US20230215425A1 (en) User-system dialog expansion
WO2021185113A1 (en) Data analysis method based on multiple analysis tasks and electronic device
CN111522966A (en) Data processing method and device based on knowledge graph, electronic equipment and medium
CN117829295A (en) Task type dialogue method based on vector retrieval and large language model
US11508372B1 (en) Natural language input routing
CN117609612A (en) Resource recommendation method and device, storage medium and electronic equipment
US11756550B1 (en) Integration of speech processing functionality with organization systems
CN115658875B (en) Data processing method based on chat service and related products

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200515