Dialogue method and device based on knowledge base, computing equipment and storage medium
By rewriting and enhancing the content of user questions, combining the dialogue context, high-quality dialogue requests are generated, which solves the problem of insufficient user questions in the existing technology, and improves the effect and user experience of knowledge base retrieval.
Patent Information
- Application Number
- CN202411625361.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-01-14
AI Technical Summary
The existing knowledge base question and answer system is difficult to understand the true intention of the user's question, which leads to low recall and accuracy of the answers, especially when the user asks questions, the information is insufficient or vague, and the intent is not accurately expressed.
By obtaining the user's question content and conversation context, determine whether the question content needs to be rewritten, rewritten and enhanced, generate auxiliary conversation requests to improve the quality and relevance of the question, and obtain response information from the knowledge base.
It significantly improves the quality and relevance of the problem, improves the recall and accuracy of knowledge base search, reduces the requirements for users to enter precise question content, and improves the user experience.
Smart Images

Figure CN119311837A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of computers, and more particularly to a conversation method and apparatus based on a knowledge base, a computing device, and a storage medium. Background Art
[0002] With the development of big data and artificial intelligence technologies, knowledge base question answering has been widely used in many fields, such as education, medical care, and law. In the field of knowledge base question answering, a common challenge is to ensure the accuracy and information richness of user questions. Current knowledge base question answering implementations usually rely on questions provided by users to retrieve answers, but these questions often have problems such as insufficient information and ambiguity. This results in the retrieval system being unable to effectively understand the true intent of the question, thereby reducing the recall rate of the answer and the accuracy of the recalled answer. Moreover, users may not have sufficient expertise when asking questions, or may not be able to accurately express their query intent, further limiting the recall rate of the answer and the accuracy of the recalled answer. Summary of the invention
[0003] In view of this, the present disclosure provides a knowledge base-based dialogue method and apparatus, a computing device, and a storage medium, which are expected to overcome some or all of the above-mentioned deficiencies and other possible deficiencies.
[0004] According to a first aspect of the present disclosure, a knowledge base-based dialogue method is provided, comprising: obtaining a first dialogue request including a question content and a dialogue context on which the first dialogue request is based; determining whether the first dialogue request needs to be rewritten based on the dialogue context; in response to the first dialogue request needing to be rewritten, rewriting the first dialogue request based on the dialogue context to obtain an auxiliary dialogue request, the auxiliary dialogue request including rewritten content obtained by rewriting the question content in the first dialogue request; enhancing the auxiliary dialogue request to obtain at least one second dialogue request; and using the at least one second dialogue request, obtaining response information from at least one knowledge base as a response to the first dialogue request.
[0005] In some embodiments, the method further includes: in response to the first dialog request not needing to be rewritten, determining the first dialog request as an auxiliary dialog request.
[0006] In some embodiments, determining whether the first dialogue request needs to be rewritten based on the dialogue context includes: identifying associated elements present in the question content included in the first dialogue request, the associated elements including one or more of pronouns and reference words; determining the degree of association between the first dialogue request and the dialogue context based on the associated elements; and determining that the first dialogue request needs to be rewritten in response to the degree of association being greater than an association threshold.
[0007] In some embodiments, in response to the first dialogue request needing to be rewritten, the first dialogue request is rewritten based on the dialogue context to obtain an auxiliary dialogue request, including: in response to the first dialogue request needing to be rewritten, identifying entities and noun entities related to the question content in the first dialogue request and the associated elements in the dialogue context; determining the noun entity in the dialogue context to which the associated elements in the question content are associated; and rewriting the associated elements using the noun entity to obtain an auxiliary dialogue request including the rewritten content.
[0008] In some embodiments, the auxiliary conversation request is enhanced to obtain at least one second conversation request, including: performing redundancy processing on the rewritten content included in the auxiliary conversation request to obtain a second conversation request including the rewritten content after removing redundant information.
[0009] In some embodiments, the auxiliary conversation request is enhanced to obtain at least one second conversation request, including: generating similar content, wherein the semantic similarity between the similar content and the rewritten content included in the auxiliary conversation request is greater than a similarity threshold; and generating a second conversation request including the similar content.
[0010] In some embodiments, the auxiliary dialogue request is enhanced to obtain at least one second dialogue request, including: using a large language model to generate a response to the rewritten content included in the auxiliary dialogue request as an auxiliary response; and generating a second dialogue request including the auxiliary response.
[0011] In some embodiments, the auxiliary conversation request is enhanced to obtain at least one second conversation request, including: correcting one or more grammatical, semantic, and spelling errors in the rewritten content included in the auxiliary conversation request to obtain corrected content; and generating a second conversation request including the corrected content.
[0012] In some embodiments, the auxiliary conversation request is enhanced to obtain at least one second conversation request, including: replacing synonyms, abbreviations, and aliases in the rewritten content included in the auxiliary conversation request to obtain replacement content; and generating a second conversation request including the replacement content.
[0013] According to a second aspect of the present disclosure, a conversation device based on a knowledge base is provided, comprising: a request acquisition module, configured to acquire a first conversation request including a question content and a conversation context on which the first conversation request is based; a determination module, configured to determine whether the first conversation request needs to be rewritten based on the conversation context; a rewriting module, configured to rewrite the first conversation request based on the conversation context in response to the first conversation request needing to be rewritten, so as to obtain an auxiliary conversation request, wherein the auxiliary conversation request includes the rewritten content obtained by rewriting the question content in the first conversation request; an enhancement module, configured to enhance the auxiliary conversation request to obtain at least one second conversation request; and a response acquisition module, configured to use the at least one second conversation request to acquire response information from at least one knowledge base as a response to the first conversation request.
[0014] According to a third aspect of the present disclosure, a computing device is provided, comprising: a memory configured to store computer-executable instructions; and a processor configured to perform any one of the methods described above when the computer-executable instructions are executed by the processor.
[0015] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, which stores computer-executable instructions. When the computer-executable instructions are executed, any one of the methods described above is executed.
[0016] According to a fifth aspect of the present disclosure, a computer program product is provided, characterized in that the computer program product comprises computer executable instructions, and the computer executable instructions implement any of the methods described above when executed.
[0017] In the knowledge base-based dialogue method and device claimed for protection in the present disclosure, a first dialogue request including question content and a dialogue context based on the first dialogue request are first obtained, and then it is determined whether the first dialogue request needs to be rewritten based on the dialogue context. In the case where it is determined that the first dialogue request needs to be rewritten, the first dialogue request is rewritten based on the dialogue context to obtain an auxiliary dialogue request, and the auxiliary dialogue request is enhanced to obtain at least one second dialogue request. Finally, using the at least one second dialogue request, response information is obtained from at least one knowledge base as a response to the first dialogue request. In this way, the quality and relevance of the question can be significantly improved, thereby improving the recall rate and accuracy of the response information in the knowledge base retrieval, reducing the requirement for the user to input precise question content, and improving the user experience.
[0018] These and other advantages of the disclosure will be apparent from and elucidated with reference to the embodiments described hereinafter. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Embodiments of the present disclosure will now be described in more detail and with reference to the accompanying drawings, in which:
[0020] Figure 1 An exemplary application scenario in which the technical solution according to the embodiments of the present disclosure can be implemented is illustrated;
[0021] Figure 2 A schematic flow chart of a knowledge base-based dialogue method according to an embodiment of the present disclosure is illustrated;
[0022] Figure 3 An exemplary flow chart of a method for determining whether the first dialog request needs to be rewritten according to an embodiment of the present disclosure is illustrated;
[0023] Figure 4 An exemplary structural block diagram of a knowledge base-based dialogue device according to an embodiment of the present disclosure is illustrated;
[0024] Figure 5 An example system is illustrated that includes an example computing device that represents one or more systems and / or devices that may implement the various techniques described herein. DETAILED DESCRIPTION
[0025] The following description provides specific details of various embodiments of the present disclosure so that those skilled in the art can fully understand and implement the various embodiments of the present disclosure. It should be understood that the technical solution of the present disclosure can be implemented without some of these details. In some cases, the present disclosure does not show or describe in detail some well-known structures or functions to avoid these unnecessary descriptions from obscuring the description of the embodiments of the present disclosure. The terms used in the present disclosure should be understood in their broadest reasonable manner, even if they are used in conjunction with specific embodiments of the present disclosure.
[0026] Figure 1 FIG. 1 illustrates an exemplary application scenario 100 in which the technical solution according to an embodiment of the present disclosure can be implemented. Figure 1 As shown, the application scenario shown includes a terminal 110 and a server 120 , and the terminal 110 is communicatively coupled with the server 120 via a network 130 .
[0027] The terminal 110 may be an intelligent terminal device with web page access capability. As an example, the dialogue application 140 may be run on the terminal 110. The user may input a question content on the dialogue application to initiate a first dialogue request to the server 120, in the hope of obtaining a reply or answer to the question content.
[0028] After obtaining the first dialogue request including the question content, the server 120 may further obtain the dialogue context on which the first dialogue request is based. Then, the server 120 determines whether the first dialogue request needs to be rewritten based on the dialogue context; and when it is determined that the first dialogue request needs to be rewritten, the first dialogue request is rewritten based on the dialogue context to obtain an auxiliary dialogue request, and the auxiliary dialogue request includes the rewritten content obtained by rewriting the question content in the first dialogue request. Next, the server 120 enhances the auxiliary dialogue request to obtain at least one second dialogue request, and uses the at least one second dialogue request to obtain response information from at least one knowledge base as a response to the first dialogue request. After obtaining the response information, the server may return the response information to the dialogue application 140 so as to present it to the user.
[0029] It should be noted that the terminal 110 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, an intelligent speaker, a smart watch, etc., but is not limited thereto. The server 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here. The network 130 can be, for example, a wide area network (WAN), a local area network (LAN), a wireless network, a public telephone network, an intranet, and any other type of network known to those skilled in the art.
[0030] The scenario described above is merely an example in which the embodiments of the present disclosure may be implemented and is not limiting.
[0031] Figure 2 The schematic flow chart of a knowledge base-based dialogue method 200 according to an embodiment of the present disclosure is shown. The method can be used, for example, in Figure 1 The server 120 shown is implemented, of course, this is not restrictive, and it can also be implemented independently on the terminal 110 or other third-party entities. Figure 2 As shown, the method 200 includes the following steps.
[0032] In step 210, a first dialogue request including a question content and a dialogue context based on the first dialogue request are obtained. The dialogue context introduces the historical process of France and mentions the name "Napoleon". At this time, the user wants to obtain a detailed introduction to Napoleon and can initiate a first dialogue request including a question content, and the question content can be, for example, "Introduce Napoleon in detail" or "Introduce him in detail". The server can obtain the first dialogue request and the dialogue context based on the first dialogue request, that is, the dialogue context introducing the historical process of France mentioned above.
[0033] In step 220, it is determined whether the first dialogue request needs to be rewritten based on the dialogue context. The question content in the first dialogue request may be a supplement to the dialogue context, a follow-up question, or an inquiry about a specific word in the dialogue context. It is closely related to the dialogue context and needs to rely on the context to be fully understood. Without combining the context, it is difficult to accurately express the complete intention. For example, for the above question content "Introduce him in detail", without combining the dialogue context, it is unknown who "he" is here, resulting in the inability to correctly identify the complete intention of the question content. Therefore, it is necessary to determine whether the first dialogue request needs to be rewritten, and if rewriting is required, rewrite the first dialogue request to clarify its complete intention.
[0034] As an example, Figure 3 FIG. 3 is a flow chart of a method 300 for determining whether the first dialog request needs to be rewritten according to an embodiment of the present disclosure. Figure 3 As shown, in step 310, firstly, the associated elements existing in the question content included in the first dialogue request are identified, and the associated elements include one or more of pronouns and reference words. For example, the pronoun "he" in the question content "detailed introduction to him" and other reference words such as "mentioned above", "see above", etc. Then, in step 320, the degree of association between the first dialogue request and the dialogue context is determined according to the associated elements. As an example, the degree of association can be positively correlated with the number of associated elements. Alternatively, when calculating the degree of association, different weights can also be given to pronouns or reference words, for example, the weight of pronouns is greater than the weight of reference words. Then, the weighted sum of the number of pronouns and the number of reference words is used as the degree of association between the first dialogue request and the dialogue context. In step 330, in response to the degree of association being greater than the association threshold, it is determined that the first dialogue request needs to be rewritten. The association threshold can be specified as needed and is not limited here.
[0035] In other embodiments, similar content with the highest similarity to the question content in the first dialogue request can be directly determined in the dialogue context, and when the similarity between the similar content and the question content is less than a first similarity threshold, it is determined that the first dialogue request needs to be rewritten.
[0036] In another embodiment, when it is determined that the correlation degree is greater than the correlation threshold and the similarity between the similar content and the question content is less than the first similarity threshold, it is determined that the first dialogue request needs to be rewritten. This can greatly reduce the amount of rewriting tasks while ensuring the accuracy of rewriting judgment.
[0037] In step 230, in response to the first dialogue request needing to be rewritten, the first dialogue request is rewritten based on the dialogue context to obtain an auxiliary dialogue request, the auxiliary dialogue request including the rewritten content obtained by rewriting the question content in the first dialogue request. In some embodiments, in response to the first dialogue request not needing to be rewritten, the first dialogue request is directly determined as an auxiliary dialogue request.
[0038] In some embodiments, when rewriting the first dialogue request based on the dialogue context, entities and noun entities related to the question content in the first dialogue request and the associated elements in the dialogue context may be first identified. Then, the noun entity in the dialogue context to which the associated elements in the question content are associated is determined. Finally, the associated elements are rewritten using the noun entity to obtain an auxiliary dialogue request including the rewritten content.
[0039] Any entity recognition technology can be used to identify the question content in the first dialogue request and the pronoun entity and noun entity in the dialogue context. Entity recognition (Entity Recognition), also known as named entity recognition (NER), is a subtask of information extraction, which aims to identify predefined entity types (personal names, institutions, place names, etc.) from unstructured text. For example, for the statement "Napoleon is French", the entity recognition technology can be used to identify that "Napoleon" is a person's name and "France" is a country name. For "Introduce him in detail", "he" can be identified according to the entities related to the associated elements. "Noun phrase" can be, for example, "Napoleonic Code", "First French Empire", etc. Then, the noun entity "Napoleon" in the dialogue context of the associated element "he" in the question content can be determined. Finally, the associated element "he" can be rewritten using the noun entity "Napoleon" to obtain an auxiliary dialogue request including "Introduce Napoleon in detail".
[0040] In some embodiments, when performing entity recognition, the question content and the text of the dialogue context can first be represented by distributed vectors. For example, if it is a Chinese text, the Chinese can be first segmented, and then the content in the text after the segmentation process can be word embedded and symbol embedded to obtain a distributed vector representation. If it is an English text, the content in the text can be directly word embedded and symbol embedded to obtain a distributed vector representation. Then, the distributed vector representation is feature transformed to extract semantic information and obtain the transformed features. As an example, a pre-trained convolutional neural network is also used to extract feature transformation. Finally, the corresponding label category is output for the transformed features, and the label category can indicate the category of the entity, such as a person's name, a place name, etc., and further, the noun entity, the entity related to the associated element, etc. can be determined. For example, the corresponding label category can be output using technologies such as multi-layer perceptrons and conditional random fields.
[0041] In step 240, the auxiliary dialogue request is enhanced to obtain at least one second dialogue request. In order to improve the recall rate of subsequent knowledge base retrieval, the auxiliary dialogue request needs to be further enhanced to enrich the expression of the rewritten content.
[0042] In some embodiments, when the auxiliary dialogue request is enhanced, the rewritten content included in the auxiliary dialogue request may be de-redundant to obtain a second dialogue request including the rewritten content after removing redundant information. De-redundant processing may include simplifying the rewritten content, splitting the question expressed by the rewritten content into multiple clearer sub-questions, etc. This is conducive to in-depth understanding of the core intent of the question, so as to improve the clarity and pertinence of the question, thereby significantly improving the quality and relevance of the question, and further improving the recall rate and accuracy of relevant information in knowledge base retrieval.
[0043] In some embodiments, when enhancing the auxiliary dialogue request, similar content may be first generated, wherein the semantic similarity between the similar content and the rewritten content included in the auxiliary dialogue request is greater than a similarity threshold; and then a second dialogue request including the similar content is generated. As an example, natural language processing technology may be used to generate the similar content. In this way, questions that are similar in content but expressed differently may be generated so as to significantly improve the quality and relevance of the questions, thereby improving the recall rate and accuracy of relevant information in knowledge base retrieval. As another example, similar content may be generated by performing synonym replacement, sentence structure adjustment, and the like on the rewritten content.
[0044] In some embodiments, when the auxiliary dialogue request is enhanced, a large language model can be used to generate a response to the rewritten content included in the auxiliary dialogue request as an auxiliary response; then a second dialogue request including the auxiliary response is generated. As an example, a large language model can be used to generate a response to the rewritten content, and the response is, for example, a hypothetical answer to the question expressed by the rewritten content. A large language model (LLM) refers to a generative deep learning model trained with a large amount of text data, which can generate natural language text or understand language text. Then, a second dialogue request including the auxiliary response is constructed to perform knowledge base retrieval. In this way, the text used for retrieval is converted from the semantic space of the question to the semantic space of the answer or response, which can significantly improve the quality and relevance of the question, thereby improving the recall rate and accuracy of relevant information in knowledge base retrieval.
[0045] In some embodiments, when the auxiliary dialogue request is enhanced, one or more of grammatical, semantic, and spelling errors in the rewritten content included in the auxiliary dialogue request can be corrected to obtain corrected content; then, a second dialogue request including the corrected content is generated. This can also significantly improve the quality and relevance of the questions, thereby improving the recall rate and accuracy of relevant information in knowledge base retrieval.
[0046] In some embodiments, when the auxiliary dialogue request is enhanced, the synonyms, abbreviations, and aliases in the rewritten content included in the auxiliary dialogue request can be replaced to obtain replacement content; then, a second dialogue request including the replacement content is generated. This can increase the information points in the question, expand the scope and depth of the search, and thus improve the recall rate and accuracy of relevant information in the knowledge base search.
[0047] In step 250, response information is obtained from at least one knowledge base using the at least one second dialogue request as a response to the first dialogue request. As an example, the response information can be obtained from at least one knowledge base using a multi-path search method as a response to the first dialogue request. In the case of multiple second dialogue requests, the response information can be obtained from the first knowledge base using the first second dialogue request, and the response information can be obtained from the second knowledge base using the second second dialogue request, and so on.
[0048] In the knowledge base-based dialogue method claimed in the present disclosure, a first dialogue request including question content and a dialogue context based on the first dialogue request are first obtained, and then it is determined whether the first dialogue request needs to be rewritten based on the dialogue context. In the case where it is determined that the first dialogue request needs to be rewritten, the first dialogue request is rewritten based on the dialogue context to obtain an auxiliary dialogue request, and the auxiliary dialogue request is enhanced to obtain at least one second dialogue request. Finally, using the at least one second dialogue request, response information is obtained from at least one knowledge base as a response to the first dialogue request. In this way, the quality and relevance of the question can be significantly improved, thereby improving the recall rate and accuracy of the response information in the knowledge base retrieval, reducing the requirement for the user to input precise question content, and improving the user experience.
[0049] Figure 4 FIG. 4 is a block diagram of an exemplary structure of a knowledge base-based dialogue device 400 according to an embodiment of the present disclosure. Figure 4 As shown, the knowledge base-based dialogue device 400 includes a request acquisition module 410 , a determination module 420 , a rewriting module 430 , an enhancement module 440 , and a response acquisition module 450 .
[0050] The request acquisition module 410 is configured to acquire a first dialogue request including question content and a dialogue context based on the first dialogue request.
[0051] The determination module 420 is configured to determine whether the first dialogue request needs to be rewritten based on the dialogue context. The question content in the first dialogue request may be a supplement to the dialogue context, a follow-up question, or an inquiry about a specific word in the dialogue context. It is closely related to the dialogue context and needs to rely on the context to be fully understood. Without combining the context, it is difficult to accurately express the complete intention. Therefore, it is necessary to determine whether the first dialogue request needs to be rewritten, and if it needs to be rewritten, rewrite the first dialogue request to clarify its complete intention.
[0052] The rewriting module 430 is configured to, in response to the first dialogue request needing to be rewritten, rewrite the first dialogue request based on the dialogue context to obtain an auxiliary dialogue request, wherein the auxiliary dialogue request includes the rewritten content obtained by rewriting the question content in the first dialogue request. In some embodiments, the rewriting module 430 is further configured to, in response to the first dialogue request not needing to be rewritten, directly determine the first dialogue request as an auxiliary dialogue request.
[0053] The enhancement module 440 is configured to enhance the auxiliary dialog request to obtain at least one second dialog request.
[0054] The response acquisition module 450 is configured to acquire response information from at least one knowledge base using the at least one second dialogue request as a response to the first dialogue request.
[0055] In the knowledge base-based dialogue device claimed for protection in the present disclosure, a first dialogue request including question content and a dialogue context based on the first dialogue request are first obtained, and then it is determined whether the first dialogue request needs to be rewritten based on the dialogue context. In the case where it is determined that the first dialogue request needs to be rewritten, the first dialogue request is rewritten based on the dialogue context to obtain an auxiliary dialogue request, and the auxiliary dialogue request is enhanced to obtain at least one second dialogue request. Finally, using the at least one second dialogue request, response information is obtained from at least one knowledge base as a response to the first dialogue request. In this way, the quality and relevance of the question can be significantly improved, thereby improving the recall rate and accuracy of the response information in the knowledge base retrieval, reducing the requirement for the user to input precise question content, and improving the user experience.
[0056] Figure 5 An example system 500 is illustrated, which includes an example computing device 510 that represents one or more systems and / or devices that can implement the various techniques described herein. Computing device 510 can be, for example, a server of a service provider, a device associated with a server, a system on a chip, and / or any other suitable computing device or computing system. Figure 4 The described knowledge base based dialog apparatus 400 may take the form of a computing device 510. Alternatively, the knowledge base based dialog apparatus 400 may be implemented as a computer program in the form of an application 516.
[0057] The example computing device 510 as shown includes a processing system 511, one or more computer-readable media 512, and one or more I / O interfaces 513 that are communicatively coupled to each other. Although not shown, the computing device 510 may also include a system bus or other data and command transmission system that couples various components to each other. The system bus may include any one or combination of different bus structures, such as a memory bus or memory controller, a peripheral bus, a universal serial bus, and / or a processor or local bus utilizing any one of a variety of bus architectures. Various other examples are also contemplated, such as control and data lines.
[0058] Processing system 511 represents the functionality of performing one or more operations using hardware. Thus, processing system 511 is illustrated as including hardware elements 514 that may be configured as processors, functional blocks, and the like. This may include other logic devices implemented in hardware as application specific integrated circuits or formed using one or more semiconductors. Hardware elements 514 are not limited by the materials from which they are formed or the processing mechanisms employed therein. For example, a processor may be composed of (multiple) semiconductors and / or transistors (e.g., electronic integrated circuits (ICs)). In such a context, processor executable instructions may be electronic executable instructions.
[0059] Computer-readable media 512 is illustrated as including memory / storage 515. Memory / storage 515 represents memory / storage capacity associated with one or more computer-readable media. Memory / storage 515 may include volatile media (such as random access memory (RAM)) and / or non-volatile media (such as read-only memory (ROM), flash memory, optical disks, magnetic disks, etc.). Memory / storage 515 may include fixed media (e.g., RAM, ROM, fixed hard drives, etc.) and removable media (e.g., flash memory, removable hard drives, optical disks, etc.). Computer-readable media 512 may be configured in various other ways as further described below.
[0060] One or more I / O interfaces 513 represent functionality that allows a user to input commands and information to the computing device 510 using various input devices and optionally also allows information to be presented to the user and / or other components or devices using various output devices. Examples of input devices include a keyboard, a cursor control device (e.g., a mouse), a microphone (e.g., for voice input), a scanner, touch functionality (e.g., a capacitive or other sensor configured to detect physical touch), a camera (e.g., that can detect motion that does not involve touch as gestures using visible or invisible wavelengths (such as infrared frequencies), etc.). Examples of output devices include a display device (e.g., a monitor or projector), a speaker, a printer, a network card, a tactile response device, etc. Thus, the computing device 510 can be configured in various ways as further described below to support user interaction.
[0061] Computing device 510 also includes application 516. Application 516 may be, for example, a software instance of knowledge-base-based dialog apparatus 400, and in combination with other elements in computing device 510 implements the techniques described herein.
[0062] Various techniques may be described herein in the general context of software hardware elements or program modules. Generally, these modules include routines, programs, objects, elements, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The terms "module", "function" and "component" as used herein generally represent software, firmware, hardware or a combination thereof. The features of the techniques described herein are platform-independent, meaning that these techniques can be implemented on a variety of computing platforms with a variety of processors.
[0063] An implementation of the described modules and techniques may be stored on or transmitted across some form of computer-readable media. Computer-readable media may include various media accessible by computing device 510. By way of example and not limitation, computer-readable media may include “computer-readable storage media” and “computer-readable signal media.”
[0064] In contrast to a simple signal transmission, carrier wave, or signal itself, "computer-readable storage medium" refers to a medium and / or device capable of persistently storing information, and / or a tangible storage device. Therefore, a computer-readable storage medium refers to a non-signal-bearing medium. Computer-readable storage media include hardware such as volatile and non-volatile, removable and non-removable media and / or storage devices implemented in a method or technology suitable for storing information (such as computer-readable instructions, data structures, program modules, logic elements / circuits, or other data). Examples of computer-readable storage media may include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical storage device, hard disk, cassette, magnetic tape, magnetic disk storage device or other magnetic storage device, or other storage device, tangible medium, or article of manufacture suitable for storing desired information and accessible by a computer.
[0065] "Computer-readable signal media" refers to signal-bearing media that is configured to send instructions to the hardware of the computing device 510, such as via a network. Signal media typically can embody computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave, data signal, or other transport mechanism. Signal media also include any information transfer media. The term "modulated data signal" refers to a signal that has one or more of its characteristics set or changed so as to encode information into the signal. By way of example and not limitation, communication media include wired media such as a wired network or direct connection and wireless media such as acoustic, RF, infrared, and other wireless media.
[0066] As previously described, hardware elements 514 and computer-readable media 512 represent instructions, modules, programmable device logic, and / or fixed device logic implemented in hardware form, which in some embodiments can be used to implement at least some aspects of the technology described herein. Hardware elements can include integrated circuits or systems on a chip, application-specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), complex programmable logic devices (CPLDs), and other implementations in silicon or components of other hardware devices. In this context, hardware elements can be used as processing devices for executing program tasks defined by instructions, modules, and / or logic embodied by hardware elements, as well as hardware devices for storing instructions for execution, such as the computer-readable storage media described previously.
[0067] The aforementioned combinations may also be used to implement the various techniques and modules described herein. Therefore, software, hardware or program modules and other program modules may be implemented as one or more instructions and / or logic embodied on some form of computer-readable storage medium and / or by one or more hardware elements 514. The computing device 510 may be configured to implement specific instructions and / or functions corresponding to the software and / or hardware modules. Therefore, for example, by using a computer-readable storage medium and / or hardware element 514 of a processing system, the module may be implemented as a module executable by the computing device 510 as software, at least in part, in hardware. Instructions and / or functions may be executable / operable by one or more articles (e.g., one or more computing devices 510 and / or processing systems 511) to implement the techniques, modules and examples described herein.
[0068] In various embodiments, computing device 510 can be implemented in various configurations. For example, computing device 510 can be implemented as a computer-type device including a personal computer, a desktop computer, a multi-screen computer, a laptop computer, a netbook, etc. Computing device 510 can also be implemented as a mobile device-type device including mobile devices such as mobile phones, portable music players, portable game devices, tablet computers, multi-screen computers, etc. Computing device 510 can also be implemented as a television-type device, which includes a device with or connected to a generally larger screen in a casual viewing environment. These devices include televisions, set-top boxes, game consoles, etc.
[0069] The techniques described herein may be supported by these various configurations of computing device 510 and are not limited to the specific examples of the techniques described herein. Functionality may also be implemented in whole or in part on the "cloud" 520 by using a distributed system, such as through platform 522 as described below.
[0070] Cloud 520 includes and / or represents a platform 522 for resources 524. Platform 522 abstracts the underlying functionality of the hardware (e.g., servers) and software resources of cloud 520. Resources 524 may include applications and / or data that may be used when executing computer processing on a server remote from computing device 510. Resources 524 may also include services provided over the Internet and / or over a subscriber network such as a cellular or Wi-Fi network.
[0071] The platform 522 can abstract resources and functionality to connect the computing device 510 with other computing devices. The platform 522 can also be used to abstract the hierarchy of resources to provide a hierarchy of corresponding levels of demand encountered for resources 524 implemented via the platform 522. Therefore, in an interconnected device embodiment, the implementation of the functionality described herein can be distributed throughout the system 500. For example, the functionality can be implemented in part on the computing device 510 and through the platform 522 that abstracts the functionality of the cloud 520.
[0072] The present disclosure provides a computer-readable storage medium on which computer-readable instructions are stored. When the computer-readable instructions are executed, any of the above methods is implemented.
[0073] The present disclosure provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computing device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computing device executes any method provided in the above-mentioned various optional implementations.
[0074] It should be understood that, for the sake of clarity, embodiments of the present disclosure are described with reference to different functional units. However, it will be apparent that, without departing from the present disclosure, the functionality of each functional unit can be implemented in a single unit, in multiple units, or as a part of other functional units. For example, the functionality that is described as being performed by a single unit can be performed by multiple different units. Therefore, reference to a specific functional unit is only considered as a reference to a suitable unit for providing the described functionality, rather than indicating a strict logical or physical structure or organization. Therefore, the present disclosure can be implemented in a single unit, or can be physically and functionally distributed between different units and circuits.
[0075] It will be understood that although the first, second, third, etc. terms may be used to describe various devices, elements, parts or portions in this article, these devices, elements, parts or portions should not be limited by these terms. These terms are only used to distinguish one device, element, part or portion from another device, element, part or portion.
[0076] Although the present disclosure has been described in conjunction with some embodiments, it is not intended to be limited to the specific forms set forth herein. On the contrary, the scope of the present disclosure is limited only by the appended claims. Additionally, although individual features may be included in different claims, these may possibly be advantageously combined, and inclusion in different claims does not imply that the combination of features is not feasible and / or advantageous. The order of features in the claims does not imply any specific order in which the features must work. Furthermore, in the claims, the word "comprising" does not exclude other elements, and the term "one" or "an" does not exclude a plurality. The figure marks in the claims are provided only as clear examples and should not be interpreted as limiting the scope of the claims in any way.
Claims
1. A conversation method based on a knowledge base, comprising: Acquire a first dialogue request including question content and a dialogue context based on the first dialogue request; determining whether the first dialog request needs to be rewritten based on the dialog context; In response to the first dialogue request needing to be rewritten, rewriting the first dialogue request based on the dialogue context to obtain an auxiliary dialogue request, the auxiliary dialogue request including rewritten content obtained by rewriting question content in the first dialogue request; enhancing the auxiliary dialogue request to obtain at least one second dialogue request; Utilizing the at least one second dialogue request, response information is obtained from at least one knowledge base as a response to the first dialogue request.
2. The method according to claim 1, further comprising: In response to the first dialog request not needing to be rewritten, the first dialog request is determined to be an auxiliary dialog request.
3. The method according to claim 1, wherein: Determining whether the first dialog request needs to be rewritten based on the dialog context includes: identifying a correlation element in the question content included in the first dialogue request, wherein the correlation element includes one or more of a pronoun and a reference word; determining, according to the correlation element, a correlation degree between the first dialog request and the dialog context; In response to the correlation degree being greater than a correlation threshold, it is determined that the first dialog request needs to be rewritten.
4. The method according to claim 3, wherein: In response to the first dialogue request needing to be rewritten, rewriting the first dialogue request based on the dialogue context to obtain an auxiliary dialogue request, including: In response to the first dialogue request needing to be rewritten, identifying entities and noun entities related to question content in the first dialogue request and associated elements in the dialogue context; Determine a noun entity in the conversation context to which the associated element in the question content is associated; The associated element is rewritten using the noun entity to obtain an auxiliary dialogue request including the rewritten content.
5. The method according to claim 1, wherein: The auxiliary dialogue request is enhanced to obtain at least one second dialogue request, comprising: The rewritten content included in the auxiliary dialogue request is de-redundantly processed to obtain a second dialogue request including the rewritten content after the redundant information is removed.
6. The method according to claim 1, wherein: The auxiliary dialogue request is enhanced to obtain at least one second dialogue request, comprising: generating similar content, wherein the semantic similarity between the similar content and the rewritten content included in the auxiliary dialogue request is greater than a similarity threshold; A second dialog request including the similar content is generated.
7. The method according to claim 1, wherein: The auxiliary dialogue request is enhanced to obtain at least one second dialogue request, comprising: generating, by using a large language model, a response to the rewritten content included in the auxiliary dialogue request as an auxiliary response; A second dialog request is generated including the secondary response.
8. The method according to claim 1, wherein: The auxiliary dialogue request is enhanced to obtain at least one second dialogue request, comprising: Correcting one or more of grammatical, semantic, and spelling errors in the rewritten content included in the auxiliary dialogue request to obtain corrected content; A second dialog request including the correction content is generated.
9. The method according to claim 1, wherein: The auxiliary dialogue request is enhanced to obtain at least one second dialogue request, comprising: Replacing synonyms, abbreviations, and aliases in the rewritten content included in the auxiliary dialogue request to obtain replacement content; A second dialog request including the replacement content is generated.
10. A conversation device based on a knowledge base, comprising: A request acquisition module, configured to acquire a first dialogue request including question content and a dialogue context based on the first dialogue request; a determination module, configured to determine whether the first dialog request needs to be rewritten based on the dialog context; a rewriting module configured to, in response to the first dialogue request needing to be rewritten, rewrite the first dialogue request based on the dialogue context to obtain an auxiliary dialogue request, wherein the auxiliary dialogue request includes rewritten content obtained by rewriting the question content in the first dialogue request; an enhancement module, configured to enhance the auxiliary dialogue request to obtain at least one second dialogue request; The response acquisition module is configured to acquire response information from at least one knowledge base using the at least one second dialogue request as a response to the first dialogue request.
11. A computing device comprising a memory configured to store computer-executable instructions; A processor, which is configured to perform the method according to any one of claims 1 to 9 when the computer executable instructions are executed by the processor.
12. A computer-readable storage medium storing computer-executable instructions, wherein when the computer-executable instructions are executed, the method according to any one of claims 1 to 9 is executed.
13. A computer program product, characterized in that The computer program product comprises computer executable instructions which, when executed, implement the method according to any one of claims 1 to 9.