Human-computer interaction method, system, device and storage medium based on large language model
By introducing a search engine call judgment and result utilization mechanism into the large language model, and combining the summary and full-text information of search results, the problem of insufficient data in real-time scenarios and vertical fields of the large language model is solved, and the answer accuracy and system response efficiency are improved. , which improves the user experience.
Patent Information
- Application Number
- CN202311857312.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2043-12-29
AI Technical Summary
Existing large language models have poor answers and poor generalization due to insufficient data in real-time scenarios or vertical knowledge fields. In addition, due to the rapid update of Internet data, traditional machine learning methods need to re-collect and label data, resulting in lags in model knowledge and difficulty in timely development. renew.
By obtaining the user input information, it is determined whether it is necessary to call the search engine for search. If necessary, the search keywords are generated and the search engine is called to obtain the search results. The large language model is used to generate response information; if not, the large language model is directly used to generate the response. Information, combining summary and full-text information from search results to improve response quality.
It improves the accuracy of large language models in answering user questions, reduces system delays, improves the efficiency of human-computer interaction and user experience, makes up for the model's shortcomings in processing new tasks or real-time tasks, and avoids frequent calls to search engines. negative impact.
Smart Images

Figure CN117909557B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a human-computer interaction method, system, electronic device, computer program product, and computer-readable storage medium based on a large language model. Background Art
[0002] With the development of artificial intelligence technology, human-computer interaction has been widely used in many fields. As an important type of artificial intelligence model, the Large Language Model has the function of understanding and generating human language, and can be used to perform a wide range of tasks, bringing great improvements to the human-computer interaction mode and experience.
[0003] Existing large language models are usually pre-trained on massive amounts of data. However, in some real-time scenarios or some vertical knowledge fields, the lack of data may lead to model errors or poor generalization. In addition, due to the rapid update of Internet scenario data and tasks, traditional machine learning methods need to re-collect and annotate data to train the model, which makes the knowledge learned by the large language model have a certain lag, making it difficult to update the large model in a timely manner.
[0004] In response to the above problems, this specification provides a human-computer interaction method, system, electronic device, computer program product and computer-readable storage medium based on a large language model to improve the accuracy of the large language model in answering user questions and enhance the efficiency and experience of human-computer interaction. Summary of the invention
[0005] One or more embodiments of this specification provide a human-computer interaction method based on a large language model. The method includes: obtaining input information input by a user through an application terminal; based on the input information, determining whether it is necessary to call a search engine for a search to obtain a first judgment result; in response to the first judgment result indicating that the search engine needs to be called for a search: calling the search engine to search for the input information to obtain search results; based on the search results, generating first response information using the large language model to facilitate providing the first response information to the user; in response to the first judgment result indicating that it is not necessary to call the search engine for a search: generating second response information using the large language model based on the input information to facilitate providing the second response information to the user.
[0006] In some embodiments, judging whether it is necessary to call a search engine for search based on the input information to obtain a first judgment result includes: judging whether it is necessary to call the search engine for search based on the input information and generating search keywords when it is necessary to call the search engine for search to obtain the first judgment result, the first judgment result including the search keywords when it is necessary to call the search engine for search and one of the search keywords when it is necessary to call the search engine for search.
[0007] In some embodiments, in response to the first judgment result indicating the need to call the search engine for search, calling the search engine to search for the input information to obtain search results includes: calling the search engine to search according to the search keyword to obtain the search results.
[0008] In some embodiments, the method further includes: expanding the search keyword; and / or increasing the number of one or more uniform resource locators (URLs) included in the search results.
[0009] In some embodiments, the search results include summary information corresponding to one or more uniform resource locators (URLs), and generating the first response information based on the search results using the large language model includes: based on the summary information, determining whether it is necessary to obtain the full-text information corresponding to the one or more uniform resource locators (URLs) to obtain a second judgment result; in response to the second judgment result indicating that the full-text information needs to be obtained: obtaining the full-text information according to the one or more uniform resource locators (URLs); based on the full-text information, generating the first response information using the large language model; in response to the second judgment result indicating that the full-text information does not need to be obtained: generating the first response information using the large language model based on the summary information.
[0010] In some embodiments, the determining whether it is necessary to obtain the full-text information corresponding to the one or more uniform resource locators URLs based on the summary information to obtain a second determination result includes: determining whether it is necessary to obtain the full-text information corresponding to the one or more uniform resource locators URLs based on the input information, the search keywords corresponding to the input information, and one or more of the summary information to obtain the second determination result, wherein the second determination result includes one of the classification results of requiring the full-text information to be obtained and not requiring the full-text information to be obtained.
[0011] In some embodiments, judging whether it is necessary to obtain the full-text information corresponding to the one or more uniform resource locators URLs based on the summary information to obtain a second judgment result includes: determining the correlation between the summary information and the input information, and judging whether the correlation satisfies a preset condition; in response to the correlation not satisfying the preset condition, determining that it is necessary to obtain the full-text information; in response to the correlation satisfying the preset condition, determining that it is not necessary to obtain the full-text information.
[0012] In some embodiments, generating the first response information based on the full-text information using the large language model includes: generating a summary of the full-text information; and generating the first response information according to the summary using the large language model.
[0013] One or more embodiments of the present specification provide a human-computer interaction system based on a large language model, the system comprising: an acquisition module, used to acquire input information input by a user through an application terminal; a judgment module, used to judge whether it is necessary to call a search engine for search based on the input information to obtain a first judgment result; a search module, used to call the search engine to search for the input information in response to the first judgment result indicating that the search engine needs to be called for search to obtain search results; an information generation module, used to: based on the search results, generate first response information using the large language model to facilitate providing the first response information to the user; or based on the input information, generate second response information using the large language model to facilitate providing the second response information to the user.
[0014] One or more embodiments of the present specification provide an electronic device, including: a memory for storing executable instructions; and a processor for implementing a human-computer interaction method based on a large language model when executing the executable instructions stored in the memory.
[0015] One or more embodiments of the present specification provide a computer program product, including a computer program or computer executable instructions, which, when executed by a processor, implements a human-computer interaction method based on a large language model.
[0016] One or more embodiments of the present specification provide a computer-readable storage medium, wherein the storage medium stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes a human-computer interaction method based on a large language model. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] This specification will be further described in the form of exemplary embodiments, which will be described in detail by way of the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure.
[0018] Figure 1 It is a schematic diagram of an application scenario of a human-computer interaction system according to some embodiments of this specification.
[0019] Figure 2 It is an exemplary module diagram of a human-computer interaction system according to some embodiments of this specification.
[0020] Figure 3 This is an exemplary flow chart of a human-computer interaction method based on a large language model according to some embodiments of this specification.
[0021] Figure 4 This is an exemplary flowchart of using a large language model to generate response information according to some embodiments of this specification.
[0022] Figure 5 It is an exemplary flow chart of another human-computer interaction method based on a large language model according to some embodiments of this specification. DETAILED DESCRIPTION
[0023] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of this specification. For ordinary technicians in this field, this specification can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.
[0024] It should be understood that the "system", "device", "unit" and / or "module" used herein are a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.
[0025] As shown in this specification and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "comprise" and "include" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0026] Flowcharts are used in this specification to illustrate the operations performed by the system according to the embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed precisely in order. Instead, the steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or one or more operations may be removed from these processes.
[0027] Figure 1 1 is a schematic diagram of an application scenario of a human-computer interaction system according to some embodiments of this specification. In some embodiments, the human-computer interaction system 100 can be applied to one or more fields. Exemplary fields may include text summarization, translation, chatbots, etc. The human-computer interaction system 100 can determine whether to call a search engine for search by implementing the method disclosed in this specification, call the search engine for search when necessary, and then generate response information based on the search results and feed it back to the user.
[0028] In some embodiments, the application scenario of the human-computer interaction system 100 may include one or more servers 110, a network 120, one or more terminal devices 130, and one or more storage devices 140. The components in the application scenario of the human-computer interaction system 100 may be connected in various ways. For example, the storage device 140 may be directly connected to the server 110 or connected through the network 120. For another example, the server 110 may be directly connected to the terminal device 130 or connected through the network 120. For another example, the terminal device 130 may be directly connected to the storage device 140 or connected through the network 120.
[0029] In some embodiments, the server 110 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the server 110 may be local or remote. For example, the server 110 may access information and / or data stored in the terminal device 130 and / or the storage device 140 via the network 120. For another example, the server 110 may be directly connected to the terminal device 130 and / or the storage device 140 to access the stored information and / or data. In some embodiments, the server 110 may be implemented on a cloud platform. As an example only, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-layer cloud, etc., or any combination thereof. In some embodiments, the server 110 may include one or more servers, such as a server 110-1, a server 110-2, ..., a server 110-n. The server 110 may be configured to perform one or more functions, such as calling a search engine for searching, generating response information using a large language model, etc., or any combination thereof.
[0030] In some embodiments, server 110 may include one or more processing devices 112. Figure 1 As shown, server 110-1 may include processing device 112-1, server 110-2 may include processing device 112-2, ..., and server 110-n may include processing device 112-n. Processing device 112 may process information and / or data stored in a storage device (e.g., storage device 140) and / or generated by terminal device 130 to perform one or more functions described in this specification. For example, processing device 112 may determine whether it is necessary to call a search engine to search based on input information of user 150 to obtain a first judgment result. For another example, processing device 112 may call a search engine to search for input information to obtain search results. For another example, processing device 112 may generate response information based on search results (or directly based on user input information) using a large language model. By way of example only, the processing device 112 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), an application specific instruction set processor (ASIP), a graphics processing unit (GPU), a physical processing unit (PPU), a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a controller, a microcontroller unit, a reduced instruction set computer (RISC), a microprocessor, the like, or any combination thereof.
[0031] In some embodiments, at least a portion of the server 110 may be connected to the network 120 to communicate with one or more components (e.g., terminal device 130, storage device 140) of the human-computer interaction system 100. In some embodiments, at least a portion of the server 110 may be directly connected to or communicate with one or more components (e.g., terminal device 130, storage device 140) of the human-computer interaction system 100.
[0032] The network 120 can facilitate the exchange of information and / or data. In some embodiments, one or more components of the human-computer interaction system 100 (e.g., the server 110, the terminal device 130, or the storage device 140) can send information and / or data to other components of the human-computer interaction system 100 through the network 120. For example, the terminal device 130 can send the user's input information (e.g., the user's question) to the server 110 via the network 120. As another example, the processing device 112 can send the search results or the reply to the user's input information to the terminal device 130 via the network 120. In some embodiments, the network 120 can be any form of wired or wireless network, or any combination thereof. As an example only, the network 120 can include a cable network, a wired network, a fiber optic network, a telecommunications network, an intranet, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a public switched telephone network (PSTN), a Bluetooth network, a ZigBee network, a near field communication (NFC) network, etc. or any combination thereof. In some embodiments, the network 120 can include one or more network access points. For example, the network 120 may include a wired or wireless network access point through which one or more components of the human-computer interaction system 100 may connect to the network 120 to exchange data and / or information.
[0033] In some embodiments, the terminal device 130 may include a mobile device 130-1, a tablet computer 130-2, a laptop computer 130-3, a vehicle built-in device 130-4, a wearable device 130-5, etc., or any combination thereof. In some embodiments, the mobile device 130-1 may include a smart home device, a smart mobile device, a virtual reality device, an augmented reality device, etc., or any combination thereof. In some embodiments, the vehicle-mounted device 130-4 may include a vehicle-mounted computer, a vehicle-mounted TV, etc. In some embodiments, the wearable device 130-5 may include a smart bracelet, smart shoes and socks, smart glasses, smart helmets, smart watches, smart clothing, smart backpacks, smart accessories, etc., or any combination thereof. In some embodiments, the server 110 may be integrated into the terminal device 130. The terminal device 130 may be configured to facilitate communication between the user and the human-computer interaction system 100. For example, the user 150 may send a request to the human-computer interaction system 100 through the terminal device 130. For another example, the user may obtain a reply fed back by the human-computer interaction system 100 via the terminal device 130. As another example, the user may interact with the human-computer interaction system 100 by logging into an application program that is integrated with (or can communicate with) the human-computer interaction system 100 via the terminal device 130 .
[0034] The storage device 140 may store data, instructions, and / or any other information. In some embodiments, the storage device 140 may store data obtained from the server 110 or the terminal device 130. In some embodiments, the storage device 140 may store data and / or instructions, and the processing device 112 may execute or use the data and instructions to execute the exemplary method / system described in this specification. In some embodiments, the storage device 140 may include a mass storage, a removable memory, a volatile read-write memory, a read-only memory (ROM), etc., or any combination thereof. In some embodiments, the storage device 140 may be executed on a cloud platform. By way of example only, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-layer cloud, etc., or any combination thereof.
[0035] It should be noted that the human-computer interaction system 100 is provided only for the purpose of illustration and is not intended to limit the scope of the present application. For those of ordinary skill in the art, various changes and modifications can be made according to the description of the present application. However, these changes and modifications will not deviate from the scope of the present application. For example, the human-computer interaction system 100 can be configured on other devices to implement similar or different functions. For another example, the storage device 140 can be omitted from the human-computer interaction system 100. For another example, the functions of the human-computer interaction system 100 can be centrally deployed on the server side, or they can be centrally deployed on the user terminal device.
[0036] Figure 2 2 is an exemplary module diagram of a human-computer interaction system according to some embodiments of the present specification. In some embodiments, the human-computer interaction system 200 may include an acquisition module 210, a judgment module 220, a search module 230 and / or an information generation module 240. The various modules of the human-computer interaction system 200 may be configured in the terminal device 130 and / or the server 110. For example, the judgment module 220, the search module 230 and / or the information generation module 240 may be configured in the server 110. For another example, the acquisition module 210 may be configured in the terminal device 130.
[0037] The acquisition module 210 may be used to acquire input information input by a user through an application terminal.
[0038] The judgment module 220 can be used to judge whether it is necessary to call a search engine for search based on the user's input information to obtain a first judgment result. In some embodiments, the judgment module 220 can judge (for example, using the first model to judge) whether it is necessary to call a search engine for search based on the user's input information and generate a search keyword when it is necessary to call a search engine for search to obtain a first judgment result. Among them, the first judgment result can include one of the search keywords when the search engine needs to be called for search and the search engine does not need to be called for search. The input of the first model can be the user's input information. When the search engine needs to be called, the output of the first model can be a search keyword. When the search engine does not need to be called, the output of the first model can be empty or an indication that the search engine does not need to be called. In some embodiments, the first model can be a classification model. The classification model can be trained by collecting a large number of questions marked as needing to call a search engine for search and questions marked as not needing to call a search engine for search as sample data (such as "Hello" marked as not needing to be searched, "What news today" marked as needing to be searched). In some embodiments, the judgment module 220 can judge (for example, using the fifth model to judge) whether it is necessary to call a search engine for search based on the user's input information to obtain a first judgment result. The first judgment result may include one of the classification results of needing to call the search engine for searching and not needing to call the search engine for searching. The fifth model may classify whether it is necessary to call the search engine to search the input information, and the classification result is one of needing to call and not needing to call. The input of the fifth model is the user's input information, and the output is the classification result.
[0039] The search module 230 can be used to call the search engine to search for the input information in response to the first judgment result indicating that the search engine needs to be called for search, and to obtain search results. In some embodiments, if the first judgment result includes a search keyword, the search module 230 can call the search engine to search according to the search keyword and obtain search results. In some embodiments, if the first judgment result indicates that the search engine needs to be called for search but does not include a search keyword, the search module 230 can (for example, using a second model) generate a search keyword based on the input information, and call the search engine to search according to the search keyword to obtain search results. The second model can be a classification model, and the input of the second model can be one or more of the user's input information, the search keyword corresponding to the input information, and the summary information, and the output of the second model is the second judgment result. The second judgment result can include one of the classification results of needing to obtain full-text information and not needing to obtain full-text information.
[0040] In some embodiments, the information generation module 240 can be used to generate a first response message based on the search results using a large language model, so as to provide the first response message to the user. The first response message can be response information generated based on the search results (for example, a reply to a question raised by the user). For example, the user question is "What's the news today?", and the first response message is the content of the news of the day. In some embodiments, in response to the first judgment result indicating that there is no need to call a search engine for a search, the information generation module 240 can be used to generate a second response message directly based on the input information using a large language model, so as to provide the second response message to the user. The second response message can be response information generated directly based on the user's input information (for example, a reply to a question raised by the user). For example, the user question is "Hello", and the second response message is "Hello, is there anything I can help you with?"
[0041] In some embodiments, the search results may include summary information corresponding to one or more uniform resource locators (URLs). Before generating the first response information using the large language model, the judgment module 220 may determine whether it is necessary to obtain the full-text information corresponding to the aforementioned one or more uniform resource locators (URLs) based on the summary information to obtain a second judgment result. In response to the second judgment result indicating that the full-text information needs to be obtained, the acquisition module 210 may obtain the full-text information based on the aforementioned one or more uniform resource locators (URLs), and the information generation module 240 may generate the first response information based on the full-text information using the large language model. In response to the second judgment result indicating that the full-text information does not need to be obtained, the information generation module 240 may directly generate the first response information based on the summary information using the large language model.
[0042] For a detailed description of the acquisition module 210, see step 310. For a detailed description of the determination module 220, see steps 320 and 341. For a detailed description of the search module 230, see step 330. For a detailed description of the information generation module 240, see steps 340 and 350.
[0043] It should be noted that the above description of the human-computer interaction system 200 and its modules is only for convenience of description and does not limit the present specification to the scope of the embodiments. It is understandable that for those skilled in the art, after understanding the principle of the device, it is possible to arbitrarily combine the modules or form sub-devices to connect with other modules without deviating from this principle. In some embodiments, Figure 2 The modules disclosed in can be implemented on the same or different processing devices. In some embodiments, Figure 2The modules disclosed in the specification may be different modules in a system, or one module may realize the functions of two or more modules. For example, each module may share a storage module, or each module may have its own storage module. Such variations are within the scope of protection of this specification.
[0044] Figure 3 It is an exemplary flow chart of the human-computer interaction method based on the large language model shown in some embodiments of this specification. In some embodiments, process 300 can be executed by the human-computer interaction system 100 (for example, the processing device 112) or the human-computer interaction system 200. For example, process 300 can be stored in a storage device in the form of a program or instructions, and when the human-computer interaction system 100 (for example, the processing device 112) or the human-computer interaction system 200 executes the instructions, process 300 can be implemented. The operational diagram of process 300 presented below is illustrative. In some embodiments, the process can be completed using one or more additional operations not described and / or one or more operations not discussed. In addition, Figure 3 The order in which the operations of process 300 are shown and described below is not limiting. Figure 3 As shown, process 300 may include one or more of the following steps.
[0045] Step 310 , obtaining input information input by the user through the application terminal. Step 310 may be performed by the obtaining module 210 .
[0046] The application terminal may be a terminal device 130. The user's input information may be a question raised by the user. In some embodiments, the user inputs information (e.g., a question raised by the user) through the terminal device 130, so that the terminal device 130 acquires the input information. In some embodiments, the terminal device 130 may transmit the input information to the processing device 112, so that the processing device 112 acquires the input information for subsequent analysis and processing. The user may input information by voice, text, graphics, etc. In some embodiments, the acquisition module 210 may convert input information in non-text form (e.g., voice, graphics, etc.) into input information in text form for subsequent analysis and processing.
[0047] Step 320 , based on the user's input information, determines whether it is necessary to call a search engine to perform a search to obtain a first determination result. Step 320 may be performed by the determination module 220 .
[0048] In some embodiments, the user's input information (e.g., the user's question) may involve strong real-time or knowledge, and the knowledge learned by the large language model usually has a certain lag. If the large language model is directly called to reply to the input information, it may be difficult to obtain a high-quality reply content. Search engines can usually easily obtain content with high real-time or knowledge. Therefore, the combination of a large language model and a search engine can make full use of the advantages of both and provide users with higher-quality replies. However, if the user's input information is not distinguished and the search engine is directly called for search, the system reply delay may be relatively long, which has a negative impact on the user experience. Therefore, based on the user's input information, a judgment can be made as to whether it is necessary to call the search engine for search. When it is determined that the search engine needs to be called, the search engine is called for search. When it is determined that the search engine does not need to be called, the large language model is directly called to give a reply, which can improve the accuracy of the reply and effectively reduce the delay.
[0049] In some embodiments, it is possible to determine (for example, using a first model to determine) whether it is necessary to call a search engine for search based on input information, and generate search keywords when it is necessary to call a search engine for search, so as to obtain a first judgment result. The first judgment result may include one of the search keywords when it is necessary to call a search engine for search and the search engine does not need to be called for search. The input of the first model may be the user's input information. When it is necessary to call a search engine, the output of the first model may be a search keyword. When it is not necessary to call a search engine, the output of the first model may be empty, or an indication that a search engine does not need to be called. As an example, a search engine may need to be called for search, which may be a real-time or knowledge-intensive question, and a search engine may not need to be called for search, which may be a more common or conventional chat content. For example, if the user's question is "What news is there today", it is first determined whether it is necessary to call a search engine to search for what news is there today, and if it is determined that the question is a question that needs to be searched, then a corresponding search keyword (such as "news on December 1, 2023") is generated. For another example, if the user input information is "Hello", it is first determined whether it is necessary to call a search engine to search for content related to "Hello", and if it is determined that the question is a question that does not need to be searched, then a prompt indicating that no search is required.
[0050] In some embodiments, the first model may be a classification model. The classification model may be trained by collecting a large number of questions marked as requiring a search engine to be searched and questions marked as not requiring a search engine to be searched as sample data (e.g., "hello" is marked as not requiring a search, and "what's the news today" is marked as requiring a search).
[0051] In some embodiments, the first model may include two sub-models (e.g., a fifth model and a sixth model). The fifth model may classify whether it is necessary to call a search engine to search the input information, and the classification result is one of the two: the call is needed and the call is not needed. The input of the fifth model is the user's input information, and the output is the classification result. If the classification result of the fifth model is that the search engine needs to be called for search, the sixth model may generate a search keyword based on the user's input information. The input of the sixth model is the user's input information, and the output is the search keyword.
[0052] Step 330 , in response to the first judgment result indicating that a search engine needs to be called for search, the search engine is called to search for the input information to obtain search results. Step 330 may be performed by the search module 230 .
[0053] In some embodiments, when it is necessary to call a search engine, the program interface API (Application Programming Interface) of the search engine is called to search for the input information and obtain search results. In some embodiments, if the first judgment result contains a search keyword, the search engine (e.g., the API of the search engine) is called to search according to the search keyword to obtain search results. The search engine that can be called may include one or more. In some embodiments, the system may select a search engine from multiple search engines for calling according to the application scenario. The application scenario may be related to the content of the search keyword, the language type of the user input information (or search keyword), etc. For example, in an English scenario (e.g., the user enters an English question, or the search keyword is English, etc.), the system may select an overseas search engine (e.g., bing search engine) for calling. For another example, in a Chinese scenario (e.g., the user enters a Chinese question, or the search keyword is Chinese, etc.), the system may select a domestic search engine (e.g., Baidu search engine) for calling.
[0054] The search results may be the top k (k is a positive integer) search results returned by the search engine. The number k of search results may be set according to specific application scenarios and requirements. The search results may include one or more Uniform Resource Locators (URLs) and / or their corresponding summary information. The number of resource locators (URLs) is k.
[0055] Step 340 , based on the search results, using the large language model to generate first response information, so as to provide the first response information to the user. Step 340 may be performed by the information generation module 240 .
[0056] The first response information may be response information generated based on the search results (eg, a reply to a question raised by the user). After the first response information is generated, it may be sent to the terminal device 130 for the user to know.
[0057] In some embodiments, in the process of generating the first response information based on the search results using the large language model, it is possible to determine whether the current search results are sufficient for generating the first response information based on the search results (e.g., summary information). In some embodiments, if the current search results are sufficient for generating the first response information, the current search results (e.g., summary information) are directly used to generate the first response information. In some embodiments, if the current search results are insufficient to generate the first response information, the full text information corresponding to the current search results can be obtained, and then the first response information is generated based on the full text information (e.g., Figure 4 In some embodiments, if the current search results are insufficient to generate the first response information, or if the current search results cannot generate qualified first response information, the number k of resource locators URLs included in the search results may be expanded (e.g., k may be expanded to 2k, 3k, etc.), and the first response information may be generated based on the expanded search results (e.g., 2k or 3k search results); and / or, the aforementioned search keywords may be expanded, and the search may be performed again based on the expanded keywords to obtain new search results, and the first response information may be generated based on the new search results (e.g., Figure 5 For more information about generating the first response information, see Figure 4-5 and corresponding description.
[0058] Step 350 , in response to the first judgment result indicating that there is no need to call a search engine for searching, directly based on the input information, using a large language model to generate second response information, so as to provide the second response information to the user. Step 350 may be performed by the information generation module 240 .
[0059] The second response information may be response information directly generated based on the user's input information. After the second response information is generated, it may be sent to the terminal device 130 for the user to know.
[0060] In some embodiments, when there is no need to call a search engine for searching, the large language model can directly generate the second response information based on the user's input information. The input of the large language model can be the user's input information, and the output can be the response information (for example, the second response information).
[0061] In some embodiments of the present specification, by combining a large language model with a search engine, the defects or deviations of the large language model when processing new tasks or real-time tasks can be compensated, thereby improving the accuracy of the large language model; by judging whether it is necessary to call the search engine for search based on the user's input information before calling the search engine, calling the search engine for search only when it is necessary, and directly using the large language model to generate response information when it is not necessary, it is possible to avoid frequent calls to the search engine for search, reduce system latency, improve the system's response efficiency to user input information, and enhance user experience.
[0062] It should be noted that the description of process 300 is provided only for the purpose of illustration and is not intended to limit the scope of this specification. For those of ordinary skill in the art, various changes and modifications can be made according to the description of this specification. However, these changes and modifications do not depart from the scope of this specification. In some embodiments, the above process may include one or more additional operations, or one or more operations may be omitted.
[0063] Figure 4 It is an exemplary flowchart of generating response information using a large language model according to some embodiments of this specification. In some embodiments, process 400 can be executed by the human-computer interaction system 100 (e.g., processing device 112) or the human-computer interaction system 200. For example, process 400 can be stored in a storage device in the form of a program or instructions, and when the human-computer interaction system 100 (e.g., processing device 112) or the human-computer interaction system 200 executes the instructions, process 400 can be implemented. The operational diagram of process 400 presented below is illustrative. In some embodiments, the process can be completed using one or more additional operations not described and / or one or more operations not discussed. In addition, Figure 4 The order in which the operations of process 400 are shown and described below is not limiting. Figure 4 As shown, process 400 may include one or more of the following steps.
[0064] In some embodiments, after obtaining the search results in step 330, in some cases, the summary information contained in the search results may not be well used to answer the user's question (that is, it may not be possible to obtain good response information directly based on the search results). In order to improve the accuracy of the response generated by the large language model, it may be necessary to obtain the full-text information corresponding to the summary information, and then generate a response (that is, response information) based on the full-text information; and in some cases, the summary information contained in the search results is sufficient to answer the user's question. In this case, it is not necessary to obtain the full-text information corresponding to the summary information. In order to improve the efficiency of the system generating responses, the response can be generated directly based on the summary information. Therefore, in order to take into account the accuracy and latency of the system response, the system can first determine whether it is necessary to obtain the full-text information based on the search results, and then take corresponding processing methods based on the judgment results.
[0065] Step 341 , based on the search results, determines whether full-text information needs to be obtained. Step 341 may be performed by the determination module 220 .
[0066] In some embodiments, based on the summary information contained in the search results, it can be determined whether it is necessary to obtain the full-text information corresponding to the one or more uniform resource locators URLs to obtain a second judgment result. In some embodiments, the judgment process can be implemented using a model. For example, a second model can be used to determine whether it is necessary to obtain the full-text information corresponding to the one or more uniform resource locators URLs based on the user's input information, the search keywords corresponding to the input information, and one or more of the summary information to obtain a second judgment result. The second model can be a classification model, and the input of the second model can be the user's input information, the search keywords corresponding to the input information, and / or the summary information, and the output of the second model is the second judgment result. The second judgment result can include one of the classification results of needing to obtain the full-text information and not needing to obtain the full-text information.
[0067] In some embodiments, it is possible to determine whether the full text information needs to be obtained based on the correlation between the summary information and the input information. For example, the third model can be used to determine the correlation between the summary information and the input information, and determine whether the correlation meets the preset conditions; in response to the correlation not meeting the preset conditions, it is determined that the full text information needs to be obtained; in response to the correlation meeting the preset conditions, it is determined that the full text information does not need to be obtained. The input of the third model can be the user's input information, summary information, and / or the search keyword corresponding to the input information. The output of the third model can be a value representing the correlation between the summary information and the input information (for example, a probability value of needing to obtain the full text information). When the probability value meets the preset conditions (for example, the probability value is greater than or equal to the preset threshold), it indicates that the full text information needs to be obtained; when the probability value does not meet the preset conditions (for example, the probability value is less than the preset threshold), it indicates that the full text information does not need to be obtained. In some embodiments, the third model can be a large language model (for example, the same model or a different model as the large language model that generates the response information).
[0068] Step 342 , in response to the need to obtain full-text information, obtain the full-text information. Step 342 may be performed by the obtaining module 210 .
[0069] In some embodiments, in response to the need to obtain full-text information, the system may parse one or more links of uniform resource locators (URLs) contained in the aforementioned search results to obtain the full-text information.
[0070] In some embodiments, the number of resource locator URLs included in the search results is k, and in step 341, the k search results may be judged as a whole; if it is determined that full-text information needs to be obtained, then in step 342, the full-text information corresponding to each of the k search results may be obtained. In other embodiments, the number of resource locator URLs included in the search results is k, and in step 341, each of the k search results may be judged separately; if it is determined that one or more of the k search results need to obtain full-text information, then in step 342, the full-text information corresponding to one or more of the k search results may be obtained.
[0071] Step 343 , based on the full text information, using the large language model to generate the first response information. Step 343 may be performed by the information generation module 240 .
[0072] In some embodiments, a summary of the full-text information can be generated based on the full-text information, and then a first response message can be generated based on the summary. The summary can be the key content of the full-text information. In some embodiments, a summary of the full-text information can be generated (for example, using a fourth model), the input of the fourth model is the full-text information, and the output is the summary of the full-text information. In some embodiments, a large language model can be used to generate the first response information based on the summary of the full-text information, the input of the large language model is the user's input information and summary, and the output is the first response information. The fourth model can be a large language model (for example, the same model or a different model as the large language model that generates the response information), or it can be another model that can generate a summary (for example, Match-LSTM, BiDAF, QA-Net, BERT, ALBERT and other machine reading comprehension models). In other embodiments, the large language model can be directly used to generate the first response information based on the full-text information, the input of the large language model is the full-text information and the user's input information, and the output is the first response information.
[0073] Step 344 , in response to not needing to obtain the full text information, directly generating the first response information based on the summary information using the large language model. Step 344 may be performed by the information generation module 240 .
[0074] In some embodiments, in response to not needing to obtain full text information, the large language model can be directly used to generate the first response information according to the summary information. The input of the large language model is the summary information and the user's input information, and the output is the first response information.
[0075] In some embodiments of the present specification, in the process of generating response information based on search results, it is first determined whether the current search results are sufficient for generating response information. When the search results are insufficient for generating the first response information, the full-text information is obtained, and then the response information is generated based on the full-text information. When the search results are sufficient for generating response information, the response information is generated directly based on the summary information. This improves the accuracy of the system response, while reducing system latency, further enhancing the user experience.
[0076] It should be noted that the description of process 400 is provided only for the purpose of illustration and is not intended to limit the scope of this specification. For those of ordinary skill in the art, various changes and modifications can be made according to the description of this specification. However, these changes and modifications do not depart from the scope of this specification. In some embodiments, the above process may include one or more additional operations, or one or more operations may be omitted.
[0077] Figure 5It is an exemplary flowchart of another human-computer interaction method based on a large language model shown in some embodiments of this specification. In some embodiments, process 500 can be executed by the human-computer interaction system 100 (for example, the processing device 112) or the human-computer interaction system 200. For example, process 500 can be stored in a storage device in the form of a program or instructions, and when the human-computer interaction system 100 (for example, the processing device 112) or the human-computer interaction system 200 executes the instructions, process 500 can be implemented. The operational diagram of process 500 presented below is illustrative. In some embodiments, the process can be completed using one or more additional operations not described and / or one or more operations not discussed. In addition, Figure 5 The order in which the operations of process 500 are shown and described below is not limiting. Figure 5 As shown, process 500 may include one or more of the following steps.
[0078] In some embodiments, if a high-quality reply still cannot be generated after searching and obtaining the full text, the system can expand the scope of the search results in some way to increase the possibility of generating a high-quality reply.
[0079] Step 360 , based on the search results, determines whether qualified first response information can be generated. Step 360 may be performed by the determination module 220 .
[0080] In some embodiments, it can be determined based on the search results whether a qualified first response message can be generated. Step 360 can be implemented in a similar manner to step 341. The difference is that a more stringent standard can be adopted in step 360. For example, when the correlation between the summary information and the input information is high, it is also determined that the full-text information needs to be obtained. In some embodiments, it can be further determined based on the full-text information whether a qualified first response message can be generated. For example, it can be determined by analyzing the correlation between the full-text information and the input information. When it is determined that the correlation between the full-text information and the input information is high, it means that a qualified first response message can be generated. The judgment method can be similar to the method of step 341. In some embodiments, the quality of the generated first response information can be controlled by adjusting the relevant judgment criteria.
[0081] Step 370 , in response to failure to generate qualified first response information, expanding the number of one or more uniform resource locators (URLs) included in the search results. Step 370 may be performed by the acquisition module 210 or the search module 230 .
[0082] In some embodiments, if it is determined that qualified first response information cannot be generated, indicating that the aforementioned top k search results have a low correlation with the user's input information, then the number k of resource locators URLs contained in the search results can be expanded (for example, k is expanded to 2k, 3k, etc.), that is, the top 2k or top 3k search results are obtained. In some embodiments, it is possible to further determine whether qualified first response information can be generated for the expanded top 2k or top 3k search results; if so, the first response information is generated based on the expanded search results; if not, the number of search results can be expanded again (for example, from 2k or 3k to 4k or 5k search results), or the keyword can be expanded and searched again (as shown in step 380).
[0083] Step 380 , in response to failure to generate qualified first response information, expanding the search keyword. Step 380 may be performed by the acquisition module 210 or the determination module 220 .
[0084] In some embodiments, if it is determined that a qualified first response message cannot be generated, it means that the correlation between the top k search results and the user's input information is low, and further indicates that the search keywords may not be set accurately enough, then the search keywords can be expanded. The expansion method may include expanding the language type of the search keywords (for example, expanding Chinese keywords to English keywords), extracting synonyms of the search keywords, extracting other replacement words for the search keywords, etc. In some embodiments, the system can call the search engine again to search based on the expanded search keywords (as shown in step 330), and then analyze the new search results again (as shown in step 360).
[0085] In some embodiments, if step 360 determines that a qualified first response message can be generated, the first response message is generated based on the search results using a large language model (as shown in step 340). For more description of step 340, see Figure 3-4 Related description.
[0086] It is worth noting that steps 370 and 380 are optional. In some embodiments, only one of steps 370 and 380 may be performed. In some embodiments, both steps 370 and 380 may be performed, and the order of their execution is not limited (for example, step 370 may be performed first and then step 380, or step 380 may be performed first and then step 370).
[0087] In some embodiments of the present specification, by expanding the scope of search results and / or expanding search keywords, the accuracy and quality of system responses can be further improved, thereby further improving the user experience.
[0088] It should be noted that the description of process 500 is provided for illustrative purposes only and is not intended to limit the scope of this specification. For those of ordinary skill in the art, various changes and modifications can be made according to the description of this specification. However, these changes and modifications do not depart from the scope of this specification. In some embodiments, the above process may include one or more additional operations, or one or more of the above operations may be omitted. For example, after obtaining the search results in step 330, step 340 may be performed first to generate response information, and then step 360 may be performed to determine whether the quality of the response information can meet the user's needs. If the quality requirements can be met, the response information is directly provided to the user; if the quality requirements cannot be met, the scope of the search results is expanded and / or the search keywords are expanded, and then the response information is generated based on the updated search results to improve the quality of the reply.
[0089] The large language model in this specification can be any large language model (for example, GPT, BERT, T5, ERNIE, etc.). The large language model is configured to generate response information (for example, second response information) directly based on the user's input information; generate response information (for example, first response information) based on summary information and input information; generate summary based on full-text information; generate response information (for example, first response information) based on summary and input information; generate response information (for example, first response information) based on full-text information and input information. The large language model training process may include pre-training and targeted training using question-answer pairs. During the pre-training process, the large language model can learn based on a large amount of corpus and predict the next word; during the targeted training process, the large language model can learn based on question-answer pairs, and the trained large language model can respond to the user's questions. This specification does not limit the function, type, or form of the large language model.
[0090] The beneficial effects that may be brought about by the embodiments of this specification include but are not limited to: (1) by combining a large language model with a search engine, the defects or deviations of the large language model when processing new tasks or real-time tasks can be compensated, thereby improving the accuracy of the large language model; (2) by judging whether it is necessary to call the search engine for search based on the user's input information before calling the search engine, calling the search engine for search only when it is necessary, and directly using the large language model to generate response information when it is not necessary, it is possible to avoid frequent calls to the search engine for search, reduce system latency, improve the system's response efficiency to user input information, and enhance user experience; (3) in the process of generating response information based on search results, first judge whether the current search results are sufficient for generating response information. When the search results are insufficient for generating the first response information, obtain the full text information, and then generate the response information based on the full text information. When the search results are sufficient for generating the response information, directly generate the response information based on the summary information, thereby improving the accuracy of the system response, while reducing the system latency and further enhancing the user experience; (4) by expanding the scope of search results and / or expanding search keywords, the accuracy and quality of the system response can be further improved. It should be noted that different embodiments may produce different beneficial effects. In different embodiments, the beneficial effects that may be produced may be any one or a combination of the above, or any other beneficial effects that may be obtained.
[0091] The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is only for example and does not constitute a limitation of this specification. Although not explicitly stated here, those skilled in the art may make various modifications, improvements and corrections to this specification. Such modifications, improvements and corrections are suggested in this specification, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of this specification.
[0092] At the same time, this specification uses specific words to describe the embodiments of this specification. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of this specification. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different positions in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures or characteristics in one or more embodiments of this specification can be appropriately combined.
[0093] In addition, unless explicitly stated in the claims, the order of the processing elements and sequences described in this specification, the use of alphanumeric characters, or the use of other names are not intended to limit the order of the processes and methods of this specification. Although the above disclosure discusses some invention embodiments that are currently considered useful through various examples, it should be understood that such details are only for illustrative purposes, and the attached claims are not limited to the disclosed embodiments. On the contrary, the claims are intended to cover all modifications and equivalent combinations that are consistent with the essence and scope of the embodiments of this specification. For example, although the system components described above can be implemented by hardware devices, they can also be implemented only by software solutions, such as installing the described system on an existing server or mobile device.
[0094] Similarly, it should be noted that in order to simplify the description disclosed in this specification and thus help understand one or more embodiments of the invention, in the above description of the embodiments of this specification, multiple features are sometimes combined into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the subject matter of this specification are more than the features mentioned in the claims. In fact, the features of the embodiments are less than all the features of the single embodiment disclosed above.
[0095] Finally, it should be understood that the embodiments described in this specification are only used to illustrate the principles of the embodiments of this specification. Other variations may also fall within the scope of this specification. Therefore, as an example and not a limitation, alternative configurations of the embodiments of this specification may be considered consistent with the teachings of this specification. Accordingly, the embodiments of this specification are not limited to the embodiments explicitly introduced and described in this specification.
Claims
1. A human-computer interaction method based on a large language model, characterized in that: The method comprises: Obtain input information entered by the user through the application terminal; Based on the input information, determining whether it is necessary to call a search engine to perform a search to obtain a first determination result; In response to the first judgment result indicating that the search engine needs to be called to perform a search: Invoke the search engine to search for the input information to obtain search results; Based on the search results, generating first response information using the large language model, so as to provide the first response information to the user; In response to the first judgment result indicating that it is not necessary to call the search engine to perform the search: Based on the input information, generate second response information using the large language model, so as to provide the second response information to the user; The search results include summary information corresponding to one or more uniform resource locators (URLs); The method of generating the first response information based on the search results using the large language model includes: taking the summary information corresponding to the one or more uniform resource locators URLs in the search results as a whole, judging whether it is necessary to obtain the full-text information corresponding to the one or more uniform resource locators URLs to obtain a second judgment result; in response to the second judgment result indicating that the full-text information needs to be obtained: obtaining the full-text information according to each uniform resource locator URL in the one or more uniform resource locators URLs; generating the first response information based on the full-text information using the large language model; in response to the second judgment result indicating that the full-text information does not need to be obtained: generating the first response information based on the summary information using the large language model information; or including: separately judging the summary information corresponding to the one or more uniform resource locators URLs in the search results, and judging whether it is necessary to obtain the full-text information corresponding to at least one uniform resource locator URL in the one or more uniform resource locators URLs, so as to obtain a second judgment result; in response to the second judgment result indicating that the full-text information needs to be obtained: obtaining the full-text information according to at least one uniform resource locator URL in the one or more uniform resource locators URLs; based on the full-text information, generating the first response information by using the large language model; in response to the second judgment result indicating that the full-text information does not need to be obtained: generating the first response information by using the large language model based on the summary information.
2. The method according to claim 1, characterized in that The step of determining whether it is necessary to call a search engine to perform a search based on the input information to obtain a first determination result includes: Based on the input information, determine whether it is necessary to call the search engine for search and generate search keywords when it is necessary to call the search engine for search, so as to obtain the first judgment result, wherein the first judgment result includes the search keywords when it is necessary to call the search engine for search and one of the search keywords when it is not necessary to call the search engine for search.
3. The method according to claim 2, characterized in that In response to the first judgment result indicating that the search engine needs to be called for searching, calling the search engine to search for the input information to obtain search results includes: The search engine is called to search according to the search keyword to obtain the search result.
4. The method according to claim 2, characterized in that The method further comprises: Expand the search keywords; and / or The number of one or more uniform resource locators (URLs) included in the search results is expanded.
5. The method according to claim 1, characterized in that The determining, based on the summary information, whether it is necessary to obtain full-text information corresponding to the one or more uniform resource locators URLs to obtain a second determination result includes: Based on the input information, the search keywords corresponding to the input information, and one or more of the summary information, determine whether it is necessary to obtain the full-text information corresponding to the one or more uniform resource locators URLs to obtain the second judgment result, wherein the second judgment result includes one of the classification results of needing to obtain the full-text information and not needing to obtain the full-text information.
6. The method according to claim 1, characterized in that The determining, based on the summary information, whether it is necessary to obtain full-text information corresponding to the one or more uniform resource locators URLs to obtain a second determination result includes: Determining the correlation between the summary information and the input information, and judging whether the correlation satisfies a preset condition; In response to the relevance not satisfying the preset condition, determining that the full-text information needs to be acquired; In response to the relevance satisfying the preset condition, it is determined that there is no need to obtain the full-text information.
7. The method according to claim 1, wherein generating the first response information based on the full-text information and using the large language model comprises: generating a summary of the full-text information; The first response information is generated according to the summary using the large language model.
8. A human-computer interaction system based on a large language model, characterized in that: The system comprises: An acquisition module, used to acquire input information input by a user through an application terminal; A judgment module, used for judging whether it is necessary to call a search engine to search based on the input information to obtain a first judgment result; A search module, configured to, in response to the first judgment result indicating that the search engine needs to be called for searching, call the search engine to search for the input information to obtain search results; Information generation module, used to: Based on the search results, generating first response information using the large language model, so as to provide the first response information to the user; or Based on the input information, generate second response information using the large language model, so as to provide the second response information to the user; The search results include summary information corresponding to one or more uniform resource locators (URLs); The information generation module is further used to: take the summary information corresponding to the one or more uniform resource locator URLs in the search results as a whole, and judge whether it is necessary to obtain the full-text information corresponding to the one or more uniform resource locator URLs to obtain a second judgment result; in response to the second judgment result indicating that the full-text information needs to be obtained: obtain the full-text information according to each uniform resource locator URL in the one or more uniform resource locator URLs; based on the full-text information, generate the first response information using the large language model; in response to the second judgment result indicating that the full-text information does not need to be obtained: generate the first response information using the large language model based on the summary information; or further used to : separately judging the summary information corresponding to the one or more uniform resource locators URLs in the search results, and judging whether it is necessary to obtain the full-text information corresponding to at least one uniform resource locator URL among the one or more uniform resource locators URLs, so as to obtain a second judgment result; in response to the second judgment result indicating that the full-text information needs to be obtained: obtaining the full-text information according to at least one uniform resource locator URL among the one or more uniform resource locators URLs; based on the full-text information, generating the first response information by using the large language model; in response to the second judgment result indicating that the full-text information does not need to be obtained: generating the first response information by using the large language model based on the summary information.
9. An electronic device, characterized in that: include: A memory for storing executable instructions; The processor is used to implement the human-computer interaction method based on a large language model according to any one of claims 1 to 7 when executing the executable instructions stored in the memory.
10. A computer program product comprising a computer program or computer executable instructions, characterized in that: When the computer program or computer executable instruction is executed by a processor, the human-computer interaction method based on a large language model according to any one of claims 1 to 7 is implemented.
11. A computer-readable storage medium, wherein the storage medium stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes the human-computer interaction method based on a large language model as described in any one of claims 1 to 7.
