Interaction method and device based on large language model
By introducing intent analysis and service interface calling mechanisms into the large language model, the problem of low interaction efficiency and accuracy of large language models in the existing technology is solved, and more efficient and accurate user interaction is achieved.
Patent Information
- Application Number
- CN202311597928.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-27
- Publication Date
- 2025-05-30
AI Technical Summary
When calling a large language model, the prior art needs to add all codes corresponding to various tools or methods to the large language model, resulting in too long context and reducing the efficiency and accuracy of the large language model to obtain replies.
By obtaining the intent analysis of the user's input text, the corresponding service interface is determined, and the service interface provided by the intelligent assistant platform of the large language model is directly called to obtain target reply, avoiding the need to write all code into the large language model.
It improves the efficiency and accuracy of obtaining target responses from large language models and improves the user interaction experience.
Smart Images

Figure CN120069052A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data management, and particularly to an interaction method and device based on a large language model. Background Art
[0002] With the development of technologies such as computers, networks, and communications, large language models have become an essential technology in human-computer interaction; nowadays, large language models can reply to user input text through large language model assistants (intelligent assistants of large language models, which can automatically call various tools or methods).
[0003] However, currently when calling various tools or methods, all the codes corresponding to the various tools or methods need to be added to the large language model. Therefore, when interacting with the large language model, a large amount of code information often needs to be run, resulting in an overly long context when developing and using the large language model, and thus reducing the efficiency and accuracy of the large language model in obtaining replies. Summary of the Invention
[0004] In view of this, embodiments of the present application provide an interaction method and device based on a large language model, which can obtain a service interface corresponding to user input text, and directly obtain a corresponding target reply through the service interface, thereby improving the efficiency and accuracy of user interaction through the large language model.
[0005] In a first aspect, embodiments of the present application provide an interaction method based on a large language model, including:
[0006] Obtain user input text, and perform intent analysis on the user input text to obtain a prompt corresponding to the user input text;
[0007] Based on the prompt, obtain at least one service interface corresponding to the user input text; the service interface is provided by a large language model intelligent assistant platform; the large language model intelligent assistant platform provides service interfaces for various different services of the large language model;
[0008] Call the at least one service interface to obtain a target reply corresponding to the user input text;
[0009] Send the target reply to the user terminal.
[0010] As an optional implementation manner of embodiments of the present application, after obtaining the user input text, the method further includes:
[0011] Save the user input text to a database, and obtain historical user input text from the database;
[0012] Combined with the historical user input text, perform intent analysis on the user input text.
[0013] As an optional implementation manner of an embodiment of the present application, obtaining at least one service interface corresponding to the user input text based on the prompt word includes:
[0014] Obtaining at least one service interface corresponding to the prompt word from a preset correspondence table; the preset correspondence table includes the correspondence between the prompt word and the service interface.
[0015] As an optional implementation manner of an embodiment of the present application, before calling the at least one service interface, the method further includes:
[0016] Detecting whether the user input text carries the call permission for the at least one service interface; the call permission of the service interface is set for different users;
[0017] If it is detected that the call permission for the at least one service interface is owned, then call the at least one service interface.
[0018] As an optional implementation manner of an embodiment of the present application, calling the at least one service interface to obtain a target reply corresponding to the user input text includes:
[0019] Calling a first function in the at least one service interface, and obtaining a first reply to the user input text based on the first function;
[0020] Judging whether the first reply meets the demand information of the user input text;
[0021] If the first reply does not meet the demand information of the input text, then generate the target reply based on the first reply;
[0022] If the first reply meets the demand information of the input text, then use the first reply as the target reply.
[0023] As an optional implementation manner of an embodiment of the present application, if the first reply does not meet the demand information of the input text, then generating the target reply based on the first reply includes:
[0024] Calling a second function in the at least one service interface to obtain a supplementary reply corresponding to the user input text;
[0025] Performing a fusion process on the supplementary reply and the first reply to obtain the target reply.
[0026] In a second aspect, an embodiment of the present application provides an interaction device based on a large language model, including:
[0027] An analysis unit for obtaining user input text and performing intent analysis on the user input text to obtain a prompt word corresponding to the user input text;
[0028] An acquisition unit for obtaining at least one service interface corresponding to the user input text based on the prompt word; the service interface is provided by a large language model intelligent assistant platform; the large language model intelligent assistant platform provides service interfaces for various different services of the large language model;
[0029] An invocation unit for invoking the at least one service interface to obtain a target reply corresponding to the user input text;
[0030] A sending unit for sending the target reply to the user terminal.
[0031] As an optional implementation manner of an embodiment of the present application, the analysis unit is specifically configured to save the user input text to a database and obtain historical user input text from the database; and perform intent analysis on the user input text in combination with the historical user input text.
[0032] As an optional implementation manner of an embodiment of the present application, the acquisition unit is specifically configured to obtain at least one service interface corresponding to the prompt word from a preset correspondence table; the preset correspondence table includes the correspondence between the prompt word and the service interface.
[0033] As an optional implementation manner of an embodiment of the present application, the interaction device based on the large language model further includes a detection unit specifically configured to detect whether the user input text carries the invocation permission of the at least one service interface; the invocation permission of the service interface is set for different users; if it is detected that the invocation permission of the at least one service interface is owned, the at least one service interface is invoked.
[0034] As an optional implementation manner of an embodiment of the present application, the detection unit is further configured to invoke a first function in the at least one service interface, and obtain a first reply of the user input text based on the first function; determine whether the first reply meets the requirement information of the user input text; if the first reply does not meet the requirement information of the input text, generate the target reply based on the first reply; if the first reply meets the requirement information of the input text, use the first reply as the target reply.
[0035] As an optional implementation manner of an embodiment of the present application, the invocation unit is specifically configured to invoke a second function in the at least one service interface to obtain a supplementary reply corresponding to the user input text; and perform a fusion process on the supplementary reply and the first reply to obtain the target reply.
[0036] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor, where the memory is used to store a computer program; the processor is used to cause the electronic device to implement the interaction method based on a large language model described in any of the above embodiments when executing the computer program.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a computing device, the computing device is caused to implement the interaction method based on a large language model described in any of the above embodiments.
[0038] In a fifth aspect, an embodiment of the present application provides a vehicle, including: the interaction device based on a large language model described in the second aspect or the electronic device described in the third aspect.
[0039] The interaction method based on a large language model provided by the embodiments of the present application is specifically as follows: obtaining user input text, and performing intent analysis on the user input text to obtain a prompt word corresponding to the user input text; based on the prompt word, obtaining at least one service interface corresponding to the user input text; the service interface is provided by a large language model intelligent assistant platform; the large language model intelligent assistant platform provides service interfaces for a large language model to provide a variety of different services; calling the at least one service interface to obtain a target reply corresponding to the user input text; and sending the target reply to the user terminal. By performing intent analysis on the user input text, the embodiments of the present application determine at least one service interface corresponding to the user input text, and directly complete the corresponding task by calling the service interface, avoiding the need to write all the functions corresponding to various services into the large language model as in the prior art. The present application only needs to call the interfaces corresponding to various services to complete the corresponding task, which can improve the efficiency and accuracy of the large language model in obtaining the target reply, and further improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0041] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required to be referred to in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0042] Figure 1 It is the overall framework diagram of the interaction method based on a large language model provided by the embodiments of the present application;
[0043] Figure 2 One of the step flowcharts of the interaction method based on the large language model provided by the embodiments of the present application;
[0044] Figure 3 Schematic diagram of the system framework of the interaction method based on the large language model provided by the embodiments of the present application;
[0045] Figure 4 Another step flowchart of the interaction method based on the large language model provided by the embodiments of the present application;
[0046] Figure 5 Schematic diagram of the flow of the interaction steps of the interaction method based on the large language model provided by the embodiments of the present application;
[0047] Figure 6 Schematic diagram of the structure of the interaction device based on the large language model provided by the embodiments of the present application;
[0048] Figure 7 Schematic diagram of the hardware structure of the electronic device provided by the embodiments of the present application. Detailed implementation manners
[0049] In order to more clearly understand the above objects, features and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that, without conflict, the embodiments of the present disclosure and the features in the embodiments may be combined with each other.
[0050] Many specific details are set forth in the following description in order to fully understand the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some embodiments of the present disclosure, rather than all embodiments.
[0051] In the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner. In addition, in the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality" refers to two or more.
[0052] It should be noted that in this text, the term "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements not only includes those elements but also includes other elements not expressly listed, or elements that are inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the presence of additional identical elements in the process, method, article, or device that includes the said element.
[0053] In the prior art, when calling various tools or methods, all the codes corresponding to the various tools or methods need to be added to the large language model. Therefore, when interacting with the large language model, a large amount of code information often needs to be run, resulting in an overly long context when developing and using the large language model, and thus reducing the efficiency and accuracy of the large language model in obtaining responses.
[0054] To solve the above problems, the embodiments of the present application provide an interaction method based on a large language model. The specific embodiments are as follows:
[0055] Refer to Figure 1 As shown, it is the overall framework diagram of the interaction method based on the large language model provided by the embodiments of the present application, which includes: a large language model 11, a large language model intelligent assistant platform 12, and an audit module 13; specifically, the large language model (LLM) 11 is an artificial intelligence model designed to understand and generate human language. They are trained on a large amount of text data and can perform a wide range of tasks, including text summarization, translation, sentiment analysis, etc. The characteristic of the LLM is its huge scale, containing billions of parameters, which helps them learn complex patterns in language data. The large language model intelligent assistant platform 12 is a platform proposed in the present application for quickly connecting the large language model with microservices. By connecting the large language model with this large language model intelligent assistant platform, the service interfaces in the large language model intelligent assistant platform can be directly called, and then the large language model generates a target response and sends it to the user.
[0056] The embodiments of the present application provide an interaction method based on a large language model. Refer to Figure 2 As shown, the interaction method based on the large language model includes the following steps S201 - S204:
[0057] S201. Obtain the user input text, and perform intent analysis on the user input text to obtain the prompt word corresponding to the user input text.
[0058] In the embodiments of the present application, the method for obtaining the user input text may be as follows: When the user interacts with the large language model, the user can directly initiate a conversation through the corresponding web page or the intelligent robot in a certain application, and input the conversation text directly into the corresponding dialogue box to generate the user input text, and then transmit the user input text to the large language model.
[0059] It should be noted that before transmitting the user input text to the large language model, the following steps A and B need to be executed:
[0060] Step A: Detect whether the user input text carries the call permission for the at least one service interface.
[0061] Among them, the call permission for the service interface is set for different users.
[0062] Step B: If it is detected that the at least one service interface call permission is available, then call the at least one service interface.
[0063] In some embodiments, before calling the corresponding service interface, it is also necessary to confirm whether the user input text carries the call permission for the corresponding interface. In the present application, corresponding permission levels can be set for different users to facilitate the call of the corresponding service interface; specifically, some service interfaces may involve sensitive information or confidential information and can only be called by specific users. Therefore, it is necessary to divide permission levels for users. After user A initiates a conversation with the large language model and generates the user input text, the corresponding permission level of user A is transmitted to the large language model together. Then, the large language model intelligent assistant platform determines the service interface that can be called based on the corresponding permission level of user A to obtain the corresponding target response.
[0064] S202: Based on the prompt words, obtain at least one service interface corresponding to the user input text.
[0065] Among them, the service interface is provided by the large language model intelligent assistant platform; the large language model intelligent assistant platform provides service interfaces for various different services of the large language model.
[0066] In some embodiments, the purpose of performing intent analysis on the user input text is to obtain the user's intent and determine the service interface to be called according to the user's intent. Specifically, the intent analysis is another key task in Natural Language Processing (NLP), which aims to judge the intent or topic expressed in the text. The methods of intent recognition are mainly divided into three categories: rule-based, template-based, and deep learning-based.
[0067] By performing intent analysis on the user input text, obtain the prompt words corresponding to its intent; specifically, the intent of the text can be recognized through deep learning algorithms. Sequence labeling and recurrent neural networks are the two most commonly used deep learning structures. The sequence labeling method can label each word in the text with a tag to determine the overall intent of the text. The recurrent neural network can understand the intent of the text by capturing the context information of the text. By training the deep learning model, efficient intent recognition of the text can be achieved.
[0068] In the embodiment of the present application, corresponding prompt words will be set in advance according to the services or intents corresponding to multiple service interfaces in the large language model intelligent assistant platform to prompt the service interface corresponding to the user input text; specifically, when the interaction method based on the large language model provided in the embodiment of the present application obtains the service interface corresponding to the prompt word, it further includes: obtaining at least one service interface corresponding to the prompt word from a preset correspondence table; the preset correspondence table includes the correspondence between the prompt word and the service interface.
[0069] Exemplarily, when the prompt words corresponding to the service interface for translating text can be: translate, how to say, language type, etc., which can be set by developers according to the actual situation. Similarly, corresponding prompt words will also be set for other service interfaces; then, each service interface is corresponded and saved with its corresponding keyword. An identifier can be set for each service interface, and its corresponding prompt word is corresponded and saved with the identifier to generate the correspondence table for easy lookup. Therefore, after obtaining the user input text, perform intent analysis on the user input text, extract the prompt word, and then based on the above-mentioned correspondence table, obtain the identifier of the service interface corresponding to the prompt word, and further determine the corresponding service interface. Specifically, when the user input text is "Help me query the price of vehicle A", through intent analysis, the corresponding intent analysis result can be: query the price of the vehicle; then, according to the intent analysis result, the corresponding prompt word can be: query data; based on the prompt word, the corresponding service interface can be found according to the preset correspondence table, so as to add the corresponding service interface to the context of the large language model and obtain the corresponding target reply.
[0070] It should be noted that in the embodiments of the present application, the large language model intelligent assistant platform will include service interfaces corresponding to various demand information that users may be involved in. Specifically, according to different demand information of users, various demand information is classified into corresponding services. For example, the user demand information can be: time query, date query, registered license plate number query, text translation, data table report, etc.; for various demand information of users, corresponding service interfaces can be registered in the large language model intelligent assistant platform, and the function domains corresponding to each service interface are saved correspondingly; by way of example, service interface 1 is used for text translation, service interface 2 is used for date query, etc. In the embodiments of the present application, the function domains corresponding to multiple services can also be combined to better meet the user demand information. For example, the two services of querying data and generating a report can be combined and connected to the same interface, so that when the user demand information is to integrate a large amount of data, a report can be directly generated based on the queried data for the user to view.
[0071] To illustrate the large language model intelligent assistant platform in the embodiments of the present application, refer to Figure 3 As shown, it is a framework schematic diagram of the large language model intelligent assistant platform in the embodiments of the present application. The large language model intelligent assistant platform may include n service interfaces. In the embodiments of the present application, taking service interface 1 as an example, service interface 1 needs to go through registration in the large language model framework and authentication registration. The function domain corresponding to service interface 1 includes n functions corresponding to service interface 1; among them, the purpose of registering the service interface in the large language model framework is to enable the functions corresponding to the service interface to be added to the large language model. Otherwise, the service interface that is not registered cannot be directly added to the context of the large language model; the authentication registration is because some service interfaces may involve sensitive information or confidential information, and the corresponding functions need to pass the authentication information to obtain sensitive data or information data with a relatively high security factor.
[0072] S203. Invoke the at least one service interface to obtain a target reply corresponding to the user input text.
[0073] In some embodiments, after determining the service interface corresponding to the intent according to the user input text and determining the user permission, the function domain corresponding to the corresponding service interface will be added to the context of the large language model to help the large language model obtain the target reply.
[0074] Exemplarily, when user B initiates a conversation with the large language model through the dialog box on the web page, the text content of the conversation can be "Help me query the price of vehicle A". After intention analysis, it can be obtained that the intention of the user is: query data; through the service interface corresponding to the intention, determine service interface A corresponding to the intention of "query data", then make a call, add service interface A to the context of the large language model, and then jointly generate a target reply through service interface A and the large language model, for example: The selling price of vehicle A is: XX yuan.
[0075] S204. Send the target reply to the user terminal.
[0076] In some embodiments, after the large language model generates the final target reply, the target reply is transmitted to the user terminal again. If the user initiates a conversation through the web page, the reply is made in the corresponding dialog box; the form of the reply can adopt various formats such as text format, picture format, table format, etc.; an appropriate format can be adopted according to the user demand information and the target reply to generate the final reply and send it to the user terminal.
[0077] The interaction method based on the large language model provided by the embodiments of the present application is specifically as follows: obtain the user input text, perform intention analysis on the user input text to obtain the prompt word corresponding to the user input text; based on the prompt word, obtain at least one service interface corresponding to the user input text; the service interface is provided by the large language model intelligent assistant platform; the large language model intelligent assistant platform provides service interfaces for various different services of the large language model; call the at least one service interface to obtain the target reply corresponding to the user input text; send the target reply to the user terminal. By performing intention analysis on the user input text, the embodiments of the present application determine at least one service interface corresponding to the user input text, directly complete the corresponding task by calling the service interface, and avoid the need to write all the functions corresponding to various services into the large language model as in the prior art. The present application only needs to call the interfaces corresponding to various services to complete the corresponding task, which can improve the efficiency and accuracy of the large language model in obtaining the target reply, and further improve the user experience.
[0078] As an extension and refinement of the above embodiments, the embodiments of the present application provide an interaction method based on a large language model, referring to Figure 4 As shown, the interaction method based on the large language model includes the following steps S401-S408:
[0079] S401. Obtain the user input text, and perform intention analysis on the user input text to obtain the prompt word corresponding to the user input text.
[0080] In some embodiments, when the above step S401 is executed, it may further include the following steps 1 and 2:
[0081] Step 1: Save the user input text to the database and obtain historical user input text from the database.
[0082] In some embodiments, saving the user input text to the database is to facilitate subsequent context analysis when the user inputs text for the second time based on the first Q&A, so as to better understand the user's intention and improve accuracy; that is, when the user continues to initiate a Q&A later, the context analysis of the current user's input text can be performed in combination with the previous user input texts in this round, and the user's intention can be understood more accurately.
[0083] Step 2: Perform intention analysis on the user input text in combination with the historical user input text.
[0084] Exemplarily, when the user input text for the first time is "How is the current employment situation?", after the large language model gives a reply to "How is the current employment situation?", the user continues to converse with the large language model. When the user input text for the second time is "Which industry is developing best currently?", the context analysis can be performed in combination with the first user input text, and the user's intention to obtain the industry development situation regarding employment can be obtained more precisely, and a reply can be further provided to the user.
[0085] In the embodiments of the present application, when performing intention analysis on the user input text, the historical user input text is combined to analyze the user's intention as a whole, or the historical user input text can be used as a supplementary prompt to analyze the current user input text, and a more accurate user intention can be obtained. This is convenient for more precisely calling the corresponding service interface later, improving the accuracy of the generated target reply, and better meeting the user's demand information.
[0086] S402: Based on the prompt words, obtain at least one service interface corresponding to the user input text.
[0087] Among them, the service interface is provided by the large language model intelligent assistant platform; the large language model intelligent assistant platform provides service interfaces for various different services of the large language model.
[0088] In some embodiments, after analyzing the intent of the user input text and obtaining the prompt word, then based on the correspondence table including the identifiers of each service interface and their corresponding prompt words in step S202 above, the identifier of the service interface corresponding to the prompt word is obtained, and then the corresponding service interface is determined. It should be noted that when the user input text requirement information is simple, the generated prompt word will also be relatively single, and calling one service interface can meet the user requirement information; when the user input text requirement information is more, multiple prompt words can be generated to call multiple service interfaces to meet the user requirement information.
[0089] S403. Call the first function in the at least one service interface, and obtain the first reply to the user input text based on the first function.
[0090] In some embodiments, each service interface among the various service interfaces will include corresponding multiple functions according to its own business type, and these functions are respectively used to execute corresponding functions; by way of example, when the user input text is "Help me query the price of vehicle A", first, a function is needed to query vehicle A, and then a function is needed to query the price of vehicle A.
[0091] S404. Determine whether the first reply meets the requirement information of the user input text.
[0092] In some embodiments, through one inference of the large language model, it may occur that the obtained reply does not meet the user requirement information or completely deviates from the user requirement information. Therefore, the embodiments of the present application add a step of reviewing the reply generated by the large language model to detect whether the obtained reply meets the user requirement information. If not, the reply is supplemented or modified until a reply that meets the user requirement information is obtained and used as the target reply, thereby improving the user experience.
[0093] S405. If the first reply does not meet the requirement information of the input text, generate the target reply based on the first reply.
[0094] In some embodiments, the specific method for generating the target reply based on the first reply in step S406 above can refer to the following step one and step two:
[0095] Step one. Call the second function in the at least one service interface to obtain the supplementary reply corresponding to the user input text.
[0096] Exemplarily, when the user input text is "Help me integrate the vehicle sales data", after one inference by the large language model, the obtained reply only retrieves the vehicle sales data without integration. Therefore, after reviewing the first reply, it is found that no report is made. Based on the review result, it can be known that report making is still required. Then, the function in the corresponding interface for report making is called again to make a report to obtain the final target reply.
[0097] Step 2: Perform a fusion process on the supplementary reply and the first reply to obtain the target reply.
[0098] In some embodiments, after calling the second function in the at least one service interface to obtain the supplementary reply corresponding to the user input text, that is, after the large language model performs a second inference to obtain the supplementary reply, the fusion process in combination with the first reply can be to delete the overlapping parts of the two or summarize them to obtain the target reply.
[0099] S406: If the first reply meets the requirement information of the input text, use the first reply as the target reply.
[0100] S407: Send the target reply to the user side.
[0101] As an extension and refinement of the above embodiments, the embodiment of the present application provides a schematic diagram of the interaction process framework of an interaction method based on a large language model. Taking the user initiating a conversation through the web page as an example, as shown in Figure 5 The interaction process framework of the interaction method based on the large language model includes: a user side, a web page side, a large language model, and a large language model intelligent assistant platform. The specific method steps are as follows:
[0102] S501: The large language model obtains the user input text from the web page side.
[0103] S502: The large language model performs intention analysis on the user input text.
[0104] S503: The large language model determines at least one service interface corresponding to the user input text.
[0105] S504: After determining at least one service interface corresponding to the user input text, the large language model intelligent assistant platform calls the at least one service interface.
[0106] S505: The large language model obtains the target reply corresponding to the user input text.
[0107] S506: The large language model sends the target reply to the web page side to be sent to the user side.
[0108] The embodiment of the present application introduces a large language model assistant platform. The large language model can call any service interface through the large language model assistant platform to meet user demand information, avoiding the need to write all the codes corresponding to various services into the large language model assistant platform when the language model uses various services, and being unable to update the newly added service codes in real time; thereby lowering the threshold for using the large model, and directly calling the corresponding service interface through platform registration and debugging of the coding and other operations, avoiding the solidification of services, capabilities, and interfaces, and enabling the large model assistant capabilities to be continuously updated.
[0109] Based on the same inventive concept, as an implementation of the above method, the embodiment of the present application also provides an interactive device based on a large language model. This embodiment corresponds to the aforementioned method embodiment. For ease of reading, this embodiment will no longer repeat the details of the aforementioned method embodiment one by one, but it should be clear that the interactive device based on a large language model in this embodiment can correspond to all the contents of the aforementioned method embodiment.
[0110] The embodiment of the present application provides an interactive device based on a large language model, Figure 6 is a schematic diagram of the structure of the interactive device based on the large language model, such as Figure 6 As shown, the interaction device 600 based on the large language model includes:
[0111] The analysis unit 601 is used to obtain a user input text, and perform intention analysis on the user input text to obtain a prompt word corresponding to the user input text;
[0112] An acquisition unit 602 is used to acquire at least one service interface corresponding to the user input text based on the prompt word; the service interface is provided by a large language model intelligent assistant platform; the large language model intelligent assistant platform provides a variety of service interfaces for different services for the large language model;
[0113] A calling unit 603 is used to call the at least one service interface to obtain a target reply corresponding to the user input text;
[0114] The sending unit 604 is configured to send the target reply to the user terminal.
[0115] As an optional implementation of the embodiment of the present application, the analysis unit is specifically used to save the user input text into a database, and obtain historical user input text from the database; and perform intent analysis on the user input text in combination with the historical user input text.
[0116] As an alternative implementation manner of the embodiment of the present application, the obtaining unit is specifically configured to obtain at least one service interface corresponding to the prompt word from a preset correspondence table; the preset correspondence table includes the correspondence between the prompt word and the service interface.
[0117] As an alternative implementation manner of the embodiment of the present application, the interaction device based on the large language model further includes a detection unit, which is specifically configured to detect whether the user input text carries the call permission of the at least one service interface; the call permission of the service interface is set for different users; if it is detected that the user has the call permission of the at least one service interface, then call the at least one service interface.
[0118] As an alternative implementation manner of the embodiment of the present application, the detection unit is further configured to call a first function in the at least one service interface, and obtain a first reply to the user input text based on the first function; determine whether the first reply meets the requirement information of the user input text; if the first reply does not meet the requirement information of the input text, then generate the target reply based on the first reply; if the first reply meets the requirement information of the input text, then use the first reply as the target reply.
[0119] As an alternative implementation manner of the embodiment of the present application, the calling unit is specifically configured to call a second function in the at least one service interface to obtain a supplementary reply corresponding to the user input text; perform a fusion process on the supplementary reply and the first reply to obtain the target reply.
[0120] Based on the same inventive concept, an embodiment of the present disclosure further provides an electronic device. Figure 7 The structural schematic diagram of the electronic device provided by the embodiment of the present disclosure is as Figure 7 shown. The electronic device provided in this embodiment includes: a memory 701 and a processor 702. The memory 701 is used to store a computer program; the processor 702 is used to execute the audio data processing method provided in the above embodiment when executing the computer program.
[0121] Based on the same inventive concept, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the computing device is enabled to implement the interaction method based on the large language model provided in the above embodiment.
[0122] Based on the same inventive concept, an embodiment of the present application further provides a vehicle, which includes the interaction device based on the large language model provided in the above embodiment or the electronic device provided in the above embodiment.
[0123] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media that contain computer-usable program code.
[0124] The processor can be a central processing unit (CPU), or can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0125] The memory may include non-permanent memory in the computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
[0126] Computer-readable media include permanent and non-permanent, removable and non-removable storage media. The storage media can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of the computer's storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. According to the definition herein, computer-readable media do not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. An interaction method based on a large language model, characterized in that, comprising: Obtain the user input text, and perform intent analysis on the user input text to obtain the prompt word corresponding to the user input text; Based on the prompt word, obtain at least one service interface corresponding to the user input text; the service interface is provided by the large language model intelligent assistant platform; The large language model intelligent assistant platform provides service interfaces for the large language model with a variety of different services; Invoke the at least one service interface to obtain the target reply corresponding to the user input text; Send the target reply to the user side.
2. The method according to claim 1, characterized in that, After obtaining the user input text, the method further comprises: Save the user input text to the database, and obtain the historical user input text from the database; Combine the historical user input text to perform intent analysis on the user input text.
3. The method according to claim 1, characterized in that, The step of obtaining at least one service interface corresponding to the user input text based on the prompt word includes: Obtain at least one service interface corresponding to the prompt word from a preset correspondence table; the preset correspondence table includes the correspondence between the prompt word and the service interface.
4. The method according to claim 1, characterized in that, Before invoking the at least one service interface, the method further comprises: Detect whether the user input text carries the invocation permission of the at least one service interface; the invocation permission of the service interface is set for different users; If it is detected that the invocation permission of the at least one service interface is owned, then invoke the at least one service interface.
5. The method according to claim 4, characterized in that, The step of invoking the at least one service interface to obtain the target reply corresponding to the user input text includes: Invoke the first function in the at least one service interface, and obtain the first reply of the user input text based on the first function; Judge whether the first reply meets the demand information of the user input text; If the first reply does not meet the demand information of the input text, then generate the target reply based on the first reply; If the first reply meets the demand information of the input text, then use the first reply as the target reply.
6. The method according to claim 5, characterized in that, The step of if the first reply does not meet the demand information of the input text, then generate the target reply based on the first reply includes: Invoke the second function in the at least one service interface to obtain the supplementary reply corresponding to the user input text; Perform a fusion process on the supplementary reply and the first reply to obtain the target reply.
7. An interaction device based on a large language model, characterized in that, comprising: An analysis unit, configured to obtain the user input text, and perform intent analysis on the user input text to obtain the prompt word corresponding to the user input text; An acquisition unit, configured to acquire at least one service interface corresponding to the user input text based on the prompt word; the service interface is provided by a large language model intelligent assistant platform; The large language model intelligent assistant platform provides service interfaces for the large language model to offer a variety of different services; A calling unit, configured to call the at least one service interface to obtain a target reply corresponding to the user input text; A sending unit, configured to send the target reply to the user terminal.
8. An electronic device, characterized in that, it includes: A memory and a processor, the memory is used to store a computer program; the processor is used to cause the electronic device to implement the large language model-based interaction method according to any one of claims 1-6 when executing the computer program.
9. A computer-readable storage medium, characterized in that, a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a computing device, the computing device is caused to implement the large language model-based interaction method according to any one of claims 1-6.
10. A vehicle, characterized in that, it includes: The large language model-based interaction device according to claim 7 or the electronic device according to claim 8.
Citation Information
Cited By
Intelligent earphone interaction method and system based on large language model intelligent assistant Agent
CN121034308A