Human-computer interaction method, device, electronic device and storage medium
By determining the target plug-in from the large language model and generating the spliced dialogue text, the problem of processing new data and plug-in selection in the large language model is solved, improving the processing efficiency and accuracy of the dialogue system, and improving the user experience.
Patent Information
- Application Number
- CN202311433823.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2043-10-31
AI Technical Summary
Large language models cannot accurately answer questions when processing new data outside of training data. As the number of plug-ins increases, it is difficult for users to choose the plug-ins they need at low cost, and the dialogue system processing time is extended and the accuracy of responses decreases.
By determining the target plug-in related to the user input dialogue text from multiple plug-ins registered in the large language model, generating the dialogue text spliced with the plug-in description, and inputting it into the large language model to improve processing efficiency and accuracy.
It effectively improves the user experience, reduces the processing time and error rate of the dialogue system, and improves the usability and credibility of the dialogue system.
Smart Images

Figure CN117332068B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to the field of deep learning, natural language processing, and large model technology. Background Art
[0002] The conversation system based on the large language model is an intelligent system that can simulate human conversations and is built using deep learning and natural language processing technologies. By learning and training on a large amount of text data, it can capture the nuances of natural language and better understand user input, thereby generating more natural responses. Summary of the invention
[0003] The present disclosure provides a human-computer interaction method, device, electronic device and storage medium.
[0004] According to one aspect of the present disclosure, a human-computer interaction method is provided, comprising: in response to a human-computer interaction request, based on a first dialogue text included in the human-computer interaction request, determining a first target plug-in related to the first dialogue text from a plurality of plug-ins registered in a large language model; obtaining a second dialogue text based on the first dialogue text and a description text of the first target plug-in; and inputting the second dialogue text into the large language model to obtain a reply text.
[0005] According to another aspect of the present disclosure, a human-computer interaction device is provided, including: a determination module, for responding to a human-computer interaction request, and determining a first target plug-in related to the first dialogue text included in the human-computer interaction request from multiple plug-ins registered in a large language model; a first processing module, for obtaining a second dialogue text based on the first dialogue text and a description text of the first target plug-in; and a first input module, for inputting the second dialogue text into the large language model to obtain a reply text.
[0006] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.
[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method as described above.
[0008] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method described above when executed by a processor.
[0009] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0011] Figure 1 An exemplary system architecture to which the human-computer interaction method and apparatus according to an embodiment of the present disclosure can be applied is schematically shown.
[0012] Figure 2 The flowchart of the human-computer interaction method according to the embodiment of the present disclosure is schematically shown.
[0013] Figure 3A The following is a schematic diagram schematically showing a matching process of a first target plug-in according to an embodiment of the present disclosure.
[0014] Figure 3B The following is a schematic diagram schematically showing a matching process of a first target plug-in according to another embodiment of the present disclosure.
[0015] Figure 4A The following is a schematic diagram of a reply text generation process according to an embodiment of the present disclosure.
[0016] Figure 4B The following is a schematic diagram of a reply text generation process according to another embodiment of the present disclosure.
[0017] Figure 5 A flowchart of a human-computer interaction method according to another embodiment of the present disclosure is schematically shown.
[0018] Figure 6 A block diagram of a human-computer interaction device according to an embodiment of the present disclosure is schematically shown.
[0019] Figure 7 A schematic block diagram of an example electronic device that can be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0020] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0021] With the continuous development of artificial intelligence technology, dialogue systems, as one of the important application fields, have been widely used in human-computer interaction, intelligent customer service, intelligent assistants and other fields. Among them, large language models, as an important part of dialogue systems, play a vital role in dialogue systems.
[0022] The realization of large language models mainly relies on deep learning technology and natural language processing technology. Among them, deep learning technology learns and trains the input text data through multi-layer neural networks and back propagation algorithms to obtain output results. Natural language processing technology processes and understands the input natural language through the processing and analysis of text data, thereby realizing the functions of the dialogue system.
[0023] In actual application, the large language model has the common defect of artificial neural networks, that is, it cannot accurately answer questions about new data outside the training data set. To solve this defect, relevant technical personnel began to configure plug-ins for the large language model. The plug-in can become the "eyes and ears" of the large language model, allowing the large language model to access new, private or specific information that is not included in the training data, so that the large language model can better serve users. On the other hand, the plug-in can also combine the large language model's powerful content generation and context understanding capabilities to broaden the application field of the large language model and increase the credibility of the generated results. In addition, the plug-in can also enable the large language model to perform safe and restricted operations on behalf of the user, improving the practicality of the entire system.
[0024] In the related plug-in management method, the user needs to manually select the required plug-in. When the user is having a conversation, the conversation system can input the plug-in description of the user's selected plug-in into the large language model in the form of a prompt word, that is, insert the plug-in description of the user's selected plug-in into the context of the user's input conversation content, and then input the processed conversation content into the large language model. The large language model can determine which plug-in is needed for the current input conversation content, and then call the corresponding plug-in to complete the relevant functions.
[0025] As the number of plug-ins configured in the large language model increases, for example, tens of thousands of plug-ins may be configured, and the large number of plug-ins will make it impossible for users to choose the plug-ins they need at a low cost. On the other hand, in the process of multiple rounds of dialogue between the dialogue system based on the large language model and the user, the input dialogue content and output reply content of the historical dialogue will be added to the context of the subsequent dialogue, so that the dialogue content of the new round of dialogue has a longer context. If the plug-in descriptions of the multiple plug-ins selected by the user are inserted into the context of the dialogue content input by the user, the text actually input into the large language model will be too long, and even exceed the token number limit of the large language model for the input content, which will make the processing time of the large language model longer and the accuracy of the output reply content will decrease.
[0026] In view of this, the embodiments of the present disclosure provide a human-computer interaction method, device, electronic device and storage medium to at least partially solve the above problems. The human-computer interaction method includes: in response to a human-computer interaction request, based on a first dialogue text included in the human-computer interaction request, determining a first target plug-in related to the first dialogue text from multiple plug-ins registered in a large language model; based on the first dialogue text and the description text of the first target plug-in, obtaining a second dialogue text; and inputting the second dialogue text into the large language model to obtain a reply text.
[0027] Figure 1 An exemplary system architecture to which the human-computer interaction method and apparatus according to an embodiment of the present disclosure can be applied is schematically shown.
[0028] It should be noted that Figure 1 The examples shown are only examples of system architectures to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios. For example, in another embodiment, the exemplary system architecture to which the human-computer interaction method and apparatus can be applied may include a terminal device, but the terminal device may implement the human-computer interaction method and apparatus provided by the embodiments of the present disclosure without interacting with the server.
[0029] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0030] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0031] The client application of the dialogue system may be installed on the terminal devices 101, 102, 103. The dialogue system may be a dialogue system based on a large language model. The user may use the client application on the terminal devices 101, 102, 103 to perform text processing using the large language model.
[0032] The server 105 may be a server or a cloud server that provides various services. The server 105 may be installed with a backend application of the dialog system.
[0033] It should be noted that the human-computer interaction method provided in the embodiment of the present disclosure can generally be executed by the terminal device 101, 102, or 103. Accordingly, the human-computer interaction apparatus provided in the embodiment of the present disclosure can also be set in the terminal device 101, 102, or 103.
[0034] Alternatively, the human-computer interaction method provided in the embodiment of the present disclosure may also be generally executed by the server 105. Accordingly, the human-computer interaction device provided in the embodiment of the present disclosure may generally be arranged in the server 105. The human-computer interaction method provided in the embodiment of the present disclosure may also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the human-computer interaction device provided in the embodiment of the present disclosure may also be arranged in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0035] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0036] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0037] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0038] Figure 2 The flowchart of the human-computer interaction method according to the embodiment of the present disclosure is schematically shown.
[0039] like Figure 2As shown, the method includes operations S210 to S230.
[0040] In operation S210 , in response to a human-computer interaction request, based on a first dialogue text included in the human-computer interaction request, a first target plug-in related to the first dialogue text is determined from a plurality of plug-ins registered in a large language model.
[0041] In operation S220, a second dialogue text is obtained based on the first dialogue text and the description text of the first target plug-in.
[0042] In operation S230, the second conversation text is input into the large language model to obtain a reply text.
[0043] According to an embodiment of the present disclosure, a human-computer interaction request can be triggered when a user uses a dialogue system to conduct a dialogue. The dialogue system can be configured with information input interfaces such as a text input control and an audio input control. For example, a user can enter a dialogue text in a text box included in the text input control. After completing the input of the dialogue text, the user can click the send button included in the text input control to input the dialogue text into the dialogue system. The dialogue system can trigger the human-computer interaction request when receiving the dialogue text. For another example, a user can press a dialogue button included in an audio input control, and input audio information through an audio receiving device configured by an electronic device loaded with the dialogue system. The input audio information can be converted into a dialogue text by natural language processing. After the user releases the dialogue button, the converted dialogue text can be input into the dialogue system. The dialogue system can trigger the human-computer interaction request when receiving the dialogue text. The dialogue system as described above can be a dialogue system based on a large language model, that is, in the dialogue system, a large language model can be used to process the received dialogue text.
[0044] According to an embodiment of the present disclosure, the first dialogue text is the dialogue text received by the dialogue system when the human-computer interaction request is triggered.
[0045] According to an embodiment of the present disclosure, a developer can pre-register multiple plug-ins for a large language model. After completing the registration of the plug-in, the large language model can use the description text of the plug-in to call the plug-in. The description text of the plug-in may include, for example, a functional description text of the plug-in, an example of the use of the plug-in, and the like. The functional description text may be used to explain the role of the plug-in. For example, for a weather query plug-in, the functional description text of the plug-in may be, for example, "the plug-in may output weather conditions based on the city and date input by the user". The use examples of the plug-in may include, but are not limited to, correct use examples and incorrect use examples of the plug-in. Each use example may at least include the form of the user's input text and the form of the large language model output text. For example, for a weather query plug-in, the use example of the weather query plug-in may be "input: query the weather of city A on day D of month C of year B; output: the weather of city A on day D of month C of year B is sunny, the temperature is E℃, the relative humidity is F%, and the wind force level is G". The large language model calls the plug-in to process the dialogue text, which may be to adjust the dialogue text to the same text form as the input of the use example, and then use the plug-in to process based on the adjusted dialogue text to obtain the output text of the plug-in.
[0046] According to an embodiment of the present disclosure, a first target plug-in is determined from multiple plug-ins. For example, the dialog text is matched with the text of the input part of the usage example included in the description text of the plug-in, and the plug-in with the highest matching degree is determined. The plug-in with the highest matching degree is the first target plug-in.
[0047] According to an embodiment of the present disclosure, the second dialogue text can be obtained by splicing the first dialogue text and the description text of the first target plug-in. Alternatively, the first dialogue text and the description text of the first target plug-in can be filled into the same text template to obtain the second dialogue text. Alternatively, the first dialogue text and the description text of the first target plug-in can be reconstructed using a large language model to obtain the second dialogue text. The second dialogue text can include the text content and feature information of the first dialogue text, and the text content and feature information of the description text of the first target plug-in. The second dialogue text can be used as the text actually input into the large language model.
[0048] According to an embodiment of the present disclosure, as an optional implementation, in response to a human-computer interaction request, it can also be detected whether the first dialogue text can be implemented using the function of the large language model itself. In the case where it is determined that the first dialogue text can be implemented using the function of the large language model itself, the large language model can be directly used to process the first dialogue text to obtain a reply text. In the case where it is determined that the first dialogue text cannot be implemented using the function of the large language model itself, the text content of the first dialogue text can be used to match the most appropriate first target plug-in, and then the function of the first target plug-in can be used to achieve the generation of the reply text.
[0049] According to an embodiment of the present disclosure, when a user inputs a new dialogue text into the dialogue system to trigger a human-computer interaction request, the most relevant first target plug-in can be matched from multiple registered plug-ins based on the text content of the first dialogue text, and the second dialogue text obtained by fusing the first dialogue text and the description text of the first target plug-in is input into the large language model to obtain a reply text corresponding to the first dialogue text. By matching plug-ins based on the text content of the first dialogue text, the user no longer needs to actively select the required plug-in during the dialogue, thereby effectively improving the user experience. At the same time, by screening the plug-ins, the dialogue system does not need to splice too many plug-in description texts in the context of the dialogue text, thereby effectively reducing the length of the text actually input into the large language model and improving the processing efficiency and accuracy of the large language model.
[0050] Reference below Figure 3A to Figure 3B , Figure 4A to Figure 4B and Figure 5 , combined with specific embodiments Figure 2 The method shown is further explained.
[0051] According to an embodiment of the present disclosure, in order to satisfy the call of the large language model to the plug-in, the plug-in needs to be registered in the large language model. When registering the plug-in, an index can be established based on the description of the plug-in, and then when performing human-computer interaction, the plug-in can be matched based on the index.
[0052] According to an embodiment of the present disclosure, taking the plug-in to be registered as the third target plug-in as an example, the plug-in registration process may include the following operations:
[0053] In response to the plug-in registration request, index information of the third target plug-in is generated based on the description text of the third target plug-in included in the plug-in registration request; and the index information of the third target plug-in is written into the plug-in information library.
[0054] According to an embodiment of the present disclosure, a plug-in registration request can be actively triggered by a user. Specifically, the user can import the third target plug-in to be registered into the dialogue system and trigger the plug-in registration request through command line instructions, plug-in registration controls on the front-end page of the dialogue system, etc.
[0055] According to an embodiment of the present disclosure, the form of the plug-in index information is not limited herein. For example, the plug-in index information may include one or more keywords, which may be extracted from the description text of the plug-in. For another example, the plug-in index information may be represented as a vector, which may be a feature vector obtained based on the description text of the plug-in.
[0056] According to an embodiment of the present disclosure, the plug-in information library may be any type of database, or the plug-in information library may also be represented as a data structure in other forms, which is not limited herein.
[0057] According to an embodiment of the present disclosure, corresponding to the registration process of the plug-in, when matching the plug-in, the index information of each plug-in in the plug-in information library can also be used to achieve plug-in matching. Specifically, based on the first dialogue text included in the human-computer interaction request, determining the first target plug-in related to the first dialogue text from multiple plug-ins registered in the large language model can include the following operations:
[0058] The respective index information of the plurality of plug-ins is obtained from the plug-in information library; the first dialogue text is matched with the respective index information of the plurality of plug-ins to obtain a plurality of matching results; and based on the plurality of matching results, a first target plug-in is determined from the plurality of plug-ins.
[0059] Figure 3A The following is a schematic diagram schematically showing a matching process of a first target plug-in according to an embodiment of the present disclosure.
[0060] like Figure 3A As shown, the large language model may be configured with N registered plug-ins 301, which may be respectively represented as plug-in 1, plug-in 2, ..., plug-in N. N index information 303 corresponding to the N plug-ins 301 may be recorded in the plug-in information library 302, for example, index information 1 corresponding to plug-in 1, index information 2 corresponding to plug-in 2, index information N corresponding to plug-in N, etc.
[0061] According to an embodiment of the present disclosure, the first conversation text 304 can be used to match the N index information 303 respectively to obtain N matching results 305. For example, the first conversation text 304 can be used to match the index information 1 to obtain the matching result 1, and the first conversation text 304 can be used to match the index information 2 to obtain the matching result 2, etc.
[0062] According to an embodiment of the present disclosure, the N matching results 305 can all be represented as numerical values within a fixed interval, and based on the calculation method of the matching results, the probability of matching represented by the matching results and the numerical value of the matching results have a fixed corresponding relationship. For example, the N matching results can all be between 0 and 1, and the closer the numerical value of the matching result is to 1, the more the matching result can represent that the first conversation text and the plug-in match. Determining the first target plug-in 306 based on the N matching results is to compare the sizes of the N matching results to determine the matching result with the largest numerical value, and the plug-in corresponding to the matching result with the largest numerical value is the first target plug-in 306.
[0063] According to an embodiment of the present disclosure, a specific calculation method of the matching result may be related to a generation method and form of the index information when the plug-in is registered.
[0064] For example, when registering a plug-in, feature extraction can be performed on the description text of the plug-in to obtain a feature vector of the description text, and the index information of the plug-in can be generated based on the feature vector, that is, the index information of the plug-in can include the feature vector of the description text of the plug-in. Matching the first conversation text with the respective index information of multiple plug-ins to obtain multiple matching results can include the following operations:
[0065] Perform feature extraction on the first dialogue text to obtain a feature vector of the first dialogue text; perform similarity calculation on the feature vector of the first dialogue text and the feature vectors of the description texts of the multiple plug-ins to obtain multiple similarity calculation results; and obtain multiple matching results based on the multiple similarity calculation results.
[0066] According to an embodiment of the present disclosure, similarity calculation may be implemented by using any method for calculating similarity between vectors, and any method for calculating similarity between vectors may include but is not limited to a cosine similarity calculation method, a correlation coefficient method, and the like.
[0067] According to an embodiment of the present disclosure, the larger the value of the similarity calculation result is, the higher the similarity between the feature vector of the first dialogue text and the feature vector of the description text of the corresponding plug-in is, and the corresponding matching result is also represented as a better match.
[0068] For another example, when registering a plug-in, keyword extraction can be performed on the description text of the plug-in to obtain at least one keyword of the description text, and the index information of the plug-in can be generated based on the at least one keyword, that is, the index information of the plug-in can include at least one keyword related to the description text of the plug-in. Matching the first conversation text with the respective index information of multiple plug-ins to obtain multiple matching results can include the following operations:
[0069] Keyword extraction is performed on the first dialogue text to obtain keywords related to the first dialogue text; and the keywords related to the first dialogue text are matched with at least one keyword related to the description texts of the multiple plug-ins to obtain multiple matching results.
[0070] According to an embodiment of the present disclosure, the similarity between the index information of the plug-in and the first dialogue text can be determined based on the number of keyword hits, that is, the matching result can be expressed as the number of hit keywords. For example, keyword extraction is performed on the description text of plug-in α, and keyword a, keyword b, keyword c, and keyword d can be obtained. Similarly, keyword extraction is performed on the first dialogue text, and keyword b, keyword d, and keyword e can be obtained. Since plug-in α and the first dialogue text include both keyword b and keyword d, the matching result obtained by matching the first dialogue text with plug-in α can be expressed as 2.
[0071] According to an embodiment of the present disclosure, by setting index information for a plug-in when registering the plug-in, fast plug-in matching can be achieved based on the index information during plug-in matching, thereby effectively improving the matching accuracy of the plug-in and improving the efficiency of the plug-in matching operation.
[0072] According to the embodiments of the present disclosure, each plug-in may have its own problem type that can be processed, for example, plug-in 1 may be used to solve mathematical calculation problems, plug-in 2 may be used to solve weather query problems, etc. Based on this, multiple registered plug-ins may be grouped and processed based on the problems they can solve. For example, the weather query plug-in and the humidity query plug-in are all for solving the problem of how to query the climate, so the weather query plug-in and the humidity query plug-in may be classified into one category, and the plug-in types of the weather query plug-in and the humidity query plug-in are determined to be climate plug-ins.
[0073] According to an embodiment of the present disclosure, as an optional implementation, the amount of index information contained in the plug-in information library can be large. At this time, plug-in matching based on index information may still take a long time. Therefore, before plug-in matching based on index information, plug-ins can be initially screened based on plug-in types.
[0074] Figure 3B The following is a schematic diagram schematically showing a matching process of a first target plug-in according to another embodiment of the present disclosure.
[0075] like Figure 3B As shown, the large language model may be configured with N registered plug-ins 301 , and the plug-in information library 302 may record N index information 303 corresponding to the N plug-ins 301 .
[0076] According to an embodiment of the present disclosure, plug-in type information 307 related to the first dialogue text 304 can be determined based on the first dialogue text 304. Based on the plug-in type information 307, at least one second target plug-in 308 can be determined from the N plug-ins 301. That is, the plug-in type of each of the at least one second target plug-in 308 is consistent with the plug-in type represented by the plug-in type information 307. After determining the at least one second target plug-in 308, the index information 303 of each of the at least one second target plug-in 308 can be obtained from the plug-in information library 302. The first dialogue text 304 is matched with the index information 303 of each of the at least one second target plug-in 308 to obtain at least one matching result 305. Based on the at least one matching result 305, the first target plug-in 306 can be determined from the at least one second target plug-in 308.
[0077] According to an embodiment of the present disclosure, the process of matching at least one second target plug-in and the process of determining the first target plug-in from at least one second target plug-in can be implemented using the method of matching multiple plug-ins and the method of determining the first target plug-in from multiple plug-ins as described above, which will not be repeated here.
[0078] According to an embodiment of the present disclosure, by preliminarily screening plug-ins based on plug-in types before plug-in matching based on index information, the computing resources consumed by the plug-in matching process can be effectively reduced and the processing efficiency can be improved.
[0079] According to an embodiment of the present disclosure, after the first target plug-in is determined, the text actually input into the large language model, ie, the second dialog text, may be obtained based on the first dialog text and the description text of the first target plug-in.
[0080] According to an embodiment of the present disclosure, a second dialogue text can be generated based on the first dialogue text and the description text of the first target plug-in by direct splicing, that is, the description text of the first target plug-in can be spliced in the context of the first dialogue text to obtain the second dialogue text.
[0081] According to an embodiment of the present disclosure, for example, the first dialogue text may be “Please help me calculate what 256 times 4 equals”, and the first target plug-in matched based on the first dialogue text may be a mathematical calculation plug-in, and the description text of the mathematical calculation plug-in may be “a mathematical calculation plug-in that can input an expression consisting of numbers and operators and output a calculation result”, and the description text of the first target plug-in is spliced into the context of the first dialogue text, and the obtained second dialogue text may be expressed as “a mathematical calculation plug-in that can input an expression consisting of numbers and operators and output a calculation result. Please help me calculate what 256 times 4 equals”.
[0082] According to an embodiment of the present disclosure, a template-based splicing method can also be used to generate a second dialogue text based on the first dialogue text and the description text of the first target plug-in, that is, the first dialogue text and the description text of the first target plug-in can be respectively filled into the first prompt template to obtain the second dialogue text.
[0083] According to an embodiment of the present disclosure, the first prompt template can be a text template set by the user, having one or more replaceable text paragraphs, and the language expression is suitable for inputting a large language model. The replaceable text paragraph can be represented as an information slot in the first prompt template. For example, the first prompt template can include two information slots, namely a first text information slot and a plug-in information slot, the first text information slot is suitable for filling in the dialogue text input by the user, and the plug-in information slot is suitable for filling in the description text of the plug-in. The second dialogue text generated based on the first prompt template can be used to guide the large language model to call the plug-in and process the text.
[0084] According to an embodiment of the present disclosure, for example, the first prompt template may be expressed as "You can answer the question by using the following plug-in: [insert text 1]. Given the following question: [insert text 2]". In the first prompt template, "[insert text 1]" represents the plug-in information slot, and "[insert text 2]" represents the first text information slot. The first dialogue text may be "Please help me calculate what 256 times 4 equals", and the first target plug-in matched based on the first dialogue text may be a mathematical calculation plug-in, and the description text of the mathematical calculation plug-in may be "a mathematical calculation plug-in that can input an expression consisting of numbers and operators and output the calculation result". The first dialogue text may be filled into the first text information slot, and the description text of the first target plug-in may be filled into the plug-in information slot to obtain the second dialogue text. The obtained second dialogue text may be expressed as "You can answer the question by using the following plug-in: a mathematical calculation plug-in that can input an expression consisting of numbers and operators and output the calculation result. Given the following question: Please help me calculate what 256 times 4 equals".
[0085] According to an embodiment of the present disclosure, after the second dialogue text is generated, the large language model can be used to call the first target plug-in to process the second dialogue text to obtain a reply text.
[0086] According to an embodiment of the present disclosure, the output text obtained by the first target plug-in after processing the second dialogue text may be a text with actual meaning or specific meaning, and the output text may be directly used as the reply text of the large language model. That is, the second dialogue text may be input into the large language model, so as to use the large language model to call the first target plug-in based on the description text of the first target plug-in included in the second dialogue text, and process the first dialogue text included in the second dialogue text to obtain the reply text.
[0087] Figure 4A The following is a schematic diagram of a reply text generation process according to an embodiment of the present disclosure.
[0088] like Figure 4A As shown, the second dialogue text 401 can be input into the large language model 402. The large language model can call the first target plug-in 403 to process the first dialogue text 4012 included in the second dialogue text 401 based on the description text 4011 included in the second dialogue text 401, and the processing result of the first target plug-in 403 is the reply text 404 of the large language model 402.
[0089] For example, the second dialogue text may be expressed as "You can answer questions by using the following plug-ins: Mathematical calculation plug-in, which can input expressions consisting of numbers and operators and output calculation results. Given the following question: Please help me calculate what 256 times 4 equals". After the second dialogue text is input into the large language model, the large language model may determine that the plug-in to be called is the mathematical calculation plug-in based on the description text "Mathematical calculation plug-in, which can input expressions consisting of numbers and operators and output calculation results" contained in the second dialogue text, and then use the mathematical calculation plug-in to process the first dialogue text "Please help me calculate what 256 times 4 equals" contained in the second dialogue text. After processing, the output text "1024" may be obtained, and the output text may be directly used as the reply text of the large language model.
[0090] According to an embodiment of the present disclosure, as an optional implementation, the processing result output by the first target plug-in can be input into the large language model again to utilize the text processing capability of the large language model to output a reply text that is closer to the expected expression form. For example, the second dialogue text can be input into the large language model to utilize the large language model to call the first target plug-in based on the description text of the first target plug-in included in the second dialogue text, process the first dialogue text included in the second dialogue text to obtain the initial reply text; obtain the third dialogue text based on the first dialogue text and the initial reply text; and input the third dialogue text into the large language model to obtain the reply text.
[0091] Figure 4B The following is a schematic diagram of a reply text generation process according to another embodiment of the present disclosure.
[0092] like Figure 4BAs shown, the second dialogue text 401 can be input into the large language model 402. The large language model can call the first target plug-in 403 to process the first dialogue text 4012 included in the second dialogue text 401 based on the description text 4011 included in the second dialogue text 401 to obtain the initial reply text 405. The initial reply text 405 can be merged with the first dialogue text 4012 to obtain the third dialogue text 406. Specifically, the first dialogue text 4012 and the initial reply text 405 can be filled into the second prompt template respectively to obtain the third dialogue text 406. Afterwards, the third dialogue text 406 can be input into the large language model 402 to obtain the reply text 404.
[0093] According to an embodiment of the present disclosure, similar to the first prompt template, the second prompt template may also include multiple information slots. For example, the number of information slots included in the second prompt template may be 2, which may be represented as a second text information slot and a third text information slot, respectively. It should be noted that the second prompt template also includes more than two information slots, which is not limited here.
[0094] According to an embodiment of the present disclosure, the first dialogue text 4012 and the initial reply text 405 are respectively filled into the second prompt template to obtain the third dialogue text 406. Specifically, the first dialogue text 4012 can be filled into the second text information slot, and the initial reply text 405 can be filled into the third text information slot to obtain the third dialogue text 406.
[0095] For example, the second prompt template can be expressed as "You can answer the question based on the following information: [insert text 3]. Given the following question: [insert text 4]". Among them, the information slot "[insert text 3]" can represent the third text information slot, and the information slot "[insert text 4]" can represent the second text information slot. The first dialogue text can be expressed as "Please help me calculate what 256 times 4 equals", and the initial reply text can be expressed as "1024". After filling the first dialogue text and the initial reply text into the second prompt template, the third dialogue text obtained can be expressed as "You can answer the question based on the following information: 1024. Given the following question: Please help me calculate what 256 times 4 equals". After the third dialogue text is input into the large language model, the obtained reply text can be expressed as "The calculation result of 256 times 4 is 1024".
[0096] According to the embodiments of the present disclosure, with the help of the understanding ability of the large language model, the corresponding plug-in can be called based on the description text of the plug-in to handle tasks that the large language model cannot handle originally. The usability and universality of the large language model can be effectively improved, and there is no need to retrain the large language model when facing different tasks, thereby reducing the cost of using the large language model.
[0097] According to an embodiment of the present disclosure, as an optional implementation, the user can manually select to indicate that the large language model can use the selected plug-in to process the dialogue text, that is, the user can specify that the description text of some plug-ins needs to be added to the context of the dialogue text. At this time, the text actually input into the large language model may include the first dialogue text, the description text of the plug-in selected autonomously by the dialogue system, and the description text of the plug-in manually selected by the user.
[0098] According to an embodiment of the present disclosure, an operation manually selected by a user can be used to change the selected status mark of a plug-in. For example, a user can manually select at least one fourth target plug-in. Accordingly, multiple plug-ins can include at least one fourth target plug-in, and at least one fourth target plug-in can be marked as selected.
[0099] Figure 5 A flowchart of a human-computer interaction method according to another embodiment of the present disclosure is schematically shown.
[0100] like Figure 5 As shown, the method includes operations S510 to S530.
[0101] In operation S510 , in response to a human-computer interaction request, based on a first dialogue text included in the human-computer interaction request, a first target plug-in related to the first dialogue text is determined from a plurality of plug-ins registered in a large language model.
[0102] In operation S520, a fourth dialogue text is obtained based on the first dialogue text, the description text of the first target plug-in, and the description text of each of at least one fourth target plug-in.
[0103] In operation S530, the fourth dialogue text is input into the large language model to obtain a reply text.
[0104] According to an embodiment of the present disclosure, the method for determining the first target plug-in from multiple plug-ins can refer to the matching process of the first target plug-in described above, which will not be repeated here.
[0105] According to an embodiment of the present disclosure, a method for obtaining a fourth dialogue text based on the first dialogue text, the description text of the first target plug-in, and the description text of each of at least one fourth target plug-in can refer to the method for generating the second dialogue text as described above, and replace the description text of the first target plug-in with the description text of the first target plug-in and the description text of each of at least one fourth target plug-in, and then replace the second dialogue text with the fourth dialogue text, which will not be repeated here.
[0106] According to an embodiment of the present disclosure, in the process of generating the reply text, at least one matching result obtained by matching the first dialogue text with at least one fourth target plug-in can be further determined. Based on the at least one matching result, it can be determined whether the plug-in that actually processes the first dialogue text is the first target plug-in selected autonomously by the dialogue system or the plug-in selected by the user. That is, the fourth dialogue text can be input into the large language model, so as to use the large language model to determine the fourth target plug-in from the first target plug-in and at least one fourth target plug-in based on the fourth dialogue text; and the large language model can be used to call the fourth target plug-in based on the description text of the fourth target plug-in included in the fourth dialogue text, and the first dialogue text included in the fourth dialogue text is processed to obtain the reply text. The process of obtaining the reply text using the fourth dialogue text can refer to the generation process of the reply text as described above, and will not be repeated here. The method used when matching the first dialogue text with at least one fourth target plug-in can be different from the method used when matching the first dialogue text with multiple plug-ins. Further, a correction coefficient can be added to the matching result of the fourth target plug-in, and the correction coefficient can be a value greater than 1, so that the large language model can use the plug-in selected by the user to process the text as much as possible.
[0107] According to an embodiment of the present disclosure, by adding the description text of the plug-in automatically selected by the dialogue system and the description text of the plug-in selected by the user to the context of the dialogue text, it is possible to improve the user experience while ensuring the tendency of the large language model when processing text, so that the reply text output by the large language model is more in line with the user's original intention, thereby improving the usability of the dialogue system.
[0108] Figure 6 A block diagram of a human-computer interaction device according to an embodiment of the present disclosure is schematically shown.
[0109] like Figure 6 As shown, the human-computer interaction device 600 includes a determination module 610 , a first processing module 620 and a first input module 630 .
[0110] A determination module 610 is used to determine, in response to a human-computer interaction request, a first target plug-in related to the first dialogue text from a plurality of plug-ins registered in a large language model based on a first dialogue text included in the human-computer interaction request;
[0111] A first processing module 620 is used to obtain a second dialogue text based on the first dialogue text and the description text of the first target plug-in; and
[0112] The first input module 630 is used to input the second dialogue text into the large language model to obtain a reply text.
[0113] According to an embodiment of the present disclosure, the determination module 610 includes a first determination unit, a second determination unit, and a third determination unit.
[0114] The first determining unit is used to obtain the index information of each of the plurality of plug-ins from the plug-in information library.
[0115] The second determining unit is used to match the first dialogue text with the respective index information of the plurality of plug-ins to obtain a plurality of matching results.
[0116] The third determining unit is configured to determine a first target plug-in from the plurality of plug-ins based on the plurality of matching results.
[0117] According to an embodiment of the present disclosure, the index information of the plug-in includes a feature vector of a description text of the plug-in.
[0118] According to an embodiment of the present disclosure, the second determining unit includes a first determining subunit, a second determining subunit, and a third determining subunit.
[0119] The first determining subunit is used to extract features from the first dialogue text to obtain a feature vector of the first dialogue text.
[0120] The second determining subunit is used to perform similarity calculations on the feature vector of the first dialogue text and the feature vectors of the description texts of the plurality of plug-ins to obtain a plurality of similarity calculation results.
[0121] The third determination subunit is used to obtain multiple matching results based on multiple similarity calculation results.
[0122] According to an embodiment of the present disclosure, the index information of the plug-in includes at least one keyword related to the description text of the plug-in.
[0123] According to an embodiment of the present disclosure, the second determining unit includes a fourth determining subunit and a fifth determining subunit.
[0124] The fourth determining subunit is used to extract keywords from the first dialogue text to obtain keywords related to the first dialogue text.
[0125] The fifth determining subunit is used to match the keywords related to the first dialogue text with at least one keyword related to the description texts of the multiple plug-ins to obtain multiple matching results.
[0126] According to an embodiment of the present disclosure, the determination module 610 includes a fourth determination unit, a fifth determination unit, a sixth determination unit, a seventh determination unit, and an eighth determination unit.
[0127] The fourth determining unit is used to determine the plug-in type information related to the first dialogue text based on the first dialogue text.
[0128] The fifth determining unit is configured to determine at least one second target plug-in from the plurality of plug-ins based on the plug-in type information.
[0129] The sixth determining unit is configured to obtain respective index information of at least one second target plug-in from the plug-in information library.
[0130] The seventh determination unit is used to match the first dialogue text with the respective index information of at least one second target plug-in to obtain at least one matching result.
[0131] An eighth determining unit is configured to determine a first target plug-in from at least one second target plug-in based on at least one matching result.
[0132] According to an embodiment of the present disclosure, the human-computer interaction device 600 further includes a generating module and a writing module.
[0133] The generating module is used to generate index information of the third target plug-in in response to the plug-in registration request and based on the description text of the third target plug-in included in the plug-in registration request.
[0134] The writing module is used to write the index information of the third target plug-in into the plug-in information library.
[0135] According to an embodiment of the present disclosure, the first processing module 620 includes a first processing unit.
[0136] The first processing unit is used to splice the description text of the first target plug-in into the context of the first dialogue text to obtain a second dialogue text.
[0137] According to an embodiment of the present disclosure, the first processing module 620 includes a second processing unit.
[0138] The second processing unit is used to fill the first dialogue text and the description text of the first target plug-in into the first prompt template respectively to obtain the second dialogue text.
[0139] According to an embodiment of the present disclosure, the first prompt template includes a first text information slot and a plug-in information slot.
[0140] According to an embodiment of the present disclosure, the second processing unit includes a processing sub-unit.
[0141] The processing subunit is used to fill the first dialogue text into the first text information slot, and fill the description text of the first target plug-in into the plug-in information slot to obtain the second dialogue text.
[0142] According to an embodiment of the present disclosure, the first input module 630 includes a first input unit.
[0143] The first input unit is used to input the second dialogue text into the large language model, so as to use the large language model to call the first target plug-in based on the description text of the first target plug-in included in the second dialogue text, process the first dialogue text included in the second dialogue text, and obtain a reply text.
[0144] According to an embodiment of the present disclosure, the first input module 630 includes a second input unit, a third input unit, and a fourth input unit.
[0145] The second input unit is used to input the second dialogue text into the large language model, so as to use the large language model to call the first target plug-in based on the description text of the first target plug-in included in the second dialogue text, process the first dialogue text included in the second dialogue text, and obtain an initial reply text.
[0146] The third input unit is used to fill the first dialogue text and the initial reply text into the second prompt template respectively to obtain the third dialogue text.
[0147] The fourth input unit is used to input the third dialogue text into the large language model to obtain a reply text.
[0148] According to an embodiment of the present disclosure, the second prompt template includes a second text information slot and a third text information slot.
[0149] According to an embodiment of the present disclosure, the third input unit includes an input sub-unit.
[0150] The input subunit is used to fill the first dialogue text into the second text information slot and fill the initial reply text into the third text information slot to obtain the third dialogue text.
[0151] According to an embodiment of the present disclosure, the plurality of plug-ins include at least one fourth target plug-in, wherein the at least one fourth target plug-in is marked as a selected state.
[0152] According to an embodiment of the present disclosure, the human-computer interaction device 600 further includes a second processing module and a second input module.
[0153] The second processing module is used to obtain a fourth dialogue text based on the first dialogue text, the description text of the first target plug-in and the description text of at least one fourth target plug-in.
[0154] The second input module is used to input the fourth dialogue text into the large language model to obtain a reply text.
[0155] According to an embodiment of the present disclosure, the second input module includes a fifth input unit and a sixth input unit.
[0156] The fifth input unit is used to input the fourth dialogue text into the large language model, so as to determine the fourth target plug-in from the first target plug-in and the at least one fourth target plug-in based on the fourth dialogue text by using the large language model.
[0157] The sixth input unit is used to call the fourth target plug-in based on the description text of the fourth target plug-in included in the fourth dialogue text by using the large language model, and process the first dialogue text included in the fourth dialogue text to obtain a reply text.
[0158] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0159] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.
[0160] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method as described above.
[0161] According to an embodiment of the present disclosure, a computer program product includes a computer program, and when the computer program is executed by a processor, the computer program implements the method as described above.
[0162] Figure 7 A schematic block diagram of an example electronic device that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0163] like Figure 7As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0164] A number of components in the device 700 are connected to an input / output (I / O) interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0165] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as human-computer interaction methods. For example, in some embodiments, the human-computer interaction method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the human-computer interaction method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the human-computer interaction method in any other appropriate manner (e.g., by means of firmware).
[0166] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0167] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0168] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0169] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0170] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0171] A computer system may include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises through computer programs running on respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server combined with a blockchain.
[0172] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0173] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A human-computer interaction method, comprising: In response to a human-computer interaction request, based on a first dialogue text included in the human-computer interaction request, determining a first target plug-in related to the first dialogue text from a plurality of plug-ins registered in a large language model; Obtaining a second dialogue text based on the first dialogue text and the description text of the first target plug-in; as well as Inputting the second dialogue text into the large language model to obtain a reply text includes: The second dialogue text is input into the large language model, so as to use the large language model to call the first target plug-in based on the description text of the first target plug-in included in the second dialogue text, and the first dialogue text included in the second dialogue text is processed to obtain a reply text.
2. The method according to claim 1, wherein: The determining, based on the first dialogue text included in the human-computer interaction request, a first target plug-in related to the first dialogue text from a plurality of plug-ins registered in the large language model comprises: Obtaining index information of each of the plurality of plug-ins from a plug-in information repository; Matching the first conversation text with the respective index information of the multiple plug-ins to obtain multiple matching results; and Based on the multiple matching results, the first target plug-in is determined from the multiple plug-ins.
3. The method according to claim 2, wherein: The index information of the plug-in includes a feature vector of a description text of the plug-in; The first conversation text is matched with the respective index information of the plurality of plug-ins to obtain a plurality of matching results, including: Performing feature extraction on the first dialogue text to obtain a feature vector of the first dialogue text; Calculating similarities between the feature vector of the first conversation text and the feature vectors of the description texts of the plurality of plug-ins, respectively, to obtain a plurality of similarity calculation results; and Based on the multiple similarity calculation results, the multiple matching results are obtained.
4. The method according to claim 2, wherein: The index information of the plug-in includes at least one keyword related to the description text of the plug-in; The first conversation text is matched with the respective index information of the plurality of plug-ins to obtain a plurality of matching results, including: Extracting keywords from the first conversation text to obtain keywords related to the first conversation text; and The keywords related to the first conversation text are matched respectively with at least one keyword related to the description texts of the multiple plug-ins to obtain the multiple matching results.
5. The method according to claim 1, wherein: The determining, based on the first dialogue text included in the human-computer interaction request, a first target plug-in related to the first dialogue text from a plurality of plug-ins registered in the large language model comprises: Based on the first dialogue text, determining plug-in type information related to the first dialogue text; Based on the plug-in type information, determining at least one second target plug-in from the plurality of plug-ins; Acquire the index information of each of the at least one second target plug-in from the plug-in information library; Matching the first conversation text with the respective index information of the at least one second target plug-in to obtain at least one matching result; and Based on the at least one matching result, the first target plug-in is determined from the at least one second target plug-in.
6. The method according to any one of claims 2 to 5, further comprising: In response to the plug-in registration request, generating index information of the third target plug-in based on the description text of the third target plug-in included in the plug-in registration request; as well as The index information of the third target plug-in is written into the plug-in information library.
7. The method according to claim 1, wherein: The obtaining of the second dialogue text based on the first dialogue text and the description text of the first target plug-in includes: The description text of the first target plug-in is spliced into the context of the first dialogue text to obtain the second dialogue text.
8. The method according to claim 1, wherein: The obtaining of the second dialogue text based on the first dialogue text and the description text of the first target plug-in includes: The first dialogue text and the description text of the first target plug-in are respectively filled into the first prompt template to obtain the second dialogue text.
9. The method according to claim 8, wherein: The first prompt template includes a first text information slot and a plug-in information slot; The step of filling the first dialogue text and the description text of the first target plug-in into the first prompt template to obtain the second dialogue text includes: The first dialogue text is filled into the first text information slot, and the description text of the first target plug-in is filled into the plug-in information slot to obtain the second dialogue text.
10. The method according to claim 1, wherein: The step of inputting the second dialogue text into the large language model to obtain a reply text further includes: The first target plug-in is called to process the first dialogue text included in the second dialogue text to obtain a reply text as the initial reply text; Filling the first dialogue text and the initial reply text into the second prompt template respectively to obtain a third dialogue text; and The third dialogue text is input into the large language model to obtain a reply text.
11. The method according to claim 10, wherein: The second prompt template includes a second text information slot and a third text information slot; The step of filling the first dialogue text and the initial reply text into the second prompt template to obtain a third dialogue text includes: The first dialogue text is filled into the second text information slot, and the initial reply text is filled into the third text information slot to obtain the third dialogue text.
12. The method according to claim 1, wherein: The plurality of plug-ins include at least one fourth target plug-in, wherein the at least one fourth target plug-in is marked as a selected state; The method further comprises: Obtaining a fourth dialogue text based on the first dialogue text, the description text of the first target plug-in, and the description text of each of the at least one fourth target plug-in; and The fourth dialogue text is input into the large language model to obtain the reply text.
13. The method according to claim 12, wherein: The step of inputting the fourth dialogue text into the large language model to obtain the reply text comprises: Inputting the fourth dialogue text into the large language model to determine a fourth target plug-in from the first target plug-in and the at least one fourth target plug-in based on the fourth dialogue text by using the large language model; and The fourth target plug-in is called by using the large language model based on the description text of the fourth target plug-in included in the fourth dialogue text, and the first dialogue text included in the fourth dialogue text is processed to obtain the reply text.
14. A human-computer interaction device, comprising: A determination module, configured to determine, in response to a human-computer interaction request, a first target plug-in related to the first dialogue text from a plurality of plug-ins registered in a large language model based on a first dialogue text included in the human-computer interaction request; A first processing module, configured to obtain a second dialogue text based on the first dialogue text and a description text of the first target plug-in; as well as A first input module, used for inputting the second dialogue text into the large language model to obtain a reply text; The first input module comprises: The first input unit is used to input the second dialogue text into the large language model, so as to use the large language model to call the first target plug-in based on the description text of the first target plug-in included in the second dialogue text, and process the first dialogue text included in the second dialogue text to obtain a reply text.
15. The device according to claim 14, wherein: The determining module comprises: A first determining unit, configured to obtain index information of each of the plurality of plug-ins from a plug-in information library; A second determining unit, configured to match the first conversation text with the respective index information of the plurality of plug-ins to obtain a plurality of matching results; and A third determining unit is configured to determine the first target plug-in from the multiple plug-ins based on the multiple matching results.
16. The device according to claim 15, wherein: The index information of the plug-in includes a feature vector of a description text of the plug-in; Wherein, the second determining unit includes: A first determining subunit is used to extract features from the first dialogue text to obtain a feature vector of the first dialogue text; a second determining subunit, configured to perform similarity calculations on the feature vector of the first conversation text and the feature vectors of the description texts of the plurality of plug-ins to obtain a plurality of similarity calculation results; and The third determining subunit is configured to obtain the plurality of matching results based on the plurality of similarity calculation results.
17. The device according to claim 15, wherein: The index information of the plug-in includes at least one keyword related to the description text of the plug-in; Wherein, the second determining unit includes: a fourth determining subunit, configured to extract keywords from the first dialogue text to obtain keywords related to the first dialogue text; and The fifth determining subunit is used to match the keywords related to the first dialogue text with at least one keyword related to the description texts of the multiple plug-ins respectively, to obtain the multiple matching results.
18. The device according to claim 14, wherein: The determining module comprises: a fourth determining unit, configured to determine plug-in type information related to the first dialogue text based on the first dialogue text; a fifth determining unit, configured to determine at least one second target plug-in from the plurality of plug-ins based on the plug-in type information; A sixth determining unit, configured to obtain index information of each of the at least one second target plug-in from a plug-in information repository; a seventh determining unit, configured to match the first conversation text with the respective index information of the at least one second target plug-in to obtain at least one matching result; and An eighth determining unit is configured to determine the first target plug-in from the at least one second target plug-in based on the at least one matching result.
19. The device according to any one of claims 15 to 18, further comprising: A generating module, configured to generate, in response to a plug-in registration request, index information of the third target plug-in based on a description text of the third target plug-in included in the plug-in registration request; as well as A writing module is used to write the index information of the third target plug-in into the plug-in information library.
20. The device according to claim 14, wherein: The first processing module comprises: The first processing unit is used to splice the description text of the first target plug-in into the context of the first dialogue text to obtain the second dialogue text.
21. The device according to claim 14, wherein: The first processing module comprises: The second processing unit is used to fill the first dialogue text and the description text of the first target plug-in into the first prompt template respectively to obtain the second dialogue text.
22. The device according to claim 21, wherein The first prompt template includes a first text information slot and a plug-in information slot; Wherein, the second processing unit includes: The processing subunit is used to fill the first dialogue text into the first text information slot, and fill the description text of the first target plug-in into the plug-in information slot to obtain the second dialogue text.
23. The device according to claim 14, wherein: The first input module further includes: A second input unit is used to input the second dialogue text into the large language model, so as to use the large language model to call the first target plug-in based on the description text of the first target plug-in included in the second dialogue text, and process the first dialogue text included in the second dialogue text to obtain an initial reply text; A third input unit, used to fill the first dialogue text and the initial reply text into the second prompt template respectively to obtain a third dialogue text; and The fourth input unit is used to input the third dialogue text into the large language model to obtain the reply text.
24. The device according to claim 23, wherein: The second prompt template includes a second text information slot and a third text information slot; Wherein, the third input unit includes: The input subunit is used to fill the first dialogue text into the second text information slot, and fill the initial reply text into the third text information slot to obtain the third dialogue text.
25. The device according to claim 14, wherein: The plurality of plug-ins include at least one fourth target plug-in, wherein the at least one fourth target plug-in is marked as a selected state; The device also includes: a second processing module, configured to obtain a fourth dialogue text based on the first dialogue text, the description text of the first target plug-in, and the description text of each of the at least one fourth target plug-in; and The second input module is used to input the fourth dialogue text into the large language model to obtain the reply text.
26. The device according to claim 25, wherein The second input module comprises: a fifth input unit, configured to input the fourth dialogue text into the large language model, so as to determine a fourth target plug-in from the first target plug-in and the at least one fourth target plug-in based on the fourth dialogue text by using the large language model; and The sixth input unit is used to call the fourth target plug-in based on the description text of the fourth target plug-in included in the fourth dialogue text by using the large language model, and process the first dialogue text included in the fourth dialogue text to obtain the reply text.
27. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 13.
28. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-13.
29. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Question matching method, device and equipment and computer readable storage medium
CN110569342A
Interactive consultation method and device based on multi-model matching and electronic equipment
CN114328860A
Model training method and device, electronic equipment and storage medium
CN114416974A
Method and system for automatically extracting fine granularity of third-party component document based on question and answer model
CN114841124A
Human-computer interaction dialogue method, device and equipment
CN115481227A
