Conversation processing method and device, electronic equipment and storage medium
By constructing a knowledge graph to replace uncommon vocabulary with professional vocabulary, the accuracy of large language models to understand and answer questions in the professional field is solved, and efficient injection of professional knowledge and model universal retention is achieved.
Patent Information
- Application Number
- CN202510600663.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-09-02
AI Technical Summary
When injecting professional knowledge in the prior art, fine-tuning and continuing pre-training methods of large language models will destroy the universality of the model and will be poorly effective, making it difficult to accurately understand and answer questions in the professional field.
Build a knowledge graph, and based on the historical dialogue data of the target model, and retrieve and replace uncommon vocabulary entities as professional vocabulary entities to realize the rewriting of dialogue information to ensure that the model can recognize the meaning.
Through the application of knowledge graphs, the accurate injecting of professional knowledge has been improved, and the understanding and answering ability of large language models in professional fields is avoided.
Smart Images

Figure CN120578735A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of this specification relate to the field of artificial intelligence technology, and in particular, to a dialogue processing method and apparatus, an electronic device, and a storage medium. Background Art
[0002] With the continuous advancement of artificial intelligence technology, more and more network models are emerging. These models are rich in functions and bring great convenience to users in various aspects such as production, life, and learning. For example, the Large Language Model (LLM) is a natural language processing model built based on artificial neural networks, especially deep learning technology. It has powerful language understanding and generation capabilities. Therefore, after pre-training and fine-tuning, it can be applied to question-answering services in some professional fields, that is, as an intelligent robot to answer questions posed by users.
[0003] To enable large language models to understand and answer questions within specialized fields, they need to be infused with specialized knowledge, such as theoretical knowledge, industry idioms, and personal idioms. Related technologies use methods like fine-tuning and continued pre-training to achieve this goal, but these approaches are ineffective and inefficient. Fine-tuning changes the model's original parameters and structure, while continued pre-training can affect model quality due to poor training data quality, both of which undermine the model's inherent versatility. Summary of the Invention
[0004] In view of this, one or more embodiments of this specification provide a conversation processing method and apparatus, an electronic device, and a storage medium.
[0005] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:
[0006] According to a first aspect of one or more embodiments of this specification, a conversation processing method is proposed, the method comprising:
[0007] Obtain the original conversation information to be input into the target model;
[0008] Determining a knowledge graph applicable to the target model, wherein the knowledge graph records predefined mapping relationships between uncommon vocabulary entities and professional vocabulary entities, wherein the uncommon vocabulary entities are derived from conversation content in historical conversation data of the target model whose meaning cannot be recognized by the target model;
[0009] Based on the knowledge graph, uncommon vocabulary entities contained in the original conversation information are retrieved, and the retrieved uncommon vocabulary entities in the original conversation information are replaced with corresponding professional vocabulary entities to obtain rewritten conversation information; wherein the rewritten conversation information is used to replace the original conversation information for input into the target model.
[0010] In a possible embodiment of the present specification, the retrieving rare vocabulary entities contained in the original conversation information based on the knowledge graph includes:
[0011] Retrieving uncommon vocabulary entities contained in the original conversation information based on the industry graph and / or the personal graph;
[0012] Among them, the industry graph is constructed based on the historical conversation data of multiple users in the industry; when the original conversation information is related to the initial conversation information submitted by the user, the personal graph is constructed based on the historical conversation data of the user.
[0013] In a possible embodiment of this specification, the knowledge graph is constructed in the following manner:
[0014] Obtaining uncommon vocabulary entities in the historical conversation data;
[0015] Retrieving knowledge content related to the uncommon vocabulary entity in the knowledge document, and determining the professional vocabulary entity corresponding to the uncommon vocabulary entity based on the retrieved knowledge content;
[0016] A knowledge graph is constructed based on the professional vocabulary entities corresponding to the uncommon vocabulary entities.
[0017] In a possible embodiment of the present specification, constructing a knowledge graph based on professional vocabulary entities corresponding to the uncommon vocabulary entities includes:
[0018] For each acquired rare vocabulary entity, determining whether the rare vocabulary entity belongs to an industry vocabulary entity based on at least one of the following information of the rare vocabulary entity: the number of occurrences in historical conversation data, the number of occurrences in knowledge documents, and the number of users involved;
[0019] Construct an industry graph based on the professional vocabulary entities corresponding to each uncommon vocabulary entity belonging to the industry vocabulary entity;
[0020] At least one personal graph is constructed based on the professional vocabulary entity corresponding to each uncommon vocabulary entity that does not belong to the industry vocabulary entity.
[0021] In a possible embodiment of the present specification, the step of constructing at least one personal knowledge graph based on the professional vocabulary entity corresponding to each uncommon vocabulary entity that does not belong to an industry vocabulary entity includes:
[0022] Based on the users involved in each uncommon vocabulary entity that does not belong to the industry vocabulary entity, all uncommon vocabulary entities that do not belong to the industry vocabulary entity are divided into at least one entity group, wherein each entity group belongs to one user;
[0023] For each entity group in the at least one entity group, a personal graph of a user belonging to the entity group is constructed based on the professional vocabulary entity corresponding to each uncommon vocabulary entity in the entity group.
[0024] In a possible embodiment of the present specification, the constructing of a knowledge graph based on professional vocabulary entities corresponding to the historically uncommon vocabulary entities includes:
[0025] Based on the correction instruction, the professional vocabulary entity corresponding to the uncommon vocabulary entity is corrected, and a knowledge graph is constructed based on the correction result.
[0026] In a possible embodiment of the present specification, obtaining original conversation information to be input into the target model includes:
[0027] In the case where the target model is a question-answering model, the original dialogue information output by the rewriting model corresponding to the question-answering model is obtained, where the original dialogue information is obtained by rewriting the initial dialogue information input by the user by the rewriting model.
[0028] In a possible embodiment of the present specification, obtaining original conversation information to be input into the target model includes:
[0029] In a case where the target model is a rewritten model corresponding to a question-answering model, initial dialogue information input by the user is obtained as the original dialogue information.
[0030] In a possible embodiment of the present specification, the uncommon vocabulary entities involved in the knowledge graph also originate from: conversation content in the historical conversation data of the question-answering model, the meaning of which cannot be recognized by the question-answering model.
[0031] According to a first aspect of one or more embodiments of this specification, a dialog processing device is provided, the device comprising:
[0032] An acquisition module is used to obtain the original conversation information to be input into the target model;
[0033] a determination module, configured to determine a knowledge graph applicable to the target model, wherein the knowledge graph records predefined mapping relationships between uncommon vocabulary entities and specialized vocabulary entities, wherein the uncommon vocabulary entities are derived from conversation content in historical conversation data of the target model, the meaning of which cannot be recognized by the target model;
[0034] A replacement module is used to retrieve uncommon vocabulary entities contained in the original dialogue information based on the knowledge graph, and replace the retrieved uncommon vocabulary entities in the original dialogue information with corresponding professional vocabulary entities to obtain rewritten dialogue information; wherein the rewritten dialogue information is used to replace the original dialogue information for input into the target model.
[0035] According to a third aspect of one or more embodiments of this specification, a computer program product is provided, comprising a computer program / instruction, which implements the steps of the method described in the first aspect when executed by a processor.
[0036] According to a fourth aspect of one or more embodiments of this specification, an electronic device is provided, including:
[0037] processor;
[0038] a memory for storing processor-executable instructions;
[0039] The processor implements the method described in the first aspect by running the executable instructions.
[0040] According to a fifth aspect of one or more embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
[0041] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:
[0042] The dialogue processing method provided in the embodiments of this specification obtains original dialogue information to be input into a target model and determines a knowledge graph applicable to the target model; based on the knowledge graph, retrieves rare vocabulary entities contained in the original dialogue information, and replaces the retrieved rare vocabulary entities in the original dialogue information with corresponding professional vocabulary entities to obtain rewritten dialogue information. Based on the mapping relationship between rare vocabulary entities and professional vocabulary entities pre-defined in the knowledge graph, the method replaces rare vocabulary entities whose meanings the target model cannot recognize with corresponding professional vocabulary entities, thereby completing the rewriting of the dialogue information, so that the dialogue information does not contain vocabulary entities whose meanings the target model cannot recognize, and the target model can accurately understand the meaning of the dialogue information; in other words, the method completes the injection of professional knowledge in a professional field into the target model through the knowledge graph. In particular, the knowledge graph is derived from the historical dialogue data of the target model, that is, all rare vocabulary entities that have appeared in historical dialogues will be collected by the knowledge graph, so that the entities in the knowledge graph are accurate and targeted, and do not contain redundant and useless data. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 2 is a schematic diagram of the architecture of a question-answering system provided by an exemplary embodiment.
[0044] Figure 2 It is a flowchart of a conversation processing method provided by an exemplary embodiment.
[0045] Figure 3 It is a logical diagram of a conversation processing method provided by an exemplary embodiment.
[0046] Figure 4 It is a structural diagram of a device provided by an exemplary embodiment.
[0047] Figure 5 It is a block diagram of a conversation processing device provided by an exemplary embodiment. DETAILED DESCRIPTION
[0048] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments are not intended to represent all implementations consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with certain aspects of one or more embodiments of this specification, as detailed in the appended claims.
[0049] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than those described in this specification. In addition, a single step described in this specification may be broken down into multiple steps for description in other embodiments, and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0050] Large language models, or specialized question-and-answer service systems based on them, often encounter industry and personal idioms during conversations with users. For example, Bank AB is referred to as Bank A within the industry, and as Bank A by individuals. Related technologies pre-guess and configure these specialized or personalized terms to enable large language models or question-and-answer service systems to recognize them. However, these guesses are often lengthy and inaccurate.
[0051] Based on the above technical problems, at least one embodiment of this specification provides a conversation processing method, which can construct a knowledge graph based on the historical conversation data of the target model, thereby completing the accurate injection of professional knowledge in fields such as proprietary vocabulary and personalized vocabulary, so that the original conversation information to be input into the target model can be rewritten, that is, the uncommon vocabulary entities contained therein, that is, the vocabulary entities whose meanings the target model cannot recognize, are replaced with professional vocabulary entities, that is, the vocabulary entities whose meanings the target model can recognize, so that it can recognize conversation information containing uncommon vocabulary entities and output correct responses.
[0052] This method can be applied to question-answering service systems in professional fields. The system can serve as an intelligent robot to answer professional questions input by users. The professional fields can be legal, financial, insurance, etc. Please refer to the attached Figure 1 , which exemplarily shows the architecture of the question-answering service system, which includes session (dialogue module), Agent Retriever (intelligent agent retrieval module), Doc Lib (document library), Router (routing module), Streaming Decoder (streaming decoding module), and Agents (intelligent agents).
[0053] The session includes conversation persistence and memory components. Conversation persistence is used to maintain the continuity of multiple rounds of conversations between the user and the system and record information such as the historical status of the conversation. Memory is used to store conversation-related memories. This information can help the system better understand user intent and provide assistance to users.
[0054] Agent Retriever includes vector retrieval and embedding functions. Embedding converts the content in the document library (Doc Lib) (such as process documents, task background, etc.) into vector representation to facilitate similarity retrieval; vector retrieval finds the most relevant agent candidate objects in the vector space based on the semantic information of the user request, achieving fast and accurate agent retrieval.
[0055] Doc Lib is used to store process documents and task background information, providing a knowledge base for the system, making it easier for the agent to reference relevant knowledge when performing tasks, and providing a retrieval basis for the Agent Retriever.
[0056] Agents include agent templates and configured access. Agent templates define the structure and behavior patterns of different agent types, facilitating rapid creation and management. Configured access allows for the integration of new agents through configuration, improving system scalability. Specific agents include the Workflow Agent and the Plan-ExecuteAgent (based on the V1 framework). The Workflow Agent is responsible for executing standard processes and invoking tools. It follows pre-set workflow steps, sequentially invoking relevant tools to complete tasks. For example, in a task approval process, it performs approval operations according to the prescribed steps and invokes the corresponding approval tools. The Plan-Execute Agent's primary function is task planning and plan adjustment. It first plans complex tasks, breaking them down into multiple subtasks and then adjusts the plan based on actual conditions during execution to ensure smooth completion. For example, in project management tasks, it first plans project phases and task allocations, then adjusts them based on project progress. Agents can include question-answering models to output answers to rewritten user requests. These models can be large language models or other types of models.
[0057] The Streaming Decoder's main function is streaming translation. It is responsible for translating asynchronous streaming data (such as real-time processing progress and intermediate results) during the agent's execution, converting it into a user-readable streaming message format and sending it to the user, allowing them to understand the task execution status in real time.
[0058] The Router features intent recognition and multi-turn dialogue rewriting. Intent recognition analyzes user requests to determine the type of task they intend to complete, such as querying information or performing an action. Multi-turn dialogue rewriting rewrites the user's current request based on the context of the multi-turn dialogue to better meet the system's processing requirements, and then assigns the task to the appropriate agent. Multi-turn dialogue rewriting can be achieved using a rewriting model, such as a large language model. This method can be applied to the Router to process user requests and inject expertise into the system.
[0059] The system operates as follows: a user initiates a request, the Router identifies the intent, and after multiple rounds of dialogue rewriting, the task is assigned to the corresponding agent (such as the Workflow Agent or Plan-Execute Agent) based on the dialogue history and relevant agents retrieved by the Agent Retriever. During execution, the agent references knowledge from the Doc Lib and uses the Streaming Decoder to translate asynchronous streaming data into streaming messages that are fed back to the user.
[0060] Please follow the attached Figure 2 , which exemplarily shows the process of the method, including steps S201 to S203.
[0061] In step S201 , original dialogue information to be input into the target model is obtained.
[0062] For example, when the target model is a question-answering model, this step can obtain the original dialogue information output by the rewriting model corresponding to the question-answering model, where the original dialogue information is obtained by rewriting the initial dialogue information input by the user by the rewriting model. Figure 1 In the system shown, the user's request is the initial dialogue information input by the user, such as prompt content, question content, etc. The rewriting model rewrites the initial dialogue information to obtain the original dialogue information; then the router can process the original dialogue information based on this method to further rewrite the original dialogue information and input the rewritten dialogue information into the question-answering model.
[0063] For another example, when the target model is a rewritten model corresponding to the question-answering model, this step can obtain the initial dialogue information input by the user as the original dialogue information. Figure 1 In the system shown, the user's request is the initial conversation information entered by the user, such as prompt content, question content, etc. The Router can process this initial conversation information as original conversation information, that is, rewrite the original conversation information based on this method, and input the rewritten conversation information into the rewriting model for further context rewriting. The context rewriting result is input into the question-answering model.
[0064] In step S202, a knowledge graph applicable to the target model is determined, wherein the knowledge graph records a mapping relationship between predefined uncommon vocabulary entities and professional vocabulary entities, and the uncommon vocabulary entities are derived from conversation content in the historical conversation data of the target model, the meaning of which cannot be recognized by the target model.
[0065] In the process of talking with the user, the target model will output the conversation content that it cannot recognize, such as rare vocabulary entities. Figure 1 The system shown will save the unrecognizable conversation content output by the target model, such as rare vocabulary entities; preferably, the unrecognizable conversation content and its context will be saved together to facilitate subsequent determination of its meaning.
[0066] In one possible embodiment, the knowledge graph is pre-constructed in the following manner:
[0067] First, uncommon lexical entities in the historical conversation data are obtained. Prompt content (such as the prompt content of few shot) can be input into the target model to make it output lexical entities whose meanings are not understood in the historical conversation data, that is, uncommon lexical entities.
[0068] For example, if the target model is a question-answering model, this step can obtain uncommon vocabulary entities from the historical conversation data of the question-answering model. That is, the uncommon vocabulary entities involved in the knowledge graph come from conversations in the historical conversation data of the question-answering model whose meaning the question-answering model cannot recognize.
[0069] For example, if the target model is a rewriting model corresponding to a question-answering model, this step can obtain uncommon vocabulary entities from the historical conversation data of the rewriting model. That is, the uncommon vocabulary entities involved in the knowledge graph are derived from conversations in the historical conversation data of the rewriting model whose meaning the rewriting model cannot recognize.
[0070] For another example, if the target model is a rewriting model corresponding to a question-answering model, this step can obtain rare vocabulary entities from the historical conversation data of the rewriting model, as well as rare vocabulary entities from the historical conversation data of the question-answering model. That is, the rare vocabulary entities involved in the knowledge graph are derived from: conversation content in the historical conversation data of the rewriting model whose meaning is unrecognizable, and conversation content in the historical conversation data of the question-answering model whose meaning is unrecognizable.
[0071] Next, knowledge content related to the uncommon vocabulary entity is retrieved in the knowledge document, and a professional vocabulary entity corresponding to the uncommon vocabulary entity is determined based on the retrieved knowledge content.
[0072] That is, the professional vocabulary entity corresponding to the uncommon vocabulary entity is determined in accordance with the RAG (Retrieval-Augmented Generation) method.
[0073] Finally, a knowledge graph is constructed based on the professional vocabulary entities corresponding to the uncommon vocabulary entities.
[0074] This step can be performed as follows: based on the correction instruction, the professional vocabulary entity corresponding to the uncommon vocabulary entity is corrected, and a knowledge graph is constructed based on the correction result. That is to say, before constructing the knowledge graph based on the professional vocabulary entity corresponding to the uncommon vocabulary entity, the professional vocabulary entity corresponding to the uncommon vocabulary entity can be corrected, such as professionals in the professional field checking whether the professional vocabulary entity corresponding to the uncommon vocabulary entity is accurate, and changing it if it is inaccurate to complete the correction. In addition, when correcting, it can also be based on the review data, that is, the data summarized in the review meeting of the bad case of the system operation, which also contains uncommon vocabulary entities.
[0075] For example, when constructing a knowledge graph based on the professional vocabulary entities corresponding to the uncommon vocabulary entities, or constructing a knowledge graph based on the correction results of the professional vocabulary entities corresponding to the uncommon vocabulary entities, each acquired uncommon vocabulary entity and its corresponding professional vocabulary entity can be recorded in the knowledge graph to form a mapping relationship between the uncommon vocabulary entities and the professional vocabulary entities.
[0076] For another example, when constructing a knowledge graph based on the professional vocabulary entities corresponding to the uncommon vocabulary entities, or constructing a knowledge graph based on the correction results of the professional vocabulary entities corresponding to the uncommon vocabulary entities, for each acquired uncommon vocabulary entity, it can be determined whether the uncommon vocabulary entity belongs to an industry vocabulary entity based on at least one of the following information of the uncommon vocabulary entity: the number of appearances in historical conversation data, the number of appearances in knowledge documents, and the number of users involved. For example, if the number of appearances of a certain uncommon vocabulary entity in historical conversation data exceeds a preset threshold, the number of appearances in knowledge documents also exceeds a preset threshold, and multiple users are involved, it can be determined that the uncommon vocabulary entity belongs to an industry vocabulary entity. For another example, if the number of appearances of a certain uncommon vocabulary entity in historical conversation data does not exceed a preset threshold, the number of appearances in knowledge documents also does not exceed a preset threshold, and one user is involved, it can be determined that the uncommon vocabulary entity does not belong to an industry vocabulary entity.
[0077] Furthermore, an industry graph can be constructed based on the professional vocabulary entities corresponding to each uncommon vocabulary entity belonging to an industry vocabulary entity. That is, each uncommon vocabulary entity belonging to an industry vocabulary entity and its corresponding professional vocabulary entity are recorded in the knowledge graph to form a mapping relationship between the uncommon vocabulary entities and the professional vocabulary entities.
[0078] Furthermore, at least one personal graph can be constructed based on the professional vocabulary entity corresponding to each uncommon vocabulary entity that does not belong to an industry vocabulary entity. For example, first, based on the user associated with each uncommon vocabulary entity that does not belong to an industry vocabulary entity, all uncommon vocabulary entities that do not belong to an industry vocabulary entity are divided into at least one entity group, where each entity group belongs to a user; then, for each entity group in the at least one entity group, a personal graph of the user belonging to the entity group is constructed based on the professional vocabulary entity corresponding to each uncommon vocabulary entity in the entity group.
[0079] This example determines whether the retrieved rare vocabulary entities belong to industry vocabulary entities and, based on this, identifies an industry graph and at least one personal graph. This allows the knowledge graph to be divided into multiple subsets, allowing for targeted use of the knowledge graph and improving the efficiency of knowledge graph utilization. By excluding a large number of rare vocabulary entities that do not belong to industry vocabulary entities from the industry graph, the industry graph's data volume is reduced, improving the efficiency of searches using the industry graph. For example, if the industry graph contains 10,000 rare vocabulary entities, while the other 10,000 rare vocabulary entities are recorded in multiple personal graphs, then when processing conversation information input by a user without a personal graph, only the 10,000 rare vocabulary entities recorded in the industry graph can be used. This can improve search efficiency by 50% compared to recording all rare vocabulary entities in a single knowledge graph. In particular, some users' personal usage habits often lack any logic and are formed entirely out of habit or even error. The collection of these personalized vocabulary in a personal database can align with the user's habits, providing a better user experience.
[0080] It should be understood that after the target model has initially run for a certain period of time, a knowledge graph can be constructed based on the knowledge graph construction method provided in the above embodiment; and, after the target model has run for a certain period of time each time, newly appeared rare vocabulary entities can be added to the knowledge graph based on the knowledge graph construction method provided in the above embodiment, that is, the content of the knowledge graph can be updated regularly, so as to ensure that the knowledge graph gradually collects as many rare vocabulary entities of industries and / or individuals as possible during the update iteration.
[0081] Based on the knowledge graph constructed in the above embodiment, this step can determine the corresponding industry graph and / or personal graph when determining the knowledge graph applicable to the target model. For example, when constructing the knowledge graph based on the historical conversation data of the target model, only the industry graph is constructed, then this step can determine that the industry graph is the knowledge graph applicable to the target model. For another example, when constructing the knowledge graph based on the historical conversation data of the target model, no industry graph is constructed, and a personal graph of the user who inputs the initial conversation information related to the original conversation information is constructed, then this step can determine that the personal graph of the user is the knowledge graph applicable to the target model. For another example, when constructing the knowledge graph based on the historical conversation data of the target model, an industry graph and a personal graph of the user who inputs the initial conversation information related to the original conversation information are constructed, then this step can determine that the industry graph and the personal graph of the user are the knowledge graph applicable to the target model.
[0082] In step S203, based on the knowledge graph, uncommon vocabulary entities contained in the original dialogue information are retrieved, and the retrieved uncommon vocabulary entities in the original dialogue information are replaced with corresponding professional vocabulary entities to obtain rewritten dialogue information; wherein, the rewritten dialogue information is used to replace the original dialogue information to be input into the target model.
[0083] Exemplarily, this step can retrieve uncommon vocabulary entities contained in the original conversation information based on the industry graph and / or personal graph; wherein the industry graph is constructed based on the historical conversation data of multiple users in the industry; when the original conversation information is related to the initial conversation information submitted by the user, the personal graph is constructed based on the historical conversation data of the user.
[0084] Please refer to the attached Figure 3 , which exemplarily shows a logical diagram of the dialogue processing method obtained by combining the above embodiments.
[0085] Figure 4 This is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 4 At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410. Of course, it may also include hardware required for other tasks. One or more embodiments of this specification can be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0086] Please refer to Figure 5 , the dialogue processing device can be applied to Figure 4 The device shown in the figure can be used to implement the technical solution of this specification. The dialogue processing device can include:
[0087] An acquisition module 501 is used to acquire original conversation information to be input into the target model;
[0088] Determination module 502, configured to determine a knowledge graph applicable to the target model, wherein the knowledge graph records predefined mapping relationships between uncommon vocabulary entities and specialized vocabulary entities, wherein the uncommon vocabulary entities are derived from conversation content in historical conversation data of the target model whose meaning is unrecognizable by the target model;
[0089] The replacement module 503 is used to retrieve the rare vocabulary entities contained in the original dialogue information based on the knowledge graph, and replace the retrieved rare vocabulary entities in the original dialogue information with corresponding professional vocabulary entities to obtain rewritten dialogue information; wherein the rewritten dialogue information is used to replace the original dialogue information for input into the target model.
[0090] In a possible embodiment of the present specification, when the replacement module is used to retrieve rare vocabulary entities contained in the original conversation information based on the knowledge graph, it is used to:
[0091] Retrieving uncommon vocabulary entities contained in the original conversation information based on the industry graph and / or the personal graph;
[0092] Among them, the industry graph is constructed based on the historical conversation data of multiple users in the industry; when the original conversation information is related to the initial conversation information submitted by the user, the personal graph is constructed based on the historical conversation data of the user.
[0093] In a possible embodiment of the present specification, the apparatus further includes a construction module configured to construct the knowledge graph in the following manner:
[0094] Obtaining uncommon vocabulary entities in the historical conversation data;
[0095] Retrieving knowledge content related to the uncommon vocabulary entity in the knowledge document, and determining the professional vocabulary entity corresponding to the uncommon vocabulary entity based on the retrieved knowledge content;
[0096] A knowledge graph is constructed based on the professional vocabulary entities corresponding to the uncommon vocabulary entities.
[0097] In a possible embodiment of the present specification, the construction module is used to construct a knowledge graph based on the professional vocabulary entities corresponding to the uncommon vocabulary entities, and is used to:
[0098] For each acquired rare vocabulary entity, determining whether the rare vocabulary entity belongs to an industry vocabulary entity based on at least one of the following information of the rare vocabulary entity: the number of occurrences in historical conversation data, the number of occurrences in knowledge documents, and the number of users involved;
[0099] Construct an industry graph based on the professional vocabulary entities corresponding to each uncommon vocabulary entity belonging to the industry vocabulary entity;
[0100] At least one personal graph is constructed based on the professional vocabulary entity corresponding to each uncommon vocabulary entity that does not belong to the industry vocabulary entity.
[0101] In a possible embodiment of the present specification, when the construction module is used to construct at least one personal knowledge graph based on the professional vocabulary entity corresponding to each uncommon vocabulary entity that does not belong to the industry vocabulary entity, it is used to:
[0102] Based on the users involved in each uncommon vocabulary entity that does not belong to the industry vocabulary entity, all uncommon vocabulary entities that do not belong to the industry vocabulary entity are divided into at least one entity group, wherein each entity group belongs to one user;
[0103] For each entity group in the at least one entity group, a personal graph of a user belonging to the entity group is constructed based on the professional vocabulary entity corresponding to each uncommon vocabulary entity in the entity group.
[0104] In a possible embodiment of the present specification, when the construction module is used to construct a knowledge graph based on the professional vocabulary entities corresponding to the historically uncommon vocabulary entities, it is used to:
[0105] Based on the correction instruction, the professional vocabulary entity corresponding to the uncommon vocabulary entity is corrected, and a knowledge graph is constructed based on the correction result.
[0106] In a possible embodiment of this specification, the acquisition module is used to:
[0107] In the case where the target model is a question-answering model, the original dialogue information output by the rewriting model corresponding to the question-answering model is obtained, where the original dialogue information is obtained by rewriting the initial dialogue information input by the user by the rewriting model.
[0108] In a possible embodiment of this specification, the acquisition module is used to:
[0109] In a case where the target model is a rewritten model corresponding to a question-answering model, initial dialogue information input by the user is obtained as the original dialogue information.
[0110] In a possible embodiment of the present specification, the uncommon vocabulary entities involved in the knowledge graph also originate from: conversation content in the historical conversation data of the question-answering model, the meaning of which cannot be recognized by the question-answering model.
[0111] One or more embodiments of this specification also provide a computer program product, comprising a computer program / instruction, which implements the steps of the method provided in the first aspect when executed by a processor.
[0112] One or more embodiments of this specification also provide a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0113] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email transceiver, game console, tablet computer, wearable device, or any combination of these devices.
[0114] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0115] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0116] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0117] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0118] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0119] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "an," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0120] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0121] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining."
[0122] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification shall be included in the scope of protection of one or more embodiments of this specification.
Claims
1. A method for processing a conversation, the method comprising: Obtain the original conversation information to be input into the target model; Determining a knowledge graph applicable to the target model, wherein the knowledge graph records predefined mapping relationships between uncommon vocabulary entities and professional vocabulary entities, wherein the uncommon vocabulary entities are derived from conversation content in historical conversation data of the target model whose meaning cannot be recognized by the target model; Based on the knowledge graph, uncommon vocabulary entities contained in the original conversation information are retrieved, and the retrieved uncommon vocabulary entities in the original conversation information are replaced with corresponding professional vocabulary entities to obtain rewritten conversation information; wherein the rewritten conversation information is used to replace the original conversation information for input into the target model.
2. The dialog processing method according to claim 1, wherein the step of retrieving uncommon vocabulary entities contained in the original dialog information based on the knowledge graph comprises: Retrieving uncommon vocabulary entities contained in the original conversation information based on the industry graph and / or the personal graph; Among them, the industry graph is constructed based on the historical conversation data of multiple users in the industry; when the original conversation information is related to the initial conversation information submitted by the user, the personal graph is constructed based on the historical conversation data of the user.
3. According to the dialog processing method of claim 1, the knowledge graph is constructed in the following manner: Obtaining uncommon vocabulary entities in the historical conversation data; Retrieving knowledge content related to the uncommon vocabulary entity in the knowledge document, and determining the professional vocabulary entity corresponding to the uncommon vocabulary entity based on the retrieved knowledge content; A knowledge graph is constructed based on the professional vocabulary entities corresponding to the uncommon vocabulary entities.
4. The dialog processing method according to claim 3, wherein the step of constructing a knowledge graph based on the professional vocabulary entities corresponding to the uncommon vocabulary entities comprises: For each acquired rare vocabulary entity, determining whether the rare vocabulary entity belongs to an industry vocabulary entity based on at least one of the following information of the rare vocabulary entity: the number of occurrences in historical conversation data, the number of occurrences in knowledge documents, and the number of users involved; Construct an industry graph based on the professional vocabulary entities corresponding to each uncommon vocabulary entity belonging to the industry vocabulary entity; At least one personal graph is constructed based on the professional vocabulary entity corresponding to each uncommon vocabulary entity that does not belong to the industry vocabulary entity.
5. The method for processing conversations according to claim 4, wherein the step of constructing at least one personal knowledge graph based on the professional vocabulary entities corresponding to each uncommon vocabulary entity that does not belong to an industry vocabulary entity comprises: Based on the users involved in each uncommon vocabulary entity that does not belong to the industry vocabulary entity, all uncommon vocabulary entities that do not belong to the industry vocabulary entity are divided into at least one entity group, wherein each entity group belongs to one user; For each entity group in the at least one entity group, a personal graph of a user belonging to the entity group is constructed based on the professional vocabulary entity corresponding to each uncommon vocabulary entity in the entity group.
6. The dialog processing method according to claim 3, wherein the step of constructing a knowledge graph based on the professional vocabulary entities corresponding to the historically uncommon vocabulary entities comprises: Based on the correction instruction, the professional vocabulary entity corresponding to the uncommon vocabulary entity is corrected, and a knowledge graph is constructed based on the correction result.
7. The dialog processing method according to claim 1, wherein obtaining original dialog information to be input into the target model comprises: In the case where the target model is a question-answering model, the original dialogue information output by the rewriting model corresponding to the question-answering model is obtained, where the original dialogue information is obtained by rewriting the initial dialogue information input by the user by the rewriting model.
8. The dialog processing method according to claim 1, wherein obtaining original dialog information to be input into the target model comprises: In a case where the target model is a rewritten model corresponding to a question-answering model, initial dialogue information input by the user is obtained as the original dialogue information.
9. According to the dialogue processing method according to claim 8, the uncommon vocabulary entities involved in the knowledge graph also come from: dialogue content in the historical dialogue data of the question-answering model whose meaning cannot be recognized by the question-answering model.
10. A conversation processing device, comprising: An acquisition module is used to obtain the original conversation information to be input into the target model; a determination module, configured to determine a knowledge graph applicable to the target model, wherein the knowledge graph records predefined mapping relationships between uncommon vocabulary entities and specialized vocabulary entities, wherein the uncommon vocabulary entities are derived from conversation content in historical conversation data of the target model, the meaning of which cannot be recognized by the target model; A replacement module is used to retrieve uncommon vocabulary entities contained in the original dialogue information based on the knowledge graph, and replace the retrieved uncommon vocabulary entities in the original dialogue information with corresponding professional vocabulary entities to obtain rewritten dialogue information; wherein the rewritten dialogue information is used to replace the original dialogue information for input into the target model.
11. The dialog processing device according to claim 10, wherein the replacement module is configured to retrieve uncommon vocabulary entities contained in the original dialog information based on the knowledge graph, and is configured to: Retrieving uncommon vocabulary entities contained in the original conversation information based on the industry graph and / or the personal graph; in, The industry graph is constructed based on historical conversation data of multiple users in the industry; when the original conversation information is related to the initial conversation information submitted by the user, the personal graph is constructed based on the historical conversation data of the user.
12. The dialog processing device according to claim 10, further comprising a construction module configured to construct the knowledge graph in the following manner: Obtaining uncommon vocabulary entities in the historical conversation data; Retrieving knowledge content related to the uncommon vocabulary entity in the knowledge document, and determining the professional vocabulary entity corresponding to the uncommon vocabulary entity based on the retrieved knowledge content; A knowledge graph is constructed based on the professional vocabulary entities corresponding to the uncommon vocabulary entities.
13. The dialog processing device according to claim 12, wherein the construction module is configured to construct a knowledge graph based on the professional vocabulary entities corresponding to the uncommon vocabulary entities, and is configured to: For each acquired rare vocabulary entity, determining whether the rare vocabulary entity belongs to an industry vocabulary entity based on at least one of the following information of the rare vocabulary entity: the number of occurrences in historical conversation data, the number of occurrences in knowledge documents, and the number of users involved; Construct an industry graph based on the professional vocabulary entities corresponding to each uncommon vocabulary entity belonging to the industry vocabulary entity; At least one personal graph is constructed based on the professional vocabulary entity corresponding to each uncommon vocabulary entity that does not belong to the industry vocabulary entity.
14. A computer program product comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9.
15. An electronic device comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 9 by running the executable instructions.
16. A computer-readable storage medium having computer instructions stored thereon, which implement the steps of the method according to any one of claims 1 to 9 when executed by a processor.